[OpenSER-Users] Unable to configure LCR in openser - problem with next_gw()?

Ovidiu Sas sip.nslu at gmail.com
Sun Jul 22 02:32:09 CEST 2007


Hi Miodrag,

Please check the lcr documentation for openser 1.2.
The '%' is no longer valid.  Use an empty string instead.

>From the 'Overview':
Table lcr contains prefix of user part of Request-URI, From URI,
gateway group id, and priority. From URI is a regular expression.
Empty From URI pattern matches any From URI. Smaller priority value
means higher priority (highest priority value being 0).


Regards,
Ovidiu Sas

On 7/21/07, Miodrag Radulovic <mradulovic at comutel.co.yu> wrote:
>
> Hello everyone! Please help...
>
> I've started testing openser 1.2.1 few weeks ago (on freebsd 6.2, I've got it from freebsd port collection) and I simple can not make LCR work at all. I spent last few hours reading almost all the posts on this mailing list and I can see it is working but I can not figure it out why mine configuration is not...
>
> For simple start - I want all calls where destination number starts with 9 to be routed to PSTN GW.
>
> So I made these entries in LCR tables:
>
> [root at santos /var/log]# openserctl lcr show
> lcr routes
> +----+--------+----------+--------+----------+
> | id | prefix | from_uri | grp_id | priority |
> +----+--------+----------+--------+----------+
> | 10 | 9      | %        |      1 |        1 |
> +----+--------+----------+--------+----------+
> lcr gateway groups
> +--------+----------+
> | grp_id | grp_name |
> +--------+----------+
> |      1 | comutel  |
> +--------+----------+
> lcr gateways
> +---------+---------------+------+------------+-----------+--------+-------+--------+
> | gw_name | ip_addr       | port | uri_scheme | transport | grp_id | strip | prefix |
> +---------+---------------+------+------------+-----------+--------+-------+--------+
> | c2811   | 192.168.253.1 | 5060 |          1 |         1 |      1 |     0 |        |
> +---------+---------------+------+------------+-----------+--------+-------+--------+
>
> For openser.cfg itself I've started with sip:wizard configuration template (SIP Proxy/Registrar with Offnet-Termination and Accounting) then I made some necessary changes (I do not have Mediaproxy or RTPproxy and added domain and populated trusted table).
>
> But when I dial 93016576 I always have this error message in xlog output:
>
> Jul 19 18:50:24 santos /usr/local/sbin/openser[1412]: No PSTN gateways available - M=INVITE RURI=sip:93016576 at 192.168.253.205:5060 F=sip:lvs1 at 192.168.253.205:5060 T=sip:93016576 at 192.168.253.205:5060 IP=192.168.253.202 ID=676c7a05-4bcd2745 at 192.168.253.202
>
> Here is part of openser.cfg where next_gw() fails:
>
> route[10]
> {
>         if(isflagset(20))
>         {
>
>                 xlog("L_INFO", "Call to foreign domain - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
>                 route(6);
>                 exit;
>         }
>
>         route(12);
>         if(!isflagset(23))
>         {
>                 # don't allow calls relaying from PSTN to PSTN, if not explicitely forwarded
>                 if(uri =~ "^sip:[0-9]+@")
>                 {
>                         # only route numeric users to PSTN
>                         if(!load_gws())
>                         {
>
>                                 xlog("L_ERR", "Error loading PSTN gateways - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
>                                 sl_send_reply("503", "PSTN Termination Currently Unavailable");
>                                 exit;
>                         }
>                         if(!next_gw())
>                         {
>
>                                 xlog("L_ERR", "No PSTN gateways available - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
>                                 sl_send_reply("503", "PSTN Termination Currently Unavailable");
>                                 exit;
>                         }
>                         setflag(21);
>
>                         t_on_failure("1");
>                         route(6);
>                 }
>         }
>
>         xlog("L_INFO", "Call to unknown user - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
>         route(3);
>         sl_send_reply("404", "User Not Found");
>         exit;
> }
>
> I believe that I've made some errors in LCR routes entries, but documentation is really sparse on this issue...
>
> Please note - I've tried replacing "%" with empty string in from_uri column in routes table but then openser was not able to startup:
>
> [root at santos /var/log]# openserctl lcr rmroute 9 % 1 1
> MySql password for user 'openser at localhost':
> 200 OK
>
> [root at santos /var/log]# openserctl lcr addroute 9 '' 1 1
> MySql password for user 'openser at localhost':
> 200 OK
>
> [root at santos /var/log]# openserctl lcr show
> lcr routes
> +----+--------+----------+--------+----------+
> | id | prefix | from_uri | grp_id | priority |
> +----+--------+----------+--------+----------+
> | 11 | 9      |          |      1 |        1 |
> +----+--------+----------+--------+----------+
> lcr gateway groups
> +--------+----------+
> | grp_id | grp_name |
> +--------+----------+
> |      1 | comutel  |
> +--------+----------+
> lcr gateways
> +---------+---------------+------+------------+-----------+--------+-------+--------+
> | gw_name | ip_addr       | port | uri_scheme | transport | grp_id | strip | prefix |
> +---------+---------------+------+------------+-----------+--------+-------+--------+
> | c2811   | 192.168.253.1 | 5060 |          1 |         1 |      1 |     0 |        |
> +---------+---------------+------+------------+-----------+--------+-------+--------+
>
> [root at santos /var/log]# openserctl restart
>
> Stopping OpenSER : \E[37;33mINFO: stopped
>
> Starting OpenSER :
> \E[37;31mERROR: PID file /var/run/openser.pid does not exist -- OpenSER start failed
>
> And here is relevant part from openser log output:
>
> Jul 21 21:30:26 santos /usr/local/sbin/openser[10216]: ERROR:lcr:load_regex: bad from_uri re
> Jul 21 21:30:26 santos /usr/local/sbin/openser[10216]: ERROR: lcr:mod_init(): failed to reload gateways and routes
> Jul 21 21:30:26 santos /usr/local/sbin/openser[10216]: init_mod(): Error while initializing module lcr
>
> Please can someone help and point me in the right direction?
>
> BR,
> Miodrag
>
>
>
> _______________________________________________
> Users mailing list
> Users at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users
>




More information about the Users mailing list