Log and forward calls to cellphone?

Home » Asterisk Users » Log and forward calls to cellphone?
Asterisk Users 17 Comments


I don’t have a landine and use a VOSP to provide access to the
telephone network.

In case a call comes in and I’m not home, I’d like Asterisk to log the
call, and then send an SIP message to my VOSP so the call is forwarded
to my cellphone and is thus charged to the caller, without Asterisk
having to dial out to my cellphone through my VOSP at my expense and
bridge the two calls.

Is this possible?

Thank you.

17 thoughts on - Log and forward calls to cellphone?

  • Le 29/12/2010 12:16, Gilles a écrit :

    I wouldn’t be one of your friend: when I’m calling you I call a landline
    but finally will be charged for a mobile call (imagine I have free calls
    to landlines from my ISP). I give you an information: in France you
    don’t have the right to do this unless you have it precise *before*

    Perhaps I misundersand you …

  • On Wed, 29 Dec 2010 16:55:46 +0100, Administrator TOOTAI

    I checked with the VOSP: Apparently, it doesn’t support getting an SIP
    message to forward calls on the fly, and I pay for the forwarded leg
    of the call (the caller will pay his part).

    Thanks guys.

  • Hi,

    I am, in a way, in a similar situation. I have a POTS/PSTN landline
    connected to my Asterisk server – and Asterisk calls my mobile when a
    call comes in down the POTS line and then bridges the calls for me. This
    is effectively home-brew/DIY call diversion. Instead of asking the phone
    company to divert the calls when I’m not home, I setup Asterisk to do
    that for me. The slight advantage in doing it myself is that I use
    another SIP provider for the outgoing leg of the call – who charges me
    far less per minute then my landline provider would charge me for their
    divert feature. They even charge an extra monthly fee for having the
    divert feature!

    I take it the above is your option number one – which you are trying to
    avoid. I’m afraid your option number two doesn’t really exist – as far
    as I know. First of all – as the others have pointed out, the incoming
    call has dialled a landline number – and expects to pay for a call to a
    landline number. So any diversion happening would be your responsability
    to pay for. That is of course if you don’t live in USA or Canada – where
    I believe calls *to* mobiles are similarly charged as calls *to*
    landlines – and it is the receiving end who gets charged for calls to
    mobiles. So in general – sending any sort of message to phone provider
    and asking them, on the fly, to send the call to another number –
    without you being charged – is most likely impossible – and will stay
    that way.

    The closest you will come to this is if you have a call divert with the
    phone company, and a package which allows free calls to a specific
    mobile phone (or free mobile minutes). I used to be with a landline
    provider – who gave me free unlimited calls from my landline to my
    mobile phone. They didn’t realised that this would mean I could have
    call diverts from my landline to my mobile free as well – as effectively
    I was being charged as if my house phone would call my mobile! This
    worked for about two years – until I had to move house, and provider.

    Anyway – there is a third option – which I have been using with some
    success. I connected my softphone on my laptop to my Asterisk server at
    home (through OpenVPN for extra security – but this is not compulsory).
    Sometime I keep my laptop on when out in the field at clients, with
    Internet connection running – and pick-up incoming calls on the laptop.
    This way the divert part of the call is free – as it is coming through
    the Internet to my laptop. I configured my phone divert (in Asterisk) to
    ring simultaneously my mobile and my softphone when a call comes down
    the landline. I answer on whichever one I want. I don’t use Followme – I
    don’t like the way it has been implemented (the line gets answered early
    – not when I answer the mobile or softphone).

    As a last alternative – a slight improvement on the above. If you can
    get a smartphone with Android – which would let you run SIP over 3G –
    you should have true free voice divert. Everything would be as above –
    the main difference is that the phone (instead of the laptop) would be
    on and connected all the time – even when moving out and about – which
    with a laptop is not feasible. This would allow you to answer your calls
    through the 3G data link – and not be charged per minute. If your mobile
    phone company will let you do that (run SIP over 3G). This is where an
    OpenVPN (or any other VPN) connection again would come in handy – they
    shouldn’t be able to tell you are running SIP – if it is inside VPN 😉
    I haven’t trialled this version yet – but this would be my ultimate call
    diversion setup.

    Hope the above helps,


  • Le 01/01/2011 18:32, Gilles a écrit :

    As you are a Free Telecom customer, why not using your freephonie
    account to forward incoming calls to your mobile?

    Something like in you POTS incoming context:

    exten =>

    exten => s,n,Goto(s-${DIALSTATUS},1)

    exten =>
    exten => s-NOANSWER,n,Hangup

    exten => s-ANSWER,1,Hangup

    exten =>_s-.,1,Voicemail() ;other cases

  • On Mon, 03 Jan 2011 12:27:56 +0100, Administrator TOOTAI

    Thanks for the tip, but experience shows that their SIP access sucks
    (not reliable, quality NOK). That’s why I got a VOSP account.

  • On Sat, 01 Jan 2011 23:32:15 +0000, Sebastian

    Thanks Sebastian for the tip. The goal is to 1) have clients call the
    usual landline number instead of asking them to try a cellphone in
    case no one’s home, 2) get Asterisk to handle the call, 3) have the
    cellphone ring with the CID of the original caller instead of

    It looks like getting a 3G smartphone with SIP + OpenVPN + unlimited
    Internet plan would solve the issue.

    Does someone know…
    1. how reliable 3G Internet access is in Europe in cities?
    2. what smartphone supports installing an SIP + OpenVPN clients?
    3. how much juice those things need to keep those applications + 3G
    connection running for hours each day?

    Thank you.

  • Le 03/01/2011 18:28, Gilles a écrit :
    Don’t know the meaning of VOSP but you can do it with any
    SIP/IAX/H323/… provider.

  • The problem with doing no. 3 is, if you are routing the call over the PSTN at
    any rate, your telephone company will (silently) *drop* the caller ID if
    the number you are presenting does not actually “belong” to you. This is
    *good* most of the time, because it means you can trust other people’s caller
    ID to be accurate (and untrustworthy caller ID makes caller ID pointless).

    We first met this when we ordered our second E1 line and batch of presentation
    numbers. As a result of a mistake on somebody’s part, the two lines appeared
    (according to BT’s records) to belong to different companies. As a result,
    approximately half our calls were going out anonymously; because if we were
    trying to go out on span 2 but using a number that was only allowed on span
    1, or vice versa, then the ident would get stripped somewhere along the way.

    Diagnosing this obscure fault rather stretched the definition of “fun” :/

  • Le 04/01/2011 11:50, Gilles a écrit :

    I Would avoid OpenVPN (tested an Android) as it drains quickly battery

    Without OpenVPN lots off, IPhone, Android, Nokia, Windows mobile, …
    Best SIP client integrated with mobile are Nokias (E series for
    instance). I’m running HTC Hero (Android) with SipDroid.


  • Hi,

    I can only speak for the UK. In the UK – Three seems to be one of the
    best providers (in my experience). However, coverage quality varies
    throughout the country, and I have clients on O2, T-Mobile and Vodafone
    – with varying results. It is, by its very nature, a connection which
    will vary continually in bandwidth and reliability with the time and

    Looking around, it seems to me that any Android phone should be able to
    have SIP clients installed. If anybody knows of any manufacturer or
    operator imposed blocks – I would love to know. One of the more popular
    SIP clients (www.sipdroid.org) doesn’t seem to mention any possible
    impediments to installing it on any Android phone (1.5 and above)

    Again, at least according to http://www.sipdroid.org FAQ – it seems that it
    shouldn’t make any extra difference. I suppose it depends on the battery
    size. They claim a 3 days standby – but don’t say which phone did they
    test it on. They also claim that a stock Asterisk talking to a SIP
    client on Android is not ideal in terms of battery life for the Android
    phone – but I really can’t think why. If anybody here has some ideas –
    would be great.

    One other thing to watch out for is operator imposed contractual
    restrictions. Many mobile/3G operators expressly forbid running any type
    of VoIP through their network in the contract (you can still use the
    phone + SIP over wifi, though). However, I believe that if you run it
    through OpenVPN – they shouldn’t be able to tell. Again, if anybody has
    any info on this, or knows otherwise – I would love to know.

    One of the openvpn implementations for Android is TunnelDroid
    (http://sourceforge.net/projects/tunneldroid/). This one needs the phone
    to be rooted – so when searching for a phone – make sure it has a
    (hopefully easy) rooting procedure. I don’t know if there is an openvpn
    implementation for Android which doesn’t need the phone to be rooted –
    but considering you need extra kernel modules (the tun device) I would
    have thought rooting is essential.

    Sorry to keep on butting in. I’ve been interested in SIP on Android for
    a while now – so this just gave me more incentives to actually do the
    research 🙂


  • I agree with your point. That is why routing the divert part of the call
    through an (effectively) internal SIP extension – which is the case if
    you call your laptop or Android phone through SIP as an internal
    extension to your Asterisk server (through OpenVPN as well, optionally)
    has the advantage that you can transmit/present whatever Caller ID you want.


  • Hi,

    Any chance you could provide few more details please? Mainly which
    phone, what version of Android, and how many hours on standby when using
    OpenVPN. Also, which application were you running through OpenVPN and
    was it in constant use (the app).

    I am investigating using OpenVPN with Android – and I would find the
    above detail very useful.

    Many thanks,


  • Le 04/01/2011 20:50, Sebastian a écrit :

    Hmmh, most of all those infos were given in the original message, see
    below ;-). HTC Hero rooted with Android 2.1 VillainRom9.0.0 Sip client
    is SipDroid (tested few others but never got them connecting to our
    Asterix). OpenVPN drains battery in less then 4 hours without calling.

    SipDroid is able to connect using 3G, I use it from time to time.

    How I use my mobile phone:

    . in the office, connected through WIFI with Asterisk server: can pass
    and receive calls, any technologie
    . out of the office: incoming calls to office numbers are routed to my
    mobile number after x seconds of no answer from the office phones. My
    mobile subscription include free calls to few landlines numbers 24h/24h
    7d/7d: one of them is the office number. Calling this number give me an
    IVR from where I can enter the number I wish to call using our SIP routes.

    As I told, the best SIP client I had is Nokias one. Fully integrated,
    working out of the box.

  • On Tue, 04 Jan 2011 17:57:27 +0000, Sebastian

    No problem. I hadn’t thought about using a 3G connection to register a
    smartphone with Asterisk and receive calls directly that way. Thanks
    for the tip.

  • On Wed, 05 Jan 2011 11:49:40 +0100, Administrator TOOTAI

    Thanks much for the feedback. I was mentioning OpenVPN because I
    assumed 3G carriers blocked SIP, but your experience shows that they
    don’t necessarily do.

    I’ll check the Nokia E series and the latest Android phones.

    Thank you.