Saturday, November 22, 2014

How to Setup GOIP 1/4/8 (GSM VOIP Gateway) as a Trunk gateway for Asterisk (PABX system)

How to Setup GOIP 1/4/8/16 .. as a Trunk gateway for Asterisk (PABX system)
The GOIP (VOIP) routers is available from http://www.giga.co.za

GOIP 1
GOIP 4














What can I do with a GOIP?

With one GOIP device you can do the following.
1) Dial from GSM Cellphone and PSTN land line to a SIP (VOIP) phone.
2) Dail from SIP to GSM Cellphone and PSTN line.
3) GOIP can and act as a trunk gateway for Asterisk (PABX)


With two and more GOIP devices. (Branch to Branch local dial cost)




Here is the setup procedure for the GSM/PSTN to SIP and SIP GSM/PSTN

1) Install a local GSM SIM  from your local GSM network provider ( MTN or Vodacom ....) make shore there is airtime on the SIM and you know what is the Cell number.

2) Connect the GOIP to your internet router with  ethernet cable. (Router should have DHCP enabled)


2) You know need to find out what IP was allocated to your GOIP by your Internet router.
There are two ways to establish the GOIP IP.
  • Dial the SIM number of anyone of the GSM channels available. Once the cal is answerd dial “*01” to hear voice prompt reporting the LAN port IP address.
  • Send the “#INFO#” SMS message command to of the GSM channels available. The GoIP will then return back the LAN port IP address.  E.G. 192.168.1.130
3) Now that you know what your GOIP IP is just use your browser and point it to the IP for example http://192.168.1.130

4) You should get a login popup, the default login username and password is admin admin.

5) After login you should see a admin home page.


6) We now need to configer the GOIP (SIP200) to foreword incoming GSM calls to cell number to a SIP numbers (My SIP number at home (101) and on my Android phone(100).
The problem is that the GOIP can only foreword to one SIP number.
So what I did is foreword it to a SIP number on my Asterisk server and allowed the Asterisk to foreword to both SIP phones (100,101). (see diagram below)


6) We now need to set up the Goip to call a SIP (VOIP) number when a call comes in from GSM network.
Click on the Configurations menu on the left.
6.1) I had to give the GOIP a SIP number (200) so that the GOIP can register to Asterisk.
6.2) I had to add a SIP number to GOIP to foreword all incoming GSM calls to a SIP number (105)
6.3) I had to add the Asterisk server IP 192.168.1.11 (substitute your IP)
6.4) and set the rest as in the RED config options below.
GOIP1 Configuration for GSM call forwording to SIP on Asterisk.
7) Next we need to configure Asterisk to allow GOIP1 to register its SIP 200 number and setting up Asterisk to foreword the incoming call to both my SIP app on android as well as my SIP client on My laptop or my Desktop SIP phone.
7.1) Login into you Linux server using your command  terminal (Ubuntu in my case)
7.2) Install Asterisk 
sudo apt-get update
when its complete the install asterisk
sudo apt-get install asterisk
When it is complete we now need to configure Asterisk to allow GOIP to connect to a SIP and to setup asterisk to foreword incoming and outgoing calls to and from Goip.
There is two files that needs editing. sip.conf and extensions.conf
 change to the asterisk config directory /etc/asterisk directory
cd /etc/asterisk
now edit the sip.conf file with your favorite editor
sudo vi sip.conf

add this example to your (/etc/asterisk/sip.config) file
sudo vi /etc/asterisk/sip.config


[200]
type=friend
secret=gioppassword ;NOTE it is important to set up a complex password
qualify=no ; Will not drop the connection
nat=yes ; This phone may be outside the network
host=dynamic ; This device registers with us
canreinvite=no ; Asterisk by default tries to redirect
context=GOIP ; Or whatever context you want to define in Asterisk
mailbox=200@default ; only if you are configuring voicemail.

now add the following to your extensions.conf file (/etc/asterisk/extensions.conf)
sudo vi extensions.conf

in the [general] section add the following  (only numbers in South Africa)

exten => _0[1,8,7]XXXXXXXX,1,Dial(SIP/200/${EXTEN})
and create GOIP section as below

[GOIP]
#incoming GOIP call
exten => s,1,Wait(1)
exten => s,n,Answer
exten => s,n,Playback(beep)
exten => s,n,Dial(SIP/101&SIP/102&SIP/103);Dail my Sip app on cell phone and my Sip desktop
exten => s,n,Hangup

Save files

Now restart  asterisk

 sudo /etc/init.d/asterisk stop
 sudo /etc/init.d/asterisk start

now monitor asterisk and test your Goip dail from GSM and dialing from you sip phone to any number in south africa.

sudo asterisk -rvvvvvvv


you should see your connection on the terminal

hope this help

Please note the GOIP units is Available from http://www.giga.co.za
 
Sending an SMS 
wget --user=admin --password=admin --auth-no-challenge --post-data 'line=1&smskey=0000000e&action=SMS&telnum=0812345678&smscontent=TEXT message to be send&send=Send' http://192.168.1.11/default/en_US/sms_info.html -O /dev/null


 
Check if SMS was send (wget will return the XMl below)
wget http://192.168.1.11/default/en_US/send_status.xml?u=admin&p=admin 

<send-sms-status>
<id1>0000000e</id1>
<status1>DONE</status1>
<error1/>
<id2/>
<status2/>
<error2/>
<id3/>
<status3/>
<error3/>
<id4/>
<status4/>
<error4/>
<id5/>
<status5/>
<error5/>
<id6/>
<status6/>
<error6/>
<id7/>
<status7/>
<error7/>
<id8/>
<status8/>
<error8/>
</send-sms-status>
 
Restarting the Goip remotely 
sudo wget --user=admin --password=admin --auth-no-challenge http://192.168.1.11/default/en_US/reboot.html -O /dev/nulll

Setting up SMS server for the Goip is available link below

 
 
here is also a good SMS server install dock

4 comments:

  1. Thanks man. Appreciate the post. been away from asterisk for a while and this just recapped it nicely.. Appreciate the effort.

    ReplyDelete
  2. To enable interconnection between GSM/CDMA/WCDMA/LTE network and VoIP network smoothly and safely Dasscom's GSM voip gateways in India are the optimum choice. The product effectively connects wireless networks with IP networks in accordance with the demanding user requirements.

    ReplyDelete
  3. Thanks for sharing this information with us
    GSM Gateways
    Please keep posting such informative blogs!

    ReplyDelete