On April 21, 2008 11:33:02 am Anastasia LePlume wrote:
> exten => 6474763667,n,Set(EXPIRYDATEVALUE=${DB(CT/${CALLERID(num)})})
> exten => 6474763667,n,GotoIf($[${ISNULL(${EXPIRYDATEVALUE})}]?:continue)
> exten => 6474763667,n,Set(DB(CT/${CALLERID(num)})=$[${EPOCH} + 604800])
> This problem keeps happening and ill change the values and they just keep
> changing back or changing to something else. Oh another thing... the values
> seem to sometimes change to values I know I have entered but NOT EVER for
> the caller ID which will have it.
Well, from the snippet above, I can guess at a few things that may be wrong.
First, you need to make sure that CALLERID(number) (not num) is valid. I ran
into a similar problem with my "cheap-ass follow-me" implementation. I check
to make sure that CALLERID(number) is not blank, is 10 digits, and is not ten
zeroes. If any of these tests fail, I look up a 'none' key instead of
CALLERID(number).
Now that your Caller*ID is sanitized, don't use ISNULL. Perhaps it is my SQL
experience, but blank != NULL. I use DB_EXISTS so I can do something if the
database entry doesn't exist, and I have ${DB_RESULT} if it did.
> Is someone cracking my system?
Occam's razor and all that, I would say no, it's just something you're doing
wrong. :-)
Here's my stupid-simple follow-me: I will ring either mine, my wife's, both,
or neither of or cell phones, depending on the incoming caller ID. That way
her friends find her, my friends find me, and telemarketers find neither of
us. :-)
; looks up the caller*id/origexten combo in the 'trycell' astdb to see if it
; should call a cell phone or not. possible values are 'andrew' or 'alina'
or 'both'
; if caller*id isn't 10 digits, or if it's 10 zeroes, try to lookup
; "trycell/origexten-none" -- this is done so that I can optionally call a
cell for
; blocked caller ID.
; if trycell/${ORIGEXTEN}-${CID} or trycell/${ORIGEXTEN}-none does not exist,
; try trycell/${ORIGEXTEN}-default.
; if I still don't have a valid cell to call, just go to voicemail.
; eventually I'd like to have the option to call andrew/alina/both or,
; if the key does not match any of those, whatever the result is.
; e.g. trycell/5195551212 => 5191234567 would have the system dial
; SIP/[EMAIL PROTECTED] if the house was called from 5195551212.
exten => trycell,1,NoOp(About to try cell phones for "${ORIGEXTEN}"
from "${CALLERID(number)}")
exten => trycell,n,GotoIf($[ "${ORIGEXTEN}" != "" ]?gotorigexten)
exten => trycell,n,Set(ORIGEXTEN=5195551234)
exten => trycell,n(gotorigexten),GotoIf($[ ${LEN(${CALLERID(number)})} =
10 ]?goodcid)
exten => trycell,n,GotoIf($[ ${CALLERID(number)} != 0000000000]?goodcid)
exten => trycell,n(badcid),GotoIf($[ ${DB_EXISTS(trycell/${ORIGEXTEN}-none)} =
0 ]?trydef)
exten =>
trycell,n(goodcid),GotoIf($[${DB_EXISTS(trycell/${ORIGEXTEN}-${CALLERID(number)})}
= 1 ]?parse)
exten => trycell,n(trydef),GotoIf($[${DB_EXISTS(trycell/${ORIGEXTEN}-default)}
= 0 ]?vm,1)
exten => trycell,n(parse),NoOp(trycell: DB_RESULT is "${DB_RESULT}")
exten => trycell,n,GotoIf($[ ${DB_RESULT} = alina ]?alina)
exten => trycell,n,GotoIf($[ ${DB_RESULT} = andrew ]?andrew)
exten => trycell,n,GotoIf($[ ${DB_RESULT} = both ]?both)
exten => trycell,n,NoOp(weird result from DB: "${DB_RESULT}", ignoring)
exten => trycell,n,Goto(vm,1)
exten => trycell,n(alina),Set(CELLDEST=${ALINACELL})
exten => trycell,n,Goto(dial)
exten => trycell,n(andrew),Set(CELLDEST=${ANDREWCELL})
exten => trycell,n,Goto(dial)
exten => trycell,n(both),Set(CELLDEST=${ANDREWCELL}&${ALINACELL})
exten => trycell,n(dial),NoOp(Trying to dial ${CELLDEST})
exten => trycell,n,Playback(pls-wait-connect-call,noanswer)
exten => trycell,n,Wait(0.5)
exten => trycell,n,Answer()
exten => trycell,n,Dial(${CELLDEST},24,grtk)
exten => trycell,n,GotoIf($[ ${DIALSTATUS} = ANSWER ]?h,1)
exten => trycell,n,GotoIf($[ ${DIALSTATUS} = NOANSWER ]?vm,1)
exten => trycell,n,NoOp(trycell: called cell, but got odd dialstatus
(${DIALSTATUS}))
exten => trycell,n,Goto(h,1)
*CLI> database show
/trycell/5195551234-5191234567 : alina
/trycell/5195551234-5190987654 : andrew
/trycell/5195551234-5195874321 : andrew
/trycell/5195551234-5190012345 : alina
/trycell/5195551234-5190987863 : andrew
/trycell/5195551234-5191232123 : andrew
/trycell/5195555678-default : andrew
/trycell/5195555678-none : andrew
Hope that helps...
-A.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]