aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Johnson <matt9j@cs.washington.edu>2020-08-10 17:06:00 -0700
committerlaforge <laforge@osmocom.org>2020-08-13 19:31:58 +0000
commit52b2afce2ca902bbae4a550d03d471be784efe28 (patch)
treed26e0df7538e5bacb8c23c2572bfe5aa4f4f0832
parent39a2e19309827c369a904c433ace93c7bbb31c57 (diff)
sip: Specify invite contact tag
Version 1.12.12 of libsofia-sip-ua no longer automatically generates a contact header element from the local ip address and port. Specifying the contact tag does not break operation with the existing library (1.12.11), but allows for operation on a system with freeswitch 1.10.4 or later installed, which is built against this new version of libsofia-sip-ua. Change-Id: I5c35c5a4bad2fbe76c22ac6d7ee37c832e0ba246
-rw-r--r--src/sip.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sip.c b/src/sip.c
index c635542..61916c9 100644
--- a/src/sip.c
+++ b/src/sip.c
@@ -597,6 +597,9 @@ static int send_invite(struct sip_agent *agent, struct sip_call_leg *leg,
called_num,
agent->app->sip.remote_addr,
agent->app->sip.remote_port);
+ char *contact = talloc_asprintf(leg, "sip:%s:%d",
+ agent->app->sip.local_addr,
+ agent->app->sip.local_port);
char *sdp = sdp_create_file(leg, other, sdp_sendrecv);
leg->state = SIP_CC_INITIAL;
@@ -604,6 +607,7 @@ static int send_invite(struct sip_agent *agent, struct sip_call_leg *leg,
nua_invite(leg->nua_handle,
SIPTAG_FROM_STR(from),
SIPTAG_TO_STR(to),
+ SIPTAG_CONTACT_STR(contact),
NUTAG_MEDIA_ENABLE(0),
SIPTAG_CONTENT_TYPE_STR("application/sdp"),
SIPTAG_PAYLOAD_STR(sdp),
@@ -612,6 +616,7 @@ static int send_invite(struct sip_agent *agent, struct sip_call_leg *leg,
leg->base.call->remote = &leg->base;
talloc_free(from);
talloc_free(to);
+ talloc_free(contact);
talloc_free(sdp);
return 0;
}