Skip to content

Asterisk and GOIP

Goip 4 : Firmware Version: GS-4.01-98 Module Version: M35FAR02A01_RSIM

Goip16: Firmware Version: GST1610-1.01-61 Module Version: G610_V0C.58.0D_T1B

Goip32: Firmware Version: GST1610-1.01-61 Module Version: M35FAR02A01_RSIM

[GoIP User Manual] FIXFILE

Problems: Models 16 and 32 cannot save or restore the configuration. The feature exists and produces a readable text file, but restoring from it changes nothing. This was not tested on model 4.

sip.conf

[gsm-tpl](!) ; template for gsm peers
host = dynamic
type = peer
port = 5060
bindport = 5060
qualify = 1000

[gsm-life](gsm-tpl)
context = from_gsm_life
username = gsm-life
secret = PASSWORD

[gsm-mts](gsm-tpl)
context = from_gsm_mts
username = gsm-mts
secret = PASSWORD

extensions.conf

# Value 8888 is configured in the gateway's Voip Call in setting
[from_gsm_ks]
exten => 8888,1,Noop()
 same => n,Set(CALLERID(num)=${CALLERID(num):1}) ; strip the leading plus
 same => n,macro(incoming)

Gateway setup

General configuration IMPORTANT: Specify a prefix! goip4-2

Incoming calls — option 1 goip4-1

extensions.conf

# Value 8888 is configured in the gateway's Voip Call in setting
[from_gsm_ks]
exten => 8888,1,Noop()
 same => n,macro(incoming)

Outgoing calls goip4-3 extensions.conf

# Add digit 3 to the Dial command to select this slot (SIM card)
[gsm_ks_line]
exten => _X.,1,Noop()
 same => n,macro(record)
 same => n,Dial(SIP/gsm-ks/3${EXTEN})

Problems

A. Incoming calls arrive from any trunk (peer). Because gms-\* uses insecure=invite and all peers come from the same IP address and host, the trunks cannot be separated. Options: - Port separation: GoIP does not support it in the current version, or I have not found it yet. - Remove insecure=invite: GoIP cannot authenticate, producing this:

chan_sip.c:17126 check_auth: username mismatch, have <9005>, digest has <9006>
chan_sip.c:26179 handle_request_invite: Failed to authenticate device ....

Solution to problem A:

Tested on versions 11.7.0 and 13.14.1.

Enable match_auth_username=yes in sip.conf.

[general]
match_auth_username=yes

[gsm-goip](!)
type=friend
secret=PASSWORD
; now disable insecure
insecure=no

[slot1](gsm-goip)

[slot2](gsm-goip)
...

Conclusions after 3 weeks

Configuring the gateway as separate lines made no sense. Switched to a Single Server Mode configuration: goip-gsm-gate

Incoming calls in GOIP: image-3

With the following Asterisk incoming-call configuration:

[from-gsm-gate]
exten => gsm-mts,1,Noop()
 same => n,Gosub(sub-incoming,s,1)

exten => gsm-ks,1,Noop()
 same => n,Gosub(sub-incoming,s,1)

exten => gsm-life,1,Noop()
 same => n,Gosub(sub-incoming,s,1)

Advantages: - The log clearly shows which line was called.

UPDATE 10.10.2017

GoIP supports four groups; divide all SIM cards into groups by operator:

image

Routing Prefix is what you specify in the extension to place a call through this group.

In sip.conf:

[gsm-goip](!)
type=friend
host=dynamic
qualify=1000
canreinvite=no
deny=0.0.0.0/0.0.0.0
permit=10.0.10.0/255.255.255.0

[gsm1-life](gsm-goip)
context=income-gsm-life
username=gsm1-life
secret=PASSWORD

[gsm1-ks](gsm-goip)
context=income-gsm-ks
username=gsm1-ks
secret=PASSWORD

Outgoing calls:

[gsm_ks_dial]
; Prefixes for group 111
exten => _X.,1,Noop()
 same => n,Dial(SIP/gsm1-ks/111${EXTEN},120)

Incoming calls:

Although we selected groups, incoming calls are handled according to each individual SIM card's settings, but in the context that corresponds to the group.

In the Forwarding to VoIP Number field, enter the card's actual mobile number, an operator prefix, and so on:

images

[income-gsm-ks]
; arrive as 067***
exten => _X.,1,Noop()
 same => n,Gosub(sub-incoming-callcenter,${EXTEN},1)