[Home]

Summary:ASTERISK-10307: [patch] see channel in agi debug
Reporter:Clod Patry (junky)Labels:
Date Opened:2007-09-15 06:42:24Date Closed:2007-11-06 17:58:45.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_agi
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20070923_10730.diff
( 1) agi_debug_chan.diff
Description:After a quick speech with jsmith, at AMUG meeting yesterday, I finally decided to implements it.

Right now, when you do agi debug:
AGI Rx << GET DATA multi/A125 2000 3 "1234567890*"
   -- <SIP/64.15.69.138-b5caf660> Playing 'multi/A125.slin' (language 'fr')
AGI Tx >> 200 result=0 (timeout)
AGI Rx << STREAM FILE multi/A151 "1234567890"
   -- Playing 'multi/A151' (escape_digits=1234567890) (sample_offset 0)
AGI Tx >> 200 result=0 endpos=8192

you just see whats happening, but now the question could raise, on which channel just happened the "STREAM FILE multi/A151" ?
There's no way to know it!

That patch changes the behavior to see the channel name before any Rx/Tx.
Same when agi starts (getting some agi vars) and when agi completes.

****** ADDITIONAL INFORMATION ******

example of that patch:
   -- Executing [83@from-sip:1] AGI("SIP/10-08221248", "saynumber.agi") in new stack
   -- Launched AGI Script /var/lib/asterisk/agi-bin/saynumber.agi
<SIP/10-08221248>AGI Tx >> agi_request: saynumber.agi
<SIP/10-08221248>AGI Tx >> agi_channel: SIP/10-08221248
<SIP/10-08221248>AGI Tx >> agi_language: en
<SIP/10-08221248>AGI Tx >> agi_type: SIP
<SIP/10-08221248>AGI Tx >> agi_uniqueid: 1189856891.1
<SIP/10-08221248>AGI Tx >> agi_callerid: 10
<SIP/10-08221248>AGI Tx >> agi_calleridname: JunK-Y
<SIP/10-08221248>AGI Tx >> agi_callingpres: 0
<SIP/10-08221248>AGI Tx >> agi_callingani2: 0
<SIP/10-08221248>AGI Tx >> agi_callington: 0
<SIP/10-08221248>AGI Tx >> agi_callingtns: 0
<SIP/10-08221248>AGI Tx >> agi_dnid: 83
<SIP/10-08221248>AGI Tx >> agi_rdnis: unknown
<SIP/10-08221248>AGI Tx >> agi_context: from-sip
<SIP/10-08221248>AGI Tx >> agi_extension: 83
<SIP/10-08221248>AGI Tx >> agi_priority: 1
<SIP/10-08221248>AGI Tx >> agi_enhanced: 0.0
<SIP/10-08221248>AGI Tx >> agi_accountcode:
<SIP/10-08221248>AGI Tx >>
<SIP/10-08221248>AGI Rx << STREAM FILE beep ""
   -- Playing 'beep' (escape_digits=) (sample_offset 0)
<SIP/10-08221248>AGI Tx >> 200 result=0 endpos=3520
<SIP/10-08221248>AGI Rx << SAY NUMBER 0 ""
   -- <SIP/10-08221248> Playing 'digits/0.gsm' (language 'en')
<SIP/10-08221248>AGI Tx >> 200 result=0
<SIP/10-08221248>AGI Rx << WAIT FOR DIGIT 1000
<SIP/10-08221248>AGI Tx >> 200 result=0
<SIP/10-08221248>AGI Rx << RECORD FILE testagi gsm 1234 3000
<SIP/10-08221248>AGI Tx >> 200 result=0 (hangup) endpos=17120

[...]

   -- <SIP/10-08276df8>AGI Script saynumber.agi completed, returning 0
   -- Auto fallthrough, channel 'SIP/10-08276df8' status is 'UNKNOWN'
   -- Executing [h@from-sip:1] Set("SIP/10-08276df8", "i=0") in new stack
   -- Executing [h@from-sip:2] While("SIP/10-08276df8", "1 ") in new stack
 == Spawn extension (from-sip, h, 2) exited non-zero on 'SIP/10-08276df8'


When that patch will gets in, i will work on agi debug channel <channel> to allow filtering of agi debug in CLI, since when you get 50 sim. calls and all of these calls are AGIs, which makes impossible to debug.
Comments:By: Russell Bryant (russell) 2007-09-17 00:00:40

This looks good to me, and I would even support putting it in 1.4

By: Clod Patry (junky) 2007-09-17 07:47:23

yay :)
I will start working on debugging per channel now.

By: Michiel van Baak (mvanbaak) 2007-09-23 05:13:00

Uploaded patch that applies to trunk after the NEW_CLI changes.

By: Digium Subversion (svnbot) 2007-11-06 17:58:44.000-0600

Repository: asterisk
Revision: 89074

U   trunk/CHANGES
U   trunk/include/asterisk/agi.h
U   trunk/res/res_agi.c

------------------------------------------------------------------------
r89074 | russell | 2007-11-06 17:58:43 -0600 (Tue, 06 Nov 2007) | 9 lines

Print out the channel name as a prefix to the "agi debug" output.  This makes
AGI debugging on busy systems much easier.

(closes issue ASTERISK-10307)
Reported by: junky
Patches:
     agi_debug_chan.diff uploaded by junky (license 177)
 20070923_10730.diff uploaded by mvanbaak (license 7)

------------------------------------------------------------------------