<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">You are only going into the block that you put the relay in if your do_routing fails.<div class=""><br class=""></div><div class="">pay attention to the ! which means NOT</div><div class=""><br class=""><div class=""><div class="">
<div class=""><span style="orphans: 2; widows: 2;" class="">---------------------------------------------------</span><br style="orphans: 2; widows: 2;" class=""><span style="orphans: 2; widows: 2;" class="">Jennifer Akemi Hashimoto</span><br style="orphans: 2; widows: 2;" class=""><span style="orphans: 2; widows: 2;" class="">Caztel Communications</span><br style="orphans: 2; widows: 2;" class=""><a href="mailto:jennifer.hashimoto@caztel.com" style="orphans: 2; widows: 2;" class="">jennifer.hashimoto@caztel.com</a><br style="orphans: 2; widows: 2;" class=""><span style="orphans: 2; widows: 2;" class="">905-836-5445 </span></div>

</div>
<div style=""><br class=""><blockquote type="cite" class=""><div class="">On Jan 25, 2019, at 10:24 AM, Mark Farmer <<a href="mailto:farmorg@gmail.com" class="">farmorg@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class="">Thanks Jim.<div class=""><br class=""></div><div class="">I now have:</div><div class=""><br class=""></div><div class=""><div class="">        $avp(gw_whitelist) = "testpbx1";</div><div class="">        if ( !do_routing("1","L","$avp(gw_whitelist)","$avp(rules_attributes)","$avp(gw_attributes)")) {</div><div class="">          t_relay();</div><div class="">          send_reply("404","DID not found");</div><div class="">          xlog("do_routing: No rules matching the URI\n");</div><div class="">          exit;</div></div><div class=""><br class=""></div><div class="">Sadly no change.</div><div class=""><br class=""></div><div class="">I'll head over to the docs again now.</div><div class=""><br class=""></div><div class=""><br class=""></div></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 25 Jan 2019 at 15:08, Jim DeVito <<a href="mailto:jim@devito.cc" class="">jim@devito.cc</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr" class=""><div dir="ltr" class="">Are you missing the actual relay part? I'm pretty sure do_routing just loads routing info from the database but you sill need to call the actual relay. Put a t_relay() after the IF statement and see what happens. Also look at the docs regarding capturing and displaying the return code from do_routing.</div><div dir="ltr" class=""><br class=""></div><div dir="ltr" class=""><br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Fri, Jan 25, 2019 at 9:52 AM Mark Farmer <<a href="mailto:farmorg@gmail.com" target="_blank" class="">farmorg@gmail.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class="">Hello all<div class=""><br class=""></div><div class="">Very new OpenSIPS user trying to build my first real server.</div><div class=""><br class=""></div><div class="">Using debug logging I can see that my alias/dialplan operations seem to be working but when it reaches the do_routing the call never actually gets routed.</div><div class=""><br class=""></div><div class="">I've been trying to get this working for nearly 2 weeks now and I'm at a loss now. Please can someone help me?</div><div class=""><br class=""></div><div class="">From my script:</div><div class=""><br class=""></div><div class=""><div class="">        $avp(gw_whitelist) = "testpbx1";</div><div class="">        if ( !do_routing("1","L","$avp(gw_whitelist)","$avp(rules_attributes)","$avp(gw_attributes)")) {</div><div class="">          send_reply("404","DID not found");</div><div class="">          xlog("do_routing: No rules matching the URI\n");</div><div class="">          exit;</div><div class=""><br class=""></div><div class="">Oddly, I never get the no rules log entry but it drops out of here & into the else if below which forces proxy auth. </div><div class=""><br class=""></div><div class="">My DB:</div><div class=""><br class=""></div><div class=""><div class="">dr gateways</div><div class="">+----+--------------+------+---------------------+-------+------------+--------------+------------+-------+--------+-------------+</div><div class="">| id | gwid         | type | address             | strip | pri_prefix | attrs        | probe_mode | state | socket | description |</div><div class="">+----+--------------+------+---------------------+-------+------------+--------------+------------+-------+--------+-------------+</div><div class="">|  2 | BT_SDIN_BCTE |    1 | <a href="sip:xxx.xxx.xxx.xxx" class="">sip:xxx.xxx.xxx.xxx</a>   |     0 |            | BT_SDIN_BCTE |          2 |     0 |        | Inbound     |</div><div class="">|  3 | BT_SDIN_GDH  |    1 | <a href="sip:xxx.xxx.xxx.xxx" class="">sip:xxx.xxx.xxx.xxx</a>   |     0 |            | BT_SDIN_GDH  |          2 |     0 |        | Inbound     |</div><div class="">|  1 | BT_SDIN_LFH  |    1 | <a href="sip:xxx.xxx.xxx.xxx" class="">sip:xxx.xxx.xxx.xxx</a> |     0 |            | BT_SDIN_LFH  |          2 |     0 |        | Inbound     |</div><div class="">|  4 | BT_SDIN_SEH  |    1 | <a href="sip:xxx.xxx.xxx.xxx" class="">sip:xxx.xxx.xxx.xxx</a>  |     0 |            | BT_SDIN_SEH  |          2 |     0 |        | Inbound     |</div><div class="">|  5 | testpbx1     |    1 | <a href="sip:10.98.0.11" class="">sip:10.98.0.11</a>      |     2 | 0          | testpbx1     |          2 |     0 |        | Inbound     |</div><div class="">+----+--------------+------+---------------------+-------+------------+--------------+------------+-------+--------+-------------+</div><div class="">dr groups</div><div class="">+----+--------------+----------------------------+---------+-------------+</div><div class="">| id | username     | domain                     | groupid | description |</div><div class="">+----+--------------+----------------------------+---------+-------------+</div><div class="">|  7 | 441423369031 | 10.98.0.11                 |       1 |             |</div><div class="">|  6 | 441423369031 | my.domain |       2 |             |</div><div class="">+----+--------------+----------------------------+---------+-------------+</div><div class="">dr carriers</div><div class="">+----+-----------+--------------------------------------------------+-------+-------+-------+-------------+</div><div class="">| id | carrierid | gwlist                                           | flags | state | attrs | description |</div><div class="">+----+-----------+--------------------------------------------------+-------+-------+-------+-------------+</div><div class="">|  1 | BT        | BT_SDIN_BCTE,BT_SDIN_GDH,BT_SDIN_LFH,BT_SDIN_SEH |     0 |     0 |       | BT SDIN     |</div><div class="">+----+-----------+--------------------------------------------------+-------+-------+-------+-------------+</div><div class="">dr rules</div><div class="">+--------+---------+--------------+---------+----------+---------+----------+-------------------+------------------+</div><div class="">| ruleid | groupid | prefix       | timerec | priority | routeid | gwlist   | attrs             | description      |</div><div class="">+--------+---------+--------------+---------+----------+---------+----------+-------------------+------------------+</div><div class="">|     13 | 1       | 441423369031 |         |        0 |         | testpbx1 | rule_441423369031 | Send to testpbx1 |</div><div class="">+--------+---------+--------------+---------+----------+---------+----------+-------------------+------------------+</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div>-- <br class=""><div dir="ltr" class="gmail-m_8549340969137715975gmail-m_-2063528209488112719gmail_signature">Mark Farmer<br class=""><a href="mailto:farmorg@gmail.com" target="_blank" class="">farmorg@gmail.com</a></div></div></div></div></div></div></div></div></div></div></div></div>
_______________________________________________<br class="">
Users mailing list<br class="">
<a href="mailto:Users@lists.opensips.org" target="_blank" class="">Users@lists.opensips.org</a><br class="">
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank" class="">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br class="">
</blockquote></div><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div dir="ltr" class="gmail-m_8549340969137715975gmail_signature"><div dir="ltr" class="">-------------<div class="">Jim DeVito</div><div class="">Mobile 216.507.9497</div></div></div>
_______________________________________________<br class="">
Users mailing list<br class="">
<a href="mailto:Users@lists.opensips.org" target="_blank" class="">Users@lists.opensips.org</a><br class="">
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank" class="">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br class="">
</blockquote></div><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div dir="ltr" class="gmail_signature">Mark Farmer<br class=""><a href="mailto:farmorg@gmail.com" target="_blank" class="">farmorg@gmail.com</a></div>
_______________________________________________<br class="">Users mailing list<br class=""><a href="mailto:Users@lists.opensips.org" class="">Users@lists.opensips.org</a><br class="">http://lists.opensips.org/cgi-bin/mailman/listinfo/users<br class=""></div></blockquote></div><br class=""></div></div></body></html>