You can do string transformation the way you like 

see here : 
http://www.opensips.org/Resources/DocsCoreTran

For example {s.int}  returns integer value of a string-represented number.

Also see the complete syntax for a pseudo variable here: 
http://www.opensips.org/Resources/DocsCoreVar


// Binan.



________________________________
 Från: Engineer voip <forvo...@gmail.com>
Till: OpenSIPS users mailling list <users@lists.opensips.org> 
Skickat: torsdag, 18 oktober 2012 17:51
Ämne: Re: [OpenSIPS-Users] Transfering a call by opensips
 

Hi,
I have resolved my probleme,  now i stocked this time 2012-10-18  17:50:00 in 
usr_preferences table 
and i want to convert it to seconds
wa can convert the current time to secondes by using $Ts but i don't know if is 
possible to convert a precise that like 2012-10-18  17:50:00

someone know how do it?


2012/10/18 Engineer voip <forvo...@gmail.com>

Hi,
>I trying to do that with avpops module and usr_preferenses table.
>my script is:
>
>if ( avp_db_load("$ru/username","a") ) 
>                        {
>                          xlog("L_INFO", " ------------- OFF LINE FORWARD 
>phone number: $avp(s:callfwd)\n");
>                          xlog("L_INFO", " ------------- OFF LINE FORWARD from 
>time: $avp(s:from_time)\n");
>                          xlog("L_INFO", " ------------- OFF LINE FORWARD TO 
>time: $avp(s:to_time)\n");
>                          xlog("L_INFO", "method <$rm> Transforwarding Call 
>from <$fu> r-uri <$ru>\n");
>                        
>                        
>                           if(  avp_check("$avp(s:from_time)", "ge/s:10") ) 
>                            {
>                               $ru = $avp(callfwd);
>                               route(13);
>                            }
>
>
>
>
>
>
>but the result is: 
> 
>                        ------------- OFF LINE FORWARD phone number:  12
>                        ------------- OFF LINE FORWARD from time:  14
>                        ------------- OFF LINE FORWARD TO time:  <nul>
>
>Why i get 12 instead of callfwd value   ??
>
>
>2012/10/18 Engineer voip <forvo...@gmail.com>
>
>Hi Muhammad,
>>
>>I think dynamic routing is used only to routing outgoing calls but me i want 
>>to routing an incomming calls to user C between 11h and 14h when the user A 
>>called him.
>> (user A is an external user and B is an User registred on My opensips)
>>
>>
>>
>>2012/10/18 Muhammad Shahzad <shaherya...@googlemail.com>
>>
>>Binan, avp db is usually used for temporary data storage e.g. To share some 
>>value between two call session etc. So while avp db can be used for this but 
>>then you need to make sure you never call avp db clear in your script.
>>>Secondly you can use drouting to route any call, not just calls to gw. You 
>>>need to create rule that call should not be routed to user B during 11h to 
>>>14h. So drouting lookup will fail. Then you check in alias db which will 
>>>tell you user c is alias to user b and you can then route call to user c. 
>>>This way you can create N x N drouting to alias rules.
>>>Thank you.
>>>
>>>On Oct 18, 2012 10:34 AM, "Binan AL Halabi" <binanalhal...@yahoo.com> wrote:
>>>>
>>>Hi,
>>>>Add them as Attribute and Value(opensipsctl avp add ....... ): Add them as 
>>>>two separate AVP. 
>>>>
>>>>Then load them in your script as AVP (avp_db_load function).
>>>>
>>>>
>>>>
>>>>// Binan
>>>>
>>>>
>>>>
>>>>________________________________
>>>> Från: Engineer voip <forvo...@gmail.com>
>>>>Till: Binan AL Halabi <binanalhal...@yahoo.com>; OpenSIPS users mailling 
>>>>list <users@lists.opensips.org> 
>>>>Skickat: torsdag, 18 oktober 2012 10:21
>>>>Ämne: Re: [OpenSIPS-Users] Transfering a call by opensips
>>>> 
>>>>
>>>>Hi,
>>>>
>>>>I don't have the fields in user_preferences  table or i add them ?
>>>>
>>>>
>>>>2012/10/18 Binan AL Halabi <binanalhal...@yahoo.com>
>>>>
>>>>Hi,
>>>>>
>>>>>Store in usr_preferences table the time_from and time_to
>>>>>then read them in your script using avpops module 
>>>>>Take the hour of the call and compare it to the range you got it from 
>>>>>database.
>>>>>
>>>>>http://www.opensips.org/html/docs/modules/1.7.x/avpops.html
>>>>>
>>>>>// Binan  
>>>>>
>>>>>
>>>>>
>>>>>________________________________
>>>>> Från: Engineer Voip <forvo...@gmail.com>
>>>>>Till: users@lists.opensips.org 
>>>>>Skickat: torsdag, 18 oktober 2012 8:53
>>>>>Ämne: [OpenSIPS-Users] Transfering a call by opensips
>>>>> 
>>>>>
>>>>>Hello all, 
>>>>>I want to transfert the call to user C when user A calls user B in 
>>>>>interval of time for example: 11h-14h
>>>>>I can do that by asterisk but i prefer to do it by opensips
>>>>>It's possible to do that by opensips?
>>>>>
>>>>>Cordialement. 
>>>>>Envoyé de mon iPhone
>>>>>
>>>>>_______________________________________________
>>>>>Users mailing list
>>>>>Users@lists.opensips.org
>>>>>http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>>
>>>>>
>>>>>
>>>>>_______________________________________________
>>>>>Users mailing list
>>>>>Users@lists.opensips.org
>>>>>http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>>
>>>>>
>>>>
>>>>
>>>>-- 
>>>>
>>>>Best Regards.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>_______________________________________________
>>>>Users mailing list
>>>>Users@lists.opensips.org
>>>>http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>>>
>>>_______________________________________________
>>>Users mailing list
>>>Users@lists.opensips.org
>>>http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>
>>
>>-- 
>>
>>Best Regards.
>>
>>
>>
>
>
>-- 
>
>Best Regards.
>
>
>


-- 

Best Regards.



_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to