How To Remove PREFIX ... ??

Discussion in 'General' started by Dikic, Nov 23, 2010.

  1. Dikic

    Aug 18, 2010
    Likes Received:
    Hi guys, we are haveing some problems with prefixes when we use call forwarding or follow me, bellow you can find eloboration of a problem, please advise if you have any idea!!

    Our standard implementation implies prefix for PSTN calls (9 or 0,
    mostly 0, but
    for this case study it is 9).

    In order to make redial/callback on phones possible without editing call
    (incomming,missed or not) there are 2 possibilities for prepending prefix to
    callerID on to the incomming call:

    1. on the phone itself (in the call list)
    Linksys diaplan pattern substitution <dialed:replaced> i.e. <900385:385>xxxxxxxx.
    meaning remove 900385 and add 385 to 7+ digit pattern...

    Cisco 7xxx phones seem to lack this ability to manipulate dialed strings.

    2. on the PBX (FreePBX, Elastix, Trixbox) just before forwarding call to
    the phone

    3. on the PBX (FreePBX, Elastix, Trixbox) in custom context during the

    exten =>_X.,1,NoOp(===========================================================)
    ; include => from-sip-external
    ;exten => _X.,2,DumpChan()
    exten => _X.,2,NoOp(mc++: Prepending 900 to ${CALLERID(num)})
    exten => _X.,n,Set(CALLERID(num)=900${CALLERID(num)})
    exten => _X.,n,Goto(from-trunk,${EXTEN},1)
    ; last line could be replaced by (mc++ todo test)
    ; include => from-trunk

    As long as there is no call forwarding and FollowMe everything is OK. As
    soon as someone forwards call, or FollowMe rule call let say external number we have
    original inbound callerID (385 91 xxx yyyy) prefixed with 900 (900 385 91 xxx yyyy) and some mobile operators also prepend additional +385 to the number.

    Case A:
    Inbound routes end on some RingGroups which ring internal SIP and IAX
    ringgroups and external mobile phones, so

    Extension List (x, y some numbers):

    1. do not prepend on the PBX

    Problems with above solutions:
    1. no IP phone found with option od add prefix to the CallerID on the lists
    2. it seems that this could be made with custom device, but having project
    with 250 phones this is not much fun...

    In the asterisk CLI ring group is implemented through dialparties.agi,
    dial-macro as:


    So it seems to remove 900 on the incomming callerID one should "intercept"
    from-internal context with custom one.

    Is this possible with replacement in
    General settings > Default context
    replacing "from-internal" with "from-internal-custom"

    exten => _X.,1,NoOp(-----------------------------------------------------------)
    exten => _X.,2,NoOp(mc++: Removing 900 from ${CALLERID(num)} to ${CALLERID(num):3})
    exten => _X.,n,Set(CALLERID(num)=${CALLERID(num):3})
    exten => _X.,n,Goto(from-internal,${EXTEN},1)

    What would be the best solution for this problem?

    Holisticware team

Share This Page