[asterisk-users] RE: [SOLVED] Dial option G - Passing parameters?

Michael Collins mcollins at fcnetwork.com
Fri Feb 2 10:24:57 MST 2007



> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-
> bounces at lists.digium.com] On Behalf Of Michael Collins
> Sent: Thursday, February 01, 2007 12:38 PM
> To: asterisk-users at lists.digium.com
> Subject: [asterisk-users] Dial option G - Passing parameters?
> 
> Has anyone used the G option with the Dial app?  I'm looking for a way
> to control the called party leg.  Specifically, I'd like to pass a few
> variables to the called side for some call control.  Here's a synopsis
> of what I'm doing:
> 
> Make outbound call w/ AMI Originate action.
> Called party answers ("Customer")
> Customer identifies himself, and now I use Dial w/ the G option:
> Dial(Zap/g9/${agentext}|60|mG(Agent_Xfer^s^1)
> Customer hears MOH while the Dial app gets the "agent" on the line
> 
> My destination context looks like this:
> [Agent_Xfer]
> exten => s,1(Customer),Meetme({$ConfRoom}|qM)
> exten => s,2(Agent),Macro(Connect_to_agent,${Customerid},${ConfRoom})
> 
> Customerid and ConfRoom are channel variables that are set in the
> Originate action and at the start of the dialplan processing,
> respectively.
> 
> The idea is to put the customer in a conference room, listening to
MOH,
> until I can get an agent on the line.  (This part works pretty well.)
> The agent is an extension on a legacy PBX, so a simple Dial with a
macro
> has undesired side effects.  (Specifically, the customer hears ringing
> or the legacy PBX's MOH, depending upon the status of the transfer.)
> Putting the customer in a conf room, listening to music, is the best
> solution I can think of.
> 
> The problem is that I don't know how to get the two channel variables
> over to the "Agent" leg of the call.  I don't see anything in the docs
> about the G option accepting arguments to pass to the called leg.  Is
> there any way that I can get the two variables' values over to the
> called leg?
> 
> -MC

FYI,

After some researching I realized that I did not understand variable
inheritance.  I've 'globalized' the two variables in question so that
they are inherited by the second leg of the call.  For your reference,
the helpful information was found on the wiki:

http://www.voip-info.org/wiki-Asterisk+variables
(Specifically under the heading "Inheritance of Channels Variables."

-MC


More information about the asterisk-users mailing list