]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3842 the fix was to remove the (null) if you are asking for a to uri in the option...
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 27 Jan 2012 18:55:09 +0000 (12:55 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 27 Jan 2012 18:55:09 +0000 (12:55 -0600)
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_reg.c

index 12e9a8f27750f1b60c47e6320956669484444164..0faa55baa1b3e821fc16cabd63a0be6f0609336f 100644 (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;
index f0bed07d851cacb387535457d40dd1f419778203..26a47e49e788fb49d7012f9b6545eb0a12109629 100644 (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;
index 3c86824a333323baa96ca2a2ff0094c03da1346e..a768cd6b90cd11797acb9fc5a40b45505f1c0e07 100644 (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;