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:
Ben Ford
2022-08-02 12:15:36 -05:00
committed by Friendly Automation
parent 97b3459bd2
commit 31b3addce7
18 changed files with 220 additions and 73 deletions

View File

@@ -183,7 +183,6 @@ static int dialog_info_generate_body_content(void *body, void *data)
int remote_connected_num_restricted;
char *local_caller_num;
pjsip_dialog *dlg = ast_sip_subscription_get_dialog(state_data->sub);
pjsip_sip_uri *dlg_remote_fromhdr = pjsip_uri_get_uri(dlg->local.info->uri);
char remote_target[PJSIP_MAX_URL_SIZE + 32];
char dlg_remote_uri[PJSIP_MAX_URL_SIZE];
char *from_domain_stripped;
@@ -191,7 +190,7 @@ static int dialog_info_generate_body_content(void *body, void *data)
pj_xml_node *remote_node, *remote_identity_node, *remote_target_node;
/* We use the local dialog URI to determine the domain to use in the XML itself */
ast_copy_pj_str(dlg_remote_uri, &dlg_remote_fromhdr->host, sizeof(dlg_remote_uri));
ast_copy_pj_str(dlg_remote_uri, ast_sip_pjsip_uri_get_hostname(dlg->local.info->uri), sizeof(dlg_remote_uri));
from_domain_stripped = ast_strip_quoted(dlg_remote_uri, "<", ">");
ast_sip_sanitize_xml(from_domain_stripped, from_domain_sanitized, sizeof(from_domain_sanitized));