]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MODENDP-221
authorMathieu Rene <mrene@avgs.ca>
Fri, 19 Jun 2009 15:48:23 +0000 (15:48 +0000)
committerMathieu Rene <mrene@avgs.ca>
Fri, 19 Jun 2009 15:48:23 +0000 (15:48 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13865 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia_reg.c

index 6c5a36e6dcca710176fee08c3ed2c71b81ddfb49..90bdb8ad2d5f63a139c2ed602390d9b6c13bfe7d 100644 (file)
@@ -388,17 +388,21 @@ int sofia_reg_nat_callback(void *pArg, int argc, char **argv, char **columnNames
 {
        sofia_profile_t *profile = (sofia_profile_t *) pArg;
        nua_handle_t *nh;
-       char *contact = NULL;
        char to[128] = "";
+       sofia_destination_t *dst = NULL;
 
        switch_snprintf(to, sizeof(to), "sip:%s@%s", argv[1], argv[2]);
-       contact = sofia_glue_get_url_from_contact(argv[3], 1);
+       dst = sofia_glue_get_destination(argv[3]);
+       switch_assert(dst);
 
-       nh = nua_handle(profile->nua, NULL, SIPTAG_FROM_STR(profile->url), SIPTAG_TO_STR(to), NUTAG_URL(contact), SIPTAG_CONTACT_STR(profile->url), TAG_END());
+       nh = nua_handle(profile->nua, NULL, SIPTAG_FROM_STR(profile->url), SIPTAG_TO_STR(to), NUTAG_URL(dst->contact), SIPTAG_CONTACT_STR(profile->url), TAG_END());
        nua_handle_bind(nh, &mod_sofia_globals.destroy_private);
-       nua_options(nh, TAG_END());
+       nua_options(nh, 
+                               TAG_IF(dst->route_uri, NUTAG_PROXY(dst->route_uri)),
+                               TAG_IF(dst->route, SIPTAG_ROUTE_STR(dst->route)),
+                               TAG_END());
 
-       switch_safe_free(contact);
+       sofia_glue_free_destination(dst);
 
        return 0;
 }