[Users] Re: Avpops: avp_op() function
Daniel-Constantin Mierla
daniel at voice-system.ro
Tue Apr 25 15:50:32 CEST 2006
Hello,
the appropriate mailing list for openser is user at openser.org
The CSeq number is part of the header and is stored in AVP as a string.
You have to make a cast to integer/number and then perform the
operation. See avp_copy() for cast. The avp_op() operates only on avps
with integer value.
Cheers,
Daniel
On 04/21/06 13:30, Xavier TRENTIN wrote:
> Hi all,
> i'm using openser 1.0.0.
>
> I'm trying to use avpops' avp_op() function to add 100 to the Cseq
> value (just to test the avp_op() function).
>
> Here is the code inserted in ser.cfg:
>
> if (is_method("REGISTER"))
> {
> avp_printf("i:20","$hdr(CSeq)");
> xlog("L_INFO"," +*+ 1 : '$avp(i:20)'\n");
> avp_subst("i:20","/(.*) REGISTER/\1/");
> xlog("L_INFO"," +*+ 2 : '$avp(i:20)'\n");
> avp_op("i:20","add/i:0x1100100");
> xlog("L_INFO"," +*+ 3 : '$avp(i:20)'\n");
> }
>
> And here is the log:
> 3(19936) +*+ 1 : '6543 REGISTER'
> 3(19936) +*+ 2 : '6543'
> 3(19936) +*+ 3 : '6543'
>
> So the final result is 6543 instead of 6643...
>
> Can anybody tell me what I am doing wrong?
>
> Thanks in advance.
>
> Best Regards,
> Xavier.
>
> _______________________________________________
> Serusers mailing list
> Serusers at iptel.org
> http://mail.iptel.org/mailman/listinfo/serusers
>
More information about the Users
mailing list