]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add contact-params
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 18 Oct 2007 03:04:48 +0000 (03:04 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 18 Oct 2007 03:04:48 +0000 (03:04 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5959 d0543943-73ff-0310-b7d9-9358b9ac24b2

conf/directory.xml
conf/sofia.conf.xml
src/mod/endpoints/mod_sofia/sofia.c

index 675bccf07c62be1ee9d82b7e363fb1e57e93c2f4..a1468eae15bdde4991afb363bb90bb77dc959402 100644 (file)
@@ -29,6 +29,8 @@
       <!--<param name="retry_seconds" value="30"/>-->
       <!--Use the callerid of an inbound call in the from field on outbound calls via this gateway -->
       <!--<param name="caller-id-in-from" value="false"/>-->
+      <!--extra sip params to send in the contact-->
+      <!--<param name="contact-params" value="tport=tcp"/>-->
       <!--</gateway>-->
     </gateways>
     <params>
index 362416a34ba6ac5f785be95b8e27ce6ddb0cb7c8..e14edc61335663befe4749c31c43eb6041c77d6e 100644 (file)
@@ -32,6 +32,8 @@
          <!--<param name="retry_seconds" value="30"/>-->
          <!--Use the callerid of an inbound call in the from field on outbound calls via this gateway -->
          <!--<param name="caller-id-in-from" value="false"/>-->
+         <!--extra sip params to send in the contact-->
+         <!--<param name="contact-params" value="tport=tcp"/>-->
        <!--</gateway>-->
       </gateways>
 
index c46bd0cb825aa348fa16605ce0dd14e06c04ad58..b15a45517cf704c51a161b03f02e0276d9cb48b5 100644 (file)
@@ -551,7 +551,9 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
                                *expire_seconds = "3600",
                                *retry_seconds = "30",
                                *from_domain = "",
-                               *register_proxy = NULL;
+                               *register_proxy = NULL,
+                               *contact_params = NULL,
+                               *params = NULL;
                        
                        gateway->pool = profile->pool;
                        gateway->profile = profile;
@@ -589,6 +591,8 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
                                        from_domain = val;
                                } else if (!strcmp(var, "register-proxy")) {
                                        register_proxy = val;
+                               } else if (!strcmp(var, "contact-params")) {
+                                       contact_params = val;
                                }
                        }
                        
@@ -639,10 +643,21 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
                        if (switch_true(caller_id_in_from)) {
                                switch_set_flag(gateway, REG_FLAG_CALLERID);
                        }
+                       if (contact_params) {
+                               if (*contact_params == ';') {
+                                       params = contact_params;
+                               } else {
+                                       params = switch_core_sprintf(gateway->pool, ";%s", contact_params);
+                               }
+                       } else {
+                               params = "";
+                       }
+                       
+
                        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);
+                       gateway->register_contact = switch_core_sprintf(gateway->pool, "sip:%s@%s:%d%s", extension,
+                                                                                                                       profile->extsipip ? profile->extsipip : profile->sipip, profile->sip_port, params);
 
 
                        if (!strncasecmp(proxy, "sip:", 4)) {