Koozali.org: home of the SME Server

How to handle a + IDD-code in dialpatterns

Offline frifri

  • *
  • 108
  • +0/-0
How to handle a + IDD-code in dialpatterns
« on: September 05, 2011, 11:58:04 PM »
Hi,

One of my extensions has a phonebook with numbers in international format, ex : +324[789][1-9]XXXXXX
1. How can i match such a number in one of my routes-dialpatterns ?
2. Is it possible to remove the +32 part and add a 0 in front of the number, before the number is dialed by one of the trunks ?

Thanks,
F.
« Last Edit: September 06, 2011, 07:58:41 AM by frifri »

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: How to handle a + IDD-code in dialpatterns
« Reply #1 on: September 11, 2011, 11:08:06 AM »
Hello

Which release of SAIL is this please?

Kind Regards

S

Offline frifri

  • *
  • 108
  • +0/-0
Re: How to handle a + IDD-code in dialpatterns
« Reply #2 on: September 11, 2011, 08:26:46 PM »
sail-2.6.1-11

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: How to handle a + IDD-code in dialpatterns
« Reply #3 on: September 11, 2011, 09:34:50 PM »
well, you can certainly create a a route dialplan of the form _+XXXX.   which will get included in extensions.conf.  You can also create a transformation mask in the trunk of the form +32:0  which will do the transformation you want.  I can't test it though because I don't have a phone that will send +.   Neither do I know for sure that Asterisk will match a + properly but I suspect that it will.  Give it a go and let me know if it works.

Incidentally, the + is NOT supported in V3.1 but I'll put it in if this works.

Kind Regards

S

Offline frifri

  • *
  • 108
  • +0/-0
Re: How to handle a + IDD-code in dialpatterns
« Reply #4 on: September 14, 2011, 10:18:01 AM »
Hi S,

This is what i get :

Quote
[Sep 14 10:12:49] NOTICE[30959]: chan_sip.c:15765 handle_request_invite: Call from '5020' to extension '+32475XXXXXX' rejected because extension not found.

I have a routepattern : _+324[789][1-9]XXXXXX

F.

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: How to handle a + IDD-code in dialpatterns
« Reply #5 on: September 14, 2011, 09:07:21 PM »
what did you actually dial?

Offline frifri

  • *
  • 108
  • +0/-0
Re: How to handle a + IDD-code in dialpatterns
« Reply #6 on: September 14, 2011, 09:18:13 PM »
Code: [Select]
Connected to Asterisk 1.4.42 currently running on pbx (pid = 30912)
Verbosity was 17 and is now 22
    -- Remote UNIX connection disconnected
[Sep 14 21:16:30] NOTICE[30959]: chan_sip.c:15765 handle_request_invite: Call from '5020' to extension '+32494846252' rejected because extension not found.
    -- Got SIP response 415 "Unsupported Media Type" back from 192.168.1.60
    -- Remote UNIX connection
    -- Remote UNIX connection disconnected
So, here i dailed +32494846252

Part of extensions.conf :

Code: [Select]
[qrxvtmny]

include => internal-presets
include => extensions
include => conferences
exten => _**XX.,1,Pickup(${EXTEN:2})
include => utilities
exten => _07[067]XX.,1,agi(selintra,OutRoute,070-lijnen)
exten => _078XX.,1,agi(selintra,OutRoute,078-lijnen)
exten => _090[02-9]XX.,1,agi(selintra,OutRoute,090-lijnen)
exten => _116000,1,agi(selintra,OutRoute,Child_focus)
exten => _04[789][1-9]XXXXXX,1,agi(selintra,OutRoute,GSM-netwerken)
exten => _+324[789][1-9]XXXXXX,1,agi(selintra,OutRoute,GSM-netwerken_INT)
exten => _0800XX.,1,agi(selintra,OutRoute,Gratis_lijnen)
exten => _1[2-9]XX,1,agi(selintra,OutRoute,Infolijnen)
exten => _00.,1,agi(selintra,OutRoute,Internationale_lijnen)
exten => _1[01][0-6],1,agi(selintra,OutRoute,Noodnummers)
exten => _0[1-9]XXXXXXX,1,agi(selintra,OutRoute,Vaste_lijnen)
exten => _+32[1-9]XXXXXXX,1,agi(selintra,OutRoute,Vaste_lijnen_INT)
exten => _93X.,1,agi(selintra,OutTrunk,329909005877)
exten => _91X.,1,agi(selintra,OutTrunk,DAHDI1-1)
exten => _92X.,1,agi(selintra,OutTrunk,DAHDI2-1)

exten => t,1,Hangup
exten => h,1,Hangup
exten => i,1,Playtones(congestion)

« Last Edit: September 14, 2011, 09:36:31 PM by frifri »

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: How to handle a + IDD-code in dialpatterns
« Reply #7 on: September 15, 2011, 05:42:04 PM »
Hi there

Looking at this I guess you are out of luck.  It would seem that Asterisk won't process the + sign in a mask.  Sorry it didn't work out for you.   Maybe you can get the phone itself to suppress the + sign before it dials. 

Kind Regards

S