Hi all, I have the following in my extensions.conf: exten => s,4,GotoIf($["${CALLERID(number)}" = "8585979857" | "8585970327"]?15:5) The numbers listed above are known spammer numbers. However, when I call from any other CALLERID, it still directs me to s,15 which is the Hangup() application. Here are logs from the asterisk CLI: -- Executing [8995@fromlime:1] Macro("IAX2/lime-3", "forward|SIP/8995&SIP/31337|15|8995|IAX2/limemed@lime/13476681546") in new stack -- Executing [s@macro-forward:1] Zapateller("IAX2/lime-3", "answer|nocallerid") in new stack -- Executing [s@macro-forward:2] PrivacyManager("IAX2/lime-3", "") in new stack -- CallerID Present: Skipping -- Executing [s@macro-forward:3] Wait("IAX2/lime-3", "1") in new stack -- Executing [s@macro-forward:4] GotoIf("IAX2/lime-3", "("8585970327")?15:5") in new stack -- Goto (macro-forward,s,15) -- Executing [s@macro-forward:15] Hangup("IAX2/lime-3", "") in new stack == Spawn extension (macro-forward, s, 15) exited non-zero on 'IAX2/lime-3' in macro 'forward' == Spawn extension (macro-forward, s, 15) exited non-zero on 'IAX2/lime-3' -- Hungup 'IAX2/lime-3' Thank you for any assistance. - sf
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Steve Finkelstein wrote:> Hi all, > > I have the following in my extensions.conf: > > exten => s,4,GotoIf($["${CALLERID(number)}" = "8585979857" | > "8585970327"]?15:5) > > The numbers listed above are known spammer numbers. However, when I call > from any other CALLERID, it still directs me to s,15 which is the > Hangup() application. Here are logs from the asterisk CLI:You have two problems there: 1. You have CALLERID(number), which I'm pretty sure should be CALLERID(num). 2. You are trying to combine two values with the | operator to check them both against CALLERID(num). It can't be used that way. You have to have two sets of comparisons. Here's how the line should look: exten => s,4,GotoIf($["${CALLERID(num)}" = "8585979857" | "${CALLERID(num)}" = "8585970327"]?15:5) TTYL.> -- Executing [8995@fromlime:1] Macro("IAX2/lime-3", > "forward|SIP/8995&SIP/31337|15|8995|IAX2/limemed@lime/13476681546") in > new stack > -- Executing [s@macro-forward:1] Zapateller("IAX2/lime-3", > "answer|nocallerid") in new stack > -- Executing [s@macro-forward:2] PrivacyManager("IAX2/lime-3", "") > in new stack > -- CallerID Present: Skipping > -- Executing [s@macro-forward:3] Wait("IAX2/lime-3", "1") in new stack > -- Executing [s@macro-forward:4] GotoIf("IAX2/lime-3", > "("8585970327")?15:5") in new stack > -- Goto (macro-forward,s,15) > -- Executing [s@macro-forward:15] Hangup("IAX2/lime-3", "") in new stack > == Spawn extension (macro-forward, s, 15) exited non-zero on > 'IAX2/lime-3' in macro 'forward' > == Spawn extension (macro-forward, s, 15) exited non-zero on 'IAX2/lime-3' > -- Hungup 'IAX2/lime-3'- -- C. Chad Wallace, B.Sc. The Lodging Company http://www.skihills.com/ OpenPGP Public Key ID: 0x262208A0 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGbuUBKeSNHCYiCKARAlPVAKCBYdUm4nRQd4clYphLg4bOzjeRrgCgxIgs inueeqMYByPtpNDFgypNgLo=Z7qz -----END PGP SIGNATURE-----
On Tue, 12 Jun 2007, Steve Finkelstein wrote:> Hi all, > > I have the following in my extensions.conf: > > exten => s,4,GotoIf($["${CALLERID(number)}" = "8585979857" | > "8585970327"]?15:5) > > The numbers listed above are known spammer numbers. However, when I call > from any other CALLERID, it still directs me to s,15 which is the > Hangup() application. Here are logs from the asterisk CLI:I'm not convinced the parser is clever enough to do a comparison on 2 different right-hand-sides... Split it into 2 different statements, and USE n rather than absolute line numbers: exten => s,n,GotoIf($["${CALLERID(number)}" = "8585979857"]?bad) exten => s,n,GotoIf($["${CALLERID(number)}" = "8585970327"]?bad) ... exten => s,n(bad)Hangup() If you use the 'n' mechanism to number lines then you can trivially add in more tests for spammers numbers without having to renumber every time. (although this may not ultimately be the best way to do it, it is easy for a few simple cases) Gordon
Steve Finkelstein wrote:> Hi all, > > I have the following in my extensions.conf: > >I use the mysql addon and create a subroutine that checks for black listed numbers. I then call it at each entry point (For faxes as well): ; ************** ; Auto attendant ; ************** exten => 734xxxxxxx,1,Gosub(check-blacklist,s,1) exten => 734xxxxxxx,n,NoOP(Caller not blacklisted) exten => 734xxxxxxx,n,Set(CALLERID(number)=91${CALLERIDNUM}) exten => 734xxxxxxx,n,Goto(auto_attend,s,1) [check-blacklist] exten => s,1,MYSQL(Connect connid localhost anonymous '' blacklisted) exten => s,2,MYSQL(Query resultid ${connid} SELECT flag FROM BlackNumbers WHERE phone = ${CALLERIDNUM}) exten => s,3,MYSQL(Fetch fetchid ${resultid} results) exten => s,4,MYSQL(Disconnect ${connid}) exten => s,5,MYSQL(Clear ${resultid}) exten => s,6,Set(BLACKLISTED=${results}) exten => s,7,GotoIf($["${BLACKLISTED}" = "YES"]?blacklisted,s,1) exten => s,8,Return [blacklisted] exten => s,1,NoOP(Caller: ${CALLERIDNUM} is on the black list) exten => s,n,SetCDRUserField(Blacklisted) exten => s,n,Set(PRI_CAUSE=17) exten => s,n,Hangup() -- Ben Franklin quote: "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."
Steve Finkelstein wrote:> Hi all, > > I have the following in my extensions.conf: > > exten => s,4,GotoIf($["${CALLERID(number)}" = "8585979857" | > "8585970327"]?15:5) > > The numbers listed above are known spammer numbers. However, when I call > from any other CALLERID, it still directs me to s,15 which is the > Hangup() application. Here are logs from the asterisk CLI: > > -- Executing [8995@fromlime:1] Macro("IAX2/lime-3", > "forward|SIP/8995&SIP/31337|15|8995|IAX2/limemed@lime/13476681546") in > new stack > -- Executing [s@macro-forward:1] Zapateller("IAX2/lime-3", > "answer|nocallerid") in new stack > -- Executing [s@macro-forward:2] PrivacyManager("IAX2/lime-3", "") > in new stack > -- CallerID Present: Skipping > -- Executing [s@macro-forward:3] Wait("IAX2/lime-3", "1") in new stack > -- Executing [s@macro-forward:4] GotoIf("IAX2/lime-3", > "("8585970327")?15:5") in new stack > -- Goto (macro-forward,s,15) > -- Executing [s@macro-forward:15] Hangup("IAX2/lime-3", "") in new stack > == Spawn extension (macro-forward, s, 15) exited non-zero on > 'IAX2/lime-3' in macro 'forward' > == Spawn extension (macro-forward, s, 15) exited non-zero on 'IAX2/lime-3' > -- Hungup 'IAX2/lime-3' > > > Thank you for any assistance. > > - sf > _______________________________________________ > --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; ; 99% of the calls originating from 8xx #'s are telemarketers -- ; the hell with that -- shitlist em. ; exten => s,15,GotoIf($["${CALLERID(num):0:3}" = "877"]?shitlisted,s,1:16) exten => s,16,GotoIf($["${CALLERID(num):0:3}" = "800"]?shitlisted,s,1:17) exten => s,17,GotoIf($["${CALLERID(num):0:3}" = "866"]?shitlisted,s,1:18) exten => s,18,GotoIf($["${CALLERID(num):0:3}" = "855"]?shitlisted,s,1:19) exten => s,19,GotoIf($["${CALLERID(num):0:3}" = "888"]?shitlisted,s,1:20) -- -- This is my signature. There are many like it, but this one is mine.. -- http://www.catb.org/~esr/faqs/smart-questions.html http://video.google.com/videoplay?docid=-4312730277175242198 http://video.google.com/videoplay?docid=786048453686176230 http://video.google.com/videoplay?docid=-6708190071483512003 -------------------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: OpenPGP digital signature Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20070613/d524df6e/signature.pgp