Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (16895 => 16896)
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c 2010-03-04 16:27:21 UTC (rev 16895)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c 2010-03-04 16:44:56 UTC (rev 16896)
@@ -1976,8 +1976,19 @@
gateway->register_from = switch_core_sprintf(gateway->pool, "<sip:%s@%s;transport=%s>",
from_user, !zstr(from_domain) ? from_domain : proxy, register_transport);
- sipip = contact_host ? contact_host : profile->extsipip ? profile->extsipip : profile->sipip;
+ if (contact_host) {
+ if (!strcmp(contact_host, "sip-ip")) {
+ sipip = profile->sipip;
+ } else {
+ sipip = contact_host;
+ }
+ } else if (profile->extsipip) {
+ sipip = profile->extsipip;
+ } else {
+ sipip = profile->sipip;
+ }
+
if (extension_in_contact) {
format = strchr(sipip, ':') ? "<sip:%s@[%s]:%d%s>" : "<sip:%s@%s:%d%s>";
gateway->register_contact = switch_core_sprintf(gateway->pool, format, extension,