OpenVox GSM Gateway Function User Manual
OpenVox VoxStack GSM Gateway is a feature-rich, highly available and flexible modular gateway product. This manual introduces some major functions of the gateway, so that our customers could configure it easily.
Chapter 1 How to Change the System Language
Chapter 2 What Is the Difference between ETH1 and ETH2
Chapter 3 How to Use Call Duration Limit Function
Chapter 4 How to Use the Function of Modify IMEI
Chapter 5 Change the Callee ID
Chapter 6 How to Use the Time Routing Function
Chapter 7 The SIP Connection Ways
Chapter 8 How to Use the Cluster Function in OpenVox Gateway
Chapter 9 How to expand functions of OpenVox GSM Gateway
Chapter 1 How to Change the System Language
OpenVox GSM Gateway supports user custom language package. You can change the Web language of gateways. The default language is English and you could change it to Russian, Spanish, and so on. Now let me show you how to use the function.
Please click “SYSTEMGeneral”, and enable the Language Advance Settings. Then download the language package to your PC.
After you download the package, you can edit your own language. For example:
Now I will change the home page “GSM Information” (that displays with English) to Chinese.
First, please edit the Language package file. You could see this.
Please edit the first line as follows:
Now, please find the “system–status” segment.
Then change the “GSM Information” to “GSM 信息” and save it.
Please upload your file, and then click “Add” button.
After uploading successfully, you have achieved to change the language.
Click the Language drop-down list and choose your language. Don’t forget to save and apply it.
Now you can see the language has been changed to Chinese.
Notice: If your gateway doesn’t support to change language, please upgrade your firmware. The link is shown as below:
http://downloads.openvox.cn/pub/firmwares/GSM%20Gateway/wg400-current.img
Chapter 2 What Is the Difference between ETH1 and ETH2
OpenVox GSM Gateway has two RJ45 Network ports, ETH1 and ETH2. If you choose ETH1, you can access Board 1 immediately, and access other boards with the same IP address but different port numbers. This will help to avoid IP conflict. If you choose ETH2, you can access different Boards with different IP addresses.
VoxStack provides 2 kinds of working modes, Stand-alone and Cluster.
- Stand-alone: A single IP address manages one GSM modules(4 ports)
Stack Num | IP | Username | Password |
1 | 172.16.99.1 | admin | admin |
2 | 172.16.99.2 | admin | admin |
3 | 172.16.99.3 | admin | admin |
4 | 172.16.99.4 | admin | admin |
5 | 172.16.99.5 | admin | admin |
- Cluster: A single IP address manages up to 5 GSM modules (up to 20 ports).
Chapter 3 How to Use Call Duration Limit Function
OpenVox GSM Gateway could support Call Duration Limit. You can control every port Total Call Time, and control Single Call Time. It will be useful for the customers working as operators.
For example, we want to set the first port. Please click GSM GSM Settings. Then click “Action”.
Enable Single Call Duration Limit | Define maximum call duration for single call. Example: If Time of single call set to 10, the call will be disconnected after talking 10*step second. |
Enable call Duration Limitation | This function is limit the total call duration of GSM channel. The max call duration is between 1 to 999999 steps. |
Example:
step | Step length value range is 1-999 seconds, step length multiplied by time of single call just said a single call duration time allowed |
Single call duration Limitation | The value of limitation single call, this value range is 1-999999.
step length multiplied by time of single call just said a single call duration time allowed |
Means: The single call will be disconnected after session lasts 59 seconds.
Definition of Setting Call Duration Limit
Enable call duration Limitation | This function is limit the total call duration of GSM channel. The max call duration is between 1 to 999999 steps |
Call Duration Limitation | This function is to limit the total call duration of GSM channel. The max call duration is between 1 to 999999 steps. |
Minimum Charging Time | A single call over this time, GSM side of the operators began to collect fees, unit for seconds |
Alarm Threshold | Define a threshold value of call minutes, while the call minutes less than this value, the gateway will send alarm information to
designated phone number via SMS |
Alarm Phone Number | Receiving alarm phone number, user will received alarm message from gateway |
Remain Time | This value is multiplied by to step length is a reset call call time |
Enable Auto Reset | Automatic restore remaining talk time, that is, get total call minutes of GSM channel |
Auto Reset Type | Reset call minutes by data, by week, by month |
- Example 1:
Means:
Scenario 1: If the talk time is less than 30’’, the Remain Time won’t do any change. For example, if your talk time is 28’’, the Remain Time is still 10’’.
Scenario 2: If your talk time is bigger than 30’’, for example 38 seconds, the Remain Time will reduce 1, and become 9.
Scenario 3: If your talk time is 62 seconds (one minute and 2 seconds), the Remain Time will be reduce 2 and become 8.That means if your talk time less than a step, it will be regard as a step.
Notice:The Remain Time will be shown on SYSTEM Status interface dynamically.
- Example 2:
Means:
When your Remain Time is 1 (Alarm Threshold), the gateway will send a message to the phone 63291902(Alarm Phone Number).The message content is “test alarm” (Alarm Description content).
The Remain Time will be reset at 2015-03-17 15:45:26. Because I enable the Auto Reset Type, and set it to 1 Day.
If you want to enable the Call Waiting features. Please enable it
Chapter 4 How to Use the Function of Modify IMEI
OpenVox GSM Gateway allows you to modify IMEI. We provide 2 ways, one is manual and the other is automatic. It will useful when you need to change the IMEI of modules.
What does IMEI manually-modify mean:
You could provide new IMEI numbers and choose the module you want to modify at any time. The original IMEI will be changed by your new IMEI.
What is IMEI automatically-modify:
The system will randomly create some new IMEI by the rules you set. And modify the IMEI in a cycle. For example, modify all modules every 30 minutes.
Next we will guide you how to modify the IMEI automatically.
At first please login you system via Web, and look at your address bar. You will see like this “IP/cgi-bin/php/system-status.php”. Then delete the “system-staus.php”, replace it with “gsm-autoimei.php”, press “Enter” key.
You will see following figures.
Parameters:
Port | you can seclect the port you want to modify |
Enable | “on” mean enable auto modify IMEI; “off” mean disable auto modify IMEI |
Interval | The time interval that you want to modify. For example, you set “1800” means once every 1800 seconds will be modify IMEI. |
Immediately | Immediately begin to modify the IMEI.If you disable it, the system will be modify IMEI after some time, the time is “interval” setting. |
Force | Modify IMEI no matter whether the channel state is ready or not |
About “Auto-IMEI Advanced”, please click the button “Auto-IMEI Advanced”.
The x means that system will randomly create number to replace it. Set to all: apply the rule to all ports.
Just Click save and apply buttons. The system will begin to change the IMEI automatically according to your settings.
Of course, if you want to modify manually, please click the “Auto-IMEI Advanced” button. At first, please keep enable options “OFF”, like this:
And then, please click the “Auto-IMEI Advanced” button.
For example, if you need to modify the “board-1-gsm-1”, just to click the “manual” button. And input your new IMEI, click “Modify” button.
Chapter 5 Change the Callee ID
Please login your GSM Gateway and choose “ROUTINGCall Routing Rules”.
Choose your routing rules, for example, I choose my “Test_out” rule.
Please Click “Advance Routing Rule”.
Now I will give you some examples to help you understand how to use it flexibly.
- Example 1:
At first the system will detect your callee ID, if it starts with “9”, it will delete the number “9”, then try to match “.” (that means any number).If it could match, the system will send out the call.
For example,I try to call “10086”, but I need to dial “910086”. The system finds the first num could match the num ”9”, and delete “9”, then match the “.”, it will match any numbers.So the system will try to call “10086”.
- Example 2:
If I try to call “910086”,the system will found the number begin number “9”,it will delete the number “9”,and then try to match “910086”.But it can’t match,because the system have delete the number 9,so 10086 can’t match the 910086.So the system will not send the call.
Notice: About the match pattern,please refer the user manual page 44.
- Example 3:
I try to call “910086”. At first the system will detect the begin number, it can match “9”. So the system will delete the number “9”, now the number become “10086”, not 910086. Now the system will continue, it will add a prefix 0755 for the number. At last send the call “075510086”
- Example 4:
Now I try to use my extenstion 1001 to call “910086”. At first the system will try to detect the begin num,it can match “9”, so it deletes the number, now the number become “10086” and caller ID is 1001. Then the system will continue to match if it is 10086 and caller ID is 1001. Last the system will add a prefix 0755, then send the call to “075510086”.
- Example 5:
Now I use the extesntion 1001 to call “910086”. At first the system will try to match the first rule(lable 1). It can match “9”, so it will delete the number,the callee number become 10086. It will continue to match if the callee number is 10086 and the caller is 1001.The system finds the 1002 can’t match extension(caller) 1001. So it can’t match the rule 1.The system will try to match rule 2, it can match. At last call number is “02710086”.
Of course, if you try to use the extenstion 1002 to make a call to “910086”, it will send the num “075510086”.
The whole process is as follows:
The red label is the order of Gateway try to match.
Chapter 6 How to Use the Time Routing Function
OpenVox GSM Gateway supports routing according to TIME. It can judge if execute the routing according to time. For example, you have a SIM card, it will cost lower during the time 0:00-2:00, I think maybe you need this function.
I set a call out routing as an example (SIP TRUNKGSM port).
The gsm_all is a “GSM port” group, the routing means that if 1001(SIP trunk) receives calls it will send the call to an available GSM port. Without any limit, the calls will be sent at once. We can set it just within a specified time horizon. Please click “Advance Routing Rule” button.
Before we set time routings, we need to set the server time (Gateway time).Because the gateway will be in their own time.
Please choose the Time menu.
Choose your local time zone in the “Time Zone” drop-down list. And click the Sync from NTP. You will see the server time on the top right corner once you set the gateway time.
- Example 1:
If you allow the routing send the calls just during 09:00—10:00 every day. You can set it as below
The call will be sent successfully, because now the server time is “2014-1-2 09:51:32” .It meets the current setting of the time. If you try to make a call after 10 minutes, the call will be cut, because the time is not during 09:00–10:00.
- Example 2:
If you want the routing to send the call just during 09:00—10:00 from Monday to Friday, you can set it like this:
Now the call have been established, because now the gateway server time is 09:58 and today is Thursday, it can meet current settings of the time.
- Example 3:
Let’s set a time rule as below:
Today is the 2014-1-2 10:02, and Thursday. There is no doubt that the call will be established smoothly, because the server time now can match the time rule.
The process seems to be like this. When you have a call coming from 1001(SIP trunk), it will find the routing (1001-GSM_ALL), and try to match the routing. If you set the time rule, it will try to match the time rule.
At first it will try to match the time. Now the server time is 10:02, it can match your setting (09:10—10:30). Then it will continue, try to match the Week Day, today is Thursday, It can match your setting (Thursday–Thursday). It doesn’t finish, and will try to match other rules. Today is 2th
that can match Month Day (02–02), and today is January. It matches all time rules. So the call will be established.
Now I want the call to be sent just from 2013-12-15 to 2014-1-3 and from Monday to Friday
during 09:00-18:00. You can set it as follow:
At first, set the “Time to start” and “Time to finish”, it is 09:00—18:00.
Then we set the “Week Day start” and “Week Day finish”. We need to set it is Monday to Friday.
Then let’s set the “Month Day start” and “Month Day finish”. It is 12.15 to 1.3, how can we set it?
Maybe you will set it as following:
But it is wrong. The right settings should be set as below:
At first, we set the “Month Day start” and “Month Day finish”, it should be 15th to next month 3th. That means it is 12.15—12.31 and 1.1—1.3. Please click the “+ Add More Time Pattern Fields”, then set it.
At last, we set the “Month start” to “Month finish”. It is December to January.
Today is the 2014-1-2 10:02, and Thursday. At first it will try to match the label “1” rule, but it can’t match it, so it continues to match label “2” rule. It can match correctly. So the call will be established.
Notice: Don’t forget to click the save button and apply it after you change the settings.
Chapter 7 The SIP Connection Ways
Now the OpenVox GSM Gateway supports 3 ways to connect via SIP protocols. One is the GSM Gateway as a SIP server, one is the GSM Gateway as a SIP endpoint and register, the other is the Gateway as a SIP endpoint (IP to IP).
- The first way that GSM Gateway works as a SIP server
Please click the “SIPSIP EndpointsAdd New SIP Endpoint” to set SIP server. The following figure shows detail information about how to set it.
Other parameters about SIP, please set according to your requirements because there is no need to set them in simple calls.
Now I will let my softphone register to the Gateway. Of course, if you need call out or call in, also you need to make the routing. I configure it like follows.
Please run your softphone, I use the X-lite as my SIP endpoint, and register it to the Gateway.
Please input the correct username, password and Domain. You will see the register information in the WEB of Gateway once you register.
Now we can try to make a call via softphone.
As you see, the call has been established.
- The second way that GSM Gateway works as a SIP endpoint and register.
We register the SIP endpoint to my PBX via SIP protocol. This is the Gateway SIP setting.
The PBX I use is Elastix, you can set it in “PBX-TrunkSIP Trunk”
As you see, it can register successfully.
- The last way (IP to IP)
At first, please configure a SIP peer in OpenVox Gateway.
Then please configure it in your PBX, I configure it in Elastix. For example:
You can see the status:
Chapter 8 How to Use the Cluster Function in OpenVox Gateway
OpenVox GSM Gateway provides the cluster function to manage every board, it will quite flexible. Users can combine the boards at random. For example you can configure your Gateway with 4/8/12/16/20 GSM ports via cluster function.
Before we configure the cluster, we need to know the OpenVox GSM Gateway IP address. Every OpenVox GSM Board have 2 IP addresses (one is a Reserved Address). It means that if you have 5 boards (20 GSM ports) in the Box. You will have 10 IP addresses, every board have 2 IP addresses.
Please click the menu of “NETWORKLAN Settings”.
You can configure the “IPv4 Settings”, but about “Reserved Access IP”, you just can enable or disable it. If you enable it, you can visit gateway with this address, the same as IPv4 Address.
Now, let us use the “cluster” function.
Now I have one 5 boards (20 ports) GSM Gateway, the first Board IP is (172.16.99.1 and 192.168.99.1), the other in sequence are (172.16.99.2 and 192.168.99.2)…….(172.16.99.5 and 192.168.99.5). That is default IP address.
Now I login the 172.16.99.1 or 192.168.99.1, you will see like that:
Please click the “SYSTEMCluster” menu.
You will see follow:
Now OpenVox GSM Gateway can support 2 ways to configure the cluster. One is manual, the other is Automatic. At first, we cluster manual.
- Manual: Please enable the “Detail”, you will see as follows:
Now I want the first board to work as a master board and manage other 4 boards. So I choose the mode is “Master”.
Parameters :
Password | The Master mode password, must be 4-16 bits and 0-9 |
Master IP | The Master’s target IP address |
Slaves IP list | The slaves original IP and target IP address |
Remain Origianl address | You can enable or disable it and decide that if you can visit the Origianl IP address. |
Now I set like that:
At first, I set the Master IP(Local IP) is 192.168.9.1,I give another IP to the first board(172.16.99.1), now the first Board have 3 IP address, one is 172.16.99.1, one is 192.168.99.1(Reserved IP address) and the other is 192.168.9.1.
Slaves IP List:
My original IP is 172.16.99.2, and I give it another IP 192.168.9.2. It has 3 IP addresses.
That means if you need to remain original IP address, but you disable it, you couldn’t visit the Gateway with IP 172.16.99.2/172.16.99.3/172.16.99.4/172.16.99.5.
When you ensure your settings are right, please click the “Manual Cluster” button, you will see follows:
That means you have cluster successfully. You can login with the IP address 172.16.99.1 and check if you can see 20 ports.
You can use it as a 20-port Gateway. For example, I try to change the IP address.
Now I use 172.16.8.42 to login the gateway, you will see that:
Maybe you will ask me “I have a 20-port gateway, now I want to set it two gateways, one is 8 ports, the other is 12 ports. How can I do that?”
Ok, let us set it, in order to describe more clearly, I first factory reset my gateway. Now that gateway is in factory model. It has 5 boards in box, and every board has 2 IP addresses: (172.16.99.1/192.168.99.1)…….(172.16.99.5/192.168.99.5).
At first, we login 172.16.99.1 and configure 8-port Gateway. Please choose the menu “SYSTEMCluster”, and set like follows:
And then click the button “Manual Cluster”. You will see follow output:
Notice: If you can’t see any output in Report, please enable the “Detail” and set again.
Now, let’s login 172.16.99.1 and check it. As you see, you have got an 8-port GSM Gateway.
We continue to configure the 12-port GSM Gateway.
Please login 172.16.99.3 (it is the third board IP, because the second board has been used as a slave board of 8-port GSM Gateway (172.16.99.1).
Please set the “Cluster” like follows:
When ensure the settings are right, please click the “Manual Cluster” button, you will see follows output.
Now, let’s see if we get the 12-port GSM Gateway.
Above it is the manual cluster function. The automatic cluster function means “one key cluster”. You just need to click one button and the system will find all OpenVox GSM Gateways via MAC address then make them work as slave boards.
Chapter9 How to expand functions of OpenVox GSM Gateway
You can setup your personalized dialplan like setting in asterisk. The manual will refer you how to setup the IVR (include DISA) and Callback.
- IVR
OpenVox GSM Gateway can be used as a sample PBX and you can use it directly without any PBX. Next I’ll show you the basic functions of IVR
Please login your GSM gateway, and select the “SIPSIP Endpoints”, and then click t “Add New SIP Endpoint” button.
Now the OpenVox GSM gateway supports 3 kinds of connecting ways via SIP protocol. One is the Gateway as a SIP server, one is the Gateway as a SIP peers registered to PBX, and the last is the IP to IP.
I choose the first way to show you how to set the IVR.
Notice: You can choose different connecting ways by selecting the “Registration” options. I select the “Endpoint registers with this gateway” which means the Gateway will work as a SIP server. You can register your softphone to the gateway directly.
Just need to save it and apply. Be shown as below:
Now, let’s set the second SIP server.
At last, we register our softphone to the GSM Gateway.
You will see the registration status in the “SYSTEMStatusSIP Information”.
OpenVox Gateway can support SSH login, so that you can know more details, and expand your own applications.
Please select the “SYSTEMLogin Settings”.
Login the Gateway via SSH.
Please edit the file /etc/asterisk/extra-channels.conf, when you open the file, you will see:
Please change the default context. Above I have changed the context of gsm-1. When the first gsm port receives a call, it will go to the context dialplan. You can edit your own dialplan.
Please open the file /etc/asterisk/extensions_custom.conf, and edit it.
Of course, you can edit it via our web interface also.
When you finished editing, please reload the asterisk.
Notice: You can import your own recording file to OpenVox Gateway. I have imported my recording file to the gateway. And you need to add some modules in the gateway. On the other hand, I suggest you to use the gsm codec record.
How to import recording file to gateway:
You can download a tool to import the file to the gateway, I use the winscp and you can download it from internal.
The sample of dialplan:
This dialplan means that when someone calls GSM-Port 1, the gateway will play a voice. And then the custom will choose different services by inputting different digits. The gateway will detect DTMF, and execute different operations.
For example, when you hear sound, and press digit 1, the extension 1001 will ring. Of course you can setup richer dialplan according to your need, just like you setting up it in asterisk. You can also write it via AGI and AMI. It can support PHP and other program languages.
Another example: Image that, when you have a call from the Trunk. You want to match the extension, if the extension can match your settings, it will ask the caller input the destination number, and then choice a fix port send the call. If not, it will ask the caller input the PIN and match the PIN, If the PIN can match, it will ask input the destination number, and then send the call, it not it will hang up the calls directly.
Step 1: Create a Trunk via the WEB
step 2: Login your gateway via ssh, and find the Trunk settings in the /etc/asterisk/sip_endpoings.conf, then change the context=sipinbound to context=IVR. Of course,you can change it via the WEB(AdvanceAsterisk File Edit)
That means when you have a call from this Trunk, it will choice the IVR dialplan, you can use other text, just need you setup it in dialplan.
Step 3: reload the SIP settings
Run command: asterisk –r
Run command: “sip reload” or “core reload”;
Step 4: Setup the dialplan:
Run command: vi /etc/asterisk/extensions_custom.conf
Step 5: Edit the Dialplan:
Step 6: Reload the dialplan
Run command: asterisk –r
Run command: dialplan reload
Notice: You need to import some record to the gateway if you need. And you need to add some module in the gateway.
Run command: asterisk –r
Run command: module load app_disa.so
Run command: module load app_authenticate.so
Run command: module load codec_gsm.so
Run command: module load format_gsm.so
On the other hand, I suggest you use the gsm codec record.
- Callback Function
Example scenario:
The extension 1001 makes a call “SIP -> GSM” to number 13632919026, but this number doesn’t answer the call. After a few minutes, the number “13632919026” calls back “GSM -> SIP” and this call can’t go to any other extension, it has to go to the extension who originates the call (SIP extension 1001). The call must be in a buffer so that when the target phone calls back, the OpenVox gateway knows which extension that originates the mobile target.
This example we will use the PHPAGI to setup it, so that you can know how to use the PHPAGI in the gateway.
Step 1: We need to get the call state, whether “Answer, or No Answer”. And if the call is “No Answer”, we will save the originated extension and the target number (cellphone) to a file. So that we can match the file once some calls from GSMSIP.
Step 2: Please edit the file extensions_routing.conf.The file content is /etc/asterisk/extensions_routing.conf. Follows:
First, please add a dialplan in your Trunk. I add it here. You can check the dialplan and add it to the right place.
I add an AGI dialplan after the Trunk has call hung up, it will run a PHP Script named setcallbacklist.php under the content /etc/asterisk/agi-bin/setcallbacklist.php.
[sip-9999-172.16.8.44]
include => rtg-CallOut-1
exten=>h,1,WriteCDR(“${CDR(src)}”,”${CDR_CALLEEID}”,”9999″,”${CDR_TOCHAN}”,”${CDR(start)} “,”${CDR(billsec)}”,”${CDR(disposition)}”)
exten=>h,n,AGI(/etc/asterisk/agi-bin/setcallbacklist.php,”${CDR(disposition)}”,”${CDR(src)}”,”${C DR_CALLEEID}”);
The red line is I add. About the means please refer to the asterisk AGI from below link: http://www.voip-info.org/wiki/view/Asterisk+AGI
Step 3: Create a PHP script. I create it under the content /etc/asterisk/agi-bin/, so I need to create a content named agi-bin
Then you need to copy at least 2 AGI libs to the content. You can copy it from asterisk or elastix. And then change the permissions of the lib.
The AGI lib name is phpagi-asmanager.php and phpagi.php
Step 4: Write your AGI script, there is a sample PHP script:
This PHP script will create a file record the “No Answer” cellphone and the SIP extensions to a name of callbacklist.txt. Now I will make a call to a cellphone use my extensions 1001, and no answer it. You will see the file will be created and have a “No Answer” list.
Step 5: Match the cellphone number if have a call coming in gateway. Please edit the file /etc/asterisk/extensions_macro.conf
Add the AGI dialplan in this file.
exten => s,1,AGI(/etc/asterisk/agi-bin/callback.php);
Once have calls coming from GSM port, it will check a file and judge if it is a “No Answer” cellphone call in. If yes, it will call out to the right SIP extension, if no, it will continue (not change anything).
This is the callback.php.
Notice: Things above are based on asterisk dialplan, if you want to understand more clearly, please scan more information about asterisk.