Index: res/res_phoneprov.c =================================================================== --- res/res_phoneprov.c (revision 144302) +++ res/res_phoneprov.c (working copy) @@ -167,7 +167,8 @@ }; static char global_server[80] = ""; /*!< Server to substitute into templates */ -static char global_serverport[6] = ""; /*!< Server port to substitute into templates */ +static char global_sipserverport[6] = ""; /*!< Server port to substitute into templates */ +static char global_skinnyserverport[6] = ""; /*!< Server port to substitute into templates */ static char global_default_profile[80] = ""; /*!< Default profile to use if one isn't specified */ /*! \brief List of global variables currently available: VOICEMAIL_EXTEN, EXTENSION_LENGTH */ @@ -748,11 +749,16 @@ AST_LIST_INSERT_TAIL(exten->headp, var, entries); } - if (!ast_strlen_zero(global_serverport)) { - if ((var = ast_var_assign("SERVER_PORT", global_serverport))) + if (!ast_strlen_zero(global_sipserverport)) { + if ((var = ast_var_assign("SIPSERVER_PORT", global_sipserverport))) AST_LIST_INSERT_TAIL(exten->headp, var, entries); } + if (!ast_strlen_zero(global_skinnyserverport)) { + if ((var = ast_var_assign("SKINNYSERVER_PORT", global_skinnyserverport))) + AST_LIST_INSERT_TAIL(exten->headp, var, entries); + } + return exten; } @@ -904,10 +910,17 @@ /* Try to grab the port from sip.conf. If we don't get it here, we'll set it * to whatever is set in phoneprov.conf or default to 5060 */ if ((cfg = ast_config_load("sip.conf", config_flags)) && cfg != CONFIG_STATUS_FILEINVALID) { - ast_copy_string(global_serverport, S_OR(ast_variable_retrieve(cfg, "general", "bindport"), "5060"), sizeof(global_serverport)); + ast_copy_string(global_sipserverport, S_OR(ast_variable_retrieve(cfg, "general", "bindport"), "5060"), sizeof(global_sipserverport)); ast_config_destroy(cfg); } + /* Try to grab the port from skinny.conf. If we don't get it here, we'll set it + * to whatever is set in phoneprov.conf or default to 2000 */ + if ((cfg = ast_config_load("skinny.conf", config_flags)) && cfg != CONFIG_STATUS_FILEINVALID) { + ast_copy_string(global_skinnyserverport, S_OR(ast_variable_retrieve(cfg, "general", "bindport"), "2000"), sizeof(global_skinnyserverport)); + ast_config_destroy(cfg); + } + if (!(cfg = ast_config_load("users.conf", config_flags)) || cfg == CONFIG_STATUS_FILEINVALID) { ast_log(LOG_WARNING, "Unable to load users.cfg\n"); return 0; @@ -939,16 +952,19 @@ while ((cat = ast_category_browse(phoneprov_cfg, cat))) { if (!strcasecmp(cat, "general")) { for (v = ast_variable_browse(phoneprov_cfg, cat); v; v = v->next) { - if (!strcasecmp(v->name, "serveraddr")) + if (!strcasecmp(v->name, "serveraddr")) { ast_copy_string(global_server, v->value, sizeof(global_server)); - else if (!strcasecmp(v->name, "serveriface")) { + } else if (!strcasecmp(v->name, "serveriface")) { struct in_addr addr; lookup_iface(v->value, &addr); ast_copy_string(global_server, ast_inet_ntoa(addr), sizeof(global_server)); - } else if (!strcasecmp(v->name, "serverport")) - ast_copy_string(global_serverport, v->value, sizeof(global_serverport)); - else if (!strcasecmp(v->name, "default_profile")) + } else if (!strcasecmp(v->name, "sipserverport")) { + ast_copy_string(global_sipserverport, v->value, sizeof(global_sipserverport)); + } else if (!strcasecmp(v->name, "skinnyserverport")) { + ast_copy_string(global_skinnyserverport, v->value, sizeof(global_skinnyserverport)); + } else if (!strcasecmp(v->name, "default_profile")) { ast_copy_string(global_default_profile, v->value, sizeof(global_default_profile)); + } } } else build_profile(cat, ast_variable_browse(phoneprov_cfg, cat));