[OpenSIPS-Users] drouting() Function Availability

Johan De Clercq Johan at democon.be
Wed Mar 6 09:41:20 EST 2019


is_from_gw checks the gateways in the DB on their ip address and is used
for incoming calls. '
Hence it is perfeclty possible to call is from gateway before do-routing.

Op wo 6 mrt. 2019 om 15:07 schreef Mark Farmer <farmorg at gmail.com>:

> Hi everyone
>
> I am confused about when drouting() functions become available. I resolved
> an issue using is_from_gw() & goes_to_gw() by using them after
> do_routing(). But looking at my trunking script I see that is_from_gw() is
> being used before do_routing() to check if the call is coming from a known
> gateway. This was generated by the "Generate OpenSIPS Script" in make
> menuconfig which I guess knows better than me :)
>
> How come it works before do_routing() here but would not work for me
> elsewhere?
>
> route{
>
>         if (!mf_process_maxfwd_header("10")) {
>                 send_reply("483","Too Many Hops");
>                 exit;
>         }
>
>         if ( check_source_address("0","$avp(trunk_attrs)") ) {
>                 # request comes from trunks
>                 setflag(IS_TRUNK);
>         } else if ( is_from_gw() ) {
>                 # request comes from GWs
>         } else {
>                 send_reply("403","Forbidden");
>                 exit;
>         }
>
> TIA for explanations.
> Mark.
>
>
> --
> Mark Farmer
> farmorg at gmail.com
> _______________________________________________
> 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/20190306/61ecaa3a/attachment.html>


More information about the Users mailing list