[asterisk-users] Variable setting in AMI Originate

Lee Jenkins lee at datatrakpos.com
Fri Feb 15 13:32:08 CST 2008


Anthony Messina wrote:
> On Friday 15 February 2008 10:21:33 am Lee Jenkins wrote:
>> Anthony Messina wrote:
>>> Working with asterisk 1.4; using the AMI Originate command, it is
>>> possible to do something like:
>>>
>>> Variable: CDR(accountcode)123456
>>>
>>> Or must the variable names be "var[n]" where n is a number?
>>>
>>> I'd like to set the accountcode for a Local channel that originates a
>>> call.
>>>
>>> Thanks.  -A
>> Anthony,
>>
>> I may not understand your question, but setting variables from the AMI is
>> easy enough:
>>
>> Action: Originate
>> Channel: local/${DEV_NAME}@Management
>> Context: to_meetme
>> Exten: s
>> Priority: 1
>> Variable: CALLERID(num)=${DEV_NAME}|CALLERID(name)=Conference Waiting
>> Async: true
> 
> That was exactly my question (even though I forgot the "="sign). However, I am 
> not able to get that to work for reason. I'm trying to set the 
> CDR(accountcode) on the first leg of the call and am using Channel: Local/...
> 
> I am able to get it to work if I use "Variable: var1=12345" then, use 
> CDR(accountcode)=${var1} in the dialplan, but I was hoping to avoid this 
> hack.
> 

Not sure what could be the reason, maybe something in the cdr stuff and call 
origination maybe?


-- 
Warm Regards,

Lee

"Everything I needed to learn in life, I learned selling encyclopedias door to 
door."



More information about the asterisk-users mailing list