Strip "sip:" from callerid

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1625 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2003-10-10 18:58:52 +00:00
parent 4966cfa119
commit 1682b2ced8

View File

@@ -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';
}