diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2017-03-07 16:01:04 +0100 |
---|---|---|
committer | Holger Freyther <holger@freyther.de> | 2017-03-23 07:32:04 +0000 |
commit | 3d9ae085bf498c24a5c338e80929369ba9f851d1 (patch) | |
tree | 0de577ad94e47f61dab009ca79ecbd43445d647c | |
parent | 63942320b35b61fe9fe95759cdb56cbcf17c7b7a (diff) |
sip: Actually honor the remote port of the pbx
So far the remote_port has never been used. sofia-sip did the right
thing and put the port into the "Contact" and the rport option for
the via. But we would have never been able to connect a PBX on a
different port (as sofia-sip seems to parse the destination from the
to address).
Change-Id: Ifbd49b4aa6b01b118fe67e39dddef50b2946159c
-rw-r--r-- | src/sip.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -293,12 +293,14 @@ static int send_invite(struct sip_agent *agent, struct sip_call_leg *leg, { struct call_leg *other = leg->base.call->initial; - char *from = talloc_asprintf(leg, "sip:%s@%s", + char *from = talloc_asprintf(leg, "sip:%s@%s:%d", calling_num, - agent->app->sip.local_addr); - char *to = talloc_asprintf(leg, "sip:%s@%s", + agent->app->sip.local_addr, + agent->app->sip.local_port); + char *to = talloc_asprintf(leg, "sip:%s@%s:%d", called_num, - agent->app->sip.remote_addr); + agent->app->sip.remote_addr, + agent->app->sip.remote_port); char *sdp = sdp_create_file(leg, other); leg->state = SIP_CC_INITIAL; |