Changing PJSIP to work over TCP on port different than 5060

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,


I am trying to change the default SIP port 5060 to some other port.
I am using TCP, because I use PJSIP on an iOS App, which must run in background mode. And TCP is required by iOS for this to happen.


I tried this and it seemed to be working ok.
I have added to pjsua_config struct:

cfg.outbound_proxy[0] = pj_str("sip:XXX.XXX.XXX.XXX:6533;transport=tcp");

before execution the pjsua_init(&cfg, &log_cfg, NULL) function

By setting the outbound proxy to pjsua_config struct I achieved 2 things:
1. adding transport=tcp to all request
2. changing the remote port from 5060 to 6533

I also added the port to the registrar URI in pjsua_acc_config.reg_uri="sip:XXX.XXX.XXX.XXX:6533"

This way the App is able to:
1. Send REGISTER
2. Receive OPTIONS from Asterisk
3. Receive INVITE from Asterisk and establish a call, which has audio in both directions
4. Obviously, respond to Asterisk with SIP/200 OK and ACK, when needed.


However, I did find that the App is not capable to send BYE requests.
I use the App only to answer calls - by design it doesn't have the ability to make calls - so I do not know if it is capable to send INVITE requests to the Asterisk.

23:18:16.307   pjsua_call.c !Call 0 hanging up: code=0..
23:18:16.308 tcpc0x15ba6c14  ....TCP client transport created
23:18:16.309 tcpc0x15ba6c14  ....TCP transport 192.168.1.11:61873 is connecting to XXX.XXX.XXX.XXX:5060...
23:18:16.309   pjsua_core.c  ....TX 476 bytes Request msg BYE/cseq=6547 (tdta0x15abf400) to TCP XXX.XXX.XXX.XXX:5060
23:18:16.364  tsx0x15ba6064  Failed to send Request msg BYE/cseq=6547 (tdta0x15abf400)! err=120061 (Connection refused)

It tries to send the BYE request to poet 5060, which is not possible as the Asterisk doesn't listen to this port.
I think the problem is that it says "TCP client transport created" and therefore uses the default port.


What is the proper way to change the TCP port from 5060 to any other port?


Thanks,
Filip





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20140607/163325e0/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux