Asterisk Howto: Set up a test number
This recipe will allow you to dial a number, hear the caller ID number and channel associated with the number and then record/playback a test message, to verify the phone is functioning. It’s useful for testing phones and locating what extension and/or channel is associated with a phone.
This recipe was tested with Asterisk 1.6.
You need to have an exten entry in extensions.conf to enter into this channel. For the purposes of this example, extension 802 was used.
Example
This example depends on two additional sound files: channel and readback-instructions. Channel is simply the word “Channel” while readback-instructions is a recording that says, “Now entering readback mode. Please record a message after the beep and press # to finish your recording. The system will then play your message back to you, to test sound quality on this line.”
exten => 802,1,Ringing()
exten => 802,n,Wait(3)
exten => 802,n,Answer()
exten => 802,n,Playback(dir-multi3)
exten => 802,n,Wait(1)
exten => 802,n,SayDigits(${CALLERID(num)})
exten => 802,n,Wait(1)
exten => 802,n,Playback(channel)
exten => 802,n,Wait(1)
exten => 802,n,SayAlpha(${CHANNEL})
exten => 802,n,Wait(1)
exten => 802,n,Playback(readback-instructions)
exten => 802,n,Record(/tmp/802-${UNIQUEID}.wav,0,30)
exten => 802,n,Playback(/tmp/802-${UNIQUEID})
exten => 802,n,System(rm /tmp/802-${UNIQUEID}.wav)
exten => 802,n,Wait(1)
exten => 802,n,Playback(vm-goodbye)
exten => 802,n,Hangup()