[Serusers] Re: avpops module

Elena Ramona Modroiu ramona at voice-system.ro
Wed Jan 19 11:31:47 CET 2005


Hi Richard,

Richard wrote:

>Hi Elena,
>
>I have a few questions in regards to avpops. Hope that you can help.
>
>1. When avp_pushto() is used, the ruri is only used when t_relay is called.
>However the uri match can't match the regular expression correctly. For
>example, I have this,
>
>	avp_write("sip:nobody at test.com", "s:default");
>	avp_pushto("$ruri", "s:default");
>	if (uri =~ "^sip:nobody@") {
>		xlog("L_INFO", "got nobody\n");
>	} else {
>		xlog("L_INFO", "didn't get nobody\n")
>	}
>
>It would say "didn't get nobody\n".
>
>If I run t_relay, then it is sent to sip:nobody at test.com.
>  
>
I run exactly the piece of script you sent and it worked as expected - I 
got " got nobody" :-) .
To do some extra checking, you can put avp_print() before doing push - 
it will dump all current avps.
Also, after avp_pushto(), insert a xdbg("ruri is %ru\n") to double check 
what's the RURI value.

>2. Is it possible to have a function to copy an avp to another avp? The
>application is this,
>tm module uses one avp to define the invite timer. If there are multiple
>timer values defined for different scenarios, we need to copy the value into
>the one used in tm module. For example,
>
>	s:pstn_invite=100, s:sip_invite=20,
>	If (the call is to pstn) {
>		avp_copy("s:pstn_invite", "s:callee_fr_inv_timer");
>	} else {
>		avp_copy("s:sip_invite", "s:callee_fr_inv_timer");
>	}
>
for the moment no. I'm planning such a functionality along with the 
possibility of doing several operations on the avp value 
(concatenation/sum, replacing, etc).

>3. For performance reasons, we'd like to group all user preference in one
>  
>
>domain in one mysql table. Is it possible to specify the table name with an
>avp?
>  
>
No, you cannot load the table name from an avp. For more complex 
database operations please take a look to database scheme functionality :
http://www.voice-system.ro/docs/avpops/ar01s05.html#db_scheme
http://www.siphub.net/docs/avpops/ar01s06.html#avp_db_load

>Regards,
>Richard
>
Regards,
Ramona




More information about the sr-users mailing list