I am testing pjsua app on Windows 10 compiled with Visual Studio.
I connect directly to a Siemens HiPath server. The registry works correctly
for a few hours until in one of the re-registrations there is a strange
behaviour.
In one of the re-registers, pjsua creates a new TCP transport with a
different source port. Looking at the Wireshark it doesn't appear that the
previous transport has been broken at any time.
Viewing the log, the creation of the new TCP transport with a new org port
is observed, but the previous port continues to appear on contact. 50054
its the previous port and 50088 its the new source port created.
12:54:50.751 tcpc00F6B374 .TCP client transport created
12:54:50.757 tcpc00F6B374 .TCP transport 10.112.224.196:50088 is
connecting to 10.250.68.22:5060...
12:54:50.758 pjsua_core.c .TX 726 bytes Request msg REGISTER/cseq=36417
(tdta00F76F4C) to TCP 10.250.68.22:5060:
REGISTER sip:sipserver.com;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 10.112.224.196:50088
;rport;branch=z9hG4bKPj81eff9781dbe429eae25993049a28a82;alias
Max-Forwards: 70
From: <sip:xxxxxxxx@ sipserver .com>;tag=9cf46b07fd9247f2986f725806dd2942
To: <sip: xxxxxxxx @sipserver .com>
Call-ID: c23ad26b4da64272af81c4c8b4f37a8e
CSeq: 36417 REGISTER
User-Agent: PJSUA v2.10-dev win32-6.2/i386/msvc-19.2.3
Supported: outbound, path
Contact: <sip: xxxxxxxx @10.112.224.196:50054
;transport=TCP;ob>;reg-id=1;+sip.instance="urn:uuid:00000000-0000-0000-0000-00007a5cb7fa"
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY,
REFER, MESSAGE, OPTIONS
Content-Length: 0
From that moment, calls are no longer received and neither receive BYE from
calls in course. Other pjsua clients receive a 408 Timeout when try to call
me
Using re-register command in pjsua (rr) don't solve de problem and in the
application I am creating with pjsua-api it is solved if I do a
pjsua_acc_del () and then a pjsua_acc_add () with the same account,
Why is a new transport created if the previous one has not failed? Why
don't create a new contact with new source port like when an IP change?
I have tried linphone-daemon on the same machine without any issue and any
transport change for days.
Any help is welcome.
Thanks,
Calanor
More info.
I have seen that this happens when the hostname (sipserver.com in example)
resolves different IP because there is more than one computer providing
service on the same hostname and the IP changes from 10.250.68.21 to
10.250.68.22 . When this happens a new TCP connection is created with a
new local port.
The problem its that this new local port its not rewrite on the contact
even having the allow_contact_rewrite set to true.
Calanor
On Fri, Mar 27, 2020 at 1:39 PM ramon calanor@gmail.com wrote:
I am testing pjsua app on Windows 10 compiled with Visual Studio.
I connect directly to a Siemens HiPath server. The registry works
correctly for a few hours until in one of the re-registrations there is a
strange behaviour.
In one of the re-registers, pjsua creates a new TCP transport with a
different source port. Looking at the Wireshark it doesn't appear that
the previous transport has been broken at any time.
Viewing the log, the creation of the new TCP transport with a new org port
is observed, but the previous port continues to appear on contact. 50054
its the previous port and 50088 its the new source port created.
12:54:50.751 tcpc00F6B374 .TCP client transport created
12:54:50.757 tcpc00F6B374 .TCP transport 10.112.224.196:50088 is
connecting to 10.250.68.22:5060...
12:54:50.758 pjsua_core.c .TX 726 bytes Request msg REGISTER/cseq=36417
(tdta00F76F4C) to TCP 10.250.68.22:5060:
REGISTER sip:sipserver.com;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 10.112.224.196:50088
;rport;branch=z9hG4bKPj81eff9781dbe429eae25993049a28a82;alias
Max-Forwards: 70
From: <sip:xxxxxxxx@ sipserver .com>;tag=9cf46b07fd9247f2986f725806dd2942
To: <sip: xxxxxxxx @sipserver .com>
Call-ID: c23ad26b4da64272af81c4c8b4f37a8e
CSeq: 36417 REGISTER
User-Agent: PJSUA v2.10-dev win32-6.2/i386/msvc-19.2.3
Supported: outbound, path
Contact: <sip: xxxxxxxx @10.112.224.196:50054
;transport=TCP;ob>;reg-id=1;+sip.instance="urn:uuid:00000000-0000-0000-0000-00007a5cb7fa"
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY,
REFER, MESSAGE, OPTIONS
Content-Length: 0
From that moment, calls are no longer received and neither receive BYE from
calls in course. Other pjsua clients receive a 408 Timeout when try to
call me
Using re-register command in pjsua (rr) don't solve de problem and in the
application I am creating with pjsua-api it is solved if I do a
pjsua_acc_del () and then a pjsua_acc_add () with the same account,
Why is a new transport created if the previous one has not failed? Why
don't create a new contact with new source port like when an IP change?
I have tried linphone-daemon on the same machine without any issue and any
transport change for days.
Any help is welcome.
Thanks,
Calanor