Fix RPID with new string fields (bug #6145)
authorMark Spencer <markster@digium.com>
Sat, 7 Jan 2006 21:35:40 +0000 (21:35 +0000)
committerMark Spencer <markster@digium.com>
Sat, 7 Jan 2006 21:35:40 +0000 (21:35 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7862 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 39b5c23..02041de 100644 (file)
@@ -4194,7 +4194,7 @@ static int reqprep(struct sip_request *req, struct sip_pvt *p, int sipmethod, in
        add_header(req, "User-Agent", default_useragent);
        add_header(req, "Max-Forwards", DEFAULT_MAX_FORWARDS);
 
-       if (p->rpid)
+       if (!ast_strlen_zero(p->rpid))
                add_header(req, "Remote-Party-ID", p->rpid);
 
        return 0;
@@ -4720,7 +4720,7 @@ static void build_rpid(struct sip_pvt *p)
        char iabuf[INET_ADDRSTRLEN];
        const char *fromdomain;
 
-       if (p->rpid || p->rpid_from)
+       if (!ast_strlen_zero(p->rpid) || !ast_strlen_zero(p->rpid_from))  
                return;
 
        if (p->owner && p->owner->cid.cid_num)
@@ -4922,7 +4922,7 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho
        add_header(req, "CSeq", tmp);
        add_header(req, "User-Agent", default_useragent);
        add_header(req, "Max-Forwards", DEFAULT_MAX_FORWARDS);
-       if (p->rpid)
+       if (!ast_strlen_zero(p->rpid))
                add_header(req, "Remote-Party-ID", p->rpid);
 }