[asterisk-users] AGI variables being wrong

Warren Selby wcselby at selbytech.com
Thu Mar 29 14:46:42 CDT 2012

On Thu, Mar 29, 2012 at 2:16 PM, Mikhail Lischuk <mlischuk at itx.com.ua>wrote:

> **
> Warren Selby писал 29.03.2012 20:20:
>   I'd be really curious to see the entire CLI log of the call, with
> verbose set to 6 and AGI debug enabled, from when the call first comes in
> to when it's hung up, including the execution of the *9 feature code.
> Also, knowing which version of Asterisk and DAHDI we're dealing with here
> couldn't hurt
>  The output is pretty same. I can enable DTMF debugging, but can't
> imagine how could it help us:
> -- Launched AGI Script /etc/asterisk/agi/map.pl
What I meant was, let's see the CLI output of the entire call, from the
time it starts, to the time it stops.  Something like the following:

    -- Accepting call from 'XXXXXXXXXX' to 'YYYYYYYYYY' on channel 0/16,
span 1
    -- Executing [YYYYYYYYYY at incoming-pri:1] Wait("DAHDI/16-1", "2") in new
    -- Executing [YYYYYYYYYY at incoming-pri:2] Verbose("DAHDI/16-1",
"Incoming call from XXXXXXXXXX to Main Line YYYYYYYYYY on 03/29/12 at
14:39:15.") in new stack
    -- Executing [YYYYYYYYYY at incoming-pri:3] Goto("DAHDI/16-1",
"remote-phones,7999,1") in new stack
    -- Goto (remote-phones,7999,1)
    -- Executing [7999 at remote-phones:1] Verbose("DAHDI/16-1", "Trying
extension 7999 on remote host remote.") in new stack
    -- Executing [7999 at remote-phones:2] Dial("DAHDI/16-1",
"SIP/7999 at pbx-remote") in new stack
  == Using SIP RTP CoS mark 5
  == Using UDPTL CoS mark 5
    -- Called 7999 at pbx-remote
    -- SIP/pbx-remote-00000405 answered DAHDI/16-1
    -- Channel 0/16, span 1 got hangup request, cause 16
  == Spawn extension (remote-phones, 7999, 2) exited non-zero on
    -- Hungup 'DAHDI/16-1'

But with the AGI debug thrown in the middle where appropriate.

> To the OP - just trying to think outside the box here, but what if instead
> of calling the AGI directly from the features.conf feature code, you wrote
> a Macro or GoSub that you could then use as your application, and within
> the Macro / GoSub you executed your AGI?
> I'd love to, but I need that script to run only when user hits some key
> combo during call. All I was able to find regarding that, was using
> features.conf and dynamic application. If you can advise me some workaround
> - I would appreciate.
To do this, you change your features.conf setting like so:

parse => *9,peer/both,Macro,Parse

And you add something like this to your extensions.conf:

exten => s,1,Verbose(Parsing AGI variables)
exten => s,n,AGI(map.pl)

Assuming your map.pl is in the place where your asterisk looks for agi (by
default this is /var/lib/asterisk/agi-bin), otherwise include the entire
path to the file.

--Warren Selby, dCAP
http://www.SelbyTech.com <http://www.selbytech.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120329/db750212/attachment.htm>

More information about the asterisk-users mailing list