Centralino Asterisk Freepbx TCP UDP

Illustriamo qlcune procedure utili

Centralino Asterisk Freepbx TCP UDP

Messaggioda admin » mar mar 01, 2016 8:09 pm

Per ridurre batteria sullo smartphone, potrebbe essere utile abilitare il traffico su TCP, di seguito la procedura e poi cito la fonte:

1) dal menu FreePBX: Applications--> Extensions --> Transport -> All TCP - Primary (relativamente all'interno interessato)
2) Settings --> Asterisk SIP settings --> Other SIP Settings, and add "tcpenable=yes"
3) sul telefonino: Modificare da UDP a TCP
4) sul router instradare la porta su entrambi i protocolli
5) Modificare le impostazioni del client sip (ad esmpio zoiper etc) TCP Keep alive 1200 secondi (20 minuti)
6) Modificare nella voce dell'extension in questione quality da "yes" a "no"

Leggere il contenuto dell'articolo seguente per eventuali valutazioni di cosa "correggere" e/o omettere dalla procedura appena descritta/riassunta

Evinto da questo articolo:

"..Hi all !

Ok, so you want to set up your own PBX, or you already have yours. Buying extra VoIP phones is costly, not practical and you happen to have an android phone. So you set up an extension for it, use the native android Internet Calls app, or you download a couple of SIP apps and try them out. You educated yourself about NAT, PAT and the like. You finally make it work, great! The next day, you go to work, and boom your battery is dead at 12h. You suddenly realize that it must have something to do with your SIP setup, and you are damn right.

I've played a lot in the past days with my PBX, 3 android phones and 2 android tablets, trying to make a nice setup for my parents, my sister and I, so we can call each other on the cheap. I have a 6GB plan with my cellphone operator, and everybody else is using wifi. There isn't much information on the internet, just random things here and there, so I want to share what I've found.

Basically, it's all about the registration on your PBX. You phone is going to use a "keep alive" signal through a UDP connection, to tell your PBX it's still there. Being NAT behind your cellphone operator, you don't want that, because you will have to have a keep alive signal of 40-60 seconds. So 60-70 times per hour, your phone will ping your PBX, that's not acceptable. What you want, is a TCP connection.

-In your PBX, Go to Applications--> Extensions --> Transport -> All TCP - Primary. That's going to make it use TCP for your extension.
-Still in your PBX, go to Settings --> Asterisk SIP settings --> Other SIP Settings, and add "tcpenable=yes". That's going to allow Asterisk to use TCP connection, otherwise the extension TCP setting is irrelevant.

-In your phone, check "use TCP" box in your SIP app.
-Change the "TCP keep alive" in your SIP app to 1200 seconds, or play with it. That's right, 1200 seconds is 20 minutes. I've found that 15 minutes was not unnecessary, and 30 minutes was to much, gave to much time to unregister.

So now, we've gone from 60-70 registrations per hour, to 3 per hour.
Now if you want to know who doesn't read all the post before commenting, it's the ones that are going to comment "But TCP sucks for voice ! Stick with UDP !!".
Yup, TCP sucks for voice, that's why we only use it for signaling. SIP is a signaling protocol, to initiate connections. The actual voice is transported with RTP, or Real-time Transport Protocol, and that's all UDP. That's why you have to forward ports 10000-20000 on your PBX in your router, that's for RTP. Voice calls are just as good.
But that's not the only thing that will make your battery die, because your PBX is also sending the phone a keep alive signal, and your phone has to answer, it's called "qualify". If your phone doesn't answer, the PBX will disconnect it and won't forward calls to it, but that take a huge amount of battery.

-Go in your extension settings, and change the qualify option from "yes" to "no".

And voila, your phone will keep a connection to your PBX, and it's maybe going to eat 1% of battery per hour to keep it.

Downsides of all this : Very quick registrations and qualify were, at the best of my understanding, made to provide high reliability to business phones. If a line or a phone died, you knew it within 60 seconds, and that's a great thing if you don't what the boss yelling at you because his cisco phone has been down for 20 minutes and he missed calls. But those things have been made for phones that are always plugged in. I prefer to miss a call because my phone was unregistered on my PBX for 2 minutes, than having my phone die on lunch break. Plus, I haven't had a single problem yet !

Just keep in mind that with qualify turned off, your PBX won't know when your phone is off or out of reach, so it will "ring" on the dialer side, but you will never pick up. So I guess the next step is setting a voicemail smile

And for the Android SIP App, I fairly recommand CSipSimple. The fine tuning you can do on all the UDP / TCP / WIFI / Mobile keep alive packets is amazing. Get The CSipSimple Codec pack also, all free !

Hope this helps ! And if anything I said here is wrong, feel correct me please ! This was my first PBX set up ever and I started 5 days ago. Must of the things I said are self learned, assumptions and a lot of reading wink

Have a nice day folks..."

Al quale hanno risposto:

"... Some great tips here, but I thought I should share a particular issue I found with disabling the "qualify" feature from the extension settings...

Without qualify checking that the extension is online, it will take the ringtime (default 15 seconds) before any "forward if unavailable" action takes place. This was a particular issue for me because I wanted Asterisk for forward calls for the Android extension to the Android's cell network when the phone is not connected directly to the Asterisk server. ..."
Avatar utente
admin
Site Admin
 
Messaggi: 81
Iscritto il: gio mar 12, 2009 11:16 am

Torna a Procedure e Guide

Chi c’è in linea

Visitano il forum: Nessuno e 1 ospite

cron