From a66654de7d671d6f582d244c39a6002d4eb9846e Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Mon, 31 May 2010 07:25:49 -0400 Subject: [PATCH] mod_cid_lookup: honor skipcitystate when using whitepages (FSMOD-53) --- src/mod/applications/mod_cidlookup/mod_cidlookup.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_cidlookup/mod_cidlookup.c b/src/mod/applications/mod_cidlookup/mod_cidlookup.c index dec49b0c98..230c48ac8d 100755 --- a/src/mod/applications/mod_cidlookup/mod_cidlookup.c +++ b/src/mod/applications/mod_cidlookup/mod_cidlookup.c @@ -629,7 +629,17 @@ static cid_data_t *do_lookup(switch_memory_pool_t *pool, switch_event_t *event, cid->area = "UNKNOWN"; } if (!cid->name) { - cid->name = cid->area; + if (skipcitystate) { + if (strlen(number) == 11 && number[0] == '1') { + int a, b, c; + sscanf(number, "1%3d%3d%4d", &a, &b, &c); + cid->name = switch_core_sprintf(pool, "%03d-%03d-%04d", a, b, c); + } else { + cid->name = number; + } + } else { + cid->name = cid->area; + } } if (!cid->src) { cid->src = "UNKNOWN";