Changing PJSIP to work over TCP on port different than 5060

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

 



Pjsip will send bye to contact address sent in invite from asterisk. Check that. Bill

Sent from my iPhone

> On Jul 2, 2014, at 2:49 PM, Filip Planinsky <filip at fonetize.com> wrote:
> 
> Hi There,
> 
> I will try to bump up this question one more try.
> Generally, if you use TCP transport on port 5060 - there is no problem.
> However, if you try to change the port, the you get into troubles.
> Details are below in my previous emails.
> 
> If someone could help - will be much appreciated.
> 
> Thanks,
> Filip
> 
>> On Jun 9, 2014, at 7:22 PM, Filip Planinsky <filip at fonetize.com> wrote:
>> 
>> Hi Guys,
>> 
>> any hints on how to change the remote SIP port for PJSIP?
>> My Asterisk is listening on TCP port 6533 and it seems that PJSIP is having trouble to work with it in some cases.
>> I can't use UDP - because of the iOS App, which requires TCP in order to run in background.
>> 
>> Details are below.
>> If you could help - it will be greatly appreciated!
>> 
>> Thanks,
>> Filip
>> 
>> 
>>> On Jun 7, 2014, at 12:12 AM, Filip Planinsky <filip at fonetize.com> wrote:
>>> 
>>> 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
> 
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
> 
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20140704/6062bce3/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