[asterisk-users] cmd SET time value

Benjamin Jacob benjamin.jacob at masconit.com
Thu Sep 7 22:33:06 MST 2006


Ok, Had to work around this one. An innefficient implementation, but 
here goes :

================
exten => 
s,n(getFwdTime),Set(fwdTimeHrsMins=${DB(CFWDTimeHrsMins/${ARG1})}) ;

exten => s,n(getFwdTime),Set(${IF(${LEN(${fwdTimeHrsMins})} >         
          
                                     
0?fwdTimeDays=${DB(CFWDTimeDays/${ARG1})}|fwdTimeDay=${DB(CFWDTimeDay/${ARG1})}
                                    
|fwdTimeMonths=${DB(CFWDTimeMonths/${ARG1})})})

exten => 
s-dialFwdTime,1,GotoIfTime(${fwdTimeHrsMins}|${fwdTimeDays}|${fwdTimeDay}|${fwdTimeMonths}?s-dialFwd,1) 


==========

Basicaly, am storing individual entries of time, and putting them back 
together in GotoIftime.

If anyone's got a better solution, lemme know.


cheerz.
Ben.

Benjamin Jacob wrote:

> Nope Tim,
> had tried that already, duznt work.
> Here's the cli output
> =======================
> Executing Set("SIP/4000-097afc90", "fwdTime=*|mon-tue|*|*") in new stack
> Sep  7 12:22:20 WARNING[24964]: pbx.c:6062 pbx_builtin_setvar: 
> Ignoring entry 'mon-tue' with no = (and not last 'options' entry)
> Sep  7 12:22:20 WARNING[24964]: pbx.c:6062 pbx_builtin_setvar: 
> Ignoring entry '*' with no = (and not last 'options' entry)
> ==================
> with my macro line being
> exten => s,n(getFwdTime),Set(fwdTime='${DB(CFWDTime/${ARG1})}')
>
> Ben.
>
> Tim St. Pierre wrote:
>
>> _______________________________________________
>> --Bandwidth and Colocation provided by Easynews.com --
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>>  
>>
>>
>> ------------------------------------------------------------------------
>>
>> Date:
>> Thu, 7 Sep 2006 00:28:20 -0500
>>
>>
>> ------------------------------------------------------------------------
>>
>> Single quotes   -> ' <-  work when I set other variables that contain 
>> special characters.  Give that a try,
>>
>> -Tim
>>
>> On September 6, 2006 23:18, Benjamin Jacob wrote:
>>  
>>
>>> Hello ppl,
>>>
>>> Ive a couple of macros defined to call fwd based on time to a
>>> number/voicemail.
>>> Very elementary.
>>>
>>> =========================
>>> 11. [macro-dialexten]
>>> 12. exten => s,1,Dial(SIP/${ARG1})   ;
>>>
>>> 1. [macro-stdpbx1exten]
>>> 2. exten => s,1,Set(fwdedNum=${DB(CFWD/${ARG1})})
>>>
>>> 3. exten => s,n,GotoIf(${fwdedNum}?getFwdTime:dialExten)
>>>
>>> 4. exten => s,n(getFwdTime),Set(fwdTime="${DB(CFWDTime/${ARG1})}") ;
>>>
>>> 5. exten => s,n,GotoIf("${fwdedNum}" !=
>>> "VoiceMail"?s-dialFwdTime,1:s-vmFwdTime,1) ; goto VoiceMail or dial
>>> Fwded num
>>>
>>> 6. exten => s,n(dialExten),Macro(dialexten,${ARG1}) ; dial Called exten
>>>
>>> 7. exten =>
>>> s-vmFwdTime,1,GotoIfTime("${fwdTime}"?s-vmFwdTime,vmFwd:s,dialExten) 
>>> ;if
>>> fwdTime not set or time matches,
>>>
>>> ;send to VM, else dialExten
>>> 8. exten => s-vmFwdTime,n(vmFwd),VoiceMail(${ARG1})
>>>
>>> 9. exten =>
>>> s-dialFwdTime,1,GotoIfTime("${fwdTime}"?s-dialFwdTime,dialFwd:s,dialExten) 
>>>
>>> ;if fwdTime not set or time matches,
>>>
>>> ; call fwdedNum, else dialExten
>>> 10. exten => s-dialFwdTime,n(dialFwd),Macro(dialexten,${fwdedNum})
>>>
>>> ===================================
>>>
>>> I save the fwdedNum in DB, and also the fwding time.
>>> Now, when i retrieve the time value from db and set it, using cmd SET,
>>> it takes only the initial part of the time value string.
>>> e.g. if time to be checked is *|mon-tue|*|*, the time set is "*" ONLY!!
>>>
>>> The cmd Set's syntax uses the | (pipe) notation to separate variables.
>>> Thats why this behaviour.
>>> Any work around this guys??
>>>
>>> Thanks in advance
>>>
>>> Ben.
>>>
>>>
>>> _______________________________________________
>>> --Bandwidth and Colocation provided by Easynews.com --
>>>
>>> asterisk-users mailing list
>>> To UNSUBSCRIBE or update options visit:
>>>   http://lists.digium.com/mailman/listinfo/asterisk-users
>>>   
>>
>>
>>  
>>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>


More information about the asterisk-users mailing list