Wednesday, June 17, 2015

Asterisk Simple Dialplan

Asterisk Simple Dialplan


Requirement:

you need to listen to a Record a message and afterwards u want to listen the Recorded message

Solution:

First way, I am taking a sample Extension say 1001.

The default wave file location is /var/lib/asterisk/sounds .

This dialplan should be written in Extensions.conf file which will be located in /etc/asterisk folder.

The [test-Rocky],[record_rock] are called as the contexts.
This contexts needs to be included in our required contexts.

The inclusion should be done in the following way :
Include:

include=>test_Rocky
include=>record_rock

Dial plan:


[test-Rocky]
exten => 1001,1,Answer
exten => 1001,2,Goto(record_rock,s,1)

[record_raki]
exten => 1001,1,Background(record_message)
exten => 1001,2,Record(/var/lib/asterisk/sounds/RockyRecording:wav49,2,600,,)
exten => 1001,3,Background(recording_message)
exten => 1001,4,NoOP(callerid=${CALLERID(num)})
exten => 1001,5,Background(message_review)
exten => 1001,6,WaitExten(5)

exten => 1,1,Background(messagerecording_success)
exten => 1,2,Hangup
exten => 2,1,Playback(RockyRecording)
exten => 2,2,Goto(7707,6)
exten => 3,1,Goto(7707,2)

Dialplan Second Scenario:

exten=>7707,1,Answer
same=>n,Background(record_message)
same=>n,Record(/var/lib/asterisk/sounds/RockyRecording:wav49,2,600,,)
same=>n,NoOP(Callerid=${CALLERID(num)})
same=>n,Background(message_review)
same=>n,WaitExten(5)

exten => 1,1,Background(messagerecording_success)
exten => 1,2,Hangup
exten => 2,1,Playback(RockyRecording)
exten => 2,2,Goto(7707,6)
exten => 3,1,Goto(7707,2)



Both the ways will execute the same Functionality.Try this.If you want any specific dialplan.Send me the Requirement.Waiting for your comments.



No comments:

Easy Way to Handle Android Notifications

Android Notifications Android Toast class provides a handy way to show users alerts but problem is that these alerts are not persist...