[OpenSIPS-Users] trying to use the drouting module

Bogdan-Andrei Iancu bogdan at opensips.org
Fri May 10 18:36:07 CEST 2013


Hello Mark,

Your script does not handle sequential request (like BYE) at all. I
would strongly suggest to follow this webinar
http://www.opensips.org/Documentation/Webinars#toc12 in order to
understand the record routing and loose routing mechanisms in SIP. After
that, you need to change your script accordingly (you can check the
default opensips script - the part with the loose_route() function ).

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com


On 05/10/2013 06:36 PM, Mark Lassing wrote:
>
> Hi all,
>
>  
>
> I am trying to use the drouting module,
>
> this is working as expected, calls get passed to the right gw, call
> setup and audio is all working fine,
>
> but the bye request packets do not seem to be relayed to the
> destination gw, causing lot of retransmits.
>
>  
>
> How to solve this issue ? If more informations is needed please feel
> free to ask me.
>
>  
>
> --
>
>  
>
> Mark
>
>  
>
> #### Global ####
>
> debug=6
>
> log_stderror=no
>
> log_facility=LOG_LOCAL0
>
> fork=yes
>
> children=4
>
> auto_aliases=no
>
> listen=udp:213.***.***.***:5060
>
> disable_tcp=no
>
>  
>
> ####### Modules Section ########
>
>  
>
> #set module path
>
> mpath="/usr/lib/opensips/modules/"
>
> loadmodule "db_mysql.so"
>
>  
>
>  
>
> #### DROUTING module
>
> loadmodule "drouting.so"
>
> modparam("drouting", "db_url", "mysql://*****:*****@localhost/opensips")
>
> modparam("drouting", "probing_interval", 60)
>
> modparam("drouting", "probing_from", "sip:probe at q.*****.**")
>
> modparam("drouting", "probing_method", "OPTIONS")
>
> modparam("drouting", "probing_reply_codes", "501, 403, 404")
>
> modparam("drouting", "use_domain", 1)
>
>  
>
> #### Transaction Module
>
> loadmodule "tm.so"
>
> modparam("tm", "fr_timer", 5)
>
> modparam("tm", "fr_inv_timer", 30)
>
> modparam("tm", "restart_fr_on_each_reply", 0)
>
> modparam("tm", "onreply_avp_mode", 1)
>
>  
>
> #### SIGNALING module
>
> loadmodule "signaling.so"
>
>  
>
> #### StateLess module
>
> loadmodule "sl.so"
>
>  
>
> #### SIP MSG OPerationS module
>
> loadmodule "sipmsgops.so"
>
>  
>
> #### Record Route Module
>
> loadmodule "rr.so"
>
> /* do not append from tag to the RR (no need for this script) */
>
> modparam("rr", "append_fromtag", 1)
>
>  
>
> #### MAX ForWarD module
>
> loadmodule "maxfwd.so"
>
>  
>
>  
>
>  
>
> ####### Routing Logic ########
>
>  
>
> # main request routing logic
>
>  
>
> route{
>
>         if (!mf_process_maxfwd_header("10")) {
>
>                 sl_send_reply("483","Too Many Hops");
>
>                 exit;
>
>         }
>
>  
>
>         if (method == "INVITE") {
>
>                 setflag(1);   
>
>                 record_route();
>
>                
>
>                 xlog("INBOUND CALL,$dd,$ru,$ci,$fn,$fu,$tU@$td");
>
>                 route(10);
>
>                 exit;
>
>         }
>
>  
>
> }
>
>  
>
>  
>
> route[10] {
>
>  
>
>         if (!do_routing("0")) {
>
>  
>
>                 xlog("do_routing: No rules matching the URI\n");
>
>                 send_reply("503","No rules matching the URI");
>
>                 exit;
>
>         }
>
>  
>
>         if (is_method("INVITE")) {
>
>                 t_on_failure("10");
>
>         }
>
>         route(1);
>
> }
>
>  
>
>  
>
> route[1] {
>
>           xlog("route(1)\n");
>
> #         sl_send_reply("100", "Trying");
>
>           if(!t_relay())
>
>           {
>
>              sl_reply_error();
>
>           }
>
> }
>
>  
>
>  
>
> failure_route[10] {
>
>     xlog("DEBUG: DROUTING failure route active\n");
>
>     if (t_was_cancelled()) {
>
>         exit;
>
>     }
>
>     if (t_check_status("[34][0-9][0-9]")) {
>
>         exit;
>
>     }
>
>  
>
>     if (use_next_gw()) {
>
>         t_relay();
>
>         exit;
>
>     } else {
>
>         t_reply ("503", "Service not available");
>
>         exit;
>
>     }
>
> }
>
>  
>
>  
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20130510/49ed3ee1/attachment.htm>


More information about the Users mailing list