[Asterisk-Users] callerid validation and expression parser problems on Solaris 10

Joseph Rothstein jrothstein at comcentrixs.com
Tue Oct 11 05:12:02 MST 2005


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


More information about the asterisk-users mailing list