question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple variables set in Orignate AMI action are merged/joined

See original GitHub issue

I am trying to use Asterisk AMI OriginateAction method to dial out calls. Calls are working fine But I am having issue on setting variables on this action. I set 2 variables as following:

oc.SetVariables( new Dictionary<string, string>(){ { "SIPADD", "10001"}, { "VQWAITER", "10002" }});

but when i try to get one of the variables “SIPADD” in dialplan. I get both vairables at once in joined form as “Local/10002|_VQWAITER=10001”

Dialplan:

exten => 999,1,NoOp((Caller ID IS: ${CALLERID(num)}))
 same =>      n,Answer()
 same =>      n,NoOp("Callback Agent Address: "${SIPADD})
 same =>      n,Dial(${SIPADD})
 same =>      n,Hangup()

Follwoing is above CLI trace of above dialplan:

enter image description here

Can anyone please guide me whats the issue here? I want to get these variables separately an not joined like this.

For now as a work arround i am splitting the joined string i get by doing following setps in dialplan:

 same =>      n,NoOp("Callback Agent Address: "${SIPADD})
 same =>      n,Set(localSIPAdd=${CUT(SIPADD,|,1)})
 same =>      n,Set(waiter=${CUT(SIPADD,|,2)})
 same =>      n,NoOp("localSIP: "${localSIPAdd})
 same =>      n,NoOp("waiter: "${waiter})
 same =>      n,Set(CALLERID(num)=waiter)

CLI for above change:

enter image description here

My question on stackoverflow: https://stackoverflow.com/questions/59825353/originateaction-variables-joining-issue-asterisk

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
zeeshanalikhan15commented, Jan 21, 2020

@Deantwo
core show version Asterisk 16.6.2 built by mockbuild @ jenkins7 on a x86_64 running Linux on 2019-11-22 00:56:40 UTC

1reaction
Deantwocommented, Jan 21, 2020

Workaround

After connecting to the AIM, do the following:

managerConnection.VAR_DELIMITER = new char[] { ',' };
Read more comments on GitHub >

github_iconTop Results From Across the Web

OriginateAction Variables joining issue - asterisk
Current workaround is to manually set the VAR_DELIMITER property on the connection after connecting to the Asterisk server. managerConnection.
Read more >
Passing multiple Variables from AMI's Origintate action
Problem: using PHPAGI's AMI to call Originate action to send multiple variables to dialplan separated by |. BUT they all coming as one...
Read more >
[asterisk-users] Multiple Channel Variables with AMI ...
I want to set about 3 channel variables when I originate a call via AMI. All the documentation I have found says to...
Read more >
[asterisk-users] How to send variables through AMI originate
trixbox1*CLI> manager show command originate > > Action: Originate ... Variable: Channel variable to set, multiple Variable: headers are ...
Read more >
Create a launch template for an Auto Scaling group
The following steps describe how to configure your launch template: Specify the Amazon Machine Image (AMI) from which to launch the instances. Choose...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found