You are here: SwitchKit TCAP Interface Users Guide > 6 SKTAL Parameter Classes > Class TCAP_Dialogue
Purpose
The purpose of the TCAP_Dialogue interface is to define the base class for all TCAP dialogues. The class, while not abstract, should be considered as such. It is not intended that a user ever create a naked object.
The TCAP_Dialogue interface includes the following methods:
// Dialogue type
SKTAL_USHORT GetDialogueType() const;
// Dialogue ID
void SetDialogueID(const SKTAL_USHORT did);
SKTAL_USHORT GetDialogueID() const;
// Component present
virtual bool IsComponentPresent() const;
// Quality of service
virtual void SetQualityOfService(const SKTAL_OCTET flags,
const SKTAL_OCTET priority = 0);
virtual void GetQualityOfService(SKTAL_OCTET& flags,
SKTAL_OCTET& priority) const;
// Application context
virtual void SetApplicationContext(const SKTAL_OCTET* buf, const int len);
virtual void GetApplicationContext(SKTAL_OCTET* buf, int& len) const;
virtual void SetApplicationContext(const SKTAL_ByteArray& buf);
virtual void GetApplicationContext(SKTAL_ByteArray& buf) const;
// User info
virtual void SetUserInfo(const SKTAL_OCTET* buf, const int len);
virtual void GetUserInfo(SKTAL_OCTET* buf, int& len) const;
virtual void SetUserInfo(const SKTAL_ByteArray& buf);
virtual void GetUserInfo(SKTAL_ByteArray& buf) const;
// Xcvr checks
virtual bool SendCheck() const;
virtual bool ReceiveCheck();
// Send
static int Send(SKTAL_HANDLE handle, TCAP_Dialogue*dlg);
// Receive
static int Receive(SKTAL_HANDLE handle,
SKTAL_Event&ev,
TCAP_Dialogue**dlg);
// Expose the header
const SKTAL_HDR& GetHeader() const;
virtual void Print(std::ostream& os) const;
Description
This method is used to set the transaction context (or "Dialogue ID") of a transaction.
Syntax
void SetDialogueID(const SKTAL_USHORT did);
Input Parameters
did: The Dialogue ID of this transaction is an unsigned short
Input/Output Parameters and Output Parameters
None
Return Value
None
Description
Returns the type of this dialogue.
Syntax
SKTAL_USHORT GetDialogueType() const;
Input Parameters, Input/Output Parameters, & Output Parameters
None
Return Value
The type of this dialogue is an unsigned short:
If defined as ANSI:
TCPPT_TC_UNI
TCPPT_TC_QUERY_W-PERM
TCPPT_TC_QUERY_WO_PERM
TCPPT_TC_RESP
TCPPT_TC_CONV_W_PERM
TCPPT_TC_CONV_WO_PERM
TCPPT_TC_ABOUT
TCPPT_TC_NOTICE
If defined as ITU:
TCPPT_TC_UNI
TCPPT_TC_BEGIN
TCPPT_TC_END
TCPPT_TC_CONTINUE
TCPPT_TC_P_ABORT
TCPPT_TC_U_ABORT
TCPPT_TC_NOTICE
Syntax
See class TCAP_Cancel
SKTAL_USHORT GetDialogueID() const;
Description
This method is a predicate for determining if an inbound dialogue has components associated with it. This predicate is meaningless for outbound dialogues. The IsComponentPresent method is virtual.
Syntax
virtual bool IsComponentPresent() const;
Input Parameters, Input/Output Parameters, & Output Parameters
None
Return Value
true: If a dialogue primitive has associated components
false: If a dialogue primitive has no associated components
Description
This method allows the user to set the quality of service (QoS) parameters for a transaction
Syntax
virtual void SetQualityOfService(const SKTAL_OCTET flags,
const SKTAL_OCTET priority = 0);
Input Parameters
flags: Quality of service indicators (See Appendix D for a list of flags)
priority: If QOS_PRIORITY is set in the flags, this indicates the priority value
Input/Output Parameters and Output Parameters
None
Return Value
None
Important! Altering the QoS parameters is not normally done. ANSI does not support all QoS parameters. This method is virtual.
Description
This method allows the user to get the quality of service (QoS) parameters for a transaction. The GetQualityOfService method is a virtual method.
Syntax
virtual void GetQualityOfService(SKTAL_OCTET& flags,
SKTAL_OCTET& priority)
Input Parameters and Input/Output Parameters
None
Output Parameters
flags: Quality of service indicators
Return Option: QOSI_RET_OPT
Sequence Control: QOSI_SEQ_CTRL
SLS key present: QOSI_SLS_KEY
Message priority octet present: QOSI_PRIORITY
priority: If QOS_PRIORITY is set in the flags, this indicates the priority value
Return Value
None
Description
This method allows the user to set the application context for a transaction. Older versions of ANSI TCAP do not support application context. This method is a virtual method.
Syntax
virtual void SetApplicationContext(const SKTAL_OCTET* buf,
const int len);
SetApplicationContext(const SKTAL_ByteArray& buf);
Input Parameters
buf: A buffer to copy the application context into
len: The number of bytes copied
Input/Output Parameters and Output Parameters
None
Return Value
None
Older versions of ANSI TCAP do not support application context. This method is virtual.
Description
This method allows the user to get the application context for a transaction. The len parameter will become an in/out parameter and should be set to the maximum size of the buffer to copy to. Users should therefore set the length now to avoid problems in the future.
Returning a length of zero indicates that no context is present. Older versions of ANSI TCAP do not support application context. The GetApplicationContext method is a virtual method.
Syntax
virtual void GetApplicationContext(SKTAL_OCTET* buf, int& len) const;
Input Parameters
buf: A buffer to copy the application context into
Input/Output Parameters
None
Output Parameters
len: the number of bytes copied
Return Value
None
void GetApplicationContext(SKTAL_ByteArray& buf) const;
Description
This method allows the user to get the application context for a transaction.
Input Parameters and Input/Output Parameters
None
Output Parameters
buf: a buffer to copy the application context into
Return Value
None
Important! Older versions of ANSI TCAP do not support application context. This method is virtual.
Description
This method can be used to set the user information for a transaction. Older versions of ANSI TCAP do not support user information. This method is virtual.
Syntax
virtual void SetUserInfo(const SKTAL_OCTET* buf,
const int len);
virtual void SetUserInfo(const SKTAL_ByteArray& buf);
Input Parameters
buf: A pointer to a buffer to copy the user information into
len: The number of bytes copied
Input/Output Parameters and Output Parameters
None
Return Value
None
Description
This method allows the user to get the user information for a transaction. Older versions of ANSI TCAP do not support user information. This method is virtual. The len parameter will become an in/out parameter and should be set to the maximum size of the buffer to copy to. Users should set the length now to avoid problems. Returning a length of zero indicates that no information is present.
Syntax
virtual void GetUserInfo(SKTAL_OCTET* buf, int& len) const;
Input Parameters
buf: A pointer to a buffer to copy the user information into
Input/Output Parameters
None
Output Parameters
len: The number of bytes copied
Return Value
None
Description
This method allows the user to get the user information for a transaction. Older versions of ANSI TCAP do not support user information. This method is a virtual method.
Syntax
virtual void GetUserInfo(SKTAL_ByteArray& buf) const;
Input Parameters and Input/Output Parameters
None
Output Parameters
buf: A buffer to copy the user information into
Return Value
None
Description
This method allows the user to check if the transaction is proceeding. This method is virtual.
Syntax
virtual bool SendCheck() const;
Input Parameters, Input/Output Parameters, & Output Parameters
None
Return Value
true: If the transaction is proceeding
false: If the transaction is not proceeding
Description
This method allows the user to check if the information is received. This method is virtual.
Syntax
virtual bool ReceiveCheck();
Input Parameters, Input/Output Parameters, & Output Parameters
None
Return Value
true: If the information is received
false: If the information is not received
Description
This method is provided for the user to send TCAP dialogues to the stack. This is the preferred method of dialogue transmission. The Send method is static.
Syntax
static int Send(SKTAL_HANDLE handle, TCAP_Dialogue* dlg);
Input Parameters
handle - The transport this dialogue is sent. For getting the handle use sktal_getTCAPHandle() API
dlg - A pointer to the dialogue to send
Input/Output Parameters and Output Parameters
None
Return Value
If the message is successfully sent, SKTAL_SUCCESS is returned. Any other return value indicates an error.
Description
This method is provided for the user to receive TCAP dialogues from the stack. This is the preferred method of dialogue reception.The Receive method is static. This method acts as a constructor for received dialogues.
Syntax
static int Receive(SKTAL_HANDLE handle,
SKTAL_Event& ev,
TCAP_Dialogue** dlg);
Input Parameters
handle: the transport this dialogue is sent. For getting the handle use sktal_getTCAPHandle().
ev: the event to receive the dialogue from
Input/Output Parameters
None
Output Parameters
dlg - the address of a pointer that is populated with the received dialogue
Return Value
If the message is successfully sent, SKTAL_SUCCESS is returned. Any other return value indicates an error.
Description
This method exposes the SKTAL_HDR part of the received dialogue.
Syntax
const SKTAL_HDR& GetHeader() const;
Input Parameters and Input/Output Parameters
None
Output Parameters
hdr: the header present with the received dialogue
Return Value
None
Description
This method prints the contents of the dialogue to the output stream that is passed in to the method.
Syntax
virtual void Print(std::ostream& os) const;
Input Parameters
os: the output stream to print the contents to.
Input/Output Parameters and Output Parameters
None
Return Value
None