When a message is created via its message constructor, its mandatory parameters
are initialized
with zeros. Naturally, you must assign values to these parameters
and if necessary, extend the message by including some of its optional
parameters.
HP OpenCall SS7 ISUP provides a base class—ISUP::ParmValue— for encapsulating parameter values. This object class provides
methods for assigning values
of differing lengths (32,
16 and 8 bits).
Table 13-9 Methods for Assigning Values
Type | Method | Arguments |
|---|
ParmValue& | assign | (const char* s, HPAIN::Uint32 l); |
ParmValue& | assign | (const void* s, HPAIN::Uint32 l); |
ParmValue& | assign | (HPAIN::Uint32 i); |
ParmValue& | assign | (HPAIN::Uint16 i); |
ParmValue& | assign | (HPAIN::Byte b); |
Example 13-3 Assigning
Parameter Values
IsupIam* prepareIamMsg()
{
ISUP::ParmValue* value = new ISUP::ParmValue ();
ISUP::MsgStatus status;
// evaluate msgSetId
IsupIam* iamMsg = new IsupIam(msgSetId);
if (!iamMsg->isObjectValid(status)) {
delete value;
delete iamMsg;
return NULL;
}
iamMsg->natureOfCnxIndicators(value->assign (“\x66”, 1), status);
if (!status.isOk()) {
// error recovery
}
iamMsg->forwardCallIndicators(value->assign (“\x33\x58”, 2), status);
if (!status.isOk()){
// error recovery
}
iamMsg->callingPartysCategory(value->assign (“\x53”, 1), status);
if (!status.isOk()){
// error recovery
}
iamMsg->userServiceInformation(value->assign (“\x53\x33”, 2), status);
if (!status.isOk()){
// error recovery
}
iamMsg->calledPartyNumber(value->assign (“\x53\x33\x76\x68”, 4), status);
if (!status.isOk()){
// error recovery
}
delete value;
return iamMsg;
}