Hi,
Try to give is_user_in() the whole URI as in sip:username@domain or just
username@domain. I am not sure what format it expects.
/Morten
On Wed, Apr 10, 2013 at 12:03 PM, phillman25 wrote:
>
> Thank you Daniel and Morten for your assistance and prompt reply.
>
> To use the tobody transform
Thank you Daniel and Morten for your assistance and prompt reply.
To use the tobody transformation, i see that i would need to upgrade to 4.1
right? Im currently on 3.3.
I tried the below code:
$var(i)=0;
while($(hdr(Diversion)[$var(i)]) != $null )
Hello,
just adding that the tobody transformation could be handy to extract the
user or uri part of a Diversion header, not to fight with subst expressions:
-
http://www.kamailio.org/wiki/cookbooks/devel/transformations#to-body_transformations
Cheers,
Daniel
On 4/9/13 3:16 PM, Morten Isaks
Hi,
I have not tested this, but try:
$avp(s:divhdr) = $(hdr(Diversion)[$var(i)]);
avp_subst("$avp(s:divhdr)", "/.*sip:\+45(.*)(@.*)/\1/"); # Extract number
between +45 and @
if (is_user_in("$avp(s:divhdr)", "1") { ... }
Please note that there can be more than one Diverseion header. In that case
Dear List
I am currently using the group module to authenticate inbound calls using
the From header using the below code:
if (!is_user_in("From", "1")) {
sl_send_reply("403", "NOT ALLOWED");
exit;
};
};
I want to now authenticate the Diversion header,