ALERT GV: The Sky Has Fallen... Really

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
Dale Carnegie Award: Polycom's PR Man of the Year on the Demise of Google Voice

Dji19bGW4AQCUzQ.jpg
OMG that SteveInWA PolyCom PR guy LMAO Dale Carnegie Award indeed, he needs lay off the hatorade and relax LOL.
GV is simply switching protocols from xmpp to SIP enhanced with latest SIP RFCs.
GV is one profitable business inside a 789 billion dollar company which uses GV to earn itself billions yearly by offering the service under an end user agreement which lets G sell our GV call and text data to the US NSA FBI CIA intelligence community and in somewhat anonymized form to any paying business customer.
GV is here to stay because all users consent to unlimited wiretapping = massive cash cow.
That being said, it was a little crazy of G to disable XMPP before the asterisk community of developers had time to mobilize, dev, test a GVSIP update to pjsip code, and deploy it to the millions of asterisk pbx phone servers. Many users were down for days or weeks, ripping their hair out, trying to troubleshoot, in a panic mode.
 
Last edited:

mardosas

New Member
Joined
Mar 25, 2016
Messages
16
Reaction score
3
Dear Ward,

Well done! And what a perfect timing. Many, many thanks for your great efforts!
 

Eliad

Active Member
Joined
Aug 13, 2017
Messages
619
Reaction score
127
I did create a VM that has the GV hosting working http://nerdvittles.com/?p=26445. Step 6, i would like to add to the dial plan another line that would eliminate the need to dial the local area code. I did that for other trunks but the dial plan for Step 6 is a bit unusual and I do not know where to add the local area code. Any suggestions?
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
I did create a VM that has the GV hosting working http://nerdvittles.com/?p=26445. Step 6, i would like to add to the dial plan another line that would eliminate the need to dial the local area code. I did that for other trunks but the dial plan for Step 6 is a bit unusual and I do not know where to add the local area code. Any suggestions?

For the second dial string, in the prepend field, insert * followed by your 10-digital GVSIP DID number followed by your 3-digit area code. Leave the prefix field blank. In the match pattern field, insert NXXXXXX.
 

shetu

Member
Joined
Nov 28, 2014
Messages
136
Reaction score
10
What is that mean?
[2018-08-03 09:09:12] WARNING[2324]: chan_sip.c:3782 __sip_xmit: sip_xmit of 0x7f762c0102c0 (len 423) to (null) returned -1: Invalid argument
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
What is that mean?
[2018-08-03 09:09:12] WARNING[2324]: chan_sip.c:3782 __sip_xmit: sip_xmit of 0x7f762c0102c0 (len 423) to (null) returned -1: Invalid argument
You ipbx/asterisk tried to send SIP phone call data to a null IP address and failed.
http://lists.digium.com/pipermail/asterisk-bugs/2008-February/011937.html
It's probably a bug, it shouldn't try to send data to a null IP.
You should report this on the asterisk issues tracker here:
https://issues.asterisk.org/jira/secure/Dashboard.jspa
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
ATTENTION: Yesterday, a new bug fix was posted to github asterisk repo for PJSIP (PJSIP is what GVSIP uses to let asterisk connect to GV after June). The fix solves a deadlock (freeze) in SIP response retransmissions. Some of you reported your IPBX froze up on you randomly while making or receiving calls with GVoice and GVSIP. This new bug fix just might solve that random freeze issue for you. https://github.com/asterisk/asterisk/commit/9fcb3aeb07d1372a2523d6a6fa8963a045a03371
Comments @wardmundy @jerrm anyone nick (naf) if he around here.
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
Guys.... Anyone else notice the ICE STUN server setting in the ipbx (freepbx) php web portal, is NOT getting set in asterisk? This is an invitation to problems call dropping, one way audio, etc, for anyone with your pbx server behind any type of proxy, load balancer, docker container, virtualbox, or nat.
Code:
:~# asterisk -rx "stun show status"
Hostname                  Port  Period  Retries  Status  ExternAddr       ExternPort
(null)                    0     30      3        INIT    0.0.0.0          0
Inside IPBX web portal, Settings, Asterisk SIP Settings, RTP Settings, STUN Server Address is set to public STUN server stun.counterpath.net
The "Hostname" in "stun show status" should show "stun.counterpath.net" and "Port" should show the default port "3478".... why isn't it?!
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
Might be wrong, but I'm 99% sure the install-gvsip script has a serious bug. I think the git command to download the patch is wrong, it's getting the wrong patch, the asterisk 13.22.0 tarball needs a different patch, that patch is for patching between the master of that "naf419/asterisk" repo, and the same repo's "gvsip" branch. The result is, we're missing some key patches for PJSIP/GVSIP.
 

shetu

Member
Joined
Nov 28, 2014
Messages
136
Reaction score
10
Might be wrong, but I'm 99% sure the install-gvsip script has a serious bug. I think the git command to download the patch is wrong, it's getting the wrong patch, the asterisk 13.22.0 tarball needs a different patch, that patch is for patching between the master of that "naf419/asterisk" repo, and the same repo's "gvsip" branch. The result is, we're missing some key patches for PJSIP/GVSIP.
When do we get stable GVSIP with stable os?
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
When do we get stable GVSIP with stable os?
Should be easy to fix. It's just that one "git" command line to download the right set of code patches. The code author didn't provide the right command to get that full set of patches, it was close, but it wasn't quite fully accurate. No worries.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Might be wrong, but I'm 99% sure the install-gvsip script has a serious bug. I think the git command to download the patch is wrong, it's getting the wrong patch, the asterisk 13.22.0 tarball needs a different patch, that patch is for patching between the master of that "naf419/asterisk" repo, and the same repo's "gvsip" branch. The result is, we're missing some key patches for PJSIP/GVSIP.

We actually got that link from NAF. What is the link that you believe to be correct??

By the way, errors in the patch process are nothing new. They've been there since the beginning.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Guys.... Anyone else notice the ICE STUN server setting in the ipbx (freepbx) php web portal, is NOT getting set in asterisk? This is an invitation to problems call dropping, one way audio, etc, for anyone with your pbx server behind any type of proxy, load balancer, docker container, virtualbox, or nat.
Code:
:~# asterisk -rx "stun show status"
Hostname                  Port  Period  Retries  Status  ExternAddr       ExternPort
(null)                    0     30      3        INIT    0.0.0.0          0
Inside IPBX web portal, Settings, Asterisk SIP Settings, RTP Settings, STUN Server Address is set to public STUN server stun.counterpath.net
The "Hostname" in "stun show status" should show "stun.counterpath.net" and "Port" should show the default port "3478".... why isn't it?!

Will investigate this one. Any ideas??
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
@chris_c_: We have a fresh build this morning that addresses the GVSIP patch issues (with @dziny fixes) as well as the stun problem. To upgrade existing servers without losing any existing Google Voice GVSIP trunks, here's the drill:
Code:
sed -i 's|bind=0.0.0.0:5061|bind=0.0.0.0:5062|' /etc/asterisk/pjsip_custom.conf
mv /etc/asterisk/pjsip_custom.conf /etc/asterisk/pjsip_custom.tmp
touch /etc/asterisk/pjsip_custom.conf
cd /root
rm gvsip-naf-gui.tar.gz
wget http://incrediblepbx.com/gvsip-naf-gui.tar.gz
tar zxvf gvsip-naf-gui.tar.gz
rm gvsip-naf-gui.tar.gz
cd gvsip-naf
./install-gvsip
mv /etc/asterisk/pjsip_custom.tmp /etc/asterisk/pjsip_custom.conf
amportal restart
 
Last edited:

tycho

Guru (not...)
Joined
Aug 9, 2011
Messages
652
Reaction score
272
@chris_c_: We have a fresh build this morning that addresses the GVSIP patch issues (with @dziny fixes) as well as the stun problem. To upgrade existing servers without losing any existing Google Voice GVSIP trunks, here's the drill:
Code:
mv /etc/asterisk/pjsip_custom.conf /etc/asterisk/pjsip_custom.tmp
touch /etc/asterisk/pjsip_custom.conf
cd /root
rm gvsip-naf-gui.tar.gz
wget http://incrediblepbx.com/gvsip-naf-gui.tar.gz
tar zxvf gvsip-naf-gui.tar.gz
rm gvsip-naf-gui.tar.gz
cd gvsip-naf
./install-gvsip
mv /etc/asterisk/pjsip_custom.tmp /etc/asterisk/pjsip_custom.conf
amportal restart
Ward, I stopped when the installer reported this:

"This appears to be a fresh install of GVSIP for Incredible PBX.
Do you wish to install all of the required components?"

It shouldn't appear to be a fresh install; it is an existing, recent install that incorporates and that is running GVSIP.

Just a verbiage mis-match?
 

jerrm

Guru
Joined
Sep 23, 2015
Messages
838
Reaction score
405
It's baffling. The docs clearly say what settings need to be in the conf files to enable STUN. Yet asterisk appears not to be picking up the settings. https://wiki.asterisk.org/wiki/display/AST/Interactive+Connectivity+Establishment+(ICE)+in+Asterisk
Asterisk uses a stun server if defined. Issue a "stun set debug on" and make some calls to see the activity.

To find out how much trouble a broken or down stun server can cause, set the stun address to a valid address that is not a stun server.

It may be firewall/router dependent, but I've never found a stun server needed for SIP/IAX endpoints. WebRTC is another matter. I don't set it anymore because of the potential bad server issues - got bit once and it took way too long to figure out what the issue really was.

The show status is dependent on the server being listed in res_stun_monitor.conf:
Code:
;
; Configuration file for the res_stun_monitor module
;
; The res_stun_monitor module sends STUN requests to a configured STUN server
; periodically.  If the monitor detects a change in the external IP address or port
; provided by the STUN server an event is sent out internally within Asterisk
; to alert all listeners to that event of the change.
; The current default listeners for the network change event include chan_sip
; and chan_iax.  Both of these channel drivers by default react to this event
; by renewing all outbound registrations.  This allows the endpoints Asterisk
; is registering with to become aware of the address change and know the new
; location.
;
[general]
;
; ---- STUN Server configuration ---
;  Setting the 'stunaddr' option to a valid address enables the STUN monitor.
;
;stunaddr = mystunserver.com    ; Address of the STUN server to query.
                                ; Valid form:
                                ;   [(hostname | IP-address) [':' port]]
                                ; The port defaults to the standard STUN port (3478).
                                ; Set to an empty value to disable STUN monitoring.
                                ;   Default is disabled.
;stunrefresh = 30               ; Number of seconds between STUN refreshes.
                                ;   Default is 30.
 
Last edited:

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
We actually got that link from NAF. What is the link that you believe to be correct??

By the way, errors in the patch process are nothing new. They've been there since the beginning.
Late reply since you've already added the patches from dslr @dziny into a new version to fix this issue.
To explain this subtle bug, just so it will be less likely to happen again, it's as follows.
1. The naf github fork is of the entire, UP TO DATE, asterisk repo (which is too much code to fork and led to this bug, in my humble opinion, but let's save this thought for now).
2. naf's instructions on how to apply the patch kind of left out pointing out that the version of naf's asterisk fork's master is approximately asterisk 15.5.0. And naf's "gvsip" branch is code added onto that version of that master which means it's a patch to 15.5.0.
3. Again, naf said to apply the patch by either cloning his entire fork's "gvsip" branch and compile that, which is, again, gives you a variant of asterisk 15.5.0. Or, he says you can use his "wget compare master to gvsip branch and generate a patch" command, which gets all different files in the gvsip branch of the naf fork vs. the master branch of the naf fork.
4. When you use that "wget compare master to gvsip branch and generate a patch" command, the result code is substantially different and possibly will produce a different binary compiled output than intended!!!.
Have a look at this very important "patches" directory of PJSIP, this is what it's supposed to contain:
Code:
~/asterisk/third-party/pjproject/patches $ ls -la
total 116
drwxr-xr-x 2 root root  4096 Aug  4 12:34 .
drwxr-xr-x 3 root root   126 Aug  4 12:34 ..
-rw-r--r-- 1 root root  4726 Aug  4 12:34 0000-remove-third-party.patch
-rw-r--r-- 1 root root  1567 Aug  4 12:34 0000-set_apps_initial_log_level.patch
-rw-r--r-- 1 root root  1398 Aug  4 12:34 0021-sip_parser-Fix-return-code-in-pjsip_find_msg-and-add.patch
-rw-r--r-- 1 root root   781 Aug  4 12:34 0030-sip_transport-Destroy-transports-not-in-hash.patch
-rw-r--r-- 1 root root   633 Aug  4 12:34 0040-183_without_to_tag.patch
-rw-r--r-- 1 root root  2885 Aug  4 12:34 0050-dont_terminate_session_early.patch
-rw-r--r-- 1 root root  1887 Aug  4 12:34 0060-sip_msg-Prevent-crash-on-header-without-vptr.patch
-rw-r--r-- 1 root root  3652 Aug  4 12:34 0070-os_core_unix-Set-mutex-NULL-in-atomic-destroy-and-ad.patch
-rw-r--r-- 1 root root 18864 Aug  4 12:34 0080-timer-Clean-up-usage-of-timer-heap.patch
-rw-r--r-- 1 root root  1036 Aug  4 12:34 0090-sip_transaction-In-tsx_timer_callback-check-if-tsx-i.patch
-rw-r--r-- 1 root root  8345 Aug  4 12:34 0100-sip_inv-Add-option-to-accept-updated-SDP-on-same-To-.patch
-rw-r--r-- 1 root root  6779 Aug  4 12:34 0110_fix_tdata_rexmit_deadlock.patch
-rw-r--r-- 1 root root  5211 Aug  4 12:34 0120-oauth.patch
-rw-r--r-- 1 root root  3181 Aug  4 12:34 0130-contact-params.patch
-rw-r--r-- 1 root root  1752 Aug  4 12:34 asterisk_malloc_debug.c
-rw-r--r-- 1 root root  3059 Aug  4 12:34 asterisk_malloc_debug.h
-rw-r--r-- 1 root root  2684 Aug  4 12:34 config_site.h
-rw-r--r-- 1 root root   318 Aug  4 12:34 README
-rw-r--r-- 1 root root   251 Aug  4 12:34 user.mak

Here's what "patches" dir looks like after running naf's "wget patch" command on asterisk 13.22.0 tarball:
Code:
/usr/src/asterisk-13.22.0/third-party/pjproject/patches $ ls -la
total 116
drwxrwxr-x 2 1015 users  4096 Aug  3 18:29 .
drwxrwxr-x 4 1015 users  4096 Aug  3 18:42 ..
-rw-rw-r-- 1 1015 users  4726 Aug  3 18:29 0000-remove-third-party.patch
-rw-rw-r-- 1 1015 users  1567 Aug  3 18:29 0000-set_apps_initial_log_level.patch
-rw-rw-r-- 1 1015 users  1398 Aug  3 18:29 0021-sip_parser-Fix-return-code-in-pjsip_find_msg-and-add.patch
-rw-rw-r-- 1 1015 users   781 Aug  3 18:29 0030-sip_transport-Destroy-transports-not-in-hash.patch
-rw-rw-r-- 1 1015 users   633 Aug  3 18:29 0040-183_without_to_tag.patch
-rw-rw-r-- 1 1015 users  2885 Aug  3 18:29 0050-dont_terminate_session_early.patch
-rw-rw-r-- 1 1015 users  1524 Aug  3 18:29 0060-sip_msg-Prevent-crash-on-header-without-vptr.patch
-rw-rw-r-- 1 1015 users  3652 Aug  3 18:29 0070-os_core_unix-Set-mutex-NULL-in-atomic-destroy-and-ad.patch
-rw-rw-r-- 1 1015 users 18864 Aug  3 18:29 0080-timer-Clean-up-usage-of-timer-heap.patch
-rw-rw-r-- 1 1015 users  1036 Aug  3 18:29 0090-sip_transaction-In-tsx_timer_callback-check-if-tsx-i.patch
-rw-r--r-- 1 root root   5211 Aug  3 18:29 0100-oauth.patch
-rw-rw-r-- 1 1015 users  8345 Aug  3 18:29 0100-sip_inv-Add-option-to-accept-updated-SDP-on-same-To-.patch
-rw-r--r-- 1 root root   1107 Aug  3 18:29 0110-pjsip_dest_info.patch
-rw-r--r-- 1 root root   3181 Aug  3 18:29 0130-contact-params.patch
-rw-rw-r-- 1 1015 users  1717 Aug  3 18:29 asterisk_malloc_debug.c
-rw-rw-r-- 1 1015 users  2519 Aug  3 18:29 asterisk_malloc_debug.h
-rw-rw-r-- 1 1015 users  2380 Aug  3 18:29 config_site.h
-rw-rw-r-- 1 1015 users   318 Aug  3 18:29 README
-rw-rw-r-- 1 1015 users   251 Aug  3 18:29 user.mak

You see right!
1. One important crash fix patch (fix tdata rexmit deadlock) ends up missing!
2. Two patches incorrectly got the same sequence number "0100" which causes an unintended side effect - one of these two patches may not be applied!! It depends on what the patcher script does! The patcher script docs says it does NOT allow two patches having the same sequence number!
3. And the "oauth" patch is out of sequence, which also could cause an unintended side effect, if it's overlapping another patch, in which case, order does matter, and will make different code and a totally different asterisk binary!!

Back to my first comment, naf forking the entire asterisk repo, was probably too much to fork, because the diffs it makes really only work cleanly with current master 15.5.0 which most users aren't yet using, at least, most IPBX users aren't using yet. His contribution could probably be contained within one "patch" file, saved to pjsip's "patch" dir, plus one patch for asterisk consisting of the "C header" file for asterisk, plus the modified "README.md", plus "res_pjsip" modded files, which is the asterisk module which talks to the "pjsip" third party library. This way would probably make this gvsip naf feature MUCH easier to maintain and smoothly apply without error or missing code, to any version of asterisk 13 - 16. Ultimately, though, this GVSIP is just an update to PJSIP ("pjproject"), to add a few new RFC's required by GV for decent SIP security and crypto. The stuff on the asterisk side (res_pjsip) is actually a separate thing, it's the client to pjproject (PJSIP), and probably can/should be its own separate patch, and made to apply cleanly to all versions of asterisk 13-16.
 

Members online

Forum statistics

Threads
25,782
Messages
167,509
Members
19,203
Latest member
frapu
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