Woodsy
Woodsy

Reputation: 3377

Asterisk Dial and Answer within Dialplan

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.

Upvotes: 3

Views: 1526

Answers (1)

Alisio Meneses
Alisio Meneses

Reputation: 56

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

Upvotes: 3

Related Questions