App-dialvm - context other than default

Hi

This is sort of related to my previous post found at:

http://www.freepbx.org/forum/freepbx/users/voicemail-callerid-and-ampuser-app-vmmain

I am having trouble accessing voicemail - using *98 - when I set the context to a different name other than ‘default’. Note: I changed an existing extension from “default”.

However, voicemail access using *97 is OK.

From the debug when using *98 it seems the context returned is ‘default’:

-- Executing Answer("SIP/2570-093d74d8", "") in new stack
-- Executing Wait("SIP/2570-093d74d8", "1") in new stack
-- Executing VoiceMailMain("SIP/2570-093d74d8", "") in new stack
-- Playing 'vm-login' (language 'en')
-- Playing 'vm-password' (language 'en')
-- Incorrect password '2570' for user '2570' (context = default)
-- Playing 'vm-incorrect-mailbox' (language 'en')

Debug for *97 is getting the correct context of ‘qicomm’:

-- Executing Answer("SIP/2570-09459640", "") in new stack
-- Executing Wait("SIP/2570-09459640", "1") in new stack
-- Executing Macro("SIP/2570-09459640", "user-callerid|") in new stack
-- Executing NoOp("SIP/2570-09459640", "user-callerid: Monideth Pen - WiFi 2570") in new stack
-- Executing Set("SIP/2570-09459640", "AMPUSER=2570") in new stack
-- Executing GotoIf("SIP/2570-09459640", "0?report") in new stack
-- Executing GotoIf("SIP/2570-09459640", "0?start") in new stack
-- Executing Set("SIP/2570-09459640", "REALCALLERIDNUM=2570") in new stack
-- Executing NoOp("SIP/2570-09459640", "REALCALLERIDNUM is 2570") in new stack
-- Executing Set("SIP/2570-09459640", "AMPUSER=2570") in new stack
-- Executing Set("SIP/2570-09459640", "AMPUSERCIDNAME=Monideth Pen - Nokia") in new stack
-- Executing GotoIf("SIP/2570-09459640", "0?report") in new stack
-- Executing Set("SIP/2570-09459640", "AMPUSERCID=2570") in new stack
-- Executing Set("SIP/2570-09459640", "CALLERID(all)="Monideth Pen - Nokia" <2570>") in new stack
-- Executing Set("SIP/2570-09459640", "REALCALLERIDNUM=2570") in new stack
-- Executing NoOp("SIP/2570-09459640", "TTL:  ARG1: ") in new stack
-- Executing GotoIf("SIP/2570-09459640", "0?continue") in new stack
-- Executing Set("SIP/2570-09459640", "__TTL=64") in new stack
-- Executing GotoIf("SIP/2570-09459640", "1?continue") in new stack
-- Goto (macro-user-callerid,s,23)
-- Executing NoOp("SIP/2570-09459640", "Using CallerID "Monideth Pen - Nokia" <2570>") in new stack
-- Executing Macro("SIP/2570-09459640", "get-vmcontext|2570") in new stack
-- Executing Set("SIP/2570-09459640", "VMCONTEXT=qicomm") in new stack
-- Executing GotoIf("SIP/2570-09459640", "0?200:300") in new stack
-- Goto (macro-get-vmcontext,s,300)
-- Executing NoOp("SIP/2570-09459640", "") in new stack
-- Executing MailboxExists("SIP/2570-09459640", "2570@qicomm") in new stack
-- Executing VoiceMailMain("SIP/2570-09459640", "2570@qicomm") in new stack
-- Playing 'vm-password' (language 'en')
-- Playing 'vm-youhave' (language 'en')

The two voicemail functions found in extension_additional.conf are as such:

[app-dialvm]
include => app-dialvm-custom
exten => *98,1,Answer
exten => *98,n,Wait(1)
exten => *98,n,VoiceMailMain()
exten => *98,n,Macro(hangupcall,)
exten => _*98.,1,Answer
exten => _*98.,n,Wait(1)
exten => _*98.,n,Macro(get-vmcontext,${EXTEN:3})
exten => _*98.,n,VoiceMailMain(${EXTEN:3}@${VMCONTEXT})
exten => _*98.,n,Macro(hangupcall,)

; end of [app-dialvm]

[app-vmmain]
include => app-vmmain-custom
exten => *97,1,Answer
exten => *97,n,Wait(1)
exten => *97,n,Macro(user-callerid,)
exten => *97,n,Macro(get-vmcontext,${AMPUSER})
exten => *97,n(check),MailBoxExists(${AMPUSER}@${VMCONTEXT})
exten => *97,n,GotoIf($["${VMBOXEXISTSSTATUS}" = “SUCCESS”]?mbexist)
exten => *97,n,VoiceMailMain()
exten => *97,n,Macro(hangupcall,)
exten => *97,check+101(mbexist),VoiceMailMain(${AMPUSER}@${VMCONTEXT})
exten => *97,n,Macro(hangupcall,)

; end of [app-vmmain]

I noticed with [app-dialvm] that the last 5 exten entries has “_*98.” instead of “*98” - what does this mean?

Please advise why the context detection is not working for *98.

Note: I asm using device and user mode.

Regards,

Mon

bump

bump

Can somebody help please!

What is the name of the context you changed it to?
How did you change the context?
Can you verify that the voicemail directory structure exists properly for that context. To do that go to /var/spool/asterisk/voicemail/
you should see the context’s listed. cd in to that context and does it show the extension?

Also take a look at the /etc/asterisk/voicemail.conf file and see that the context is set properly for that extension.

I changed the context settings in the User config in FreePBX (“VM Context” setting) - from ‘default’ to ‘qicomm’ for user 2570

There is a voicemail directory for 2570 in both default and qicomm:

/var/spool/asterisk/voicemail/default/2570/

/var/spool/asterisk/voicemail/default/qicomm/

Not sure why there is both directories.

When I delete the default/2570 directory - the same thing still happens, I am not able to login to the 2570 voicemail using *98. However, using *97 seems to be OK.

The problem I see - as outlined in the logs I sent previously is that the [app-dialvm] process seems to use ‘default’ as the context - instead of detecting it as ‘qicomm’.

In /etc/asterisk/voicemail.conf there is a section for ‘qicomm’ context - ‘[qicomm]’ and an entry for extension/user 2570. There is no such entry in the ‘[default]’ section. I assume this is correct.

bump

I’ve been swamped. I have some time today to dig into it on my spare system…

in answer to your questions…
Lets go back to your the question at the top first. What does _*98. mean and why is it different then the *98

A extension/number/pattern starting with a _ means that pattern match follows and needs to be inspected for a match. The string it is inspecting for is *98. where . means wildcard or anything after it.

So when just dialing *98 it does the top part. I’ll answer about the second part down below

It seems it used to work as you would hope back in mid 2005. If no context was defined it searched all contexts until if found the first matching one. But there was decision about it being a bug if you have multiple identical extensions each in a different context and all programmed to a pre-determined password. In that people will not change a password until they are forced to most of the time person A then had access to person B’s voicemail which raised privacy issues.

So if no context is defined the voicemailmain application (which is a base part of asterisk not freepbx) will default to the “default” context. So that is why you can’t find that extension when just dialing *98.

Now for why *97 works. Since you use that from the phone that has that extension it also knows the context of that extension and provides it. So that is why it works. The issue is some what noted as a issue in 1.2 in the code if you review applications.conf and read it at [app-messagecenter].

Now back to the _*98.

So if you dial *982570 it will then act like you dialed *97 from extension 2570. Since it has the extension it will scan all the extensions and find the first context that matches that extension and use that context.

I hope that explains it. I don’t have a 1.4 install running at this time to see how it operates in 1.4.

FYI: I’m not the end all by any means in this. I was about to do something similar and have been doing a lot of poking around voicemail and the phone directory application in an attempt to do a integrated multi system directory (I have a prototype working).

fskrotzki,

Thanks for taking the time to investigate and answer my queries. Very much appreciated.

You are correct in saying that *982570 should work - just tried it and it certainly does.

The reason why I need to get *98 ( or should I say VoiceMailMain() ) working is to allow for users to check their voicemail remotely. All I need to do is map an inbound route number to a Misc Destination that points to the {voicemail:dialvoicemail} function. I don;t know whether this function is exactly equivalent to using *98 - but it certainly fails in teh same way.

So my next question is how can I offer remote voicemail access service? I know voicemail can be access by ringing the extension number and pressing a certain key when you get through to voicemail - but I don’t like this method as if you ring your extension number then you see it as a missed call. Having a single voicemail number for users to access remotely is much better - but they would need to enter both voicemail box number and password/pin.

Regards,

Mon

At this point I don’t in the 1.2.x branch see a quick solution except to keep them all in the same context.

I don’t have a 1.4 branch installed to dig into how it works. But the voicemailmain is a asterisk call not a freepbx call. I’d contact the asterisk forum and ask. I’m sure somebody has had the problem and can give you a solution.

Just curious, why do you need a different voicemail access code for a different context?