mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-05 18:13:27 +00:00
add contact-params
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5959 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
58ae7203ef
commit
bc0bee90d2
@ -29,6 +29,8 @@
|
|||||||
<!--<param name="retry_seconds" value="30"/>-->
|
<!--<param name="retry_seconds" value="30"/>-->
|
||||||
<!--Use the callerid of an inbound call in the from field on outbound calls via this gateway -->
|
<!--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"/>-->
|
<!--<param name="caller-id-in-from" value="false"/>-->
|
||||||
|
<!--extra sip params to send in the contact-->
|
||||||
|
<!--<param name="contact-params" value="tport=tcp"/>-->
|
||||||
<!--</gateway>-->
|
<!--</gateway>-->
|
||||||
</gateways>
|
</gateways>
|
||||||
<params>
|
<params>
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
<!--<param name="retry_seconds" value="30"/>-->
|
<!--<param name="retry_seconds" value="30"/>-->
|
||||||
<!--Use the callerid of an inbound call in the from field on outbound calls via this gateway -->
|
<!--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"/>-->
|
<!--<param name="caller-id-in-from" value="false"/>-->
|
||||||
|
<!--extra sip params to send in the contact-->
|
||||||
|
<!--<param name="contact-params" value="tport=tcp"/>-->
|
||||||
<!--</gateway>-->
|
<!--</gateway>-->
|
||||||
</gateways>
|
</gateways>
|
||||||
|
|
||||||
|
@ -551,7 +551,9 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
|
|||||||
*expire_seconds = "3600",
|
*expire_seconds = "3600",
|
||||||
*retry_seconds = "30",
|
*retry_seconds = "30",
|
||||||
*from_domain = "",
|
*from_domain = "",
|
||||||
*register_proxy = NULL;
|
*register_proxy = NULL,
|
||||||
|
*contact_params = NULL,
|
||||||
|
*params = NULL;
|
||||||
|
|
||||||
gateway->pool = profile->pool;
|
gateway->pool = profile->pool;
|
||||||
gateway->profile = profile;
|
gateway->profile = profile;
|
||||||
@ -589,6 +591,8 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
|
|||||||
from_domain = val;
|
from_domain = val;
|
||||||
} else if (!strcmp(var, "register-proxy")) {
|
} else if (!strcmp(var, "register-proxy")) {
|
||||||
register_proxy = val;
|
register_proxy = val;
|
||||||
|
} else if (!strcmp(var, "contact-params")) {
|
||||||
|
contact_params = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -639,10 +643,21 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
|
|||||||
if (switch_true(caller_id_in_from)) {
|
if (switch_true(caller_id_in_from)) {
|
||||||
switch_set_flag(gateway, REG_FLAG_CALLERID);
|
switch_set_flag(gateway, REG_FLAG_CALLERID);
|
||||||
}
|
}
|
||||||
|
if (contact_params) {
|
||||||
|
if (*contact_params == ';') {
|
||||||
|
params = contact_params;
|
||||||
|
} else {
|
||||||
|
params = switch_core_sprintf(gateway->pool, ";%s", contact_params);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
params = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
gateway->register_url = switch_core_sprintf(gateway->pool, "sip:%s", register_proxy);
|
gateway->register_url = switch_core_sprintf(gateway->pool, "sip:%s", register_proxy);
|
||||||
gateway->register_from = switch_core_sprintf(gateway->pool, "sip:%s@%s", username, from_domain);
|
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,
|
gateway->register_contact = switch_core_sprintf(gateway->pool, "sip:%s@%s:%d%s", extension,
|
||||||
profile->extsipip ? profile->extsipip : profile->sipip, profile->sip_port);
|
profile->extsipip ? profile->extsipip : profile->sipip, profile->sip_port, params);
|
||||||
|
|
||||||
|
|
||||||
if (!strncasecmp(proxy, "sip:", 4)) {
|
if (!strncasecmp(proxy, "sip:", 4)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user