Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Variable setting in AMI Originate


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
lee at datatrakpos.com
Guest





PostPosted: Fri Feb 15, 2008 11:21 am    Post subject: [asterisk-users] Variable setting in AMI Originate Reply with quote

Anthony Messina wrote:
Quote:
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
--
Warm Regards,

Lee

"Everything I needed to learn in life, I learned selling encyclopedias door to
door."
Back to top
lee at datatrakpos.com
Guest





PostPosted: Fri Feb 15, 2008 2:32 pm    Post subject: [asterisk-users] Variable setting in AMI Originate Reply with quote

Anthony Messina wrote:
Quote:
On Friday 15 February 2008 10:21:33 am Lee Jenkins wrote:
Quote:
Anthony Messina wrote:
Quote:
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."
Back to top
pchammer at dynx.net
Guest





PostPosted: Fri Feb 15, 2008 2:49 pm    Post subject: [asterisk-users] Variable setting in AMI Originate Reply with quote

Anthony Messina wrote:
Quote:
On Friday 15 February 2008 10:21:33 am Lee Jenkins wrote:

*snipped
Quote:
Quote:
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.


why not just add

Account: 12345

to the originate?

(side note: you can also have multiple Variable: lines (some versions of
asterisk have issue with the | from what i hear)

so the above would look like

...

Variable: CALLERID(num)=${DEV_NAME}
Variable: CALLERID(name)=Conference Waiting

those are bad examples as you should just use CallerID:

Callerid: Conference Waiting <DEVNUMBER>

i hope this helps.
Back to top
jsmith at digium.com
Guest





PostPosted: Fri Feb 15, 2008 4:05 pm    Post subject: [asterisk-users] Variable setting in AMI Originate Reply with quote

On Fri, 2008-02-15 at 14:45 -0600, Anthony Messina wrote:
Quote:
that does work like a charm--it sets the accountcode, except that, for some
reason, i can't access the CDR(accountcode) value during call time.

i CAN see it in channel variables, etc. but ${CDR(accountcode)} evaluates to
nothing--it's blank. it even show up in the CDR after the call is over.

This definitely sounds like a bug to me -- would you mind creating a bug
report on the bug tracker (http://bugs.digium.com) so that the
developers can take a look at it? Thanks!

--
Jared Smith
Community Relations Manager
Digium, Inc.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services