[asterisk-users] German sip dial rules

Binarus lists at binarus.de
Wed Jun 14 10:28:10 CDT 2017


On 12.06.2017 17:00, Hans-Peter Jansen wrote:
> 
>  * 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.
> 

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






More information about the asterisk-users mailing list