Asterisk Callback DISA
One reason I love my job so much is I learn a lot. Also, I can apply everything I’ve learned and be able to do something with it (read: play with a lot of stuff). The following is a forwarded email at the asterisk-ph Yahoo! Group. Originally posted here. Asterisk users are such cheap bastards. Ha ha ha!
Who needs this?
If you have an unlimited incoming cellphone service plan, you can use this method to call out without paying outgoing minute charge. You may also take advantage of your low long distance calling rate of your VoIP service by calling out through your home Asterisk server.
Requirements
- Your Asterisk box should be able to make at least two simultaneous outgoing calls. (One to call you back and the other provides DISA to dial out.)
- A separate Direct-Inward-Dial (DID) number dedicated to this task.
- Your cellphone should have a legitimate CallerID number. (We use this to identify the caller.)
How it works?
- Call your DID number on your Asterisk box from your cellphone. When you hear the ringing tone, just hang up your cellphone.
- Wait 20 seconds, your cellphone will get a incoming call from your Asterisk box. Answer it, follow the instructions. Press your password and the #. If everything is all right, you should get a dial tone.
- Now you may make an outgoing call from there. All calls should be routed from your Asterisk PBX using the lowest calling rate.
Setup
Here is how I setup my home Asterisk on Slug. I am using UnSlung 6.8 with Asterisk14 installed. A DID number 6085558888 from MyVSP is setup for this task. My cellphone number is 6081112222. You should change these to fit your situation.
- Create a file named /opt/etc/asterisk/callback.call with the following lines:
Channel: SIP/6081112222@MyVSP
Context: custom-DISA-out
Extension: s
Priority: 1
CallerID: 6085558888 - Create a file named /opt/etc/asterisk/callback_exe with the following lines:
sleep 20
cp /opt/etc/asterisk/callback.call /opt/var/spool/asterisk/outgoingMake this file executable:
chmod +x /opt/etc/asterisk/callback_exe - In your extensions.conf:
[MyVSP-incoming]
exten => 6085558888 ,1,NoOp(Incoming call from # ${CALLERID(num)})
exten => 6085558888 ,n,GotoIf($["${CALLERID(num)}" = "6081112222"]?custom-CallBack,s,1)[custom-CallBack]
;;prepare for callback and DISA
exten => s,1,NoOp(Hangup then callback to cellphone)
exten => s,2,Hangup()
exten => h,1,NoOp(copy callback.call file to /opt/var/spool/asterisk/outgoing)
exten => h,2,System(/opt/etc/asterisk/callback_exe)
exten => h,3,Hangup()[custom-DISA-out]
exten => s,1,Wait(1)
exten => s,n,Background(agent-pass)
exten => s,n,Authenticate(87235) ;this number is the password
exten => s,n,Background(pls-wait-connect-call)
exten => s,n,DISA(no-password|out-pstn) - In your modules.conf, make sure the following modules are loaded:
load=app_authenticate.so
load=app_disa.so
load=app_system.so
load=pbx_spool.so
load=func_callerid.so - Restart Asterisk and test it.
![iRant | [root@jploh.com ~]# cat /var/log/irant_](http://blog.jploh.com/wp-content/themes/default2/images/blog_jplohcom.jpg)
Add New Comment
Viewing 3 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment