[SR-Users] Add country code on incoming calls - if not present

Daniel Tryba d.tryba at pocos.nl
Tue Sep 1 15:59:25 CEST 2015


On Tuesday 01 September 2015 13:45:16 Michael Nielsen wrote:
> Is it possible to, if a subscriber has not entered either + or 00, to
> append the value from country_code of the specific subscriber to the
> dialled number?
> 
> And if the user has dialled 00, to replace it with +.

Offcourse that is possible, in folowwing example src_areacode is taken from 
usr_preferences and a no country code pattern is hardcoded to the Netherlands 
prefix. 

        if($rU=~"^[2-8][0-9]+$")
        {
                if($avp(src_areacode)=~"^\+?[0-9]+$")
                {
                        $rU=$avp(src_areacode)+$rU;
                }

        }

        if($rU=~"^00[1-9][0-9]+$")
        {
                strip(2);
                prefix("+");
        }

        if($rU=~"^0[1-9][0-9]+$")
        {
                strip(1);
                prefix("+31");
        }





More information about the sr-users mailing list