[OpenSIPS-Users] dialog timeout_avp issue

Bogdan-Andrei Iancu bogdan at opensips.org
Tue Mar 29 16:24:20 CEST 2011


Hi Chris,

the avp_db_load() loads the value into avp(s:maxtime) as string value 
and you pass it as string to $avp(i:10).

The dialog module expects an integer value in the $avp(i:10) variable, 
so do:

If (is_method(“INVITE”)){

avp_db_load(“$ru”,”$avp(s:maxtime)”);

$avp(i:10)=$(avp(s:maxtime){s.int});

setflag(6);

}

Regards,
Bogdan

Chris Martineau wrote:
>
> Hi,
>
> Using timeout_avp option in dialog module for prepay call termination.
>
> If I do the following it works fine...
>
> If (is_method(“INVITE”)){
>
> $avp(i:10)=120;
>
> setflag(6);
>
> }
>
> Call terminates after 120seconds
>
> If (is_method(“INVITE”)){
>
> $var(a)=120;
>
> $avp(i:10)=$var(a);
>
> setflag(6);
>
> }
>
> Works...
>
> If (is_method(“INVITE”)){
>
> $avp(s:test)=120;
>
> $avp(i:10)=$avp(s:test);
>
> setflag(6);
>
> }
>
> Works...
>
> If (is_method(“INVITE”)){
>
> avp_db_load(“$ru”,”$avp(s:maxtime)”);
>
> $avp(i:10)=$avp(s:maxtime);
>
> setflag(6);
>
> }
>
> Doesn’t work. Maxtime being an attribute set in usr_preferences of type 0.
>
> If I log the values $avp(i:10) and $avp(s:maxtime) the values have all 
> been set correctly but the timeout just doesn’t happen. Looking at the 
> dialog entry the timeout has just assumed the default_timeout value.
>
> Any ideas?
>
> Many thanks
>
> Chris
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   


-- 
Bogdan-Andrei Iancu
OpenSIPS eBootcamp - 2nd May 2011
OpenSIPS solutions and "know-how"




More information about the Users mailing list