Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
hp OpenCall SS7 platform Application Developer's Guide: For Release 3.1 on Linux > Chapter 13 Exchanging ISUP Messages

Receiving Messages

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

Both probe classes provide a method to receive primitives and their associated messages, receive(). This method must be used in association with the activity object mechanism as described in “Using the Activity Object”.

For details about the syntax, parameters, and return values of IsupSMProbe::receive() and IsupBPProbe::receive(), see the IsupSMProbe(3) and IsupBPProbe(3) man pages.

Casting Messages

Both IsupSMProbe::receive() and IsupSMProbe::receive() return an instance of the base message class, IsupMsg. To exactly identify which type of message has been received, you must use the IsupMsg::getMsgType() method.

From the message type indicator returned by IsupMsg::getMsgType(), you must select the appropriate cast method. Each message class has its own safe casting method, which creates an instance of the message class from the contents of the received message.

Unlike the send() methods, you must delete the received message when the receive()call has been successful and you have finished processing its contents using the accessors.

Table 13-10 Casting Methods

Type

Method

Arguments

Comment

static IsupXXX

castMsg

(const IsupMsg* msg) const;

where, IsupXXX denotes a specific message class listed in “Supported Parameters List”.

IsupMsg::Type

getMsgType

();

 

Example 13-5 Receiving a Message from an IsupSMProbe Object

ISUP::RecvStatus            recvStatus;
ISUP::MsgStatus status;
IsupSMProbe * isupSMProbe;
IsupSMProbe::PrimitiveType primitive;
ISUP::Address address;
IsupMsg *isupMsg, *acmMsg;
IsupMsg::Type msgType;
ISUPAdditional:: Info * info;
ISUP::Parmvalue* value;
int nbIndication;

do {
// receive message via isupSMProbe object
recvStatus = isupSMProbe->receive(primitive,address, isupMsg, info, nbIndication);
if (!recvStatus.isOk()){
cout << “receive failed- error=” << recvStatus << “\n” << flush;
// error recovery
}
// check if error message received
if (isupMsg==NULL)
cout <<“Warning: empty message received” << “\n” << flush;

// check message type
msgType= isup->getMsgType();

// process message contents
if (msgType == IsupMsg::ACM){IsupAcm* acmMsg = IsupAcm::castMsg(msgType);

// process contents
// delete contents
}
} while (nbIndication >0);

Queued Indications

It is the responsibility of the application to repeatedly call receive() to retrieve all the received indications (nbIndication) as soon as possible.

See “IPC Flow Control”.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.