<!--<param name="extension" value="cluecon"/>-->
<!--/// proxy host: *optional* same as realm, if blank ///-->
<!--<param name="proxy" value="asterlink.com"/>-->
+ <!--/// send register to this proxy: *optional* same as proxy, if blank ///-->
+ <!--<param name="register-proxy" value="mysbc.com"/>-->
<!--/// expire in seconds: *optional* 3600, if blank ///-->
<!--<param name="expire-seconds" value="60"/>-->
<!--/// do not register ///-->
<!--<param name="extension" value="cluecon"/>-->
<!--/// proxy host: *optional* same as realm, if blank ///-->
<!--<param name="proxy" value="asterlink.com"/>-->
+ <!--/// send register to this proxy: *optional* same as proxy, if blank ///-->
+ <!--<param name="register-proxy" value="mysbc.com"/>-->
<!--/// expire in seconds: *optional* 3600, if blank ///-->
<!--<param name="expire-seconds" value="60"/>-->
<!--/// do not register ///-->
char *register_proxy;
char *register_context;
char *expires_str;
+ char *register_url;
uint32_t freq;
time_t expires;
time_t retry;
*expire_seconds = "3600",
*retry_seconds = "30",
*from_domain = "",
- *to_domain = "";
+ *to_domain = "",
+ *register_proxy = NULL;
gateway->pool = profile->pool;
gateway->profile = profile;
from_domain = val;
} else if (!strcmp(var, "to-domain")) {
to_domain = val;
+ } else if (!strcmp(var, "register-proxy")) {
+ register_proxy = val;
}
}
-
- if (switch_strlen_zero(to_domain)) {
- to_domain = proxy;
- }
-
+
if (switch_strlen_zero(realm)) {
realm = name;
}
if (switch_strlen_zero(extension)) {
extension = username;
}
-
+
if (switch_strlen_zero(proxy)) {
proxy = realm;
}
from_domain = realm;
}
+ if (switch_strlen_zero(register_proxy)) {
+ register_proxy = proxy;
+ }
+
+ if (switch_strlen_zero(to_domain)) {
+ to_domain = proxy;
+ }
+
gateway->retry_seconds = atoi(retry_seconds);
if (gateway->retry_seconds < 10) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "INVALID: retry_seconds correcting the value to 30\n");
if (switch_true(caller_id_in_from)) {
switch_set_flag(gateway, REG_FLAG_CALLERID);
}
+ gateway->register_url = switch_core_sprintf(gateway->pool, "sip:%s", register_proxy);
gateway->register_from = switch_core_sprintf(gateway->pool, "sip:%s@%s", username, from_domain);
gateway->register_contact = switch_core_sprintf(gateway->pool, "sip:%s@%s:%d", extension,
profile->extsipip ? profile->extsipip : profile->sipip, profile->sip_port);
case REG_STATE_UNREGISTER:
nua_unregister(gateway_ptr->nh,
+ NUTAG_URL(gateway_ptr->register_url),
SIPTAG_FROM_STR(gateway_ptr->register_from),
SIPTAG_CONTACT_STR(gateway_ptr->register_contact),
SIPTAG_EXPIRES_STR(gateway_ptr->expires_str),
if (now) {
nua_register(gateway_ptr->nh,
+ NUTAG_URL(gateway_ptr->register_url),
SIPTAG_FROM_STR(gateway_ptr->register_from),
SIPTAG_CONTACT_STR(gateway_ptr->register_contact),
SIPTAG_EXPIRES_STR(gateway_ptr->expires_str),
gateway_ptr->retry = now + gateway_ptr->retry_seconds;
} else {
nua_unregister(gateway_ptr->nh,
+ NUTAG_URL(gateway_ptr->register_url),
SIPTAG_FROM_STR(gateway_ptr->register_from),
SIPTAG_CONTACT_STR(gateway_ptr->register_contact),
SIPTAG_EXPIRES_STR(gateway_ptr->expires_str),
goto cancel;
}
}
-
+
snprintf(authentication, sizeof(authentication), "%s:%s:%s:%s", scheme, realm, gateway->register_username, gateway->register_password);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Authenticating '%s' with '%s'.\n", profile->username, authentication);