Ruby VoIP developers 101

Part 3: Ruby connection with gem library (SMS)

The Ozeki Phone System gives you the opportunity to use its special features. It is possible to use the ozeki_sms.gem library to connect to the Ozeki Phone System. This guide helps you to install, and use this library.

Part 1: Ruby example on sending SMS, making VoIP calls
Part 2: Ruby example on recording VoIP calls, call routing
Part 4: Ruby connection with gem library (Calls)
Part 5: Ruby SDK Commands

Overview

This page assumes that you already have some basic knowledge in Ruby programming language. If you don't have these skills, then you should check out our basic examle site at Ruby basic example.

1. Installing

First you should download the Ozeki_VoIP_Ruby_Library.zip (100KB). After unpacking this zip file, you should execute the following command in a command prompt or in a terminal.

gem install ozeki_sms

2. Using the library

In your project after the successful installation, you should include the gem file with the following command.

require 'ozeki_sms'

Code example 1 - Including Ozeki Phone System SDK library

Now you are ready to call the functions. Here is an example how to send an SMS from the 9999 API extension to the 2000 SIP extension if your Ozeki Phone System XE IP address is 192.168.0.1, the HTTP API service is listening on port 7780, and the authentication is set to Anonymous.

OPS.send_sms '192.168.0.1', '9999', '2000', 'Hello world!'

ops = OPS.new '192.168.0.1', '9999'
ops.send_sms '2000', 'Hello world!'

Code example 2 - Sending an SMS message with the Ozeki Phone System

To send an SMS through the Ozeki NG - SMS Gateway.

ng = NG.new '192.168.0.1', 'admin', 'password'
ng.send_sms '06203105366', 'Hello world', 'admin'

Code example 3 - Sending an SMS message with Ozeki NG - SMS Gateway

Read more about OzML commands.

Part 4: Ruby connection with gem library (Calls)

If you have any questions or need assistance, please do not hesitate to contact us at info@ozekiphone.com.

More information