diff options
author | Matthew Jordan <mjordan@digium.com> | 2014-04-12 02:27:43 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2014-04-12 02:27:43 +0000 |
commit | eed03fc01ac8c6ef424eff65c718f7802a4cb1ef (patch) | |
tree | 9d7f8bd4fa085773b28aa8f6ad4c251fe11dbab7 /channels/chan_sip.c | |
parent | 39ba6a16f5c0fd1fe40a41d7102b057ef3490a9e (diff) |
chan_sip: Support RFC-3966 TEL URIs in inbound INVITE requests
This patch adds support for handling TEL URIs in inbound INVITE requests.
This includes the Request URI and the From URI. The number specified in
the Request URI will be the destination of the inbound channel in the dialplan.
The phone-context specified in the Request URI will be stored in the
TELPHONECONTEXT channel variable.
Review: https://reviewboard.asterisk.org/r/3349
ASTERISK-17179 #close
Reported by: Geert Van Pamel
Tested by: Geert Van Pamel
patches:
asterisk-12.0.0-chan_sip-RFC3966_patch.txt uploaded by Geert Van Pamel (License 6140)
asterisk-12.0.0-reqresp_parser-RFC3966_patch.txt uploaded by Geert Van Pamel (License 6140)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412292 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 68d07a63c..24a9370a7 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -17691,7 +17691,7 @@ static enum sip_get_dest_result get_destination(struct sip_pvt *p, struct sip_re uri = ast_strdupa(get_in_brackets(tmp)); - if (parse_uri_legacy_check(uri, "sip:,sips:", &uri, &unused_password, &domain, NULL)) { + if (parse_uri_legacy_check(uri, "sip:,sips:,tel:", &uri, &unused_password, &domain, NULL)) { ast_log(LOG_WARNING, "Not a SIP header (%s)?\n", uri); return SIP_GET_DEST_INVALID_URI; } @@ -17719,7 +17719,7 @@ static enum sip_get_dest_result get_destination(struct sip_pvt *p, struct sip_re ast_copy_string(tmpf, sip_get_header(req, "From"), sizeof(tmpf)); if (!ast_strlen_zero(tmpf)) { from = get_in_brackets(tmpf); - if (parse_uri_legacy_check(from, "sip:,sips:", &from, NULL, &domain, NULL)) { + if (parse_uri_legacy_check(from, "sip:,sips:,tel:", &from, NULL, &domain, NULL)) { ast_log(LOG_WARNING, "Not a SIP header (%s)?\n", from); return SIP_GET_DEST_INVALID_URI; } @@ -18607,10 +18607,13 @@ static enum check_auth_result check_user_full(struct sip_pvt *p, struct sip_requ if (ast_strlen_zero(p->exten)) { char *t = uri2; - if (!strncasecmp(t, "sip:", 4)) - t+= 4; - else if (!strncasecmp(t, "sips:", 5)) + if (!strncasecmp(t, "sip:", 4)) { + t += 4; + } else if (!strncasecmp(t, "sips:", 5)) { t += 5; + } else if (!strncasecmp(t, "tel:", 4)) { /* TEL URI INVITE */ + t += 4; + } ast_string_field_set(p, exten, t); t = strchr(p->exten, '@'); if (t) @@ -18625,7 +18628,7 @@ static enum check_auth_result check_user_full(struct sip_pvt *p, struct sip_requ /* save the URI part of the From header */ ast_string_field_set(p, from, of); - if (parse_uri_legacy_check(of, "sip:,sips:", &name, &unused_password, &domain, NULL)) { + if (parse_uri_legacy_check(of, "sip:,sips:,tel:", &name, &unused_password, &domain, NULL)) { ast_log(LOG_NOTICE, "From address missing 'sip:', using it anyway\n"); } |