Sydney Staff SRE or something.

Asterisk – Dual-dialling to save money

· by Robert Mibus · Read in about 2 min · (309 Words)
asterisk sysadmin voip

Asterisk saves me money, even using just the one VoIP provider. (Disclaimer: The provider I use is run by my employer, but I’m writing this only as a happy customer! :).

It just so happens that my work desk phone number is a free call, but my wife can never remember the number and is usually in too much of a hurry to stop and think about whether I’m at my desk yet etc. etc. (We have lots of small kids - I’m surprised I have time to write this post :). My VoIP provider (nodephone) also happens to allow two concurrent calls by default… let’s see what fun we can have with that?

My outgoing context used to look a bit like this:

[frominside]
exten => _XX.,1,Dial(SIP/${EXTEN}@nodephone,,)
;

What I wanted, was to automatically ring my desk phone whenever I was likely to be at it. Just in case I wasn’t, ring my mobile phone at the same time - let me answer whichever I choose.

Move the contents of the frominside context into a new context regular_outbound, and use an include to keep it all working the same…

[frominside]
include => regular_outbound

[regular_outbound]
exten => _XX.,1,Dial(SIP/${EXTEN}@nodephone,,)
;

Next, make a new context that will dual-dial when you call my mobile number. (No, those aren’t real phone numbers, they’re dummy numbers from ACMA). Include it at the top of the frominside context, and limit it to a “safe” set of working hours.

[frominside]
include => mibus_at_work|08:15-16:45|mon-fri|*|*
include => regular_outbound

[regular_outbound]
exten => _XX.,1,Dial(SIP/${EXTEN}@nodephone,,)

[mibus_at_work]
exten => 0491570156,1,Wait(1)
exten => 0491570156,n,Playback(hang-on-a-second)
exten => 0491570156,n,Set(LIMIT_WARNING_FILE=beep)
exten => 0491570156,n,Dial(SIP/${EXTEN}@nodephone&SIP/0855501234@nodephone,,)
;

Done! Now, trying to ring 0491570156 will also ring 0855501234. They’re charged at vastly different rates, so if I can, I’ll answer on the “cheaper” one. If not, it’ll ring my mobile phone anyway - just as it always would have.