Who need this?
If you have a 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.
Requirement:
1. Your Asterisk box (in my case this is the Slug) should be able to
make at least two simultaneous outgoing calls. (One to call you back
and the other provides DISA to dial out.)
2. A separate Direct-Inward-Dial (DID) number dedicated to this task.
3. Your cellphone should have a legitimate CallerID number. (We use
this to identify the caller.)
How it works?
1. Call your DID number on your Asterisk box from your cellphone.
When you hear the ringing tone, just hang up your cellphone.
2. Wait 20 sec, your cellphone will get a incoming call from your
Asterisk box. Answer it, follow the instruction, press your password
and the #, if everything is all right, you should get a dial tone.
3. 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.
1. 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
2. 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/outgoing
Make this file executable:
chmod +x /opt/etc/asterisk/callback_exe
3. 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,System(/opt/etc/asterisk/callback_exe)
exten => h,2,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)
4. 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
5. Restart Asterisk and test it.