From: Mark Spencer Date: Fri, 10 Oct 2003 18:58:52 +0000 (+0000) Subject: Strip "sip:" from callerid X-Git-Tag: 0.7.0~387 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1682b2ced8c26df959368fb9617d3a0074753a42;p=thirdparty%2Fasterisk.git Strip "sip:" from callerid git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1625 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 7fb4bdda54..db07df9e61 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3556,14 +3556,19 @@ static int get_destination(struct sip_pvt *p, struct sip_request *oreq) strncpy(tmpf, get_header(req, "From"), sizeof(tmpf) - 1); fr = ditch_braces(tmpf); - if (fr && !strlen(fr)) - fr = NULL; - if (strncmp(c, "sip:", 4)) { ast_log(LOG_WARNING, "Huh? Not a SIP header (%s)?\n", c); return -1; } c += 4; + if (strlen(fr)) { + if (strncmp(fr, "sip:", 4)) { + ast_log(LOG_WARNING, "Huh? Not a SIP header (%s)?\n", fr); + return -1; + } + fr += 4; + } else + fr = NULL; if ((a = strchr(c, '@')) || (a = strchr(c, ';'))) { *a = '\0'; }