Handling sign plus (+) when extension making call

Discussion in 'General' started by adopilot, Jan 14, 2010.

  1. adopilot

    Joined:
    Oct 2, 2009
    Messages:
    20
    Likes Received:
    0
    How I can handle plus sign (+) in outgoing string.
    One good news is that Nokia is now back in game with new devices for SIP Voip.
    Now I got working my N97 with Elastix just fine, One little thing that is still is annoying is that I got
    stored numbers in my phone whit leading + (+387XXXXXXX), Plus is sing for duble zero (00).
    Is there way to tell Elastix to replace leading + with 00 and make call whit that new sting.

    Here is error that I got from Asterisk log when I try to make call with + sign.

    Code:
    NOTICE[4008] chan_sip.c: Call from '115' to extension '+38761137558' rejected because extension not found

    Thanx in advanced
     
  2. jgutierrez

    Joined:
    Feb 28, 2008
    Messages:
    5,737
    Likes Received:
    0
    I would do the following:

    1. Edit /etc/asterisk/extensions_custom.conf
    2. Edit from-internal-custom context
    Code:
    [from-internal-custom]
    exten => 1234,1,Playback(demo-congrats)         ; extensions can dial 1234
    exten => 1234,2,Hangup()
    exten => h,1,Hangup()
    include => agentlogin
    include => conferences
    include => calendar-event
    include => weather-wakeup
    exten => +387XXXXXXX,1,Answer
    exten => +387XXXXXXX,n,Set(phone_number=00${EXTEN:1})
    exten => +387XXXXXXX,n,Goto(outbound-allroutes,${phone_number},1)
    
    3. Save and exit
    4. Execute from the shell
    asterisk -rx "module reload"
     
  3. adopilot

    Joined:
    Oct 2, 2009
    Messages:
    20
    Likes Received:
    0
    Than you for your answer

    Unfortunately this working only if I using full number beside of +387XXXXXXXX etc +38733941722
    Seems that If a using pattern +387XXXXXXXX and make call to some direct phone +38733771555 asterisk
    do not recognize called phone as +387XXXXXXXXX and do not apply rule we had maded.

    Anyway thanx,
     
  4. adopilot

    Joined:
    Oct 2, 2009
    Messages:
    20
    Likes Received:
    0
    I think that I configured by myself and Google how to do task

    Here is solution, Correct me if I am wrong

    In outgoing routes I added rules like this

    Code:
    +|.
    |00+.
    
    First line cout out the plus sign
    Second add leading zeros
     
  5. jgutierrez

    Joined:
    Feb 28, 2008
    Messages:
    5,737
    Likes Received:
    0
    For the solution that I gave you, I though you wanted it only for that pattern, if you want it for any other cases, you use the following:
    Code:
    exten => _+XXXX.,1,Answer
    exten => _+XXXX.,n,Set(phone_number=00${EXTEN:1})
    exten => _+XXXX.,n,Goto(outbound-allroutes,${phone_number},1)
    
    Then execute:
    asterisk -rx "module reload"

    For your solution, you may try it and check if it works, I only have a doubt on the dial rules for the trunk on
    +|.
    I'm not sure, if it is programmed on freepbx for expecting an extra prefix, not sure, I don't know if the rules will be applied in secuence, you will need to try it. I haven't tested, any ways, you can also try the one that I have submited.
     
  6. Patrick_elx

    Joined:
    Dec 14, 2008
    Messages:
    1,120
    Likes Received:
    0
    put in your the pbx extension for your nokia the context: custom-strip-plus

    and in /etc/asterisk/extensions_custom.conf
    add the following

    [custom-strip-plus]
    exten => _+.,1,Noop(Stripping + from start of number)
    exten => _+.,n,Goto(from-internal,00${EXTEN:1},1)
    exten => _*31#+.,1,Noop(Stripping *31#+ from start of number)
    exten => _*31#+.,n,Goto(from-internal,00${EXTEN:5},1)
    exten => _.,1,Goto(from-internal,${EXTEN},1)
    exten => h,1,Hangup()


    the _+ is to remove the + from the numbers entered that way in your nokia phone book
    the *31# is if you registered some of your contact with this gsm feature code (*31# is to unmask caller id)
    you can create others if you use some other feature code
     

Share This Page