skip to Main Content

Adding A Cellular Trunk To A Home Office VOIP System: Part 2

Configuring Asterisk

The documentation includes some basic examples of the Asterisk config files. I modified these examples to suit my installation as follows. This following block of the config is a landing zone for incoming calls:

[4003] ; Portech GSM Gateway
type=friend
host=dynamic
username=4003
secret=4003
nat=no
qualify=yes
dtmfmode=inband
context= inbound-gsm
call-limit=1
insecure=very
canreinvite=no

From EXTENSIONS.CONF

[inbound-gsm] exten => _4005,1,Answer()
exten => _4005,2,Set(TIMEOUT(digit)=3)
exten => _4005,3,Set(TIMEOUT(response)=5)
exten => _4005,4,DISA(no-password|local)

The last line calls the Asterisk DISA function that exposes other portions of the system for use by the outside caller. DISA means “Direct Inward System Access” and is the process whereby someone connecting externally is authenticated, then allowed to make use of system resources to place outgoing calls.

The DISA parameter “no-password” is considered wildly insecure, as it removes the need for any form of PIN code before allowing access to the system. “Local” is the dial plan context that is granted to the outside caller once on the system. Once I call into the gateway, Asterisk allows me to make further calls just as if I were physically in my office.

I offer this just as a conceptual example. Since the number of people that I call overseas is limited, I have simplified my DISA implementation by establishing preset Asterisk extensions that dial each party I might call. Then I use the gateway’s speed dial table to access the extensions directly with a single extra digit.

The next block of config establishes outbound dialing via the GSM gateway.

[outbound-gsm] ;
; all emergency calls routed through the GSM gateway to T-Mobile
exten => _911,1,SetCallerID("MyDesiredCallerID")
exten => _911,n,Dial(SIP/${EXTEN}@4003,60,r)
exten => _911,n,Hangup()
;
; directory assistance calls routed through the GSM gateway to T-Mobile
exten => _411,1,SetCallerID("MyDesiredCallerID")
exten => _411,n,Dial(SIP/${EXTEN}@4003,60,r)
exten => _411,n,Hangup()
;
;dial 9 for long distance via T-Mobile
exten => _91NXXNXXXXXX,1,SetCallerID("MyDesiredCallerID")
exten => _91NXXNXXXXXX,n,Dial(SIP/${EXTEN:1}@4003,60,r)
exten => _91NXXNXXXXXX,n,Hangup()
;
;dial 9713 for local calls via T-Mobile
exten => _9713NXXXXXX,1,SetCallerID("MyDesiredCallerID")
exten => _9713NXXXXXX,n,Dial(SIP/${EXTEN:1}@4003,60,r)
exten => _9713NXXXXXX,n,Hangup()

For 411 and 911 calls, we pass the call directly. For other local and long distance calls, we require that the user dial 9 to specify the GSM trunk.

Defining Routes: Mobile-to-LAN (Asterisk)

Routing cellular calls into Asterisk is unlike the configuration for the hosted PBX. It requires that the routing table in the gateway be essentially defeated. All calls should be sent directly to an Asterisk dial plan context. By setting the URL to 4002, all incoming calls ring my snom m3 cordless phones in my house and office.

Figure 8: MV-370 Mobile-to-LAN routing table setup to send calls to local extension 4002

Figure 8: MV-370 Mobile-to-LAN routing table setup to send calls to local extension 4002

The cellular number assigned to the gateway is not a number that I intend to publicize, so I don’t expect to receive many calls via the gateway. The exception is when I am travelling and call home. In that case, using the cellular gateway to receive the call means that I’m using free mobile-to-mobile minutes on my cellular plan.

This Post Has 3 Comments
  1. Hi. I’m using mv-372 and am consirned about latency (200-300ms).
    Another issue is hangup. When a hangup mobile phone conection to mv-372, asterisk still rings for about 3-5 seconds.

    Could anyone help me?

  2. I am facing echo issues and i have tried a lot with different values right now i am using the following values Under mobile setetingsd

    voip tx gain = 9
    Voip rx gain=11
    codexc tx gain= 6
    codec rx gain=6
    Do you have the same issues?
    Please help if you find some changes can reslove the echo issue.

Comments are closed.

Back To Top
%d bloggers like this: