mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
res_pjsip: Add TEL URI support for basic calls.
This change allows TEL URI requests to come through for basic calls. The allowed requests are INVITE, ACK, BYE, and CANCEL. The From and To headers will now allow TEL URIs, as well as the request URI. Support is only for TEL URIs present in traffic from a remote party. Asterisk does not generate any TEL URIs on its own. ASTERISK-26894 Change-Id: If5729e6cd583be7acf666373bf9f1b9d653ec29a
This commit is contained in:
committed by
Friendly Automation
parent
97b3459bd2
commit
31b3addce7
@@ -327,15 +327,15 @@ static void set_redirecting_reason_by_cause(pjsip_name_addr *name_addr,
|
||||
struct ast_party_redirecting_reason *data)
|
||||
{
|
||||
static const pj_str_t cause_name = { "cause", 5 };
|
||||
pjsip_sip_uri *uri = pjsip_uri_get_uri(name_addr);
|
||||
pjsip_uri *uri = name_addr->uri;
|
||||
pjsip_param *cause = NULL;
|
||||
unsigned long cause_value = 0;
|
||||
|
||||
if (!PJSIP_URI_SCHEME_IS_SIP(uri) && !PJSIP_URI_SCHEME_IS_SIPS(uri)) {
|
||||
if (!ast_sip_is_allowed_uri(uri)) {
|
||||
return;
|
||||
}
|
||||
|
||||
cause = pjsip_param_find(&uri->other_param, &cause_name);
|
||||
cause = ast_sip_pjsip_uri_get_other_param(uri, &cause_name);
|
||||
|
||||
if (!cause) {
|
||||
return;
|
||||
@@ -507,7 +507,6 @@ static void add_diversion_header(pjsip_tx_data *tdata, struct ast_party_redirect
|
||||
|
||||
pjsip_fromto_hdr *hdr;
|
||||
pjsip_name_addr *name_addr;
|
||||
pjsip_sip_uri *uri;
|
||||
pjsip_param *param;
|
||||
pjsip_fromto_hdr *old_hdr;
|
||||
const char *reason_str;
|
||||
@@ -534,10 +533,9 @@ static void add_diversion_header(pjsip_tx_data *tdata, struct ast_party_redirect
|
||||
hdr->sname = hdr->name = diversion_name;
|
||||
|
||||
name_addr = pjsip_uri_clone(tdata->pool, base);
|
||||
uri = pjsip_uri_get_uri(name_addr->uri);
|
||||
|
||||
pj_strdup2(tdata->pool, &name_addr->display, id->name.str);
|
||||
pj_strdup2(tdata->pool, &uri->user, id->number.str);
|
||||
pj_strdup2(tdata->pool, (pj_str_t *)ast_sip_pjsip_uri_get_username(name_addr->uri), id->number.str);
|
||||
|
||||
param = PJ_POOL_ALLOC_T(tdata->pool, pjsip_param);
|
||||
param->name = reason_name;
|
||||
|
Reference in New Issue
Block a user