[Home]

Summary:ASTERISK-20590: Frequent outgoing gtalk failure resulting in 100% CPU usage
Reporter:Aaron Sells (aaronsells)Labels:
Date Opened:2012-10-21 16:59:30Date Closed:2013-02-08 11:00:40.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Channels/chan_gtalk
Versions:SVN Frequency of
Occurrence
Frequent
Related
Issues:
Environment:Ubuntu 12.04, 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:33:09 UTC 2012 x86_64 x86_64 x86_64 GNU/LinuxAttachments:
Description:Outgoing gtalk calls are frequently failing and end up causing asterisk to use 100% of the CPU. The failed gtalk channel persists in a ringing state until manually hungup (CLI> channel request hangup ...).  CPU usage returns to normal after the channel is hungup.


{code}
[2012-10-20 18:25:59] NOTICE[20307] chan_gtalk.c: Remote peer reported an error, trying to establish the call anyway
[2012-10-20 18:25:59] NOTICE[20307] chan_gtalk.c: Ignoring duplicate call setup on SID 464b8ba140fe824b
[2012-10-20 18:25:59] VERBOSE[20307] res_jabber.c:
JABBER: XXXXXXXXXX OUTGOING: <iq type='result' from='XXXXXXXXXX@gmail.com/Talk035182CE' to='+1YYYYYYYYYY@voice.google.com/srvres-MTAuMjI3LjI3LjE5OTo5ODUw' id='aaaad'><error type='cancel'><out-of-order/></error></iq>
[2012-10-20 18:25:59] VERBOSE[21382][C-00000000] app_dial.c: -- Local/1YYYYYYYYYY@gvoice-XXXXXXXXXX-00000001;1 is ringing
[2012-10-20 18:25:59] VERBOSE[21351][C-00000000] app_dial.c: -- Local/YYYYYYYYYY@from-internal-00000000;1 is ringing
[2012-10-20 18:25:59] VERBOSE[20307] res_jabber.c:
JABBER: XXXXXXXXXX INCOMING: <iq from="+1YYYYYYYYYY@voice.google.com/srvres-MTAuMjI3LjI3LjE5OTo5ODUw" to="XXXXXXXXXX@gmail.com/Talk035182CE" type="error" id="aaaae"><session type="candidates" id="464b8ba140fe824b" initiator="XXXXXXXXXX@gmail.com/Talk035182CE" xmlns="http://www.google.com/session"><candidate name="rtp" address="192.168.10.100" port="11222" username="51864e7a12554dac" password="31e35afd3c445503" preference="1.00" protocol="udp" type="local" network="0" generation="0"/><transport xmlns="http://www.google.com/transport/p2p"/></session><error code="503" type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">status=APPLICATION_ERROR</text></error></iq>
[2012-10-20 18:25:59] NOTICE[20307] chan_gtalk.c: Remote peer reported an error, trying to establish the call anyway
[2012-10-20 18:25:59] VERBOSE[20307] res_jabber.c:
JABBER: XXXXXXXXXX OUTGOING: <iq type='result' from='XXXXXXXXXX@gmail.com/Talk035182CE' to='+1YYYYYYYYYY@voice.google.com/srvres-MTAuMjI3LjI3LjE5OTo5ODUw' id='aaaae'/>
[2012-10-20 18:26:01] WARNING[21382][C-00000000] channel.c: Exceptionally long voice queue length queuing to Local/1YYYYYYYYYY@gvoice-XXXXXXXXXX-00000001;2
[2012-10-20 18:26:02] WARNING[21382][C-00000000] channel.c: Exceptionally long voice queue length queuing to Local/1YYYYYYYYYY@gvoice-XXXXXXXXXX-00000001;2
[2012-10-20 18:26:03] WARNING[21382][C-00000000] channel.c: Exceptionally long voice queue length queuing to Local/1YYYYYYYYYY@gvoice-XXXXXXXXXX-00000001;2
[2012-10-20 18:26:05] WARNING[21382][C-00000000] channel.c: Exceptionally long voice queue length queuing to Local/1YYYYYYYYYY@gvoice-XXXXXXXXXX-00000001;2
[2012-10-20 18:26:06] WARNING[21382][C-00000000] channel.c: Exceptionally long voice queue length queuing to Local/1YYYYYYYYYY@gvoice-XXXXXXXXXX-00000001;2
{code}

{code}
exten => _X.,1,Dial(Gtalk/XXXXXXXXXX/+${EXTEN}@voice.google.com)
exten => _X.,n,Noop(GVoice Call to ${EXTEN} failed)
exten => h,1,Macro(hangupcall,)
{code}
Comments:By: Aaron Sells (aaronsells) 2012-10-22 13:05:39.861-0500

Some more relevant output during an outgoing gtalk failure:

{code}
[2012-10-22 12:27:06] VERBOSE[32353] res_jabber.c:
JABBER: XXXXXXXXXXX INCOMING: <iq from="+1YYYYYYYYYY@voice.google.com/srvres-MTAuMjI3LjEwLjY1Ojk4MjM=" to="XXXXXXXXXXX@gmail.com/TalkEE5BA039" type="error" id="aaabk"><session type="candidates" id="0ae63d5f69da90ec" initiator="XXXXXXXXXXX@gmail.com/TalkEE5BA039" xmlns="http://www.google.com/session"><candidate name="rtp" address="192.168.10.100" port="17332" username="15bed0150ef7ac08" password="46753a0f4943ef78" preference="1.00" protocol="udp" type="local" network="0" generation="0"/><transport xmlns="http://www.google.com/transport/p2p"/></session><error code="503" type="cancel"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">status=APPLICATION_ERROR</text></error></iq>
{code}

It appears that others are seeing this 503 error as well:
https://www.obitalk.com/forum/index.php?topic=4400.0
http://productforums.google.com/forum/#!search/reason$20503/voice/9DToDQ1516E/N_moG_jAkuMJ

For now, I've modified chan_gtalk.c to hangup when it sees all error types.  At least this way my system stays usable even when the outgoing gtalk call fails.

{code}
Index: channels/chan_gtalk.c
===================================================================
--- channels/chan_gtalk.c (revision 375271)
+++ channels/chan_gtalk.c (working copy)
@@ -2097,6 +2097,8 @@

if (ast_strlen_zero(iks_find_attrib(pak->query, "type"))) {
ast_log(LOG_NOTICE, "No attribute \"type\" found.  Ignoring message.\n");
+ } else if (!strcmp(S_OR(iks_find_attrib(pak->x, "type"), ""), "error")) {
+                gtalk_hangup_farend(client, pak);
} else if (!strcmp(iks_find_attrib(pak->query, "type"), "initiate")) {
/* New call */
gtalk_newcall(client, pak);
{code}

By: Matt Jordan (mjordan) 2012-10-28 16:18:37.489-0500

When you list your version as 'SVN', do you mean trunk?  Or do you mean the latest check out from a particular branch?

Please note that chan_gtalk is an extended support module, and development effort for it comes from the Asterisk community.  Response times for these issues may reflect that.

By: Aaron Sells (aaronsells) 2012-10-28 16:35:00.434-0500

Yes, I mean trunk:

{quote}
URL: http://svn.asterisk.org/svn/asterisk/trunk
Repository Root: http://svn.asterisk.org/svn/asterisk
Repository UUID: f38db490-d61c-443f-a65b-d21fe96a405b
Revision: 375271
Node Kind: directory
Schedule: normal
Last Changed Author: jrose
Last Changed Rev: 375249
Last Changed Date: 2012-10-18 17:49:24 -0400 (Thu, 18 Oct 2012)
{quote}

I'm also aware that chan_gtalk is deprecated.  However, since I have yet to make a successful google voice call using chan_motif, a functional chan_gtalk is a must for me.

By: Joshua C. Colp (jcolp) 2012-10-28 16:38:52.834-0500

So both are failing? How interesting. Could be something specific with your account. Have you filed an issue against chan_motif with all the details for the issues with it?

By: Aaron Sells (aaronsells) 2012-10-28 17:42:02.261-0500

No, I haven't filed anything against chan_motif yet--I only did limited testing with chan_motif and didn't feel like I had exhausted all the possibilities of issues unique to my system.  However, I doubt my chan_motif issues are related to the google voice 503 error.  The 503 errors seemed to have stopped around October 24th.  My chan_motif issues existed before and remain still.

For the record, chan_motif calls connect but I get no audio on either end.  But, with ICE enabled, my chan_gtalk calls get one-way-audio.  When I set "icesupport=false", chan_gtalk calls are fine but chan_motif calls do not connect.

By: Aaron Sells (aaronsells) 2013-02-08 10:59:24.830-0600

I have chan_motif working now and am no longer using chan_gtalk.  FWIW, I think my previous motif issues were caused by not forwarding port 5222.

By: Aaron Sells (aaronsells) 2013-02-08 11:00:40.396-0600

chan_gtalk is deprecated.  Use chan_motif instead.