[OpenSIPS-Users] Routing Permission errors

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Sep 21 10:48:29 CEST 2010


Hi Deon,

looking at the your script, it seams inconsistent from syntax point of 
view. Like:

# record routing
if (!is_method("REGISTER|MESSAGE"))
record_route();

# account only INVITEs
if (is_method("INVITE")) {
setflag(1); # do accounting
}
if (!uri==myself)


#########################################
#----- Routing to External Domains -----#
#########################################
if (!is_uri_host_local())
{



the line "if (!uri==myself)" has no follow...so some brackets are not 
correctly closing.....


Regards,
Bogdan


Deon Vermeulen wrote:
> Good Day
>
> I am trying to setup Routing Parameters but get errors when checking  
> opensips config.
>
> Can some one please point out what I'm doing wrong in my script below  
> or suggestions doing it differently will really be appreciated?
>
> ##################################
> #----- Group Routing Params -----#
> ##################################
>          #Normalize the local number e.164 - Windhoek (061)
>          if (uri=~"^sip:[2-9][0-9]{6}@") {
>            if (db_is_user_in("credentials","local")) {
>              prefix("061");
>              route(4);
>              exit;
>            }
>            else {
>              sl_send_reply("403", "No permissions for local calls");
>              exit;
>            }
>          }
>            # ---- National Calls ---- #
>          if (uri=~"^sip:06[1-9]{6}@") {
>            if (db_is_user_in("credentials","ld")) {
>              route(4);
>              exit;
>              }
>              else {
>                sl_send_reply("403", "No permissions for long distance");
>                exit;
>              }
>          }
>            # ---- International Calls ---- #
>          if (uri=~"^sip:00[0-9]*@") {
>            if (db_is_user_in("credentials","Int")) {
>              strip(3);
>              route(4);
>              exit;
>            }
>            else {
>              sl_send_reply("403", "No permissions for internat. calls");
>              exit;
>            }
>          }
>
> #########################
> #----- PSTN Routes -----#
> #########################
> #######################################################
> #            Send the calls to the PSTN               #
> #   Change the IP Address below to reflect network    #
> #######################################################
>
>          # ---- "Static" Routing ---- #
>                  ##route[4] {
>                  ## rewritehostport("x.x.x.x");
>                  ##  route(1);
>
>          # ---- Dynamic Routing ---- #     #### ---- THIS IS WHAT  
> SHOULD BE USED ---- #####
>          if(!do_routing()){
>              send_reply("503", "No rules found matching the URI  
> prefix");
>             exit;
>            }
>             # flag 10 – flag the transaction to handle the failure route
>            setflag(10);
>            route(1);
>          }
>          failure_route[1] {
>            if (t_was_cancelled()) {
>              exit;
>            }
>            if(isflagset(10)){
>              if (use_next_gw()) {
>                #xlog ("next gateway $ru \n");
>                t_on_failure("1");
>                t_relay();
>                exit;
>             }
>             else {
>               t_reply("503", "Service not available, no more gateways");
>               exit;
>             }
>          }
> }
>
>
> I get this error when checking the config with "opensipsctl -C /etc/ 
> opensips/opensips.cfg
>
> Sep 18 18:21:11 [19963] CRITICAL:core:yyerror: parse error in config  
> file, line 409, column 2-4: syntax error
> Sep 18 18:21:11 [19963] CRITICAL:core:yyerror: parse error in config  
> file, line 409, column 2-4:
> Sep 18 18:21:11 [19963] ERROR:core:main: bad config file (2 errors)
>
>
> " if (uri=~"^sip:[2-9][0-9]{6}@") { "   Starts on line 409
>
>
> I have the uri.so module loaded.
> Do I need the regex.so module?
>
>
> I am also looking for help to setup a Group permission "VOIP_XYZ" to  
> only allow calls between users in a specific Domain "XYZ".
>
>
> Thank you very very much in advance.
>
>
> Regards
> Deon
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   


-- 
Bogdan-Andrei Iancu
OpenSIPS Bootcamp
15 - 19 November 2010, Edison, New Jersey, USA
www.voice-system.ro




More information about the Users mailing list