From: Joshua Colp Date: Wed, 4 Mar 2009 19:22:50 +0000 (+0000) Subject: Look for the number in a callerid string starting from the end. This way a value... X-Git-Tag: 1.4.24-rc1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c42b21bc6a44b4ddd3bc95253e8441aec71d1d5a;p=thirdparty%2Fasterisk.git Look for the number in a callerid string starting from the end. This way a value using <> can exist in the name portion. (issue #AST-194) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@180194 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/callerid.c b/main/callerid.c index d446ecbb86..bf4bca4299 100644 --- a/main/callerid.c +++ b/main/callerid.c @@ -971,7 +971,7 @@ int ast_callerid_parse(char *instr, char **name, char **location) char *ns, *ne, *ls, *le; /* Try "name" format or name format */ - if ((ls = strchr(instr, '<')) && (le = strchr(ls, '>'))) { + if ((ls = strrchr(instr, '<')) && (le = strrchr(ls, '>'))) { *ls = *le = '\0'; /* location found, trim off the brackets */ *location = ls + 1; /* and this is the result */ if ((ns = strchr(instr, '"')) && (ne = strchr(ns + 1, '"'))) {