TIPS Change from UDP to TCP

ssnake_br

New Member
Joined
May 13, 2015
Messages
7
Reaction score
0
Update:
I give up triyng to figure out why the hell my PIAF updated machine stopped working with my extensions after a reboot.

Now, I just created a new VM with the original CentOS + Asterisk11. Its working like a charm with OpenVPN and softphones, with a brand new install (I just created the extensions). The extensions were created with the default configs.

But the problem is: WHAT I NEED TO CHANGE IN THE CONFIGS TO MAKE IT WORK WITH TCP INSTEAD OF UDP?

Sorry if I am acting like a pain in the ass, but I am going nuts with this.

Thank you guys.

Original post:
---------------------------------------------------
Hi guys,

I am with big troubles for at least 2 weeks.

My extensions (they need to be TCP) only register after I change (on the softphone) the protocol to UDP, then again to TCP.
If I keep them as TCP, they dont even show on asterisk log. Changing to UDP cause them to fail to register (show on logfile), and change then again to TCP cause the extension to register in asterisk.

For testing purposes, I have flushed all firewall rules. I also disabled PJSIP, and added the tcpenable=true on sip settings.

Sorry for the bad english, and sorry if this is a dumb questions, but I tried everything I could before create a new thread.

Thank you guys.
 
Last edited:

henry

Member
Joined
Apr 2, 2014
Messages
99
Reaction score
30
What softphone is used? Have you tried others?
What platform? Win/Mac/Android/iOS?

Asterisk installed where? How? What version?
Hardware? Cloud?

Doing at home? Router? ISP?

You have to work on your questions to hope get answers...
 

ssnake_br

New Member
Joined
May 13, 2015
Messages
7
Reaction score
0
What softphone is used? Have you tried others?
What platform? Win/Mac/Android/iOS?

Asterisk installed where? How? What version?
Hardware? Cloud?

Doing at home? Router? ISP?

You have to work on your questions to hope get answers...

Henry,

I have linphone and CSipSimple, in android and IOS phones. Both with same symptoms.

Asterisk installed as VM, first on a Ubuntu and now for testing purposes using a virtualbox OVA download from nerdvitles (http://wardmundy.net:82/IncrediblePBX-13-12.2-SL67.ova). Both with same symptoms. They are in a personal server, at home.

They connect via openvpn to my server, and then to the VM. The VPN connection works ok.

The weird thing is the extension connection after change to UDP then to TCP again on the phone side.
 

henry

Member
Joined
Apr 2, 2014
Messages
99
Reaction score
30
Sounds reasonable...

I'd try Zoiper using IAX to rule out the different SIP flavours...

To narrow down the search: does this setup work without openvpn in the mix?

After making it work - with acrobatics - when does is stop working?
When trying to make a second call?
When restarting the softphone?
 
Last edited:

ssnake_br

New Member
Joined
May 13, 2015
Messages
7
Reaction score
0
Hey guys, I am going nuts with this.
For some reason, my extensions only work via UDP, no matter if I use VPN or not. I REAALY need TCP here.
 

henry

Member
Joined
Apr 2, 2014
Messages
99
Reaction score
30
Since this is at home (by the sound of it), is it behind a router? What type?

To rule out NAT, did you try connecting from a softphone on the same subnet?
Let's say the router has 192.168.1.1/24, the asterisk server 192.168.1.10/24 and the softphone 192.168.1.100/24...

You have to make some basic setup work and then start adding layers...
 

ssnake_br

New Member
Joined
May 13, 2015
Messages
7
Reaction score
0
Update:
I give up triyng to figure out why the hell my PIAF updated machine stopped working with my extensions after a reboot.

Now, I just created a new VM with the original CentOS + Asterisk11. Its working like a charm with OpenVPN and softphones, with a brand new install (I just created the extensions). The extensions were created with the default configs.

But the problem is: WHAT I NEED TO CHANGE IN THE CONFIGS TO MAKE IT WORK WITH TCP INSTEAD OF UDP?

Sorry if I am acting like a pain in the ass, but I am going nuts with this.

Thank you guys.

and @henry, I tried what you suggested, but the symptoms are the same. Three weeks ago it was working, nothing changed in my VPN server or router configs.
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,540
Reaction score
729
Set tcpenable=yes in Asterisk SIP Settings.

Log in over SSH and run "netstat -pan | grep LISTEN" and look for Asterisk listening on TCP 5060.

Run "iptables --list -n" and look for a rule that permits TCP 5060 connections.

From your computer, "telnet PBXIP 5060" replacing PBXIP with your PBX IP and verify that it connects.

Once all these are confirmed then you can be sure Asterisk is listening and connectivity is fine.

Check that the extensions are set to allow the TCP transport (e.g. not set to UDP only).
 
Last edited:

ssnake_br

New Member
Joined
May 13, 2015
Messages
7
Reaction score
0
Set tcpenable=yes in Asterisk SIP Settings.

Log in over SSH and run "netstat -pan | grep LISTEN" and look for Asterisk listening on TCP 5060.

Run "iptables --list -n" and look for a rule that permits TCP 5060 connections.

From your computer, "telnet PBXIP 5060" replacing PBXIP with your PBX IP and verify that it connects.

Once all these are confirmed then you can be sure Asterisk is listening and connectivity is fine.

Check that the extensions are set to allow the TCP transport (e.g. not set to UDP only).

Now thats interesting:
Telnet / Netcat fail at first attempt (but the firewall rules are ok). Then I performed a ping to the server IP, and it worked fine, and THEN the Netcat and Telnet started to work too. Even the extension started to work with TCP.

Triyng to understand...
 

ssnake_br

New Member
Joined
May 13, 2015
Messages
7
Reaction score
0
I disabled all firewalls for testing purposes.

I double checked what you suggest @billsimon, and now on asterisk console I have:

<--- Transmitting (no NAT) to 192.168.0.220:53383 --->
SIP/2.0 403 Forbidden
Via: SIP/2.0/TCP 10.0.0.10:53383;alias;branch=z9hG4bK.Heh0uF8Mh;received=192.168.0.220;rport=53383
From: <sip:[email protected]>;tag=2sIfMWwiZ
To: sip:[email protected];tag=as087292ed
Call-ID: QPVHI-Y6S6
CSeq: 24 REGISTER
Server: FPBX-12.0.70(13.9.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Date: Wed, 27 Jul 2016 22:46:38 GMT
Content-Length: 0


<------------>
[2016-07-27 19:46:38] NOTICE[4495]: chan_sip.c:28446 handle_request_register: Registration from 'sip:[email protected]' failed for '192.168.0.220:53383' - Device not configured to use this transport type
Scheduling destruction of SIP dialog 'QPVHI-Y6S6' in 32000 ms (Method: REGISTER)

It says "Device not configured to use this transport type" but I have on softphones and asterisk the definition to use TCP.

Man...
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,540
Reaction score
729
I disabled all firewalls for testing purposes.

I double checked what you suggest @billsimon, and now on asterisk console I have:

<--- Transmitting (no NAT) to 192.168.0.220:53383 --->
SIP/2.0 403 Forbidden
Via: SIP/2.0/TCP 10.0.0.10:53383;alias;branch=z9hG4bK.Heh0uF8Mh;received=192.168.0.220;rport=53383
From: <sip:[email protected]>;tag=2sIfMWwiZ
To: sip:[email protected];tag=as087292ed
Call-ID: QPVHI-Y6S6
CSeq: 24 REGISTER
Server: FPBX-12.0.70(13.9.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Date: Wed, 27 Jul 2016 22:46:38 GMT
Content-Length: 0


<------------>
[2016-07-27 19:46:38] NOTICE[4495]: chan_sip.c:28446 handle_request_register: Registration from 'sip:[email protected]' failed for '192.168.0.220:53383' - Device not configured to use this transport type
Scheduling destruction of SIP dialog 'QPVHI-Y6S6' in 32000 ms (Method: REGISTER)

It says "Device not configured to use this transport type" but I have on softphones and asterisk the definition to use TCP.

Man...
What is the setting you have in the FreePBX extension configuration? TCP preferred, TCP only?
 

Rrrr

Tink
Joined
May 28, 2009
Messages
343
Reaction score
25
I know ... its an old thread.

Here's how I solved "Device not configured to use this transport type" with SNOM D785.

(In addition to post #8 above and here #8)

On the SNOM device:
1. In Advanced Settings, tab SIP/RTP: set Listen on SIP TCP Port to On (info)
2. In the user account (identity):
a. tab Login, set outbound proxy to
FQDN_or_IP_of_server;transport=tcp (info and here)
b. tab RTP: leave Media Transport Offer on UDP (my mistake was to set this to TCP);
3. Reboot.

In the Incredible PBX GUI:
1. Asterisk SIP Settings: Chan SIP settings: Enable TCP to YES
(alternative is to manually add Other SIP settings:
tcpenable=yes tcpbindaddr=0.0.0.0)
2. In the user extension, under Advanced, set Transport to TCP Only;
3. sip reload.

Hope this helps someone.
 
Last edited:

Members online

Forum statistics

Threads
25,810
Messages
167,754
Members
19,240
Latest member
nikko
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top