mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-15 19:40:06 +00:00
add from-user param to gateways
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6293 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
565ab1d66d
commit
39cebb4fc9
@ -18,6 +18,8 @@
|
|||||||
<!--<param name="username" value="cluecon"/>-->
|
<!--<param name="username" value="cluecon"/>-->
|
||||||
<!--/// auth realm: *optional* same as gateway name, if blank ///-->
|
<!--/// auth realm: *optional* same as gateway name, if blank ///-->
|
||||||
<!--<param name="realm" value="asterlink.com"/>-->
|
<!--<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 ///-->
|
<!--/// domain to use in from: *optional* same as realm, if blank ///-->
|
||||||
<!--<param name="from-domain" value="asterlink.com"/>-->
|
<!--<param name="from-domain" value="asterlink.com"/>-->
|
||||||
<!--/// account password *required* ///-->
|
<!--/// account password *required* ///-->
|
||||||
|
@ -10,6 +10,8 @@
|
|||||||
<!--<param name="username" value="cluecon"/>-->
|
<!--<param name="username" value="cluecon"/>-->
|
||||||
<!--/// auth realm: *optional* same as gateway name, if blank ///-->
|
<!--/// auth realm: *optional* same as gateway name, if blank ///-->
|
||||||
<!--<param name="realm" value="asterlink.com"/>-->
|
<!--<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 ///-->
|
<!--/// domain to use in from: *optional* same as realm, if blank ///-->
|
||||||
<!--<param name="from-domain" value="asterlink.com"/>-->
|
<!--<param name="from-domain" value="asterlink.com"/>-->
|
||||||
<!--/// account password *required* ///-->
|
<!--/// account password *required* ///-->
|
||||||
|
@ -561,6 +561,7 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
|
|||||||
*context = "default",
|
*context = "default",
|
||||||
*expire_seconds = "3600",
|
*expire_seconds = "3600",
|
||||||
*retry_seconds = "30",
|
*retry_seconds = "30",
|
||||||
|
*from_user = "",
|
||||||
*from_domain = "",
|
*from_domain = "",
|
||||||
*register_proxy = NULL,
|
*register_proxy = NULL,
|
||||||
*contact_params = NULL,
|
*contact_params = NULL,
|
||||||
@ -599,6 +600,8 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
|
|||||||
expire_seconds = val;
|
expire_seconds = val;
|
||||||
} else if (!strcmp(var, "retry-seconds")) {
|
} else if (!strcmp(var, "retry-seconds")) {
|
||||||
retry_seconds = val;
|
retry_seconds = val;
|
||||||
|
} else if (!strcmp(var, "from-user")) {
|
||||||
|
from_user = val;
|
||||||
} else if (!strcmp(var, "from-domain")) {
|
} else if (!strcmp(var, "from-domain")) {
|
||||||
from_domain = val;
|
from_domain = val;
|
||||||
} else if (!strcmp(var, "register-proxy")) {
|
} else if (!strcmp(var, "register-proxy")) {
|
||||||
@ -629,6 +632,10 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
|
|||||||
goto skip;
|
goto skip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (switch_strlen_zero(from_user)) {
|
||||||
|
from_user = username;
|
||||||
|
}
|
||||||
|
|
||||||
if (switch_strlen_zero(extension)) {
|
if (switch_strlen_zero(extension)) {
|
||||||
extension = username;
|
extension = username;
|
||||||
}
|
}
|
||||||
@ -674,7 +681,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", register_proxy,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,
|
gateway->register_contact = switch_core_sprintf(gateway->pool, "<sip:%s@%s:%d%s>", extension,
|
||||||
profile->extsipip ? profile->extsipip : profile->sipip, profile->sip_port, params);
|
profile->extsipip ? profile->extsipip : profile->sipip, profile->sip_port, params);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user