more NULL "" equivalence in cid fields.
authorLuigi Rizzo <rizzo@icir.org>
Fri, 21 Apr 2006 11:02:28 +0000 (11:02 +0000)
committerLuigi Rizzo <rizzo@icir.org>
Fri, 21 Apr 2006 11:02:28 +0000 (11:02 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21835 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_agi.c

index c7ff91c..c1c21d7 100644 (file)
@@ -348,14 +348,14 @@ static void setup_env(struct ast_channel *chan, char *request, int fd, int enhan
        fdprintf(fd, "agi_uniqueid: %s\n", chan->uniqueid);
 
        /* ANI/DNIS */
        fdprintf(fd, "agi_uniqueid: %s\n", chan->uniqueid);
 
        /* ANI/DNIS */
-       fdprintf(fd, "agi_callerid: %s\n", chan->cid.cid_num ? chan->cid.cid_num : "unknown");
-       fdprintf(fd, "agi_calleridname: %s\n", chan->cid.cid_name ? chan->cid.cid_name : "unknown");
+       fdprintf(fd, "agi_callerid: %s\n", S_OR(chan->cid.cid_num, "unknown"));
+       fdprintf(fd, "agi_calleridname: %s\n", S_OR(chan->cid.cid_name, "unknown"));
        fdprintf(fd, "agi_callingpres: %d\n", chan->cid.cid_pres);
        fdprintf(fd, "agi_callingani2: %d\n", chan->cid.cid_ani2);
        fdprintf(fd, "agi_callington: %d\n", chan->cid.cid_ton);
        fdprintf(fd, "agi_callingtns: %d\n", chan->cid.cid_tns);
        fdprintf(fd, "agi_callingpres: %d\n", chan->cid.cid_pres);
        fdprintf(fd, "agi_callingani2: %d\n", chan->cid.cid_ani2);
        fdprintf(fd, "agi_callington: %d\n", chan->cid.cid_ton);
        fdprintf(fd, "agi_callingtns: %d\n", chan->cid.cid_tns);
-       fdprintf(fd, "agi_dnid: %s\n", chan->cid.cid_dnid ? chan->cid.cid_dnid : "unknown");
-       fdprintf(fd, "agi_rdnis: %s\n", chan->cid.cid_rdnis ? chan->cid.cid_rdnis : "unknown");
+       fdprintf(fd, "agi_dnid: %s\n", S_OR(chan->cid.cid_dnid, "unknown"));
+       fdprintf(fd, "agi_rdnis: %s\n", S_OR(chan->cid.cid_rdnis, "unknown"));
 
        /* Context information */
        fdprintf(fd, "agi_context: %s\n", chan->context);
 
        /* Context information */
        fdprintf(fd, "agi_context: %s\n", chan->context);