mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Add contact header on reinvite
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@731 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2029,10 +2029,23 @@ static int transmit_response_with_sdp(struct sip_pvt *p, char *msg, struct sip_r
|
|||||||
static int transmit_reinvite_with_sdp(struct sip_pvt *p, struct ast_rtp *rtp)
|
static int transmit_reinvite_with_sdp(struct sip_pvt *p, struct ast_rtp *rtp)
|
||||||
{
|
{
|
||||||
struct sip_request resp;
|
struct sip_request resp;
|
||||||
|
char *from;
|
||||||
if (p->canreinvite == REINVITE_UPDATE)
|
if (p->canreinvite == REINVITE_UPDATE)
|
||||||
reqprep(&resp, p, "UPDATE", 1);
|
reqprep(&resp, p, "UPDATE", 1);
|
||||||
else
|
else
|
||||||
reqprep(&resp, p, "INVITE", 1);
|
reqprep(&resp, p, "INVITE", 1);
|
||||||
|
if (p->outgoing)
|
||||||
|
from = get_header(&p->initreq, "From");
|
||||||
|
else
|
||||||
|
from = get_header(&p->initreq, "To");
|
||||||
|
{
|
||||||
|
/* Add contact header */
|
||||||
|
char contact2[256] ="", *c, contact[256];
|
||||||
|
strncpy(contact2, from, sizeof(contact2)-1);
|
||||||
|
c = ditch_braces(contact2);
|
||||||
|
snprintf(contact, sizeof(contact), "<%s>", c);
|
||||||
|
add_header(&resp, "Contact", contact);
|
||||||
|
}
|
||||||
add_sdp(&resp, p, rtp);
|
add_sdp(&resp, p, rtp);
|
||||||
return send_request(p, &resp, 1, p->ocseq);
|
return send_request(p, &resp, 1, p->ocseq);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user