How can I run a dialplan in Asterisk through AMI?

2.7k views Asked by At

Our php website always creates conference calls with writing following command in the specific path for Asterisk. /var/spool/asterisk/outgoing/

index.php

exec('sudo echo "Channel: SIP/si/'.$_POST['number1'].'
Context: DialOut
Callerid: '.$_POST['cid'].'
Extension: DialOut
SetVar: NUMBERONE='.$_POST['number1'].'
SetVar: CUSTOMER='.$_POST['number2'].'
SetVar: RES='.$name1.'
" > /var/spool/asterisk/outgoing/'.$name1.'.call&',$outxx);

Currently for some reasons we decided to using AMI to create calls remotely instead of using files.

extensions.conf

[DialOut]
exten => DialOut,1,Set(TIMEOUT(digit)=5)
exten => DialOut,2,Set(TIMEOUT(response)=10)
exten => DialOut,3,AGI(myscript.php,${NUMBERONE},${CUSTOMER},${RES})
exten => DialOut,4,Answer
exten => DialOut,5,Playback(pls-hold-while-try)
exten => DialOut,6,Dial(SIP/si/${CUSTOMER})
exten => DialOut,7,Hangup()

So How can I use from AMI or ARI to run the mentioned dialplan remotely? I read about AMI actions but I couldn't find valuable thing.

1

There are 1 answers

0
arheops On