13.07.2015 Views

Programmer's Guide for ActiveX API - Sonera

Programmer's Guide for ActiveX API - Sonera

Programmer's Guide for ActiveX API - Sonera

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

BY CCC GROUP<strong>Programmer's</strong> <strong>Guide</strong> <strong>for</strong> <strong>ActiveX</strong> <strong>API</strong>Version 4.0October 17, 2003Content Gateway is a trademark of CCC Group


<strong>Programmer's</strong> <strong>Guide</strong> <strong>for</strong> <strong>ActiveX</strong> <strong>API</strong> 2(9)October 17, 2003The in<strong>for</strong>mation contained in this documentation describes the Content Gatewaysoftware product and is subject to change without notice. Please verify that yourcompany has the most recent version. This in<strong>for</strong>mation is intended <strong>for</strong> the use ofCCC’s customers only <strong>for</strong> the purposes of the agreement under which thedocumentation is submitted.CCC has made this documentation in professional manner using all reasonableef<strong>for</strong>ts to ensure that the in<strong>for</strong>mation in this documentation is adequate and free ofmaterial errors and omissions. However, the documentation may includein<strong>for</strong>mation about Content Gateway’s suitability that cannot be regarded binding.Content Gateway’s features are described in the agreement made between therespective parties. CCC shall, when necessary, explain issues, which may not becovered by the documentation.CCC WILL NOT BE RESPONSIBLE IN ANY EVENT FOR ERRORS IN THIS DOCUMENTATIONOR FOR ANY DAMAGES, INCIDENTIAL OR CONSEQUENTIAL (INCLUDING MONETARYLOSSES), THAT MIGHT ARISE FROM THE USE OF THIS DOCUMENTATION ORINFORMATION IN IT.Content Gateway and are trademarks of CCC Group. Other product namesappearing in the document, if any, may be trademarks of third parties, and they arementioned <strong>for</strong> identification purposes only.This documentation is protected by copyright according to the applicable laws andinternational treaties.Copyright © 2003 CCC Data Oy. All rights reserved.Copyright © 2003 CCC Data Oy. All rights reserved.


<strong>Programmer's</strong> <strong>Guide</strong> <strong>for</strong> <strong>ActiveX</strong> <strong>API</strong> 3(9)October 17, 2003TABLE OF CONTENTSTABLE OF CONTENTS...........................................................................................................................31 INTRODUCTION..............................................................................................................................41.1 THE CONTENT GATEWAY <strong>API</strong> LIBRARY..........................................................................................41.2 SERVICE TYPES ............................................................................................................................52 PROPERTIES....................................................................................................................................52.1 APPNAME PROPERTY....................................................................................................................52.2 SERVER PROPERTY.......................................................................................................................52.3 PORT PROPERTY..........................................................................................................................52.4 SYNCTIMEOUT PROPERTY .............................................................................................................53 METHODS ........................................................................................................................................63.1 START METHOD ...........................................................................................................................63.2 SEND METHOD.............................................................................................................................63.3 SENDSM METHOD........................................................................................................................63.4 STOP METHOD.............................................................................................................................74 EVENTS............................................................................................................................................74.1 RECEIVE EVENT ...........................................................................................................................74.2 RECEIVEDELIVERY EVENT..............................................................................................................84.3 RECEIVESTATUS EVENT ................................................................................................................8Copyright © 2003 CCC Data Oy. All rights reserved.


<strong>Programmer's</strong> <strong>Guide</strong> <strong>for</strong> <strong>ActiveX</strong> <strong>API</strong> 4(9)October 17, 20031 INTRODUCTIONContent Gateway <strong>ActiveX</strong> <strong>API</strong> is designed to provide a programming interface to theContent Gateway plat<strong>for</strong>m. <strong>API</strong> handles all the connections and data transferbetween the plat<strong>for</strong>m and the applications of the content/service provider.This document describes the basic principles of creating and running a ContentGateway service with the <strong>ActiveX</strong> <strong>API</strong>. Content Gateway <strong>ActiveX</strong> <strong>API</strong> provides youwith a simple programming interface <strong>for</strong> developing mobile value added servicesand applications.1.1 The Content Gateway <strong>API</strong> LibraryThe Content Gateway software contains the C++, <strong>ActiveX</strong> and Java <strong>API</strong> libraries. The<strong>API</strong> libraries offer you the following functionalities:• Interpreting the SMSC protocol via Provider Server and Operator Serverand controlling the functional features of the application. Changes inthe SMSC do not generally affect your applications.• Converting messages to a <strong>for</strong>mat that Provider Server and SMSCunderstand. Content Gateway currently supports SMS messages in a textor binary <strong>for</strong>mat. In mobile terminated messages, the system alsosupports Nokia Smart Messaging.• Per<strong>for</strong>ming character set conversions between the SMSC and <strong>API</strong>.• Controlling message handling and routing messages to the correctsession instances or callback functions.• Setting parameters <strong>for</strong> sending messages.• Developing TCP/IP socket client applications. The <strong>API</strong> librarycommunicates with Provider Server, opens the connection and createsthe message structure.• Developing TCP/IP socket server applications. The <strong>API</strong> librarycommunicates with Provider Server, opens the connection and createsthe message structure.• Deleting unnecessary characters from the recipient’s MSID number. TheMSID number is currently a mobile station number.• Controlling sessions automatically.NOTEContent Gateway <strong>ActiveX</strong> <strong>API</strong> has not been developed further since theprevious version. It is included <strong>for</strong> backwards compatibility only and hencedoes not necessarily support all the similar functionalities as the Java andC++ <strong>API</strong>s.Copyright © 2003 CCC Data Oy. All rights reserved.


<strong>Programmer's</strong> <strong>Guide</strong> <strong>for</strong> <strong>ActiveX</strong> <strong>API</strong> 5(9)October 17, 20031.2 Service TypesThe supported service types, billing and general guidelines <strong>for</strong> service andapplication development are explained in Service Development <strong>Guide</strong>.2 PROPERTIESThis chapter describes the properties of the Content Gateway <strong>ActiveX</strong> component.2.1 AppName PropertyThis property defines a unique name <strong>for</strong> the application. Provider Server uses thisname <strong>for</strong> identifying the application and <strong>for</strong> routing the incoming messages to thecorrect application.Data typeDefault valueString An empty string ("")2.2 Server PropertyThis property defines the Provider Server address. The application uses this addresswhen it sends messages to the mobile station users.Data typeDefault valueString An empty string ("")2.3 Port PropertyThis property defines which port the application listens to <strong>for</strong> incoming connectionsfrom Provider Server. If the Port value is greater than zero, the application acts asa server and starts listening to the port.Data typeDefault valueInteger Zero (0)2.4 SyncTimeout PropertyThis property defines the timeout <strong>for</strong> waiting a delivery status report.If the SyncTimeout property is greater than zero, the send method waits until themessage is delivered to the SMSC or until the SyncTimeout in seconds has beenreached. No delivery events are called until the delivery has been completed. If theSyncTimeout property is zero or less, Send does not wait, but returns immediately.Copyright © 2003 CCC Data Oy. All rights reserved.


<strong>Programmer's</strong> <strong>Guide</strong> <strong>for</strong> <strong>ActiveX</strong> <strong>API</strong> 7(9)October 17, 2003ParameterSenderRecipientMessageDestinationPortDescriptionThe sender’s number (MSID).Your Short Number or your other phone number. Therecipient sends the reply to this number.The recipient’s mobile station numberThe message.If the message starts with the string "&h" and the rest ofthe message consists of hexadecimal codes, the systemsends the message in the binary <strong>for</strong>mat.AN EXAMPLE: "&hAB1F099B"The destination port at the mobile station.The mobile station must be able to receive Nokia SmartMessages.RETURN VALUESThis method returns true if the message was sent successfully, and false if thesending failed.3.4 Stop MethodThis method stops the message handling so that the application does not send orreceive messages anymore.SYNTAXcontrolname.Stop4 EVENTSThis chapter describes the events of the Content Gateway <strong>ActiveX</strong> component.4.1 Receive EventThis event occurs when the <strong>ActiveX</strong> component receives a message from the mobilestation. The message is routed via Provider Server.SYNTAXSub controlname_Receive(ByVal Sender as String, ByVal Recipient as String,ByVal Message as String, ByVal SessionId as String, SessionStatus as Integer)Copyright © 2003 CCC Data Oy. All rights reserved.


<strong>Programmer's</strong> <strong>Guide</strong> <strong>for</strong> <strong>ActiveX</strong> <strong>API</strong> 8(9)October 17, 2003ParameterSenderDescriptionThe sender’s number (MSID)RecipientMessageSessionIDSessionStatusThe recipient’s mobile station numberThe messageThe message’s session IDThe session status.You can control the session with the session statusparameter. The values <strong>for</strong> the parameter are thefollowing:0 = Continues the session.1 = Terminates the session with the Ready status.2 = Terminates the session with the Abort status.4.2 ReceiveDelivery EventThis event occurs when the <strong>ActiveX</strong> component receives a delivery report fromProvider Server.SyntaxSub controlname_ReceiveDelivery(ByVal Number As String, ByVal Status AsInteger, ByVal StatusText As String, ByVal SessionId As String)ParameterNumberStatusStatusTextSessionIDDescriptionThe recipient’s mobile station numberThe delivery status.The values <strong>for</strong> this parameter are the following:0 = Delivery failed.1 = Delivery delayed.2 = Delivery succeeded.An error message or a message describing the deliverystatusThe message’s session ID4.3 ReceiveStatus EventThis event occurs when the <strong>ActiveX</strong> component receives a session status report fromProvider Server.SyntaxSub controlname_ReceiveStatus(ByVal StatusType As String, ByVal StatusText AsString, ByVal SessionId As String)Copyright © 2003 CCC Data Oy. All rights reserved.


<strong>Programmer's</strong> <strong>Guide</strong> <strong>for</strong> <strong>ActiveX</strong> <strong>API</strong> 9(9)October 17, 2003ParameterStatusTypeStatusTextSessionIDDescriptionThe type of the status reportThe values <strong>for</strong> this parameter are the following:"ABORT" = The session died because the preset timeoutwas reached."ERROR" = The session died because of an error."READY" = The session is ready.An error message or a message describing the deliverystatus.You receive this parameter only when an error hasoccurred in the message delivery, i.e. when the sessionhas the "ERROR" status.The message’s session IDCopyright © 2003 CCC Data Oy. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!