]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_cidlookup: null xml is bad
authorRupa Schomaker <rupa@rupa.com>
Thu, 27 May 2010 01:57:17 +0000 (20:57 -0500)
committerRupa Schomaker <rupa@rupa.com>
Thu, 27 May 2010 01:58:16 +0000 (20:58 -0500)
src/mod/applications/mod_cidlookup/mod_cidlookup.c

index 269853eb111f45613a84027211e88b7a2dd23563..dec49b0c98aa4283cc8b6927e65ba8936e00c400 100755 (executable)
@@ -467,7 +467,12 @@ static cid_data_t *do_whitepages_lookup(switch_memory_pool_t *pool, switch_event
 
        query = switch_event_expand_headers(event, "http://api.whitepages.com/reverse_phone/1.0/?phone=${whitepages-cid};api_key=${whitepages-api-key}");
        do_lookup_url(pool, event, &xml_s, query, NULL, NULL, 0);
-
+       
+       if (zstr(xml_s)) {
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No XML returned for number %s\n", num);
+               goto done;
+       }
+       
        xml = switch_xml_parse_str_dup(xml_s);
 
        if (!xml) {