1
votes

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.

1

1 Answers

1
votes

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