From: Mark Spencer Date: Thu, 27 Nov 2003 18:27:02 +0000 (+0000) Subject: Build contact, don't copy it X-Git-Tag: 0.7.0~212 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=37f33c43465223bb1b575b081829440ccbff175d;p=thirdparty%2Fasterisk.git Build contact, don't copy it git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1800 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index bfbe4e3296..5dd64d9f5f 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -5057,7 +5057,8 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc ast_queue_frame(p->owner, &af, 0); } else if (sipdebug) ast_verbose("Ignoring this request\n"); - strncpy(p->our_contact, get_header(req, "Contact"), sizeof(p->our_contact) - 1); + if (!strlen(p->our_contact)) + build_contact(p); if (!p->lastinvite) { /* Handle authentication if this is our first invite */ res = check_user(p, req, cmd, e, 1, sin); @@ -5276,8 +5277,9 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc check_via(p, req); } else if (sipdebug) ast_verbose("Ignoring this request\n"); - - strncpy(p->our_contact, get_header(req, "Contact"), sizeof(p->our_contact) - 1); + + if (!strlen(p->our_contact)) + build_contact(p); if (!p->lastinvite) { /* Handle authentication if this is our first subscribe */ res = check_user(p, req, cmd, e, 0, sin);