Like every other website on the planet, SmallNetBuilder uses cookies. Our cookies track login status, but we only allow admins to log in anyway, so those don't apply to you. Any other cookies you pick up during your visit come from advertisers, which we don't control.
If you continue to use the site, you agree to tolerate our use of cookies. Thank you!

Router Charts

Click for Router Charts

Router Ranker

Click for Router Ranker

NAS Charts

Click for NAS Charts

NAS Ranker

Click for NAS Ranker

More Tools

Click for More Tools

Configuration #2: Use With A Local Asterisk Server

When I finally had some time to experiment with the gateway, I configured it to access my local Asterisk server as the default realm with the hosted PBX as a secondary realm (Figure 6).

Registered with local Asterisk server
Click to enlarge image

Figure 6: Registered with local Asterisk server

When more than one account is registered, the gateway will answer incoming calls on all accounts, but only pass outgoing calls to the default account. So my Asterisk server needed to be the default account or I would not be able to pass IP calls out to the cellular network.

Defining Routes: LAN-to-Mobile

Previously my routing had been established for calls originating on the cellular network and being passed into the IP domain. Now I needed routing for calls passing from LAN to Mobile.

MV-370 LAN-To-Mobile routing table

Figure 7: MV-370 LAN-To-Mobile routing table

The LAN To Mobile routing table on the gateway (Figure 7) allows you to restrict acceptance of calls by originating URL, IP address, or IP address range. It also provides a means of restricting where you might call out to, perhaps restricting access to overseas calls, for example. In my case, the routing could be wide open since I was comfortable that any call originating on my home office LAN would be legitimate.

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.

Wi-Fi System Tools
Check out our Wi-Fi System Charts, Ranker and Finder!

Support Us!

If you like what we do and want to thank us, just buy something on Amazon. We'll get a small commission on anything you buy. Thanks!

Over In The Forums

Device: RT-N66UFirmware: 380.69Hello everyone,i attached a tp-link access point to my router and created vlans for several SSIDs.In addition i would l...
Hello, I'm looking for advice for the build in the subject line. I'm a landscape architect starting my own small office. It will be two people at firs...
Is this ok to do ? Also allow only specified ip address.I want to do this my for cousins so i don't have to go over there every time.I notice the 86u ...
Hi,I want to assign my virtual machines to a certain dhcp range.I have been playing around with dnsmasq.conf.add but cant get it to work.This is what ...
Hi allIt seems that devices on 5G-1 and 5G-2 cannot "see" each other.On Wireshark it seems some packets can't traverse from one 5G band to the other. ...

Don't Miss These

  • 1
  • 2
  • 3