Withheld Caller Id

Home » Asterisk Users » Withheld Caller Id
Asterisk Users 10 Comments

Hi. I am running asterisk 11 and i have usb 3g dongles to make my gsm calls with the following config in extensions.conf

exten => _9X.,1,Dial(Dongle/dongle800/${EXTEN:1},120,KT)
exten => _9X.,n,Hangup(${HANGUPCAUSE})

By dialing 9 it opens the dongle to make a call. I would like to restrict my caller id. so when i place a call from this dongle, it will send on the other end *blocked number* or *withheld*. The carrier restricts (call by call) the caller ID if i send #31# before the number (that works if i place the sim in my mobile)*. *i did try to the following from zoiper
9*+*#31#*+*destination_number. Unfortunately, zoiper did stop on 9#31# and it dialled one of my recent numbers. The same result happened with other softphone clients. I would like to restrict my callerID when placing calls from this dongle, so i would like your help please.

10 thoughts on - Withheld Caller Id

  • haven’t used zoiper at all, so can’t comment on its features of parsing numbers. I’d recommend ‘hiding’ this function or making it transparent to the end user by using something like this:

    exten =>
    _06[237]0NXXXXXX!,100,Dial(SIP/${OUTGOING_PROVIDER}/*31#0036${EXTEN:2},55)

    where ${OUTGOING_PROVIDER} is set by a macro previously, and *31# i believe is the caller ID set visible. I have used it with #31# as well but the customer requirements have changed and they now want the number to be visible at all times.

    Because the #31# or *31# is transparent to the end user and won’t have do dial it at all, it doesn’t matter if zoiper intercepts digits and parses them on its own.

    If you want the end user to be able to control when the number is shown/hidden, i’d recommend using either a pefix (90 for hiding, 91 for showing), or use an SQL backend from where an extensions.conf macro can fetch the current settings (maybe even profile people).

  • thanks a lot for the reply. i thought of that and i did try to send

    *exten => _9X.,1,Dial(Dongle/dongle800/#31#${EXTEN:1},120,KT)exten =>
    _9X.,n,Hangup(${HANGUPCAUSE})*

    but the provider replies back that it is a wrong number. Then i inserted the sim to an ordinary mobile phone and dialed #31# and the number, then the call progressed fine and it restricted the number. What am i doing wrong in asterisk?

  • unless i’m missing something your config looks OK. Do you have any logs
    / debugs of what number is actually being dialed?

  • My suggestion would be to add a pause or two before dialing the phone number

    exten => _9X.,1,Dial(Dongle/dongle800/#31#ww${EXTEN:1},120,KT)

    D(digits): After the called party answers, send digits as a DTMF stream, then connect the call to the originating channel (you can also use ‘w’ to produce .5 second pauses). You can also provide digits after a colon – all digits before the colon are sent to the called channel, all digits after the colon are sent to the calling channel (all digits are sent to the called channel if there is no colon present).

    Doug

  • after adding the ww:
    root@Pbx: /etc/asterisk $ asterisk -rvvv Asterisk 11.25.3, Copyright (C) 1999 – 2013 D == Using SIP RTP TOS bits 184
    == Using SIP RTP CoS mark 5 — Executing
    [9211123456@AllCalls:1] Goto(“SIP/500-00000003”,
    “DefaultPlan,9211123456,1”) in new stack

  • See of the D option of dial will do it:

    D([called][:calling[:progress]]): Send the specified DTMF strings *after*
        the called party has answered, but before the call gets bridged. The
        DTMF string is sent to the called party, and the 
    DTMF
        string is sent to the calling party. Both arguments  can be used alone.  If
        is specified, its DTMF is sent immediately after receiving a
        PROGRESS message.

  • Thanks for the reply. So how do i alter my config to call with prefix 9+the code to block caller id(#31#)+ the number?
    now is

    exten => _9X.,1,Dial(Dongle/dongle800/${EXTEN:1},120,KT)
    exten => _9X.,n,Hangup(${HANGUPCAUSE})

  • That’s something I’ll leave for you to investigate. As many have said, “Google is your friend”

    Doug