Saturday, October 11, 2008

Simplified Gizmo5 Backdoor Dialing Asterisk Gateway Interface Script

Using Gizmo5 backdoor dialing, one can make free VoIP calls to a growing double-digit percentage of domestic US phones. This article shows how to integrate this mechanism into FreePBX.

In an earlier article, I described a DYI VoIP setup that uses plain Asterisk for routing calls among various VoIP providers, analog phone adapters (ATAs), and the building door phone. Since I wrote that article, I have moved this Asterisk installation to a Linksys NSLU2 ("slug") and want to keep it as minimal as possible.

Starting with an updated version of the Monetra callerID lookup script, which performs some very basic screen scraping to look up callerID information from several web sites, I wrote a similar script that checks whether a given phone number can be called for free using Gizmo5 backdoor dialing and caches the result. Gizmo5 has a very simple web service for this purpose that powers its lookup form.

The script can be used in extensions.conf as follows, assuming your Gizmo5 account is set up correctly in sip.conf.
[macro-gizmo5backdoor]
exten => s,1,AGI(gizmo5backdoor_shell.agi|${MACRO_EXTEN})
exten => s,n,GotoIf($[ "${foundroute}" = "yes" ]?backdoor:pstn)
exten => s,n(backdoor),Goto(backdoor,010${MACRO_EXTEN},1)
exten => s,n(pstn),Dial(SIP/other-provider/${MACRO_EXTEN})

[domestic]
exten => _1NXXNXXXXXX,1,Macro(gizmo5backdoor,${EXTEN})

[backdoor]
exten => _0101NXXNXXXXXX,1,Dial(SIP/gizmo5/${EXTEN})
Both scripts are available from the Asterizmo project site.

1 comment:

Konstantin said...

Bummer, Gizmo5 backdoor dialing was discontinued on March 5, 2009. http://bit.ly/XJmm2