From 829f642b437dca5b585b8556f3bcee32fdd1f51e Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 9 Mar 2009 15:02:04 +0000 Subject: [PATCH] add contact-host param to gateways git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12531 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/sofia.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index c4a6507c16..a1500ccde9 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1087,7 +1087,8 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) *context = profile->context, *expire_seconds = "3600", *retry_seconds = "30", - *from_user = "", *from_domain = "", *register_proxy = NULL, *contact_params = NULL, *params = NULL, *register_transport = NULL; + *from_user = "", *from_domain = "", *register_proxy = NULL, *contact_host = NULL, + *contact_params = NULL, *params = NULL, *register_transport = NULL; if (!context) { context = "default"; @@ -1190,6 +1191,8 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) from_user = val; } else if (!strcmp(var, "from-domain")) { from_domain = val; + } else if (!strcmp(var, "contact-host")) { + contact_host = val; } else if (!strcmp(var, "register-proxy")) { register_proxy = val; } else if (!strcmp(var, "contact-params")) { @@ -1295,7 +1298,7 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) gateway->register_url = switch_core_sprintf(gateway->pool, "sip:%s;transport=%s", proxy, register_transport); gateway->register_from = switch_core_sprintf(gateway->pool, "", from_user, from_domain, register_transport); - sipip = profile->extsipip ? profile->extsipip : profile->sipip; + sipip = contact_host ? contact_host : profile->extsipip ? profile->extsipip : profile->sipip; if (extension_in_contact) { format = strchr(sipip, ':') ? "" : ""; gateway->register_contact = switch_core_sprintf(gateway->pool, format, extension,