Author: anthm Date: Sat May 12 13:57:30 2007 New Revision: 5166 Modified: freeswitch/trunk/conf/directory.xml freeswitch/trunk/conf/sofia.conf.xml freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Log: add from-domain param to sofia.conf for mmurdock Modified: freeswitch/trunk/conf/directory.xml ============================================================================== --- freeswitch/trunk/conf/directory.xml (original) +++ freeswitch/trunk/conf/directory.xml Sat May 12 13:57:30 2007 @@ -9,6 +9,8 @@ <!--<param name="username" value="cluecon"/>--> <!--/// auth realm: *optional* same as gateway name, if blank ///--> <!--<param name="realm" value="asterlink.com"/>--> + <!--/// domain to use in from: *optional* same as realm, if blank ///--> + <!--<param name="from-domain" value="asterlink.com"/>--> <!--/// account password *required* ///--> <!--<param name="password" value="2007"/>--> <!--/// replace the INVITE from user with the channel's caller-id ///--> @@ -21,6 +23,10 @@ <!--<param name="expire-seconds" value="60"/>--> <!--/// do not register ///--> <!--<param name="register" value="false"/>--> + <!--How many seconds before a retry when a failure or timeout occurs --> + <!--<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"/>--> <!--</gateway>--> </gateways> <params> Modified: freeswitch/trunk/conf/sofia.conf.xml ============================================================================== --- freeswitch/trunk/conf/sofia.conf.xml (original) +++ freeswitch/trunk/conf/sofia.conf.xml Sat May 12 13:57:30 2007 @@ -12,6 +12,8 @@ <!--<param name="username" value="cluecon"/>--> <!--/// auth realm: *optional* same as gateway name, if blank ///--> <!--<param name="realm" value="asterlink.com"/>--> + <!--/// domain to use in from: *optional* same as realm, if blank ///--> + <!--<param name="from-domain" value="asterlink.com"/>--> <!--/// account password *required* ///--> <!--<param name="password" value="2007"/>--> <!--/// replace the INVITE from user with the channel's caller-id ///--> Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Sat May 12 13:57:30 2007 @@ -476,7 +476,8 @@ *proxy = NULL, *context = "default", *expire_seconds = "3600", - *retry_seconds = "30"; + *retry_seconds = "30", + *from_domain = ""; gateway->pool = profile->pool; gateway->profile = profile; @@ -510,6 +511,8 @@ expire_seconds = val; } else if (!strcmp(var, "retry-seconds")) { retry_seconds = val; + } else if (!strcmp(var, "from-domain")) { + from_domain = val; } } @@ -539,6 +542,10 @@ gateway->state = REG_STATE_NOREG; } + if (switch_strlen_zero(from_domain)) { + from_domain = realm; + } + gateway->retry_seconds = atoi(retry_seconds); if (gateway->retry_seconds < 10) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "INVALID: retry_seconds correcting the value to 30\n"); @@ -552,7 +559,7 @@ if (switch_true(caller_id_in_from)) { switch_set_flag(gateway, REG_FLAG_CALLERID); } - gateway->register_from = switch_core_sprintf(gateway->pool, "sip:%s@%s", username, realm); + 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->sipip, profile->sip_port); if (!strncasecmp(proxy, "sip:", 4)) {