[commit] r6293 - in freeswitch/trunk: conf/directory conf/sip_profiles src/mod/endpoints/mod_sofia
Author: anthm Date: Thu Nov 15 17:45:15 2007 New Revision: 6293 Modified: freeswitch/trunk/conf/directory/default.xml freeswitch/trunk/conf/sip_profiles/default.xml freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Log: add from-user param to gateways Modified: freeswitch/trunk/conf/directory/default.xml ============================================================================== --- freeswitch/trunk/conf/directory/default.xml (original) +++ freeswitch/trunk/conf/directory/default.xml Thu Nov 15 17:45:15 2007 @@ -18,6 +18,8 @@ <!--<param name="username" value="cluecon"/>--> <!--/// auth realm: *optional* same as gateway name, if blank ///--> <!--<param name="realm" value="asterlink.com"/>--> + <!--/// username to use in from: *optional* same as username, if blank ///--> + <!--<param name="from-user" value="cluecon"/>--> <!--/// domain to use in from: *optional* same as realm, if blank ///--> <!--<param name="from-domain" value="asterlink.com"/>--> <!--/// account password *required* ///--> Modified: freeswitch/trunk/conf/sip_profiles/default.xml ============================================================================== --- freeswitch/trunk/conf/sip_profiles/default.xml (original) +++ freeswitch/trunk/conf/sip_profiles/default.xml Thu Nov 15 17:45:15 2007 @@ -10,6 +10,8 @@ <!--<param name="username" value="cluecon"/>--> <!--/// auth realm: *optional* same as gateway name, if blank ///--> <!--<param name="realm" value="asterlink.com"/>--> + <!--/// username to use in from: *optional* same as username, if blank ///--> + <!--<param name="from-user" value="cluecon"/>--> <!--/// domain to use in from: *optional* same as realm, if blank ///--> <!--<param name="from-domain" value="asterlink.com"/>--> <!--/// account password *required* ///--> 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 Thu Nov 15 17:45:15 2007 @@ -561,6 +561,7 @@ *context = "default", *expire_seconds = "3600", *retry_seconds = "30", + *from_user = "", *from_domain = "", *register_proxy = NULL, *contact_params = NULL, @@ -599,6 +600,8 @@ expire_seconds = val; } else if (!strcmp(var, "retry-seconds")) { retry_seconds = val; + } else if (!strcmp(var, "from-user")) { + from_user = val; } else if (!strcmp(var, "from-domain")) { from_domain = val; } else if (!strcmp(var, "register-proxy")) { @@ -629,6 +632,10 @@ goto skip; } + if (switch_strlen_zero(from_user)) { + from_user = username; + } + if (switch_strlen_zero(extension)) { extension = username; } @@ -672,9 +679,9 @@ params = switch_core_sprintf(gateway->pool, ";transport=%s", register_transport); } - + gateway->register_url = switch_core_sprintf(gateway->pool, "sip:%s;transport=%s", register_proxy,register_transport); - gateway->register_from = switch_core_sprintf(gateway->pool, "<sip:%s@%s;transport=%s>", username, from_domain, register_transport); + gateway->register_from = switch_core_sprintf(gateway->pool, "<sip:%s@%s;transport=%s>", from_user, from_domain, register_transport); gateway->register_contact = switch_core_sprintf(gateway->pool, "<sip:%s@%s:%d%s>", extension, profile->extsipip ? profile->extsipip : profile->sipip, profile->sip_port, params);
participants (1)
-
Freeswitch SVN