Using Exchange Unified Messaging as your FreePBX voicemail



  • Client has an existing setup with the voicemail from the PBX being sent to their Exchange Unified Messaging server that i needed to replicate in FreePBX.

    First, I am not telling you how to setup Exchange. I found this guide with Google if you want to do that part. Exchange is managed by the client IT staff and is long configured and working.
    http://savithomas.blogspot.com/2013/08/connecting-exchange-2013-unified.html

    Now on to what I did. Luckily the existing PBX was Asterisk, raw, no distribution, but Asterisk. So I was able to poke through the dial plan and find the Exchange configuration on the old system for a few pointers.

    First, you have to go into the Asterisk SIP settings to enable TCP as that is how Exchange speaks SIP.
    Go to Settings -> Asterisk SIP Settings and then click on the Chan SIP Settings tab.
    0_1527875105107_104c5202-488d-4b4c-98d5-5035b3164452-image.png

    Scroll all the way to the bottom to find Enable TCP, then click the Yes to turn it on.
    0_1527875224344_854fb854-488e-4105-833f-0fd9e06107a1-image.png

    Then click save and reload asterisk like normal.

    Now you just go make a normal SIP trunk as per this guide:
    https://mangolassi.it/post/264856

    Use these settings. Note, I am not sure how much a couple of these settings are required. But I do not have my own setup to test on. Note the name you used for the trunk on the outgoing tab you need it on the next section.
    0_1527875835693_f8b2b6ad-e99d-432e-a29e-62758dae48da-image.png

    type=friend
    host=YOUR.EXCHANGE.IP.ADDRESS
    transport=tcp
    port=5065 ;By default Exchange uses port 5065 for UM
    insecure=port,invite
    context=default
    [email protected]
    disallow=all
    allow=ulaw&alaw
    canreinvite=no
    qualify=yes
    promiscredir=yes
    

    Submit and apply, like normal.

    Now comes the fun part.
    Go to Admin -> Config Edit
    0_1527876135961_a461be23-3681-4c56-b661-30663f6d4fc8-image.png

    Select extensions_custom.conf
    0_1527876230604_368b7835-89c6-4f44-96f2-fc67bb44f21e-image.png
    Then paste in this new custom context in the box on the right. Note that the name u=you used before goes in here in the Dial section. The 9999 should be replaced by whatever your UM's Outlook Access Number is.

    [um-vm]
    exten => s,1,Wait(1)
    exten => s,n,SipAddHeader(Diversion:<tel:${DEXTEN}>\;reason=no-answer\;screen=no\;privacy=off)
    ; UPDATE THE BELOW LINE APPROPRIATELY
    exten => s,n,Dial(SIP/ExchUM/9999)
    exten => s,n,Hangup()
    

    0_1527876417199_d7b427b9-cf9d-4aa3-bd81-9ec9f7bdd31b-image.png

    Click save and apply like normal.

    Now go to Admin > Custom Destination
    0_1527876533737_a1f1ce1c-0e8c-42a5-8639-2febd3c714d8-image.png

    Create a new destination like this.
    0_1527876602290_eae54df0-76e1-46d9-9a86-1696a33d038b-image.png

    Click save and apply like normal

    Go to your extension and click on the Advanced tab.
    0_1527876691389_86e52935-cf3f-495a-b4b2-1e04cc450725-image.png

    Scroll to the bottom in the Optional Destination and change it from the defaults of this.
    0_1527876825134_378b380a-b77a-4943-b6a5-c25b875aba4b-image.png

    To this.
    0_1527876901038_64eac2b7-67c8-4de3-813f-ab763c20b364-image.png



  • To Do: Find a way to make that the default setting on a new extension.