Re: [SR-Users] Diversion header authentication

2013-04-10 Thread Morten Isaksen
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

Re: [SR-Users] Diversion header authentication

2013-04-09 Thread Daniel-Constantin Mierla
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

Re: [SR-Users] Diversion header authentication

2013-04-09 Thread Morten Isaksen
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