Re: [asterisk-users] Help with FUNC_MATH

2020-02-13 Thread Dovid Bender
I found my mistake. I was running execif on the result. I needed to change: ExecIf(${MATH(${HOUR_SELECTED}<11)}?Set(HOUR_SELECTED=${MATH(${HOUR_SELECTED}+12,int)})) TO: ExecIf($["${MATH(${HOUR_SELECTED}<11)}" == "TRUE"]?Set(HOUR_SELECTED=${MATH(${HOUR_SELECTED}+12,int)})) On Thu, Feb 13, 2020

Re: [asterisk-users] Help with FUNC_MATH

2020-02-13 Thread Don Kelly
-Commercial Discussion Subject: Re: [asterisk-users] Help with FUNC_MATH John, That is correct. I am trying to figure out why Asterisk is executing the set part of the execif, if it's coming back as false. On Thu, Feb 13, 2020 at 2:10 PM John Kiniston wrote: My Apologies Dovid, I

Re: [asterisk-users] Help with FUNC_MATH

2020-02-13 Thread Dovid Bender
John, That is correct. I am trying to figure out why Asterisk is executing the set part of the execif, if it's coming back as false. On Thu, Feb 13, 2020 at 2:10 PM John Kiniston wrote: > My Apologies Dovid, I think I misunderstood your request. > > You don't have the time you need to

Re: [asterisk-users] Help with FUNC_MATH

2020-02-13 Thread Don Kelly
in a comparison. From: asterisk-users [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Dovid Bender Sent: Thursday, February 13, 2020 1:08 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Help with FUNC_MATH HOUR_SELECTED is going to be 1

Re: [asterisk-users] Help with FUNC_MATH

2020-02-13 Thread John Kiniston
My Apologies Dovid, I think I misunderstood your request. You don't have the time you need to convert in the format of date string, Instead you have your users entering via DTMF when they want something to happen? On Thu, Feb 13, 2020 at 11:08 AM Dovid Bender wrote: > John, > > From looking at

Re: [asterisk-users] Help with FUNC_MATH

2020-02-13 Thread Dovid Bender
sk-users [mailto:asterisk-users-boun...@lists.digium.com] *On > Behalf Of *Dovid Bender > *Sent:* Thursday, February 13, 2020 4:47 AM > *To:* Asterisk Users Mailing List - Non-Commercial Discussion > *Subject:* [asterisk-users] Help with FUNC_MATH > > > > Hi, > > > > I hav

Re: [asterisk-users] Help with FUNC_MATH

2020-02-13 Thread Don Kelly
Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Help with FUNC_MATH Hi, I have some dialplan code that is trying to convert 12 hour time with AM/PM to 24 hour format. The code has something like this: Exten => 2,1,ExecIf(${MATH(${HOUR_SELECTED}<12)}?Set(HOUR_SE

Re: [asterisk-users] Help with FUNC_MATH

2020-02-13 Thread Dovid Bender
John, >From looking at the wiki won't STRFIME just give me what I need based on the unix time that I put in? What I am actually looking to do is convert over from 12 hour format to 24 (unless strftime does just that and I don't kow what am I am doing?). On Thu, Feb 13, 2020 at 12:03 PM John

Re: [asterisk-users] Help with FUNC_MATH

2020-02-13 Thread John Kiniston
Try using the STRFIME function instead of doing this by hand. https://wiki.asterisk.org/wiki/display/AST/Function_STRFTIME *%H* The hour as a decimal number using a 24-hour clock (range 00 to 23). *%I* The hour as a decimal number using a 12-hour clock (range 01 to 12). On Thu, Feb 13, 2020

[asterisk-users] Help with FUNC_MATH

2020-02-13 Thread Dovid Bender
Hi, I have some dialplan code that is trying to convert 12 hour time with AM/PM to 24 hour format. The code has something like this: Exten => 2,1,ExecIf(${MATH(${HOUR_SELECTED}<12)}?Set(HOUR_SELECTED=${MATH(${HOUR_SELECTED}+12,int)})) Earlier on in the dialplan HOUR_SELECTED is set to 12. When