Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Gotoif($[${LEN(${CALLERID(number)})} != 4]?true) doesn't work...


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
positivelyoptimistic a...
Guest





PostPosted: Wed Jul 02, 2014 10:58 am    Post subject: [asterisk-users] Gotoif($[${LEN(${CALLERID(number)})} != 4]? Reply with quote

Greetings,


I'm hoping that an extra pair of eyes might help me to solve a challenge...


Anyone have any idea why the following would not work?  I'm trying to test for a callerid value that is 4 digits in length..  






exten => s,1,NoOp(CLID is ${CALLERID(all)})
exten => s,n,Gotoif($[${LEN(${CALLERID(number)})} != 4]?true)
exten => s,n,NoOp(Value is False)
exten => s,n,Hangup
exten => s,n(true),NoOp(Value is True)
exten => s,n,Hangup
Back to top
support at drdos.info
Guest





PostPosted: Wed Jul 02, 2014 11:07 am    Post subject: [asterisk-users] Gotoif($[${LEN(${CALLERID(number)})} != 4]? Reply with quote

Positively Optimistic wrote:
Quote:
Anyone have any idea why the following would not work? I'm trying to
test for a callerid value that is 4 digits in length..

Differences between yours and mine:

Yours:
Gotoif($[${LEN(${CALLERID(number)})} != 4]?true)

Mine:
Gotoif($["${LEN(${get-admin-password})}" < "1"]?2:4)

Doug


--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
positivelyoptimistic a...
Guest





PostPosted: Wed Jul 02, 2014 11:19 am    Post subject: [asterisk-users] Gotoif($[${LEN(${CALLERID(number)})} != 4]? Reply with quote

Thanks Doug!!  I appreciate  your response..  it sent me looking in the right direction.  The following yielded the results I was looking for.

Gotoif($["${LEN(${CALLERID(number)})}" != "4"]?true)



I very much appreciate your response.  


-Joe
Dothan, AL



On Wed, Jul 2, 2014 at 11:07 AM, Doug Lytle <support@drdos.info (support@drdos.info)> wrote:
Quote:
Positively Optimistic wrote:
Quote:
Anyone have any idea why the following would not work?  I'm trying to test for a callerid value that is 4 digits in length..


Differences between yours and mine:

Yours:
Gotoif($[${LEN(${CALLERID(number)})} != 4]?true)


Mine:
Gotoif($["${LEN(${get-admin-password})}" < "1"]?2:4)

Doug


--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
              http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
asterisk.org at sedwar...
Guest





PostPosted: Wed Jul 02, 2014 12:37 pm    Post subject: [asterisk-users] Gotoif($[${LEN(${CALLERID(number)})} != 4]? Reply with quote

Please don't top post.

Quote:
On Wed, Jul 2, 2014 at 11:07 AM, Doug Lytle <support@drdos.info> wrote:

Differences between yours and mine:

Yours:
Gotoif($[${LEN(${CALLERID(number)})} != 4]?true)

Mine:
Gotoif($["${LEN(${get-admin-password})}" < "1"]?2:4)

On Wed, 2 Jul 2014, Positively Optimistic wrote:

Quote:
Thanks Doug!!  I appreciate  your response..  it sent me looking in the
right direction.  The following yielded the results I was looking for.

Quote:
Gotoif($["${LEN(${CALLERID(number)})}" != "4"]?true)

Here's a snippet from one of my (1.2) dialplans:

gotoif($[${LEN(${EXTEN})} < 10] ?add-npa,${EXTEN},1)

So are the quotes now a requirement? (Quotes makes it look like you are
comparing strings instead of numbers to my old eyes.)

--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards sedwards@sedwards.com Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
support at drdos.info
Guest





PostPosted: Thu Jul 03, 2014 6:29 am    Post subject: [asterisk-users] Gotoif($[${LEN(${CALLERID(number)})} != 4]? Reply with quote

Steve Edwards wrote:
Quote:

So are the quotes now a requirement?

It looks like quotes are only a requirement on strings. In the original
post, the only difference I can see, compared to the snippet of my
dialplan without quoting, is that I'm not using the != comparison.
Whereas it seems to work okay on strings:


exten => s,n,GotoIf($[${LEN(${source})} = 4 ]?4digits,1:6)
exten => s,n,GotoIf($[${LEN(${source})} = 10 ]?10digits,1:7)
exten => s,n,GotoIf($[${LEN(${source})} = 14 ]?14digits,1:7)

exten => s,n,GotoIf($["${get-room-num}" = "99999"]?s-verify,1:s,5)

exten => s,n,GotoIf($["${TODAY}" = "${ISTODAY}"]?s,7:s,5)
exten => s,n,GotoIf($["${set.transfer}" = "N"]?s,17:s,16)
exten => 3,1,GotoIf($["${set.transfer}" = "N"]?i,1:3,2)

Doug

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services