Вы находитесь на странице: 1из 10

Khomp KGSM-USB SPX

and Elastix Server


Setup Guide

http://www.elastix.org
PaloSanto Solutions
Khomp KGSM-USB SPX Server Setup Guide

1.0 Setup Diagram


Figure 1-1 is a setup diagram for a single Khomp KGSM-USB SPX Interface Card
configuration.

Figure 1-1. Setup Diagram

2.0 Host PC Environment


Table 2-1. Host Server Environment Details
Description
Hardware Type Elastix Appliance ELX-Series
Hardware Version ELX-3000
Software Type Elastix
Software Version 2.4

3.0 Test Setup Equipment


Table 3-1. Test Setup Equipment
Equipment Model Version
IP (SIP) Phone N/A N/A
Khomp KGSM-USB SPX asterisk-chan_khomp-3.0-011.0
Switch N/A N/A

2
PaloSanto Solutions
Khomp KGSM-USB SPX Server Setup Guide

4.0 Setup Procedure

To set up the Elastix Server for the Khomp KGSM-USB SPX Interface Card:
1. First go to the Elastix Command Line Interface and install a khomp module for this
card. You can use ssh connection or directly from the Elastix Server. Once there,
type the following:

yum install kernel-module-khomp

service asterisk stop

/etc/rc.d/init.d/khompdrv

service kserver start

service asterisk start

Figure 4-1. Elastix CLI

2. To see the status of the Khomp KGSM Card enter to Asterisk CLI by typing
asterisk –r. Once there type khomp channels show (Figure 4-2).

Figure 4-2. Asterisk CLI

3. We can see an active channel that is where we placed the SIMCARD in the Khomp
KGSM-USB. Close Asterisk CLI by typing exit.

4. Now you need to edit a configuration file to make incoming calls use the PSTN
context in Elastix (or any context). In the command line type vim
/etc/asterisk/khomp.conf and find the line “;context-gsm-call”. Press “i” key to

3
PaloSanto Solutions
Khomp KGSM-USB SPX Server Setup Guide

switch to the Vim Edition Mode and erase the semicolon and the current value and
replace it by “from-pstn” (Figure 4-3).

Figure 4-3. Editor VIM

5. Press ESC key and type “:x” followed by ENTER to save changes and exit the Vim
Editor. You can close the file without saving changes with “:q!”. Reload asterisk by
typing asterisk –rx “reload” in Elastix CLI (Figure 4-4).

Figure 4-4. Reload Asterisk

6. Now, we go to the web address of the Elastix Server Login page. The web address
is determined by the customer, for this guide we have used the IP address
192.168.1.186

7. On the Login page, type the username and password for an administrative user into
the Username and Password fields, see Figure 4-5. The username and password are
determined by the customer.

Figure 4-5. Login

8. Press Enter or click on the Submit button to go to Elastix’s Dashboard


9. Once inside, we will create a trunk for outbound calls. Click on the PBX tab on the
menu at the top of the screen

4
PaloSanto Solutions
Khomp KGSM-USB SPX Server Setup Guide

Figure 4-6. PBX

10. Go to “Extensions” and select “Generic SIP Device” to create an extension for our
IPPhone. In the Add SIP Extension page fill in the following information (Figure 4-
7):

Add Extension

 User Extension: (302 in this example)


 Display name: (“IPPhone” in this example)

Device Options

 Secret: (“h7Dka3Rf9si0t” in this example)

Figure 4-7. Add SIP Extension

11. Click on “Submit” located at the end of the page and apply changes. Now, click on
“Trunks” on the left side and select “Add Custom Trunk” (Figure 4-8).

5
PaloSanto Solutions
Khomp KGSM-USB SPX Server Setup Guide

Figure 4-8. Trunks

12. On the Add Custom Trunk page, set the following (Figure 4-9).

General Settings

 Trunk Name: (“KhompTrunk” in this example)

Outgoing Settings

 Custom Dial String: khomp/b0c0/$OUTNUM$

Figure 4-9

13. Click on “Submit Changes” button located at the end of the page. Go to “PBX =>
PBX Configuration => Outbound Routes”. Click on “Add Route” (Figure 4-10). Set
the following:

Route Settings
 Route Name: (“9_Outside_Test” in this example)
Dial patterns
 Prefix: (“9” in this example) | Match pattern: (“.” in this example)
Trunk Sequence for Matched Routes
 0: The trunk that we just created (“KhompTrunk” in this example)

6
PaloSanto Solutions
Khomp KGSM-USB SPX Server Setup Guide

Figure 4-10. Outbound Route

14. Now you can make outbound calls through the SIMCARD calling a telephone
number with “9” as prefix.

15. We’ll create an incoming route for the calls from any external number to our
SIMCARD. We’re going to use an IVR for incoming calls. Go to “PBX => PBX
Configuration => IVR”. Click on “Add IVR” (Figure 4.11). Set the following:

 Name: Name of IVR (WelcomeIVR in this example)


 Announcement: Record which will be played for incoming calls.
 Options:
o * - Phone book.
o 0 - 302 Extension
o t - Repeat the options of IVR (Add this option by modifying the
IVR after creation)

Figure 4-11. IVR

7
PaloSanto Solutions
Khomp KGSM-USB SPX Server Setup Guide

16. Click on “Save” and Apply changes by clicking on the pink ribbon that appears at
the top of the page. Now go to “PBX => PBX Configuration => Inbound Routes”.
Click on “Add Incoming Route”. (Figure 4.12). Set the following:

 Description: Name of inbound route (“Incoming_Calls” in this example)


 Set destination: Where the call will be routed. (“WelcomeIVR” IVR in this
example)

Figure 4-12. Incoming Route

17. Click on “Submit” and apply changes. Now when we receive calls to the
SIMCARD the IVR will play to the caller giving him choices to interact with
Elastix Server.

18. Configure the IP (SIP) Phone with the correct parameters.

19. To test the configurations, pick up the previously configured IP (SIP) Phone and
dial a mobile phone with “9” as prefix. When the call is established, speak into the
phone and verify that the mobile phone can hear your voice. Next, from your
mobile phone call to the SIMCARD number and when the call is established you
should be interacting with the IVR.

8
PaloSanto Solutions
Khomp KGSM-USB SPX Server Setup Guide

SMS Configuration
We can also set SMS functions for Khomp KGSM-USB.

1. For sending SMS from the SIMCARD, edit the


“/etc/asterisk/extensions_custom.conf” (Figure 4-11). Inside the [from-internal-
custom] context, add the line:

include => sms-out

sms-out is a name that can be defined by the user.

Add the context:

[sms-out]
exten => 700,1,KSendSMS(b0c0|0989532586|Testing SMS.)
exten => 700,n,Hangup()

700: Extension we have to dial in order to send the message


b0c0: The zeros in b0c0 represent the number of the board/card and the number of
the channel/module where the SIM card you want to use is located respectively.
0989532586: The mobile phone number that will receive SMS
Testing SMS: The message content you want to send.

2. When finish, reload asterisk by typing asterisk –rx “reload” in the Elastix CLI.
You can also use the Asterisk CLI to send a message. Use the following command:

khomp sms b0c0 0989532586 "Your message here"

3. Now, for receiving SMS to the SIMCARD from any mobile phone, edit the
“/etc/asterisk/extensions_custom.conf” (Figure 4-13). Inside the [from-internal-
custom] context, add the line:

include => khomp-sms-00-00

The first two zeros (00) define the board/card you want to create the context for.
The second two zeros (00) will define which GSM Module (on the card) you want
to create the context for.
Since in this configuration only one card is used it is allocated the 00 position, and
the SIMCARD is located in the first position (00).

Add the context:

[khomp-sms-00-00]
exten => s,1,System(${KSmsFrom} ${KSmsBody})

9
PaloSanto Solutions
Khomp KGSM-USB SPX Server Setup Guide

KSmsFrom and KSmsBody are variables available for processing of SMS, they
contain the Sender and Content of the text message respectively.

Figure 4-13

4. When finish, restart asterisk service by typing service asterisk restart in the Elastix
CLI.

5. To test the SMS sending, pick up your IPPhone and dial 700. After finish the call
you will receive a message in the cell phone in the next seconds. To test the SMS
receiving, enter to Asterisk CLI with the command “asterisk -r” in Elastix CLI, and
send a message from any cell phone to the SIMCARD number. In the next seconds
you will see something like figure 4-14.

Figure 4-14

NOTE: If at any time you want to remove or stop using a Khomp card, be sure to
first edit the file: /etc/asterisk/modules.conf by adding the line: "noload =>
chan_khomp.so" in its [modules] , otherwise the asterisk process will not be able to
start properly.

10

Вам также может понравиться