Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asterisk Dial and Answer within Dialplan

Tags:

asterisk

I'm trying to place a call and answer it within the dial plan. Essentially I'm looking for something like this:

Sip phone dials 000-000-0000

exten => _0000000000,1,Dial(0000)

exten => _0000,1,Answer()
same => n,NoOp('0000 has answered')
; other stuff...

I've tried exten => _0000000000,1,Answer() which works for answering the call and playing audio files but I need the dial and answer due to some ami event listeners runnning else where.

like image 461
Woodsy Avatar asked Dec 01 '25 06:12

Woodsy


1 Answers

You must use a local channel to do this. Local Channels provide a channel type for calling back into Asterisk itself. Also you should remove que underline before the extensions, since it doesn't seems that you trying to match an extension.

Checkout the same dialplan using Local channel and without the underline before que desired extension:

[example-context]
exten => 0000000000,1,Dial(local/0000@example-context)

exten => 0000,1,Answer()
same => n,NoOp('0000 has answered')
; other stuff...

The asterisk wiki contains more information and examples here:

https://wiki.asterisk.org/wiki/display/AST/Local+Channel

like image 169
Alisio Meneses Avatar answered Dec 08 '25 13:12

Alisio Meneses



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!