Join us on Facebook

Please wait..10 Seconds Cancel

12.28.2013

// // 3 comments

PHP Script to Send SMS Through Your SIM Using Ozeki NG SMS Gateway

This QuickStart guide explains how to setup your SMS gateway quickly to evaluate it's functionality, and how to send your first SMS. The information provided here will help you start using the software as soon as you have downloaded and installed it. You can learn how to login, how to configure connectivity to the mobile network, and how to compose and send SMS messages.
         Video tutorial: How to send SMS using a GSM modem from a computer.

Prerequisites

To setup your system, you need a mobile phone subscription, that comes with a SIM card. (You can get such a subscription and a SIM card at any GSM shop). In addition to the SIM card you need a mobile phone or a GSM modem that can be used to send and receive SMS messages from a PC. You also need a data cable that can be used to connect your modem to your computer. To the computer you need to Download and Install Ozeki NG SMS Gateway.



Your checklist:

  • SIM card: it provides the telephone number. SIM cards are tied to a particular service provider and can only be used with a service plan from that provider. You can buy a SIM card at the shop of the service provider. You can find these shops at any shopping mall. Just ask the shop assistant for a "SIM only" subscription
  • GSM Modem: it is a specialized type of modem that accepts the SIM card. You can connect it to the PC with a data cable for sending/receiving SMS messages. You can purchase GSM modems directly from Ozeki Informatics Ltd
  • Data cable: Data cable is provided for each GSM modem that has been ordered from Ozeki Informatics Ltd. Ozeki provides data cables both for USB and RS232 connection types
  • PC + Windows XP, 2003, 2008, or Vista or Windows 7 operating system
  • Ozeki NG SMS Gateway (Download from http://www.ozekisms.com/index.php?owpn=112)

    Ozeki NG SMS Gateway can be obtained by
    opening the download page:
    Download Ozeki NG SMS Gateway!

    Logging in

    After you have downloaded and installed Ozeki NG - SMS Gateway, the first thing you will do is login to the user interface (the management console). You can login using Internet Explorer or Mozilla Firefox, by opening the login window. The login window can be accessed at the http://127.0.0.1:9501 URL, but in most cases it will show up right after the installation of the program, along with the Installation Complete dialog box. You can also open the login window by clicking the Manage Ozeki NG program icon in Start / All Programs / Ozeki NG (Figure 1).

    Figure 1 - Opening the program
    If the login window does not show up, you can try to open it by entering its URL in the browser: http://127.0.0.1:9501/.
    If it still won't show up, you should consult the Login problems page. You are very likely to find some advice there to solve this problem.
    In the login window, enter your username and password in the respective fields. The default username is admin, and the default password is abc123. For security reasons, remember to change your password (Figure 2). It should be a combination of letters and digits (at least one or two of the latter), and it should consist of at least 6 characters. You can change the password in the Authentication tab of a Standard user. (The admin user is a standard user.) See Figure 9 below. (See also the Standard User page.)

    Figure 2 - Reminder to change the password

    If you misspell your password, the login window will show up with a blank username and password field again.

    Basic Configuration Steps

    Once you have passed the login screen, you will see an interface called Management Console. One of the components of this interface is the Management Console tab. If you click it, you will get back to this starting screen. On the right of the title bar, you can see the name of the logged-in user and a link to log out (Figure 3).

    Figure 3 - Management Console
    Any messages composed and sent (or not sent) will belong to the user account of the logged-in user (see the Sending SMS messages section below).
    To be able to send SMS messages, you need to install and configure a service provider connection.
    You can do it by clicking the Add service provider link or the Add button in the top right-hand corner of the Service providers panel on the left of the interface.
    You can also add a service provider connection by clicking the Add service provider item in the Service providers menu.
    After you have clicked one of these, the Add service provider panel will show up on the right of the interface. The panel contains a list of service provider connection options you can install and use for communication with the SMS network.
    To send and receive SMS messages using a GSM modem, you need to attach a GSM Modem for SMS messaging to your computer with a datacable or you need to setup an IP SMS connection over the Internet. In this example we will setup a GSM modem. To install a GSM modem, click the Install link in the respective entry in the list (Figure 4).

    Figure 4 - Installing a service provider connection
    To send and receive SMS messages using a GSM device (modem or phone), you need to select and install the GSM Modem in the list.
    When you have installed the GSM Modem connection, a configuration panel will show up on the right of the interface. On this form you need to select the port your device is connected to and you need to click Autodetect. The Autodetect feature is going to recognize the GSM phone or GSM modem you have attached to your computer.

    Figure 5 - Click Autodetect to configure your modem.
    After the modem has been detected, specify the telephone number assigned to your GSM modem and the service provider connection name. ( You can pick any name you want to identify the connection.)
    Enter the information in the respective edit boxes. Remember to enter the phone number in international format: starting with "+". Note that the phone number to be specified in the Telephone number edit box is a mandatory value. If you leave the edit box blank, and if the outgoing SMS message does not carry a sender phone number either, the sending will be unsuccessful.
    Once you have configured the service provider connection, you can get back to the Management Console interface by clicking the Management Console tab in the top right hand corner.
    After your connection is configured, you can send and receive messages.

    Sending the first SMS message

    To compose and send an SMS message, click the Compose button in the toolbar, which is in the header of the Management Console.
    After clicking it, the Compose a text message panel will show up. Here, select the message type and the service provider connection in the respective dropdown menus.
    Then, enter the recipient phone number in international format (starting with +) in the To (phone number) edit box.
    Compose the message in the Message text edit box.
    Click OK when you are finished (Figure 6).

    Figure 6 - How to send the first SMS message.

    Setting up users and applications

    If you want to have multiple users, you might want to create a user account. To create an SMS user account, you need to install and configure a user. You can start to install and configure a user on the Management Console interface.
    To add a user, click the Add button in the top right-hand corner of the Users and Applications panel on the right of the Management Console (Figure 7).

    Figure 7 - Adding a user
    This will bring up an interface consisting of two panels.
    The panel on the left contains a list of users that have been installed. In the bar at the bottom of the panel you can read how many users have been installed.
    The panel on the right contains a list of users that can be installed.
    Each user in the left-hand panel is listed with a unique name (and the user type stated in brackets).
    Each user in the right-hand panel is listed with the name of its type and a brief description of what it can be used for.
    A standard user can use the HTTP user interface to login to the program. To add a standard user or any other type of user, click the Install link in the respective entry in the list (Figure 8).

    Figure 8 - Installing a standard user
    When installing a user (type), you need to give it a unique username. Clicking the Install link will bring up the Standard user installation panel. Here, you need to enter a unique username in the Username field.
    This will take you to the Configuration panel with the Authentication tab.
    The Username field contains the unique username you have provided in the previous panel.
    The Password field contains a password offered by the program. You can and should change it. Your password should be a combination of letters and digits (at least one or two of the latter). From now on, the username and password you have provided can be used to login to the program (Figure 9).

    Figure 9 - User authentication
    To modify the configuration or to view server events related to an installed user, open the panel of the user's account. To do this, click the name of the user in the Users and Applications panel of the Management Console. In the panel of the user's account, click the link of the task you wish to perform (Figure 10).

    Figure 10 - Clicking a user-related task link
    To uninstall the user, click the Uninstall link.

    Routing

    To send and receive SMS messages you need to configure the routing.
    For incoming SMS messages, you need to configure the inbound routing. The configuration of the inbound routing allows the program to decide which user(s) to deliver an SMS message to.
    For outgoing SMS messages you need to configure the outbound routing. The configuration of the outbound routing allows the program to decide which SMS service provider connection to use to send out an SMS message.
    To find out more about routing, check out the Inbound Routing and the Outbound Routing page.
    To learn more about the importance and convenience of configuring outbound routing, check out the Least Cost Routing page.
    Inbound Routing
    An incoming message can be destined to one or more users. To define which of the users should receive a copy of an incoming SMS message, you have to set inbound routing rules.
    A routing rule is a set of directives. The routing rules make up a routing table. A routing table can contain any number of rules. Each routing rule is a row in the table.
    The program goes through the routing rules from top to bottom. It checks if the properties of a message match the directives of a routing rule. If a rule does not apply to the message, the program will go on to the next rule.
    If there is a match, the message will be delivered to the user specified in the rule. The position and the mode of this rule defines whether the program will compare other rules with a message and deliver it to another user (if there is a match).
    If the rule is in the last row, there are no other rules to match, and the routing will finish.
    If a rule matches a message, but it is in move mode, the routing will finish, and the subsequent rules will be ignored.
    If there is a match, but the rule is in copy mode, the routing will continue. If there is another match, the message will be delivered to another user as well.
    If a message with certain properties is destined to more than one user, a separate rule needs to be set for each user.
    The order of the rules in the table matters only if the mode directive of a rule is move. It should only be move in the last of the rules intended to apply to a message with certain properties.
    To set a rule in the inbound routing table, take the following steps:
    Click the Edit button in the top right-hand corner of the Inbound routing panel. This panel can be found in the client area (the middle section) of the Management Console (Figure 11).

    Figure 11 - The Inbound routing panel
    This will bring up a panel where you can choose to add, edit or delete a routing rule. These tasks have respective buttons. Click the Add button.
    Next, fill in the edit boxes and select the respective items from the dropdown menus. Give a rule any name you like in the Route name edit box.
    Select the GSM service provider connection in the Source (Service provider) menu. Which service provider the message comes from is one of the properties of the message.
    Next, enter the conditions in their respective edit boxes: the sender's phone number, the recipient's phone number and the keyword. The keyword is the first word of the SMS message. If you do not wish to specify one or any of these conditions, enter "ANY" in the edit box next to the condition.
    Select the destination from the dropdown menu. The destination is the user that a message is destined to. If you select ANY, all the installed users will receive the message the rule applies to.
    Select the mode in the Mode menu. If you select move (Figure 12), the routing will stop (if the rule matches a message). The user specified in this rule will be the last to receive the message. In this case, no other users specified in subsequent rules will receive a copy of the message, even if those rules match the message as well.
    To make the program match subsequent rules with the message, select copy .
    Click OK when you have finished editing the rule.
    Then the rule will be included in the inbound routing table.
    You can change the position of a rule in the routing table.
    To move a rule one position higher, click the green arrow beside it.
    To move a rule one position lower, click the red arrow beside it.

    Figure 12 - Setting an inbound routing rule

    Outbound routing

    An outgoing message can be sent out using one of the GSM service providers you are connected to. You can configure the outbound routing for the program to decide which service provider connection to use to send out a message.
    To define which of the GSM service provider connections to use to send out an SMS message, you have to set outbound routing rules.
    The outbound routing rules make up an outbound routing table. Each row in the table is a rule. Each rule consists of directives, which the program compares with the properties of the SMS message.
    The engine goes through the routing rules from top to bottom. It checks if the properties of a message match the directives of a routing rule. If there is a match, the routing will be performed, and the message will be sent out using the GSM service provider connection specified in the rule.
    The message will be sent out according to the first rule that applies to a message. Consequently, all subsequent rules will be ignored. Unlike with inbound routing, outbound routing does not allow a message to be delivered (or sent) in multiple copies.
    To set a rule in the outbound routing table, take the following steps:
    Click the Edit button in the top right-hand corner of the Outbound routing panel. This panel can be found in the client area (the middle section) of the Management Console.
    This will bring up a panel where you can choose to add, edit or delete a routing rule. These tasks have respective buttons. Click the Add button (Figure 13).

    Figure 13 - The Outbound routing panel
    Next, fill in the edit boxes and select the respective items from the dropdown menus. Give a rule any name you like in the Route name edit box.
    Specify the user in the Source (User) dropdown menu.
    Specify the conditions in the respective edit boxes. Enter the sender phone number, the recipient phone number and the keyword. The keyword is the first word of the SMS message.
    Finally, specify the GSM service provider connection to send out the SMS message by selecting it in the Destination (Service provider) dropdown menu.
    Click OK when you have finished editing the rule.
    Then the rule will be included in the outbound routing table (Figure 14).

    Figure 14 - Setting an outbound routing rule
    You can change the position of a rule in the routing table.
    To move a rule one position higher, click the green arrow in its row.
    To move a rule one position lower, click the red arrow in its row.
  • 3 comments:

    1. Superb Knowledge About Bulk SMS !
      Have A look At our Site Also Bulk SMS Provider !!
      Thanks Again For Sharing This Blog !

      ReplyDelete
    2. This comment has been removed by the author.

      ReplyDelete
    3. Now Send billions of SMS per second- anytime anywhere from MSGCLUB Bulk sms gateway and API

      ReplyDelete