Joseph Rothstein
2005-Oct-11 05:12 UTC
[Asterisk-Users] callerid validation and expression parser problems on Solaris 10
Greetings to All.
A little background about what I am trying to do, and please excuse the
length of this post.
I am setting up a voicemail (VM) system based on Asterisk. From what I've
heard Vonage uses Asterisk as their VM platform as well. I am running
1.2beta with a MYSQL backend for extensions and VM user info. All the sound
files and vm messages are being stored through an NFS mount externally. The
reason for this is that there will be several asterisk VM frontends, all
accessing the same config and vm user info as well as sounds files.
The customer's CALLERIDNUM is the same as their vm mailbox. I need to be
able to recognize when a customer calls his own mailbox, ie. when
CALLERIDNUM equals VMID (VM mailbox) so that the customer can be directed to
his or her vm mailbox. So far I have not been able to get this to work.
Here is what I have tried (the format may be strange to some, but this is
for insertion into the mysql db):
priority='1',app='Set',appdata='vmid=03413306999';
priority='2',app='Set',appdata='cid=03413306990';
priority='3',app='set',appdata='sanity=$[${vmid} =
${cid}]';
priority='4',app='noop',appdata='${sanity}';
priority='5',app='gotoif',appdata='$[${sanity}]?10:20';
priority='10',app='playback',appdata='vm-doesnotexist';
priority='11',app='Hangup',appdata='';
priority='20',app='playback',appdata='vm-intro';
-- Executing Set("SIP/10.10.13.110-00123d48",
"vmid=03413306999")
-- Executing Set("SIP/10.10.13.110-00123d48",
"cid=03413306999")
-- Executing set("SIP/10.10.13.110-00123d48",
"sanity=0")
-- Executing noop("SIP/10.10.13.110-00123d48", "0")
-- Executing gotoif("SIP/10.10.13.110-00123d48",
"0?10:20")
-- Goto (default,03413306999,20)
-- Executing playback("SIP/10.10.13.110-00123d48",
"vm-intro")
-- Playing 'vm-intro' (language 'en')
Call comes in, and the two variables are set. This has bee verified with
noop in previous attempts. Since I cannot spoof CALLERIDNUM, I am just
creating my own fake cid variable. I can also see CALLERIDNUM come in fine
so I can use this later.
Sanity is just a variable to keep track of whether or not cid and vmid are
equal. IN this case they are, so the statement is true, and sanity should be
equal to 1 as per the asrterisk variables and expressions wiki pages. But in
this case sanity=0 so the gotoif statement is false. Screwing the rest of
the vm routine. Gotoif works the way it should if I put in a zero (for
false), or 1 (for true), going to the appropriate lines. I have also tried
doing some arithmetic, but asterisk does not want to treat my variables as
numbers, and I get an op_minus overflow error.
It seems that there is a problem with Asterisk 1.2 and parsing expressions,
at least on Solaris 10. I have copied my config to Asterisk 1.0.9 running
SUSE, and it works flawlessly, just as expected. I am currently installing
1.2 on SUSE and will see if the same issue exists.
If anyone has come across this problem, and has a solution I would very much
appreciate any input.
Regards to all,
Joe
Joseph Rothstein, CCIE
Senior Network Engineer
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20051011/302b1e26/attachment.htm
trixter http://www.0xdecafbad.com
2005-Oct-11 06:10 UTC
[Asterisk-Users] callerid validation and expression parser problems on Solaris 10
On Tue, 2005-10-11 at 14:12 +0200, Joseph Rothstein wrote:> I am setting up a voicemail (VM) system based on Asterisk. From what > I've heard Vonage uses Asterisk as their VM platform as well. I am > running 1.2beta with a MYSQL backend for extensions and VM user info. > All the sound files and vm messages are being stored through an NFS > mount externally. The reason for this is that there will be several > asterisk VM frontends, all accessing the same config and vm user info > as well as sounds files. >By sound files do you mean the static 'enter your password' type files? You may do a lot better having those on the individual boxes to reduce the load on the network. If its static keep it on the box, as a general rule.> priority='5',app='gotoif',appdata='$[${sanity}]?10:20';goto 10 if true 20 if false [...]> > -- Executing set("SIP/10.10.13.110-00123d48", "sanity=0") >0 means false [...]> -- Goto (default,03413306999,20) >goes to 20 as you told it to> Sanity is just a variable to keep track of whether or not cid and vmid > are equal. IN this case they are, so the statementno they arent.> priority='1',app='Set',appdata='vmid=03413306999'; > priority='2',app='Set',appdata='cid=03413306990';6990 vs 6999> > If anyone has come across this problem, and has a solution I would > very much appreciate any input. > >Many times I have been victim of typos. My solution has always been to fix the typo then proceed. Hopefully that solution works for you too :)>-- Trixter http://www.0xdecafbad.com Bret McDanel UK +44 870 340 4605 Germany +49 801 777 555 3402 US +1 360 207 0479 or +1 516 687 5200 FreeWorldDialup: 635378 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20051011/b26d03be/attachment.pgp