Making Asterisk dial out through a HT488 adapter

In a previous post I mentioned that I had trouble getting Asterisk, my phone PBX, to dial out directly through my Grandstream HT-488 SIP ATA. Well, I finally found a post on the web that mentions a method to do it. Here we go:

First add this macro to your extensions.conf:

[macro-play-outnum-dtmf]
exten => s,1,Wait(1)
exten => s,2,SendDTMF(${ARG1})

Now you can call this later in your dialplan. For example, I have configured my dialplan so that I have to dial a 0 to go out through the PSTN (and thus the Grandstream Adapter, which is SIP/900 in my case). That definition looks as follows:

exten => _0.,1,Dial(SIP/900,120,rTM(play-outnum-dtmf,${EXTEN:1}))

What this does is it responds to everything that starts with a 0 (the _0 part) then dials SIP/900 (the ATA) and then, in the dialling options, generates a ringing tone (r), lets me transfer the call (T) and calls the aforementioned macro (M….) with the dialled number minus the first character (${EXTEN:1}). The macro, as you may have noticed, does nothing else than ‘play’ DTMF tones to the adapter (which, being connected to the PSTN line, causes dialling to the desired destination).

It’s quite hackish but hopefully useful to somebody. It certainly was for me.

Leave a comment

Your email address will not be published. Required fields are marked *

Bear