str_rfc_5626 = switch_core_sprintf(gateway->pool, ";reg-id=%s;+sip.instance=\"<urn:uuid:%s>\"",reg_id,str_guid);
}
- if (ping_freq) {
- if (ping_freq >= 5) {
- gateway->ping_freq = ping_freq;
- gateway->ping_max = ping_max;
- gateway->ping_min = ping_min;
- gateway->ping = switch_epoch_time_now(NULL) + ping_freq;
- } else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: invalid ping!\n");
- }
- }
if ((gw_subs_tag = switch_xml_child(gateway_tag, "subscriptions"))) {
parse_gateway_subscriptions(profile, gateway, gw_subs_tag);
from_user, !zstr(from_domain) ? from_domain : proxy, register_transport);
+ if (ping_freq) {
+ if (ping_freq >= 5) {
+ gateway->ping_freq = ping_freq;
+ gateway->ping_max = ping_max;
+ gateway->ping_min = ping_min;
+ gateway->ping = switch_epoch_time_now(NULL) + ping_freq;
+ gateway->options_uri = switch_core_sprintf(gateway->pool, "<sip:%s;transport=%s>",
+ !zstr(from_domain) ? from_domain : proxy, register_transport);
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: invalid ping!\n");
+ }
+ }
+
if (contact_host) {
if (!strcmp(contact_host, "sip-ip")) {
sipip = profile->sipip;
nua_options(nh,
TAG_IF(gateway_ptr->register_sticky_proxy, NUTAG_PROXY(gateway_ptr->register_sticky_proxy)),
TAG_IF(user_via, SIPTAG_VIA_STR(user_via)),
- SIPTAG_TO_STR(gateway_ptr->register_from),
- SIPTAG_CONTACT_STR(gateway_ptr->register_contact), SIPTAG_FROM_STR(gateway_ptr->register_from), TAG_END());
+ SIPTAG_TO_STR(gateway_ptr->options_uri), SIPTAG_FROM_STR(profile->url),
+ SIPTAG_CONTACT_STR(gateway_ptr->register_contact), TAG_END());
switch_safe_free(user_via);
user_via = NULL;