“Follow Me” With Asterisk That Detects Cellphone Voicemail And Similar Announcements

Home » Asterisk Users » “Follow Me” With Asterisk That Detects Cellphone Voicemail And Similar Announcements
Asterisk Users 7 Comments

Hi all,

sorry if the subject is a bit confusing, but I just couldn’t think of a good way of better describing the situation…

Basically, I travel a lot and have several SIM cards for my phone from local carriers. What I’d like to do now is to setup Asterisk, so that people who want to reach me just have to dial one number which forwards the call to all my cellphone numbers in turn. I’m still pretty new to Asterisk, so I’m unsure which method would be most suitable for this scenario.

Theoretically, I could use the dial function to call one number, then wait a few seconds and then dial another number. In practice, this won’t work because as soon as a call is answered by the mobile carrier’s voicemail the caller would be connected to that, no other numbers would be called. So here’s my question: how can I possibly avoid this situation? Is there a way for Asterisk to detect such situations and distinguish them from me actually trying to answer the call when the correct number is called?
Not sure if this is technically possible, but figured I’d ask just in case there is any sort of solution. I’m aware that it would be best to simply use SIP and a SIP client on my phone in order to take the call, but due to most carriers blocking SIP traffic on their mobile data networks this wouldn’t work as soon as I’m not connected to any WiFi. So, in case there’s any solution to this problem I’d greatly appreciate if you could share that with me!
Many thanks and best wishes, Robin

7 thoughts on - “Follow Me” With Asterisk That Detects Cellphone Voicemail And Similar Announcements

  • I know if you use freepbx on top of asterisk, you get a followme which calls one or more cell phones and ask for confirmation, maybe the regular asterisk followme does this as well, but basically this is the way to do it.

    Robin Kipp wrote:


    Your life is like a penny. You’re going to lose it. The question is:
    How do you spend it?

    John Covici
    covici@ccs.covici.com

  • Just a few ideas…

    1. Disable all mobile carrier’s voicemail and configure a voicemail on your Asterisk. Let Asterisk handle the unanswered calls.

    2. If your SIP provider allows multiple calls at the same time, configure Asterisk to call all your SIMs at once (instead of calling the first, wait… calling the second… wait and so on).

    3. If your mobile carrier blocks SIP on your data plan, simply configure Asterisk <-> SIP client on your mobile phone to use another port. Or, even better, you can use IAX instead of SIP. On your mobile device install a client that supports IAX (for example, Zoiper).

    Frank

  • I never understood why people have voicemails. Switch off the voicemail feature, so it won’t pick up the call.

    My solution to this problem is rather manual. I travel across countries as well, so here is what I have:

    […]
    exten => dialme,n,Macro(get_mobile_target)
    exten => dialme,n,Dial(SIP/${TARGET_PROVIDER}/${TARGET_NUMBER},35,t)
    […]

    Now, as you can see, the above uses a macro to set some variables, so let’s look at it:

    Apart from many logging and other, non-relevant features, it calls an AGI:

    exten => s,n,Agi(get_mobile_target.agi)

    What this AGI does, it looks up in an SQL table which provider and which destination number to call at any given time. These can change dynamically as I travel around, hence it’s in SQL. How will values be updated in SQL? By two ways.

    1) I have a web frontend where I can logon and select from a dropdown menu, which simcard is my current cellphone number. If I want, I can also select a provider from a dropdown list, as I have more and there are different deals with each. So I won’t be calling my US cellphone number from a provider that provides me good EU rates and only those.

    Usually I use airport wifi or 3G/4G at the departing airport to select the cell number from the list.

    2) I have DID number which I can call from whichever cellphone I’m currently using, where the call is handled by an AGI on the PBX. If the callerID matches one from a pre-defined list (my known sim card numbers), it assumes that I’m checking in and the caller ID gets selected the same way as if I was making the selection from the web interface. This call costs nothing as the call is never answered, the AGI hungs up the call.

    I understand that both are rather manual and not exactly textbook follow-me but they are pretty simple and it works well for me.

    regards Adam

  • There is no reliable way to distinguish whether a phone was answered by a human being or a machine.

    If you can’t just disable voicemail on all your SIMs then you will need to find out how long each carrier will wait before diverting to voicemail, and then make sure the timeouts in your Dial() statements are short enough not to trigger the carrier’s voicemail. Then use Asterisk’s VoiceMail() application to record any message your caller might leave.

    You can just chain a whole bunch of Dial() statements one after another within an extension because once the first one has been answered, execution will proceed to the “h” extension.

    If you install ConnectBot on your mobile phone, you should be able to login to your Asterisk server each time you swap in a new SIM card, and edit your dialplan so the phone you are using today gets tried first. This could even be automated, but talk of such may not be appropriate for a non-commercial list.

    Out of politeness to the caller, play them a recorded announcement before your bank of Dial() statements, so they know to wait while your Asterisk box searches for you.

    Finally, remember: You will be tying up two channels — and therefore maybe two DAHDI spans, depending how the calls are coming into and out of your Asterisk box — with this.

  • Followme can be configured to accept a keypress to accept or decline the call. Put something like this in followme.conf:

    [general]
    featuredigittimeout=>5000
    takecall=>1
    declinecall=>2
    call_from_prompt=>followme/call-from norecording_prompt=>followme/no-recording options_prompt=>followme/options pls_hold_prompt=>followme/pls-hold-while-try status_prompt=>followme/status sorry_prompt=>followme/sorry

  • –Apple-Mail=_C807833A-EC59-4617-961C-E9D10B66036E
    Content-Transfer-Encoding: quoted-printable Content-Type: text/plain;
    charset=us-ascii

    To make things worse, in the country I reside not one of the cellular telcos have the option of disabling voicemail! If you disable voicemail they still terminate the call and instead play a message to the effect of ‘This user has disabled voicemail. Goodbye’.

    We also can’t rely on timeouts because if the destination cellphone is out of coverage or turned off then the telco will drop to VM (or no-VM warning) almost immediately.

    Unfortunately for us, the only option is to code up a routine that checks for acceptance confirmation from the destination human, a-la what John was describing in FreePBX.

    Pete

    –Apple-Mail=_C807833A-EC59-4617-961C-E9D10B66036E
    Content-Transfer-Encoding: quoted-printable Content-Type: text/html;
    charset=us-ascii

    On 29/04/2016, at 3:46 am, A J Stiles <asterisk_list@earthshod.co.uk> wrote:


    <snip>


    There is no reliable way to distinguish whether a phone was answered by a human being or a machine.

     

    If you can’t just disable voicemail on all your SIMs then you will need to find out how long each carrier will wait before diverting to voicemail, and then make sure the timeouts in your Dial() statements are short enough not to trigger the carrier’s voicemail. Then use Asterisk’s VoiceMail() application to record any message your caller might leave.


    <snip>


    To make things worse, in the country I reside not one of the cellular telcos have the option of disabling voicemail! If you disable voicemail they still terminate the call and instead play a message to the effect of ‘This user has disabled voicemail. Goodbye’.

    We also can’t rely on timeouts because if the destination cellphone is out of coverage or turned off then the telco will drop to VM (or no-VM warning) almost immediately.

    Unfortunately for us, the only option is to code up a routine that checks for acceptance confirmation from the destination human, a-la what John was describing in FreePBX.

    Pete


    –Apple-Mail=_C807833A-EC59-4617-961C-E9D10B66036E

  • Hello all,

    thanks to all of you for your truly excellent ideas and suggestions, greatly appreciated!
    You have definitely given me a lot of things to play around with in the coming days. For starters, I think I will try the built-in Follow Me feature as suggested by Karl, as it seems like this would be the easiest in order to get basic functionality up and running. Following that I will definitely try something more complex, such as the setup suggested by Adam. Using some PHP and / or Python, I should even be able to integrate with Swarm by Foursquare. In that case, the Asterisk server would be notified if I check in in a new country using the Swarm API, and consequently redirect calls to the corresponding mobile number. This would be pretty sweet, as it would basically allow me to configure call redirection using the Swarm app on my phone. I will also try changing the SIP port and see what happens, at least it would allow me to use SIP over the cell network while I have an appropriately fast connection.

    Many thanks once again, this has definitely helped me make up my mind about what’s possible!
    Best wishes, Robin