From: Joshua Colp Date: Mon, 28 May 2007 23:24:04 +0000 (+0000) Subject: Due to the way stringfields work the value of the url pointer will always be non... X-Git-Tag: 1.6.0-beta1~3^2~2563 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39e9b3112c642835b0a4b3d0ee348c686215851b;p=thirdparty%2Fasterisk.git Due to the way stringfields work the value of the url pointer will always be non-NULL so we have to use ast_strlen_zero to make sure it is not empty. (issue #9821 reported by pj) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@66314 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 4c63ffe159..223e2276cb 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -6150,7 +6150,7 @@ static int respprep(struct sip_request *resp, struct sip_pvt *p, const char *msg add_header(resp, "Contact", p->our_contact); } - if (p->url) { + if (!ast_strlen_zero(p->url)) { add_header(resp, "Access-URL", p->url); ast_string_field_free(p, url); } @@ -6260,7 +6260,7 @@ static int reqprep(struct sip_request *req, struct sip_pvt *p, int sipmethod, in if (!ast_strlen_zero(p->rpid)) add_header(req, "Remote-Party-ID", p->rpid); - if (p->url) { + if (!ast_strlen_zero(p->url)) { add_header(req, "Access-URL", p->url); ast_string_field_free(p, url); }