[OpenSIPS-Devel] [ opensips-Feature Requests-3517186 ] DROUTING - function for checking that gateway group
SourceForge.net
noreply at sourceforge.net
Fri Aug 31 21:02:44 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-31 12:02
Message:
Added dr_is_gw_v2.patch.
In it:
1. SIP URI instead of socket in pvar.
2. Added 'n' flag to dr_is_gw and is_from_gw to ignore port number (I
really need it, think it will be useful).
3. Small fix for documentation (added 'i' flag to is_from_gw description).
----------------------------------------------------------------------
Comment By: Nick Altmann (nikbyte)
Date: 2012-08-31 09:13
Message:
Okay, I'll change it.
I think also that it would be nice to add additional flag to this function
and is_from_gw and goes to gw functions to ignore port number. What do you
think?
----------------------------------------------------------------------
Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2012-08-31 06:54
Message:
Nick, do not want to be picky, but shouldn't be better to have a SIP URI
for the first param, instead of a socket like definition? usually in script
you play around with SIP URIs and it is simpler to just feed the URI into
the function for checking.....
my 2 cents here
----------------------------------------------------------------------
Comment By: Nick Altmann (nikbyte)
Date: 2012-08-29 06:37
Message:
Patch to the last trunk (rev. 9233) attached.
----------------------------------------------------------------------
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