[Users] manipulate $from under avops module

Brandon Price brandon.price at hostrocket.com
Thu Oct 13 01:59:12 CEST 2005


Thank you. Can you give myself and rest of the community a working  
example of how to use avp_subst() to strip the first character? It  
would be greatly appreciated. Also it seems inefficient I'm basically  
taking the $to, storing it in a var, them manipulating that var, and  
using that in my avp_db_load(). How taxing is that in comparison to  
just directly manipulating the var somehow then using that in the  
avp_db_load()? Honest question.

On Oct 12, 2005, at 7:27 PM, Daniel-Constantin Mierla wrote:

> Hello,
>
> you have to write the From URI in an avp, then use the avp_subst()  
> to strip the first char. Afterwards,you can use the result in  
> avp_db_load(). All these are possible with the latest CVS version  
> of openser.
>
> Cheers,
> Daniel
>
>
> On 10/13/05 00:04, Brandon Price wrote:
>
>> I am having some trouble with avpops and the from variable. I am  
>> doing something like
>>
>> avp_db_load("$to","$disabled");
>>
>> which produces a query like
>> select value,attribute,type from usr_preferences where  
>> username='+15183207486' AND attribute='50'
>> the problem is I need a query like select value,attribute,type  
>> from usr_preferences where username='15183207486' AND  
>> attribute='50' ,without the "+"
>> is there any way I can strip the 1st digit from the $from  
>> variable? I have already tried using strip(1);
>>
>> As always any help greatly appreciated.
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at openser.org
>> http://openser.org/cgi-bin/mailman/listinfo/users
>>
>





More information about the Users mailing list