FS-3842 the fix was to remove the (null) if you are asking for a to uri in the options with no username try this patch. You were not clear that you were looking for no username in the to uri. Keep in mind our system considers a 404 a sucessful response to an options request anyway but this should be what you want.

This commit is contained in:
Anthony Minessale 2012-01-27 12:55:09 -06:00
parent daa49c06e2
commit cde54eb5e8
3 changed files with 16 additions and 12 deletions

View File

@ -454,6 +454,7 @@ struct sofia_gateway {
char *auth_username;
char *register_password;
char *register_from;
char *options_uri;
char *register_contact;
char *extension;
char *real_extension;

View File

@ -2485,16 +2485,6 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
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);
@ -2616,6 +2606,19 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_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;

View File

@ -354,8 +354,8 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now)
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;