Ozeki NG SMS Gateway logo OZEKI NG SMS Gateway
"The World's most reliable SMS gateway software!"

OZEKI NG SMS Gateway - Product Guide

PDF Request in SMS Contents | SearchSMS Forwarder

Home > Product Manual > Installation Guide > Users and applications > SMS to WCF service

 


Automated phone calls?
Ozeki Phone System XE VoIP PBX software is an advanced PBX built for automated voice calls and 2 way SMS messaging. It has outstanding APIs for software developers. It can be used for:

Phone calls from SQL
Phone calls from HTTP
Voice and SMS applications

Callcenter developers
If you are working on telephone solutions, please check out the Ozeki VoIP SIP SDK.
It can be used to create VoIP client and server software.

Contact Us!
If you wish to get further information, do not hesitate to contact us!

E-mail: info@ozekisms.com

If you have a technical question, please submit a support request on-line.

WCF Client User

This guide provides information on how to install a WCF user in Ozeki NG SMS Gateway. With the help of this WCF user you will be able to forward incoming messages to a WCF service (WCF: Windows Communication Foundation) that will process the messages.

Requirements:

You need an installed Ozeki NG SMS Gateway: Download Ozeki NG SMS Gateway

System architecture

If you create a WCF user in Ozeki NG SMS Gateway the system will work as follows: This created WCF user will be able to forward all incoming messages to a WCF service. As Figure 1 demonstrates, messages from mobile phones are received and processed by the WCF user of Ozeki NG SMS Gateway. This WCF user then forwards messages to the WCF service using WSHttpBinding binding. Finally the WCF service returns a response with the same type (OZmessage object) and also via WSHttpBinding binding.


Figure 1 - System architecture

Configuration steps

  1. Start Ozeki NG SMS Gateway
  2. Create a new SMS WCF user in Ozeki NG SMS Gateway. To do so click on Add new user or application and select SMS WCF user in the list (Figure 2).


    Figure 2 - Install WCF user

  3. Set the URL of the WCF service by clicking on WCF service settings and on General tab define the Service URL. In our example it is http://localhost:1165/WCFServiceForNG.svc (Figure 3).


    Figure 3 - Install WCF user

If you specified the proper parameter the connection has been created with the WCF service you wish to use. From that time all the incoming messages of the user will be forwarded to the WCF service.

Ozeki NG SMS Gateway communicates via WSHttpBinding binding with the WCF service and it uses Windows Authentication.

Ozeki NG SMS Gateway's requirements for WCF service of third parties:

The service needs to be described with IWCFServiceForNG interface. This interface has to include the operation contract defined by Ozeki Informatics Ltd:

[OperationContract]
OZmessage OnMessageReceived(OZmessage msg );

The operation contract receives an OZmessage object as a parameter. It contains the message ID, the phone number of sender and recipient, the text of the message, and the message type. Finally it saves the received message. In our example the message has been saved to Driver C into test.txt file.

public OZmessage OnMessageReceived(OZmessage msg )
            {
                FileStream file = new FileStream("C:\\test.txt",
                FileMode.OpenOrCreate | FileMode.Append, FileAccess.Write);

                StreamWriter sw = new StreamWriter(file);

                sw.WriteLine(msg.Recipient + ": " + msg.MessageData);
                sw.Close();
                file.Close();
                return msg;
            }  

The operation contract can be used for arbitrary functions in this way users can modify the body of the function. Please note that further operation contracts are not supported by Ozeki.

To operate properly you need to create OZmessage that takes part in the communication process:

Source code

[DataContract]
public class OZmessage
{
    string messageID;
    string sender;
    string recipient;
    string messageData;
    string messageType;

    [DataMember]
    public string MessageID
    {
        get { return messageID; }
        set { messageID = value; }
    }

    [DataMember]
    public string Sender
    {
        get { return sender; }
        set { sender = value; }
    }

    [DataMember]
    public string Recipient
    {
        get { return recipient; }
        set { recipient = value; }
    }

    [DataMember]
    public string MessageData
    {
        get { return messageData; }
        set { messageData = value; }
    }

    [DataMember]
    public string MessageType
    {
        get { return messageType; }
        set { messageType = value; }
    }

 }

Please note that any discrepancy from this code will result in errors.

You can also download an operating example for WCF service: WCFServiceForNG.rar





Next page: SMS Forwarder
Copyright © 2000- - Ozeki Ltd | info@ozeki.hu
Home > Product Manual > Installation Guide > Users and applications > SMS to WCF service
Legal | Privacy | Terms of use | 2669
3.235.22.210 | 87.229.102.173 | Login