Strip "sip:" from callerid
authorMark Spencer <markster@digium.com>
Fri, 10 Oct 2003 18:58:52 +0000 (18:58 +0000)
committerMark Spencer <markster@digium.com>
Fri, 10 Oct 2003 18:58:52 +0000 (18:58 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1625 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 7fb4bdd..db07df9 100755 (executable)
@@ -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';
        }