diff options
author | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-05-16 09:08:22 +0000 |
---|---|---|
committer | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-05-16 09:08:22 +0000 |
commit | 79041e3db5a4ff15d18711d88e1876d523f8c879 (patch) | |
tree | 1ffd40c7a1eebab3bd0649d80fbe0673fe392fa9 | |
parent | 8205f8e968bcc1c6ad93f14346372e9a9a1f3809 (diff) |
Support SIP uri's starting with SIP: and sip: (reported by Tony Mountfield on the mailing list. Thanks!)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@64535 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_sip.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 453f0a42e..92b49c27d 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4066,9 +4066,9 @@ static void set_destination(struct sip_pvt *p, char *uri) ++h; else { h = uri; - if (strncmp(h, "sip:", 4) == 0) + if (strncasecmp(h, "sip:", 4) == 0) h += 4; - else if (strncmp(h, "sips:", 5) == 0) + else if (strncasecmp(h, "sips:", 5) == 0) h += 5; } hn = strcspn(h, ":;>") + 1; @@ -5243,7 +5243,7 @@ static int transmit_state_notify(struct sip_pvt *p, int state, int full, int sub ast_copy_string(from, get_header(&p->initreq, "From"), sizeof(from)); c = get_in_brackets(from); - if (strncmp(c, "sip:", 4)) { + if (strncasecmp(c, "sip:", 4)) { ast_log(LOG_WARNING, "Huh? Not a SIP header (%s)?\n", c); return -1; } @@ -5253,7 +5253,7 @@ static int transmit_state_notify(struct sip_pvt *p, int state, int full, int sub ast_copy_string(to, get_header(&p->initreq, "To"), sizeof(to)); c = get_in_brackets(to); - if (strncmp(c, "sip:", 4)) { + if (strncasecmp(c, "sip:", 4)) { ast_log(LOG_WARNING, "Huh? Not a SIP header (%s)?\n", c); return -1; } @@ -5751,7 +5751,7 @@ static int transmit_refer(struct sip_pvt *p, const char *dest) ast_copy_string(from, of, sizeof(from)); of = get_in_brackets(from); ast_copy_string(p->from,of,sizeof(p->from)); - if (strncmp(of, "sip:", 4)) { + if (strncasecmp(of, "sip:", 4)) { ast_log(LOG_NOTICE, "From address missing 'sip:', using it anyway\n"); } else of += 4; @@ -6613,7 +6613,7 @@ static int register_verify(struct sip_pvt *p, struct sockaddr_in *sin, struct si if (name) *name = '\0'; - if (!strncmp(c, "sip:", 4)) { + if (!strncasecmp(c, "sip:", 4)) { name = c + 4; } else { name = c; @@ -6755,7 +6755,7 @@ static int get_rdnis(struct sip_pvt *p, struct sip_request *oreq) if (ast_strlen_zero(tmp)) return 0; c = get_in_brackets(tmp); - if (strncmp(c, "sip:", 4)) { + if (strncasecmp(c, "sip:", 4)) { ast_log(LOG_WARNING, "Huh? Not an RDNIS SIP header (%s)?\n", c); return -1; } @@ -6789,13 +6789,13 @@ static int get_destination(struct sip_pvt *p, struct sip_request *oreq) from = get_in_brackets(tmpf); - if (strncmp(uri, "sip:", 4)) { + if (strncasecmp(uri, "sip:", 4)) { ast_log(LOG_WARNING, "Huh? Not a SIP header (%s)?\n", uri); return -1; } uri += 4; if (!ast_strlen_zero(from)) { - if (strncmp(from, "sip:", 4)) { + if (strncasecmp(from, "sip:", 4)) { ast_log(LOG_WARNING, "Huh? Not a SIP header (%s)?\n", from); return -1; } @@ -6937,12 +6937,12 @@ static int get_refer_info(struct sip_pvt *sip_pvt, struct sip_request *outgoing_ } h_contact = get_header(req, "Contact"); - if (strncmp(refer_to, "sip:", 4)) { + if (strncasecmp(refer_to, "sip:", 4)) { ast_log(LOG_WARNING, "Refer-to: Huh? Not a SIP header (%s)?\n", refer_to); return -1; } - if (strncmp(referred_by, "sip:", 4)) { + if (strncasecmp(referred_by, "sip:", 4)) { ast_log(LOG_WARNING, "Referred-by: Huh? Not a SIP header (%s) Ignoring?\n", referred_by); referred_by = NULL; } @@ -7058,7 +7058,7 @@ static int get_also_info(struct sip_pvt *p, struct sip_request *oreq) c = get_in_brackets(tmp); - if (strncmp(c, "sip:", 4)) { + if (strncasecmp(c, "sip:", 4)) { ast_log(LOG_WARNING, "Huh? Not a SIP header (%s)?\n", c); return -1; } @@ -7249,7 +7249,7 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, int sipme of = get_in_brackets(from); if (ast_strlen_zero(p->exten)) { t = uri2; - if (!strncmp(t, "sip:", 4)) + if (!strncasecmp(t, "sip:", 4)) t+= 4; ast_copy_string(p->exten, t, sizeof(p->exten)); t = strchr(p->exten, '@'); @@ -7260,7 +7260,7 @@ static int check_user_full(struct sip_pvt *p, struct sip_request *req, int sipme } /* save the URI part of the From header */ ast_copy_string(p->from, of, sizeof(p->from)); - if (strncmp(of, "sip:", 4)) { + if (strncasecmp(of, "sip:", 4)) { ast_log(LOG_NOTICE, "From address missing 'sip:', using it anyway\n"); } else of += 4; @@ -13385,7 +13385,7 @@ static int sip_sipredirect(struct sip_pvt *p, const char *dest) ast_log(LOG_ERROR, "Cannot retrieve the 'To' header from the original SIP request!\n"); return 0; } - if ((localtmp = strstr(tmp, "sip:")) && (localtmp = strchr(localtmp, '@'))) { + if ((localtmp = strcasestr(tmp, "sip:")) && (localtmp = strchr(localtmp, '@'))) { char lhost[80], lport[80]; memset(lhost, 0, sizeof(lhost)); memset(lport, 0, sizeof(lport)); |