VmX Setup

Your Wish is my command, sir

[asterisk@phone1 asterisk]$ /bin/ls /var/spool/asterisk/voicemail/default/2995/unavail.[wW][aA][vV]
/var/spool/asterisk/voicemail/default/2995/unavail.wav /var/spool/asterisk/voicemail/default/2995/unavail.WAV
[asterisk@phone1 asterisk]$ echo $?
0
[asterisk@phone1 asterisk]$

Well…Couldn’t resist…

Here’s the CLI output

Extension Changed 2995 new state Idle for Notify User 4569
Extension Changed 2995 new state Idle for Notify User 1008
Extension Changed 2995 new state Idle for Notify User 2530
Extension Changed 2995 new state Idle for Notify User 4552
– Executing GotoIf(“Zap/1-1”, “1?nofile”) in new stack
– Goto (macro-vm,vmx,60)
– Executing NoOp(“Zap/1-1”, “File for mode unavail does not exist| SYSTEMSTATUS APPERROR| going to normal voicemail”) in new stack
– Executing Goto(“Zap/1-1”, “s-NOANSWER|1”) in new stack
– Goto (macro-vm,s-NOANSWER,1)
– Executing Macro(“Zap/1-1”, “get-vmcontext|2995”) in new stack
– Executing Set(“Zap/1-1”, “VMCONTEXT=default”) in new stack
– Executing GotoIf(“Zap/1-1”, “0?200300”) in new stack
– Goto (macro-get-vmcontext,s,300)
– Executing NoOp(“Zap/1-1”, “”) in new stack
– Executing VoiceMail(“Zap/1-1”, “2995@default|u”) in new stack
– Playing ‘/var/spool/asterisk/voicemail/default/2995/unavail’ (language ‘en’)
– Playing ‘vm-intro’ (language ‘en’)
– Channel 0/1, span 1 got hangup request
== Spawn extension (macro-vm, s-NOANSWER, 2) exited non-zero on ‘Zap/1-1’ in macro ‘vm’
== Spawn extension (macro-vm, s-NOANSWER, 2) exited non-zero on ‘Zap/1-1’ in macro ‘exten-vm’
== Spawn extension (macro-vm, s-NOANSWER, 2) exited non-zero on ‘Zap/1-1’
– Hungup ‘Zap/1-1’

Sorry I didn’t get to test this today. Lightning hit at our city swimming pool, and blew up about everything in their office

Like Radio for 5.8 Ghz Data Link
Router
Switch
WiFi Server
Printer
NIC in computer, etc. etc!

Maybe I can find time tomorrow…

Bill

what version of asterisk are you running? can you tell if it is even running properly or if there is a flaw in what I put in?

w5waf,
if it is not working, can you tell me what the Noop returns at the CLI where it branches to on failure:

[code:1]+exten => vmx,n(nofile),Noop(File for mode: ${MODE} does not exist, SYSTEMSTATUS: ${SYSTEMSTATUS}, going to normal voicemail) [/code:1]
so I can see if that is completely blank or if some useful error code is being printed? (or if it never hits there, then something else is broke like my dialplan…

I made the changes to extension.conf…no joy. Now I can’t even get is to work for even a few minutes…

Bill

any chance you can try out this change. It will go into the next core module update which will be a day or two. But you can also put it in manually. I had this issue occure on another person’s system also - Asterisk 1.2.20. Works for a while and then Asterisk decides to start reporting failure even though the sound file is there… (we love asterisk!)

[code:1]
Index: extensions.conf

— extensions.conf (revision 4406)
+++ extensions.conf (working copy)
@@ -288,11 +288,14 @@
exten => vmx,n,GotoIf($["${DB(AMPUSER/${ARG1}/vmx/${MODE}/state)}" != “enabled”]?s-${ARG2},1)

; If the required voicemail file does not exist, then abort and go to normal voicemail behavior
-; TODO: figure out which is proper file (.wav or .WAV) and maybe find a better way
-; still want to find something better than ‘ls’ but for now, it checks either
;
+; TODO: there have been errors using System() with jump to 101 where asterisk works fine at the begining and
+; then starts to jump to 101 even on success. This new mode is being tried with the SYSTEM Status which
+; returns SUCCESS when the command returned succcessfully with a 0 app return code.
+;
exten => vmx,n,Macro(get-vmcontext,${ARG1})
-exten => vmx,n(file),System(ls ${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/${MODE}.[wW][aA][vV])
+exten => vmx,n,TrySystem(/bin/ls ${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/${MODE}.[wW][aA][vV])
+exten => vmx,n,GotoIf($["${SYSTEMSTATUS}" != “SUCCESS”]?nofile)

; Get the repeat, timeout and loop times to use if they are overriden form the global settings
;
@@ -377,7 +380,7 @@
; If the required voicemail file is not present, then revert to normal voicemail
; behavior treating as if it was not set
;
-exten => vmx,file+101,Noop(File for mode: ${MODE} does not exist, going to normal voicemail)
+exten => vmx,n(nofile),Noop(File for mode: ${MODE} does not exist, SYSTEMSTATUS: ${SYSTEMSTATUS}, going to normal voicemail)
exten => vmx,n,Goto(s-${ARG2},1)

; Drop into voicemail either as a direct destination (in which case VMX_OPTS might be set to something) or
[/code:1]
I’ve reopened the bug until I can get some confirmation that this now fixes things:

http://freepbx.org/trac/ticket/2046

Basically what I thought, still digging into this problem. After following your advice, it seems that after a while, ls just stops seeing the file!.

I can’t explain it, I’m just grabbing at straws. I guess there’s just something flaky with my installation. I appear to be the only one having this problem, so I’m inclined to think the problem is mine, not yours.

As soon as I get some quotes in, I’m going to order a couple of the Rhino Ceros boxes. I should get them in next week. I’ll load the new trixbox beta with asterisk 1.4 and test drive it. Then in a month or so after that put it in production.

Bill

it is part of the move of core to the modules directory. All modules have had that ability, when we moved core we enacted it. The agi scripts were the same but we changed it to copying instead of linking for the time being because of some really bizarre behavior on some systems.

Just noticed something that is different from previous loads of trixbos/FreePBX.

Instead of extensions.conf being locaded in the /etc/asterisk directory, it’s a link to /var/www/html/admin/modules/core/etc/extensions.conf.

I haven’t seen that before.

w5waf,

yes I have looked at plenty of Fortran in my days…

it’s not php - it’s all asterisk dialplan that is the potential issue. If you go back and look at the problem statement, you can see it is just doing an Asterisk System() command and branching based on the results. (System branches to prio+101 if it fails or the called function returns non-0)

So you get his command (note it’s a little different then what you might have as I’ve made some unrelated changes):

[code:1]exten => vmx,n(file),System(ls ${ASTSPOOLDIR}/voicemail/${VMCONTEXT}/${ARG1}/${MODE}.[wW][aA][vV])
[/code:1]
and then you get the target at n+101:[code:1]exten => vmx,file+101,Noop(File for mode: ${MODE} does not exist, going to normal voicemail)
[/code:1]
You will note the[code:1]exten => vmx,n(file),System(…)[/code:1]
followed by:[code:1]vmx,file+101,Noop(…)[/code:1]
That is just a convenient way to number the priorities, you can just use normal hardcoded numbers if you want.

In any event, creating a test extension or something to with Noop instructions to figure out why the unpredictable behavior would be a good idea.

Well, I’m not a PHP programmer. I know just enough to get myself in trouble. I haven’t done much programming since fortran (anybody remember that). So if you could point me in the right direction, I’d appreciate it.

Bill

Could I just disable that check and not turn on VmX unless I was sure they had the unavail message?

Bill

well that wouldn’t exactly be the point of beta testing now would it? Anyhow, I’d be very concerned to understand why Asterisk is returning a failure on a System() command of an ‘ls’ - especially if it only starts happening after a while. If I were you, I would put a system command with an ls of something that is fixed, and have it run that command every time a call happens on teh system, and log the results to determine if there is something whacky going on in asterisk or on your system.

It makes NO sense otherwise why it would branch correclty until after a while when you have to restart asterisk…

what version of asterisk are your running? It appears something is going flakey with the asterisk system() command from what you are telling me. Since, as mentioned, the only thing that line is doing is an ‘ls’ of the file and branch away if it can’t detect it. (although - I do want to find a better way to do what I’m doing as mentioned…)

I’ve been running this feature as written on about 4 production systems running a variety of different 1.2 versions for months without an issue…

thanks,

Asterisk 1.2.19 – Trixbox 2.2.2

Well…

Disregard everything I have said previously…

Looks like We were barking up the wrong tree.

I changed the files …wav to WAV to [Ww][Aa][Vv]

And it seemed to work…

However…

It works only for a short time. 15 minutes to several hours. When it stops working, an amportal restart gets it working again!

After Several hours of testing (it’s almost 200am here) I can confirm that any of the three options work for a time as long as you do an amportal restart.

Bill

I have tb and have tried versions 2.2.4, 2.0.X & the latest 2.6.1 and they all have the same issue. I have been chasing this for some time but to no avail.

Alan Scott
Codeblue, New Zealand

The vmX is working okay using *.wav only (with freepbx 2.4.1), but was wondering why it can’t just use any supported sound file, be it ulaw, gsm, mp3 etc.