More Asterisk hints

Wow – a day of fixing loads of niggling little Asterisk problems!

  • Max duration

My calling plan gives me unlimited free calls as long as those calls are under an hour in duration. Pretty standard BT stuff. If you do make a call over an hour you don’t just get charged for that bit of the call over the hour, oh no, you get charged for the whole call.
Anyway – we have the technology to defeat them!

In FreePBX under General Settings change your Asterisk Outbound Dial command options to include:

L(3360000,3240000,10000)

which will drop the call after 3360000ms (56 minutes) and should alert you at 3240000ms.

  • Courtesy Tone

The above works very well and drops the calls, but without a bit of extra magic you don’t get the warning in your ear – it just drops the call. To enable the warning tones etc edit this:

/etc/asterisk/features_general_custom.conf

and add

courtesytone=beep

substituting “beep” for what ever noise you want to hear.

  • Call Recording

By also adding:

Ww

to the Dial command options in #1 you can press *1 when you’re in a call to start recording.  It plays the courtesy tone to both parties though.

g729 in Asterisk

I run Asterisk 1.8 at home for my own amusement.  I’ve just got a SIP trunk running again to SIPGate which had stopped running for some reason.  I’d set the DID for the SIPGate number to check for faxes and then, if it’s not a fax, go to my MOH application, but for some reason it didn’t work.

I also couldn’t access voicemail from the SIPGate trunk either, but I could get it to work with a phone connected to an ATA.

I had a look in the logs:

channel.c: Unable to find a codec translation path from 0x100 (g729) to 0x40 (slin)

Since slin is, I think, the Asterisk native format this is quite bad.  My assumption is that SIPGate sends through G.729 encoded audio regardless of whether you want it to or not (as configured in your allow/disallow lines for the SIP trunk PEER).

G729 from SIPGate works to the ATA because the ATA supports G729 and G729 to G729 pass-through works without any extra requirements from Asterisk.

So – in order to get SIPGate to Asterisk apps working again I installed the G729 codec binaries from here:

http://asterisk.hosting.lv/

and restarted Asterisk.  Now a:

         core show translations

shows I can convert between G729 and loads of other codecs.