[asterisk-users] DUNDi with SIP Mapping

Ryan Wagoner rswagoner at gmail.com
Thu Apr 17 08:34:18 CDT 2014


On Wed, Apr 16, 2014 at 10:20 AM, Kevin Larsen <
kevin.larsen at pioneerballoon.com> wrote:

>
> You are a bit outside of what I have done, but this looks like it might be
> what you want to do with SIP:
> http://www.voip-info.org/wiki/view/DUNDi+Enterprise+Configuration+SIP
>
>
I had looked at that guide before, but couldn't get it working. I could do
SIP without authentication. This would have worked if I only wanted to
terminate calls to extensions. For future purposes I wanted to include PSTN
routes. In the end I went with IAX and have it up and running. It was
actually simple to integrate with FreePBX. The important piece was setting
ttl to 1 to prevent DUNDi lookup loops, which would cause the box to
sometimes see its own DUNDi extensions.

The one FreePBX box with the PRI will try 10 digits numbers on DUNDi
private then go out the PRI. The other FreePBX boxes try to dial 10 digit
numbers on DUNDi private then use DUNDi to reach the PSTN. This allows me
to add additionally FreePBX boxes with PSTN connections and use weights.
Additionally providing a separate mapping for the PSTN allows toll free to
first try DUNDi private, then a VoIP provider, then the DUNDi PSTN.

cd /var/lib/asterisk/keys
    astgenkey -n `hostname -f`
    chown asterisk:asterisk *

    share .pub keys between all servers

vim /etc/asterisk/dundi.conf
    cachetime=60
    ttl=1

    priv => dundi-extens,0,IAX2,dundi:${
SECRET}@1.1.1.1/${NUMBER},nounsolicited,nocomunsolicit,nopartial
    priv => dundi-dids,100,IAX2,dundi:${
SECRET}@1.1.1.1/${NUMBER},nounsolicited,nocomunsolicit,nopartial
    pstn => dundi-via-pstn,400,IAX2,dundi:${
SECRET}@1.1.1.1/${NUMBER},nounsolicited,nocomunsolicit,nopartial

    ;[<EID of remote DUNDi peer>]
    ;model = symmetric
    ;host = <IP or FQDN of remote DUNDi peer>
    ;inkey = <public key of remote DUNDi peer, without ".pub">
    ;outkey = <private key of local PBX, without ".key">
    ;include = all
    ;permit = all
    ;qualify = yes

vim /etc/asterisk/extensions_custom.conf
    [dundi-local]
    include => dundi-extens
    include => dundi-dids
    include => dundi-via-pstn

    [dundi-local-keepcid]
    exten => _X.,1,Set(KEEPCID=TRUE)
    exten => _X.,n,Goto(dundi-local,${EXTEN},1)

    [dundi-extens]
    include => ext-queues
    include => ext-findmefollow
    include => ext-group
    include => ext-local

    [dundi-dids]
    include => ext-did-0002

    [dundi-via-pstn]
    include => outbound-allroutes

FreePBX Trunks
    Type: DUNDi
    Trunk Name: DUNDi Private
    DUNDi Mapping: priv

    Type: DUNDi
    Trunk Name: DUNDi Pstn
    DUNDi Mapping: pstn

    Type: IAX
    Trunk Name: DUNDi
    Outgoing Settings:
        Trunk Name: dundi
        PEER Details:
        type=friend
        dbsecret=dundi/secret
        disallow=all
        context=dundi-local-keepcid
        allow=ulaw&g729

FreePBX Outbound Routes
    Route Name: dundi
    Route Type: Intra-Company
    Dial Pattern: NXXX
    Trunk: DUNDi Private

    Route Name: outbound
    Dial Pattern: 1NXXNXXXXXX
    Dial Pattern: NXXNXXXXXX
    Trunk: DUNDi Private
    Trunk: PRI or DUNDi Pstn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20140417/c2a5eede/attachment-0001.html>


More information about the asterisk-users mailing list