[SR-Users] Kamailio and default paramenters to a specific gatewy

Anthony Joseph Messina amessina at messinet.com
Tue Jan 10 13:45:04 CET 2017


On Tuesday, January 10, 2017 10:51:30 AM CST Laura wrote:
> Dear all,
> 
> I'm using kamailio 4.3.6 and LCR modules.. i was wondering if it was
> possibile to add some special paramenter to all call sent to a specific
> gateway.
> 
> I was try to use the " params" field on lcr_gw table but it's not
> working like i was think..
> 
> The issue is simple.. i want to add to field "Privacy: id" to any call i
> send over a specific gateway..
> 
> What is the best and easy way to do that ?
> 
> Any idea is appreciate.
> 
> Regards
> 
> Laura

You could use the LCR 'flags' column to set flag(s) with 

#!define FLB_LCR_SPECIAL 19
modparam("lcr", "flags_avp", "$avp(lcr_gw_flags)")
...
if(!load_gws(1, $rU)) {
    ...
}

# Set the branch flags according to the LCR flags column value
$bf=$avp(lcr_gw_flags);
...
if(isbflagset(FLB_LCR_SPECIAL)) {
    append_hf("Privacy: id\r\n");
}

Note that the flags column is the integer representation of the flag so the 
19th bit is 524288 in the flags column.

I do this for LCR as well. -A

-- 
Anthony - https://messinet.com/ - https://messinet.com/~amessina/gallery
F9B6 560E 68EA 037D 8C3D  D1C9 FF31 3BDB D9D8 99B6
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20170110/e2e59b53/attachment.sig>


More information about the sr-users mailing list