*RESOLVED* Unified Voicemail and Company Directory: Almost There!!!

cvander
Posts: 288
Member Since:
2006-06-26

I've been working on making a unified voicemail and company directory for our two offices. There's some manual entries that must be made, but here's what I have so far (I'll tell you what I lack and need help with at the end!):

1. Trixbox 2.2.4 running at each location.
2. IAX2 trunks named Inter-Office
3. 1XX extensions in Houston, 2XX extensions in Dallas
4. Modified extensions_custom.conf to add this (for Houston, 1XX for Dallas):
[ext-local-custom]
exten => _2XX,1,dial(iax2/Inter-Office/${EXTEN})
5. Modified voicemail.conf in each office so the entries are the same (this gets the directory working)

So here's what works:
1. A person can call into either office and access a unified company directory.
2. Selecting a foreign user in the directory routes the call to the other PBX properly.
3. All users can dial *97 to access their direct voicemail box.

Here's what doesn't work (and I need help with)

Dialing *98 and putting in a foreign voicemail box (i.e. *98 212 from Houston) takes me to the mailbox entry for 212 on the Houston server instead of accessing the remote box.

I think I know what I need to do, but am having a hard time implementing it. In extensions_additional.conf under [app-dialvm] there is the entry include => app-dialvm-custom. I know that I can create that context in the extensions_custom.conf and override the settings here. I know that I need to play the "Asterisk Mail" sound and "Mailbox?" sound, and then route the call based on the input to either Houston or Dallas, but I don't know how to use a trunk to access VoiceMailMain() on a remote box.

I know this is a small thing, but it would really put the finishing touches on the unified directory if my *98 worked for getting their voicemail regardless of what office they are currently in.

-Chris



cvander
Posts: 288
Member Since:
2006-06-26
Bump

Really??? No takers, suggestions, pointers, etc? I'm not asking for development, just a little help.



csgcomm
Posts: 135
Member Since:
2007-01-09
I have done this but can't

I have done this but can't look it up. Obviously you only have 1 box with voicemail installed correct? As I recall, set up outbound route with *98 to point to the box with voicemail over IAX2 trunk. I don't think you need anything else, it's been a while so I don't quite remember.

Chris



cvander
Posts: 288
Member Since:
2006-06-26
No, I have two boxes with

No, I have two boxes with voicemail installed, fully independent from one another. I just need help getting to the *98 over the trunk (my dial command does not seem to like the *). Everything works like a champ except for the unified *98 application. If I can figure it out, I'll post full details, as I know several people in the community are looking for this solution.

-Chris



lazytt
Posts: 146
Member Since:
2006-06-21
here's a quick and dirty

here's a quick and dirty idea of what you need:

[app-dialvm-custom]
exten => _*98,n,Set(ex=${EXTEN:3})
exten => _*98,n,Gotoif($[${${EXTEN:3}:1}=2]?vm-othersys,1)

exten => vm-othersys,1,Dial(iax/othersys/*98${ex})

(its not tested, you might need to work on in a bit...)



jmullinix
Posts: 836
Member Since:
2006-06-04
I think you may need to

I think you may need to change lazytt's script a little to make it work.

lazytt wrote:

here's a quick and dirty idea of what you need:

[app-dialvm-custom]
exten => _*98,n,Set(ex=${EXTEN:3})
exten => _*98,n,Gotoif($[${${EXTEN:3}:1}=2]?vm-othersys,1)

exten => vm-othersys,1,Dial(iax/othersys/*98${ex})

(its not tested, you might need to work on in a bit...)

I think it needs to be:

[app-dialvm-custom]
exten => _*98X.,1,Set(ex=${EXTEN:3})
exten => _*98X.,n,Gotoif($[${${EXTEN:3}:1}=2]?vm-othersys,1:move-on)
exten => vm-othersys,1,Dial(iax/othersys/*98${ex})
exten => _*98X.,n(move-on),Noop(Returning to app-dialvm)

(its not tested, you might need to work on in a bit...)

Notice the "X." after the *98. this allows you to dial *98212 and have the script work. You will notice I added an alternate destination to the If statement and added a line. The alternate (else) in the If statement lets you skip dialing the other box if it is not a match. Since "app-dialvm-custom" was called as an include from "app-dialvm," the last line serves as a placeholder and a spot to jump back to "app-dialvm." IF line 2 does match, the code in line 3 will be executed and you will never get to line 4.

Putting it in app-dialvm-custom allows both voicemail systems to work. This is a great idea by the way.

--

John

In search of Dundi Peers in Lake Wales, FL and Baltimore, MD.
http://www.cohutta.com
1-706-632-3343 - E164 friendly (Use your friendly ENUM trunk today.)
Dial Plan helper http://www.cohutta.com/npanxx.php



lazytt
Posts: 146
Member Since:
2006-06-21
thats what i meant :-) -

thats what i meant :-) - thanks john!



cvander
Posts: 288
Member Since:
2006-06-26
I think I almost have it, but...

I think I almost have it, but for some reason, the system keeps bypassing the app-dialvm-custom in favor of the app-dialvm (even though the include should be working...) I'm still trying to figure out why the include is failing. Any help would be great, I think I a day or two away from having this thing licked. I'm going to normalize the program structure one more level so that multiple offices are easier.

Thanks,

Chris



cvander
Posts: 288
Member Since:
2006-06-26
Closer

I've found the problem with the include file, it seems that asterisk always interprets the include file last (even if it is in front of everything else). I have changed the feature code for dial voicemail to *51 (so I can use *98 in my custom file). Here's what it looks like, but it's currently ringing extensions instead of accessing voicemail, I'm sure it's something stupid I've done. Here my custom File:

[app-dialvm-custom]

exten => *98,1,Answer
exten => *98,n,Wait(1)
exten => *98,n,Playback(vm-login)
exten => *98,n,WaitExten(,)
exten => 1xx,n,Marco(get-vmcontext,${EXTEN:3})
exten => 1xx,n,VoiceMailMain(${EXTEN:3}@${VMCONTEXT})
exten => 1XX,n,Macro(hangupcall,)
exten => 2xx,n,Dial,(iax/Inter-Office/*98${EXTEN:3})

I borrowed code from the IVR, I'm thinking my problem is related to WaitExten(,) but I'm not sure what to put in it's place. I'm trying to write a "shell" replacement for *98 that reads the extension and routes the call based on the extension.

-Chris



cvander
Posts: 288
Member Since:
2006-06-26
Got It!!!

Okay, here's the final piece, I've managed to get it all working. Thanks for all your help, I couldn't have done it without you all.

1. Change the feature code of "dial voicemail" to something that you don't use, we can't use it here because the -custom include file only gets evaluated AFTER the original app (screws our pattern matching)

2. Make sure you have the dial rules set up properly (i.e. route *982XX to the Dallas IAX2 trunk).

3. Add this to extensions_custom.conf

[app-dialvm-custom]

exten => *98,1,Answer
exten => *98,2,Wait(1)
exten => *98,3,Read(ex|vm-login|||2|2)
exten => *98,4,GotoIf($[$["${ex:0:1}" = "1"]]?vm-houston,1:5)
exten => *98,5,GotoIf($[$["${ex:0:1}" = "2"]]?vm-dallas,1:hang,1)

exten => _*98.,1,Set(ex=${EXTEN:3})
exten => _*98.,2,GotoIf($[$["${ex:0:1}" = "1"]]?vm-houston,1:3)
exten => _*98.,3,GotoIf($[$["${ex:0:1}" = "2"]]?vm-dallas,1:hang,1)

exten => vm-houston,1,Macro(get-vmcontext,${ex})
exten => vm-houston,2,VoiceMailMain(${ex}@${VMCONTEXT})
exten => vm-houston,3,Goto(hang,1)

exten => vm-dallas,1,Dial(IAX2/Inter-Office/*98${ex})
exten => vm-dallas,2,Goto(hang,1)

exten => hang,1,Macro(hangupcall,)

; end of [app-dialvm-custom]

Obviously, make sure you make your contexts meaningful to you. One note is that "Inter-Office" is the name of my IAX2 trunk, make sure you replace it with whatever you have.

I think I've posted everything necessary now for a fully unified VoiceMail and Company Directory application. Let me know if you need any more details.

-Chris



fskrotzki
Posts: 176
Member Since:
2006-09-13
I did something similar...

I did something similar for our company by making a few minor changes to the directory script, and replicating the audio files so that # works just like it is on one system but can be on either system.. I've posted the code to freepbx for the directory piece and used a iax trunk between with Dundi. it runs very smooth.

You can also find me on the #trixbox and #freepbx irc channels most of the time.



Jaop
Posts: 7
Member Since:
2006-06-19
Thank you

cvander thanks for this info, that's what I was looking for ! :-)



dmadma
Posts: 8
Member Since:
2006-07-24
Device in the caller id

Everything is working great. The only thing is when I call between locations, the cid is correct but the name says device 249. Locally it is fine, but when you call from trunk to trunk you lose the stations name. I know it is little, but our sales dept has grown used to see who is calling them.



dmadma
Posts: 8
Member Since:
2006-07-24
Freepbx update

It worked great for a while until the last freepbx update to custom applications. It still works from an extention but no longer can you call an extention from an IVR on another machine.
I would really like this to work again and have tried moving in verious different locations. I have 4 diget extentions on my other pbx that start with 8.

[ext-local-custom]
exten => _8XXX,1,dial(iax2/EX/${EXTEN})



dmadma
Posts: 8
Member Since:
2006-07-24
Freepbx update

It worked great for a while until the last freepbx update to custom applications. It still works from an extention but no longer can you call an extention from an IVR on another machine.
I would really like this to work again and have tried moving in verious different locations. I have 4 diget extentions on my other pbx that start with 8.

[ext-local-custom]
exten => _8XXX,1,dial(iax2/EX/${EXTEN})



jmullinix
Posts: 836
Member Since:
2006-06-04
I replied to your question

I replied to your question on the FreePBX forum. Check it there.

Have a great evening.

--

John

In search of Dundi Peers in Lake Wales, FL and Baltimore, MD.
http://www.cohutta.com
1-706-632-3343 - E164 friendly (Use your friendly ENUM trunk today.)
Dial Plan helper http://www.cohutta.com/npanxx.php



wetchicken
Posts: 31
Member Since:
2006-11-11
> I replied to your question

> I replied to your question on the FreePBX forum. Check it there.

Do you have a link, Sir?

Thank You

Jason



jahyde
Posts: 1956
Member Since:
2006-06-02
i may be wrong (looking for

i may be wrong (looking for correction;) but I dont see anything in the code that allows company directory (as in dial-by-name) across both sites. - someone implied so - does it??

--

--my PBX is run on 2 V8's



cvander
Posts: 288
Member Since:
2006-06-26
It's in the 1st part of the post

Jahyde,

It's in step 5 of the first post:

Modify the voicemail.conf file to contain entries from your foreign pbx. This needs to be manually updated at both sites. I never got around to asking Phillipe w/ FreePBX about a way to get the databases to sync. (I'm assuming I would need to designate one as the master). FreePBX modifications to voicemail.conf are non-destructive, so if you have data in there that contains information about people in the foreign pbx, it won't overwrite your entries...

Hope that clears things up...

Regards,

Chris



jahyde
Posts: 1956
Member Since:
2006-06-02
thanks Chris, (im blind),

thanks Chris, (im blind), thats a nice way of doing things.

maybe we can figure out some sort of sed / rsync merge (eww that sounds dirty).

--

--my PBX is run on 2 V8's



jchuby
Posts: 375
Member Since:
2006-07-20
Maybe you can just post one

Maybe you can just post one final post with all the steps so that people can follow it...

--

JChuby
Experienced Trixbox Tech for Hire in Greater NYC
JChubaK@gmail.com or PM me on Trixbox.org Forums



jahyde
Posts: 1956
Member Since:
2006-06-02
I believe the first post has

I believe the first post has been revised to cover everything - we just need to read it carefully ;)

--

--my PBX is run on 2 V8's



cvander
Posts: 288
Member Since:
2006-06-26
I've been meaning to put

I've been meaning to put together a step-by-step guide on this topic, but things here are a little too hectic to get it pounded out right now... I haven't even tested the syntax with Asterisk 1.4 yet!! I will be deploying new servers (moving from beta to production) in the next month or two. I'll try and put something nice in the wiki other than the cut-and-paste from this post...

-Chris



jahyde
Posts: 1956
Member Since:
2006-06-02
ya - i posted just posted

ya - i posted just posted the forum link in here http://trixbox.org/wiki/Additional_Scripts_and_Tricks

feel free to replace that anytime with a full writeup ;)

--

--my PBX is run on 2 V8's



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.