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

  1. 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.)
  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 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.
  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,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)

  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.

Viewing 3 Comments

close Reblog this comment
blog comments powered by Disqus
Locations of visitors to this page
De La Salle Canlubang Top Sites top blogs Best blogs on the Web: all about WWW