[OpenSER-Users] LCR Module / Function: load_gws() error

Darren Sessions dsessions at icidirect.net
Thu May 1 23:48:47 CEST 2008


Answered my own question . .

In function fixstringloadgws in /modules/lcr/lcr_mod.c . .

                if(str2int(&s, (unsigned int*)&model->spec.pvp.pvn.u.isname.name.n)!=0
                           || model->spec.pvp.pvn.u.isname.name.n<100) {

As called by:

static cmd_export_t cmds[] = {
        {"load_gws",      load_gws,      0, 0, 0, REQUEST_ROUTE},
        {"load_gws",      load_gws_grp,  1, fixstringloadgws, 0,
                REQUEST_ROUTE},
        {"next_gw",       next_gw,       0, 0, 0,
                REQUEST_ROUTE | FAILURE_ROUTE},
        {"from_gw",       from_gw,       0, 0, 0,
                REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE},
        {"from_gw",       from_gw_grp,   1, fixup_str2int, 0,
                REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE},
        {"to_gw",         to_gw,         0, 0, 0,
                REQUEST_ROUTE | FAILURE_ROUTE},
        {"to_gw",         to_gw_grp,     1, fixup_str2int, 0,
                REQUEST_ROUTE | FAILURE_ROUTE},
        {"load_contacts", load_contacts, 0, 0, 0,
                REQUEST_ROUTE},
        {"next_contacts", next_contacts, 0, 0, 0,
                REQUEST_ROUTE | FAILURE_ROUTE},
        {0, 0, 0, 0, 0, 0}
};

I was using values under 100, as the default value in the docs is "1". When I set the group ids at 100 or higher, it works just fine.

Hate to answer my own questions, but thought I should so we can update the docs.

 - Darren


On 5/1/08 2:48 PM, "Darren Sessions" <dsessions at icidirect.net> wrote:

Question . .

I'm trying to use the load_gws with a particular group id per the docs for 1.3, and am getting the following error message when I try and start OpenSER:

May  1 20:40:05 [16853] DBG:core:fix_actions: fixing load_gws, line 487
May  1 20:40:05 [16853] ERROR:lcr:fixstringloadgws: Wrong value <2> for param <1>!
May  1 20:40:05 [16853] ERROR:core:fix_actions: fixing failed (code=-1) at cfg line 487
May  1 20:40:05 [16853] CRITICAL:core:fix_expr: fix_actions error
May  1 20:40:05 [16853] ERROR:core:main: failed to fix configuration with err code -1
May  1 20:40:05 [16853] INFO:snmpstats:mod_destroy: The SNMPStats module got the kill signal
May  1 20:40:05 [16853] INFO:snmpstats:mod_destroy:                  Shutting down the AgentX Sub-Agent!
May  1 20:40:05 [16853] DBG:xlog:destroy: destroy module...
May  1 20:40:05 [16853] DBG:tm:tm_shutdown: tm_shutdown : start
May  1 20:40:05 [16853] DBG:tm:unlink_timer_lists: emptying DELETE list
May  1 20:40:05 [16853] DBG:tm:tm_shutdown: emptying hash table
May  1 20:40:05 [16853] DBG:tm:tm_shutdown: releasing timers
May  1 20:40:05 [16853] DBG:tm:tm_shutdown: removing semaphores
May  1 20:40:05 [16853] DBG:tm:tm_shutdown: destroying callback lists
May  1 20:40:05 [16853] DBG:tm:tm_shutdown: tm_shutdown : done
May  1 20:40:05 [16853] DBG:core:shm_mem_destroy:
May  1 20:40:05 [16853] DBG:core:shm_mem_destroy: destroying the shared memory lock


Am I missing something? Per the docs at http://www.openser.org/docs/modules/1.3.x/lcr.html#AEN303 , I should be able to use a particular gateway group id in that function.

My config code excerpt:

    if (from_gw("1000")) {
      xlog("L_ERR", "Route 14: Call originating from incoming vendor\n");
      if (!load_gws("2")) {
        xlog("L_ERR", "Route 14: Error loading gateways (GW Group 2) - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
        sl_send_reply("503", "Termination Currently Unavailable");
        exit;
      }
      if (!next_gw()) {
        xlog("L_ERR", "Route 14: No gateways available (GW Group 2) - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
        sl_send_reply("503", "Termination Currently Unavailable");
        exit;
      }
      setflag(21);
      t_on_failure("1");
      route(10);
    }


Basically, it's checking to see if the call is originating from one of the incoming gateways in group id 1000, and if it is, I'd like to pull a gateway from group 2 and send the call to it.


Any help would be appreciated.

Thanks,

 - Darren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20080501/48139db9/attachment.htm>


More information about the sr-users mailing list