German Sip Dial Rules
Hi,
is somebody attending, that wants to share his outgoing dial rules of extension.conf, like used in typical(?) german pbx setups?
* zero prefix for outside calls
* zero zero or plus prefix for international calls
* handle emergency calls
With ISDN, one was able to just forward the called number, but with sip, one has to normalize the dialed pattern in order to match SIP (provider)
expectations… As always, the devil is in the details.
Thanks, Pete
2 thoughts on - German Sip Dial Rules
Shouldn’t you just ask the provider?
But not being German, the only problem I know of is the ISDN
sub addressing feature widely in use.
Looking at https://en.wikipedia.org/wiki/Telephone_numbers_in_Germany I’d guess a dialplan would be (assuming the operator wants e164+):
exten => _1.,1,Dial(SIP/${EXTEN}@provider)
exten => _[2-9].,1,Goto(+49xyz${EXTEN:1},1)
exten => _0[1-9].,1,Goto(+49${EXTEN:1},1)
exten => _00[1-9].,1,Goto(+${EXTEN:2},1)
exten => _+.,1,Dial(SIP/${EXTEN}@provider)
I am not sure if I have understood what your problem actually is. What I
have done:
1) Download the number plan for Germany from the Bundesnetzagentur
(abbreviated BA in the following text – I don’t know the correct English expression) and work through it carefully to get a feeling where possible problems are.
In the dial plan:
2) Check if the dial string is exactly one of the well-defined
*internal* phone numbers of other users. If yes, make the connection.
3) Using Asterisk’s text / regex functions, check if there are forbidden chars in the dial string (i.e. any char except 0-9, +, /, -). If yes, throw an error / deny the connection.
4) Using Asterisk’s text replacement / regex functions, do further checks (e.g. + (if existent) must be the first char of the dial string), and normalize the dial string (e.g. convert + to 00, throw away / and -).
Now it gets complicated. I have carefully worked through the BA plan to determine the appropriate regular expressions for the following steps.
5) Determine if the dial string is an emergency number. If yes, make the connection. For security reasons, I am doing this before the following checks; these are quite complicated any might contain errors, so I am checking for the emergency case as early as possible in the dial plan.
6) Determine if the called number is outside Germany (yes, possibly I
had to use the BA plan for that seemingly easy step, but I can’t remember for sure). If yes, make the connection (no further checks then because I don’t have the time to study the communication authorities’
number plans of all the other countries).
7) If we are still here, the called number is in Germany. Again use the BA number plan to determine what is being called. It is up to you to decide what happens if somebody (possibly accidentally) calls something like “Zeitansage” or “Sozialdienste”.
I have one rule / filter for every item from the list in the BA plan. This makes quite a bunch of rules, but this setup is working since nearly three years now without any issues.
Regards,
Binarus