[OpenSIPS-Users] Problem with dynamic routing
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Tue Jan 20 13:10:48 CET 2009
Hi Matteo,
Your route must return some negative value in order to drop the matching
- use return(-1); from the DR invoked route.
Regards,
Bogdan
mmarzuola at interfree.it wrote:
> Hi all.
> I'm testing the dynamic routing module. I read its documentation, but I have some doubt on the Routing Rule Processing.
> After finding the rule, if the route ID is different from zero, which is the flag to be set that stops the process after the executing of the indicated route?
>
> In my example, the dr_rules table is:
>
> ruleid:1 groupid:1 prefix:30 timerec:20090119T104000 priority:0 routeid:2 gwlist:1 description: Rule 1
>
> The part of the opensips.cfg is:
>
> route {
> ***
> ***
> ***
> if (is_method("INVITE")) {
> xlog("L_INFO", "Method is an INVITE\n");
> #setflag(4);
> setflag(1); # do accounting
> if($rU=~"3.*") {
> xlog("L_INFO", "Call to PSTN\n");
> do_routing();
> }
> }
>
> ****
> ****
> route(1);
> }
>
>
> route[1] {
> # for INVITEs enable some additional helper routes
> if (is_method("INVITE")) {
> t_on_branch("2");
> t_on_reply("2");
> t_on_failure("1");
> }
>
> if (!t_relay()) {
> sl_reply_error();
> };
> exit;
> }
>
> route[2] {
> if (!t_relay()) {
> sl_reply_error();
> };http://webmail.interfree.it/cgi-bin/nrmail05.cgi?mailfolder=in&new_message_to=new&new=1
> exit;
> }
>
> branch_route[2] {
> xlog("new branch at $ru\n");
> }
>
>
> onreply_route[2] {
> xlog("incoming reply\n");
> }
>
> failure_route[1] {
> if (t_was_cancelled()) {
> exit;
> }
> }
>
> When I try to call a user (i.e.3000) I get the error 500.
> In the syslog I have:
>
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: Method is an INVITE
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: Call to PSTN
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_new_result: allocate 28 bytes for result set at 0x81b21a0
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:db_mysql:db_mysql_get_columns: 1 columns returned from the query
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_allocate_columns: allocate 4 bytes for result names at 0x81b1cf0
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_allocate_columns: allocate 4 bytes for result types at 0x81b21c8
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:db_mysql:db_mysql_get_columns: allocate 8 bytes for RES_NAMES[0] at 0x81b21$
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:db_mysql:db_mysql_get_columns: RES_NAMES(0x81b21d8)[0]=[groupid]
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:db_mysql:db_mysql_get_columns: use DB_INT result type
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:db_mysql:db_mysql_convert_rows: allocate 8 bytes for rows at 0x81b21e8
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:db_mysql:db_mysql_get_columns: 1 columns returned from the query
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_allocate_columns: allocate 4 bytes for result names at 0x81b1cf0
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_allocate_columns: allocate 4 bytes for result types at 0x81b21c8
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:db_mysql:db_mysql_get_columns: allocate 8 bytes for RES_NAMES[0] at 0x81b21$
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:db_mysql:db_mysql_get_columns: RES_NAMES(0x81b21d8)[0]=[groupid]
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:db_mysql:db_mysql_get_columns: use DB_INT result type
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:db_mysql:db_mysql_convert_rows: allocate 8 bytes for rows at 0x81b21e8
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:db_mysql:db_mysql_convert_row: allocate 20 bytes for row values at 0x81b21f$
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:db_mysql:db_mysql_str2val: converting INT [1]
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_free_columns: freeing 1 columns
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_free_columns: freeing RES_NAMES[0] at 0x81b21d8
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_free_columns: freeing result names at 0x81b1cf0
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_free_columns: freeing result types at 0x81b21c8
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_free_rows: freeing 1 rows
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:db_mysql:db_mysql_convert_row: allocate 20 bytes for row values at 0x81b21f$
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:db_mysql:db_mysql_str2val: converting INT [1]
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_free_columns: freeing 1 columns
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_free_columns: freeing RES_NAMES[0] at 0x81b21d8
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_free_columns: freeing result names at 0x81b1cf0
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_free_columns: freeing result types at 0x81b21c8
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_free_rows: freeing 1 rows
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_free_row: freeing row values at 0x81b21f8
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_free_rows: freeing rows at 0x81b21e8
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:db_free_result: freeing result set at 0x81b21a0
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:drouting:do_routing: using dr group 1
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:drouting:internal_check_rt: found rgid 1 (rule list 0xb5bb5288)
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:drouting:ac_tm_fill: ---> fill = Mon Jan 19 13:55:25 2009
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:tm:t_newtran: transaction on entrance=(nil)
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:parse_headers: flags=ffffffffffffffff
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:get_hdr_field: content_length=309
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:get_hdr_field: found end of header
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:parse_headers: flags=78
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:tm:t_lookup_request: start searching: hash=55704, isACK=0
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:tm:matching_3261: RFC3261 transaction matching failed
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:tm:t_lookup_request: no transaction found
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:tm:run_reqin_callbacks: trans=0xb5bbc0e8, callback type 1, id 1 entered
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:parse_headers: flags=40
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:tm:run_reqin_callbacks: trans=0xb5bbc0e8, callback type 1, id 0 entered
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:parse_headers: flags=78
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:rr:is_direction: param ftag not found
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:parse_headers: flags=ffffffffffffffff
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:check_via_address: params 10.10.45.102, 10.10.45.102, 0
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:_shm_resize: resize(0) called
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:tm:_reply_light: reply sent out. buf=0x81b22d8: SIP/2.0 1..., shmem=0xb5bbd$
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:tm:_reply_light: finished
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:mk_proxy: doing DNS lookup...
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:sip_resolvehost: no port, no proto -> do NAPTR lookup!
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4869]: DBG:core:udp_rcv_loop: probing packet received from 10.10.45.102 50451
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:get_record: lookup(mysip.com, 35) failed
> Jan 19 13:55:25 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:sip_resolvehost: no valid NAPTR record found for mysip.com, trying direct SRV lookup...
> Jan 19 13:55:26 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:get_record: lookup(_sip._udp.mysip.com, 33) failed
> Jan 19 13:55:26 opensips-lab /usr/local/sbin/opensips[4871]: DBG:core:sip_resolvehost: no valid SRV record found for _sip._udp.mysip.com, trying A record lookup...
>
> Any suggestion?
>
> Thanks in advance
>
> Marzuola Matteo.
>
>
>
>
>
>
> ----------------------------------------------------------------------------
> Vuoi essere presente online?
> Vuoi dare voce alla tua attivita`?
> Acquista un dominio su domini.interfree.it.
> A partire da 18,59 euro
> ----------------------------------------------------------------------------
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
More information about the Users
mailing list