[asterisk-users] cmd SET time value

Tim St. Pierre tim at communicatefreely.net
Thu Sep 7 22:53:51 MST 2006


I had to do the same thing for Goto().  Perhaps there is a limitation when 
using the pipe character in variables.  That's a bit of a nuisance.



On September 8, 2006 01:33, Benjamin Jacob wrote:
> 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/${ARG
>1})}
>
> |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,dialExt
> >>>en)
> >>>
> >>> ;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
>
> _______________________________________________
> --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

-- 
Tim St. Pierre

IP telephony specialist
sip://5101@communicatefreely.net
Toronto: 647 722 6930
Toll-Free 1 888 488 6940
tim at communicatefreely.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20060907/2ca0984d/attachment.pgp


More information about the asterisk-users mailing list