[OpenSIPS-Devel] [ opensips-Feature Requests-3517186 ] DROUTING - function for checking that gateway group

SourceForge.net noreply at sourceforge.net
Wed Aug 29 15:37:02 CEST 2012


Feature Requests item #3517186, was opened at 2012-04-12 05:47
Message generated for change (Comment added) made by nikbyte
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086413&aid=3517186&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: trunk
Status: Open
Priority: 5
Private: No
Submitted By: Nick Altmann (nikbyte)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: DROUTING - function for checking that gateway group

Initial Comment:
I offer to add to drouting in addition to functions is_from_gw, goes_to_gw function, which can check any uri is from certain group.
Like ds_is_in_list in DISPATCHER.
is_from_gw and goes to gw now allow only to check from and destination uri, but not any uri.

For example,
is_gw(uri, [type, [flag]])


----------------------------------------------------------------------

>Comment By: Nick Altmann (nikbyte)
Date: 2012-08-29 06:37

Message:
1.4.7.  dr_is_gw(src_pv, [type, [flag]])

   The function checks if the ip address in pvar src_pv is a gateway
   from a certain group.
   
   This function can be used from REQUEST_ROUTE, ON_REPLY and
FAILURE_ROUTE.
              
   Meaning of the parameters is as follows:
     * src_pv (mandatory) - pvar containing ip address.
       May be a script var or avp.
     * type (optional) - GW/destination type to be checked
     * flags (optional) - what operations should be performed when
       a GW matches:
          + 's' (Strip) - apply to the username of RURI the strip
            defined by the GW
          + 'p' (Prefix) - apply to the username of RURI the
            prefix defined by the GW
          + 'a' (Attributes) - return the attributes string
            defined by the GW

   Example 1.31. dr_is_gw usage
...
if (dr_is_gw("$avp(uac)","3") {
}
...

----------------------------------------------------------------------

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2012-08-29 03:43

Message:
I would say a new function, like "dr_is_gw() ", as you suggested

----------------------------------------------------------------------

Comment By: Nick Altmann (nikbyte)
Date: 2012-08-29 02:20

Message:
Okay, I will make patch.
How do you think, should I make new functions, or add parameter to existing
functions?
Like is_from_gw( [type, [flag, [avp]]] ):
is_from_gw(type)
is_from_gw(type, flag)
is_from_gw(type, flag, avp)

?


----------------------------------------------------------------------

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2012-08-29 01:48

Message:
Hi Nick,

Willing to do the patch ? as it is a nice functionality and it will be
definitely accepted.

Regards,
Bogdan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086413&aid=3517186&group_id=232389



More information about the Devel mailing list