Put number in name field if name field is NULL *or* has 0 length
authorMark Spencer <markster@digium.com>
Fri, 11 Apr 2003 04:33:53 +0000 (04:33 +0000)
committerMark Spencer <markster@digium.com>
Fri, 11 Apr 2003 04:33:53 +0000 (04:33 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@824 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index f2ee985..1edabbe 100755 (executable)
@@ -2264,11 +2264,12 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, char *cmd, c
                if (!l || !ast_isphonenumber(l))
                                l = callerid;
        }
-       if (!n)
+       if (!n || !strlen(n))
                n = l;
        /* Allow user to be overridden */
        if (strlen(p->fromuser))
                l = p->fromuser;
+
        if ((ourport != 5060) && !strlen(p->fromdomain))
                snprintf(from, sizeof(from), "\"%s\" <sip:%s@%s:%d>;tag=as%08x", n, l, strlen(p->fromdomain) ? p->fromdomain : inet_ntoa(p->ourip), ourport, p->tag);
        else