Objective Systems, Inc.  

ooq931.h File Reference

This file contains functions to support call signalling. More...

#include "ooasn1.h"
#include "ootypes.h"
#include "H323-MESSAGES.h"

Go to the source code of this file.

Data Structures

struct  Q931InformationElement
struct  Q931Message
 Q.931 message structure. More...
struct  OOAliases
 This structure is used to hold an H.323 alias address. More...
struct  OOH225MsgCallbacks
 This structure holds the various callback functions that are triggered when H.225 messages are received or constructed. More...

Defines

#define OO_MAX_NUMBER_LENGTH   50
#define OO_MAX_CALL_TOKEN   9999
#define Q931_E_TOOSHORT   (-1001)
#define Q931_E_INVCALLREF   (-1002)
#define Q931_E_INVLENGTH   (-1003)
#define ooAliases   OOAliases

Typedefs

typedef int(*) cb_OnReceivedSetup (struct OOH323CallData *call, struct Q931Message *pmsg)
 This callback is triggered when an H.225 SETUP message is received by the application.
typedef int(*) cb_OnReceivedConnect (struct OOH323CallData *call, struct Q931Message *pmsg)
 This callback is triggered when an H.225 CONNECT message is received by the application.
typedef int(*) cb_OnBuiltSetup (struct OOH323CallData *call, struct Q931Message *pmsg)
 This callback is triggered after an H.225 SETUP message has been constructed and is ready to be sent out.
typedef int(*) cb_OnBuiltConnect (struct OOH323CallData *call, struct Q931Message *pmsg)
 This callback is triggered after an H.225 CONNECT message has been constructed and is ready to be sent out.

Enumerations

enum  Q931MsgTypes {
  Q931NationalEscapeMsg = 0x00,
  Q931AlertingMsg = 0x01,
  Q931CallProceedingMsg = 0x02,
  Q931ConnectMsg = 0x07,
  Q931ConnectAckMsg = 0x0f,
  Q931ProgressMsg = 0x03,
  Q931SetupMsg = 0x05,
  Q931SetupAckMsg = 0x0d,
  Q931ResumeMsg = 0x26,
  Q931ResumeAckMsg = 0x2e,
  Q931ResumeRejectMsg = 0x22,
  Q931SuspendMsg = 0x25,
  Q931SuspendAckMsg = 0x2d,
  Q931SuspendRejectMsg = 0x21,
  Q931UserInformationMsg = 0x20,
  Q931DisconnectMsg = 0x45,
  Q931ReleaseMsg = 0x4d,
  Q931ReleaseCompleteMsg = 0x5a,
  Q931RestartMsg = 0x46,
  Q931RestartAckMsg = 0x4e,
  Q931SegmentMsg = 0x60,
  Q931CongestionCtrlMsg = 0x79,
  Q931InformationMsg = 0x7b,
  Q931NotifyMsg = 0x6e,
  Q931StatusMsg = 0x7d,
  Q931StatusEnquiryMsg = 0x75,
  Q931FacilityMsg = 0x62
}
enum  Q931IECodes {
  Q931BearerCapabilityIE = 0x04,
  Q931CauseIE = 0x08,
  Q931FacilityIE = 0x1c,
  Q931ProgressIndicatorIE = 0x1e,
  Q931CallStateIE = 0x14,
  Q931DisplayIE = 0x28,
  Q931SignalIE = 0x34,
  Q931CallingPartyNumberIE = 0x6c,
  Q931CalledPartyNumberIE = 0x70,
  Q931RedirectingNumberIE = 0x74,
  Q931UserUserIE = 0x7e,
  Q931KeypadIE = 0x2c
}
enum  Q931InformationTransferCapability {
  Q931TransferSpeech,
  Q931TransferUnrestrictedDigital = 8,
  Q931TransferRestrictedDigital = 9,
  Q931Transfer3_1kHzAudio = 16,
  Q931TrasnferUnrestrictedDigitalWithTones = 17,
  Q931TransferVideo = 24
}
enum  Q931CauseValues {
  Q931UnallocatedNumber = 0x01,
  Q931NoRouteToNetwork = 0x02,
  Q931NoRouteToDestination = 0x03,
  Q931ChannelUnacceptable = 0x06,
  Q931NormalCallClearing = 0x10,
  Q931UserBusy = 0x11,
  Q931NoResponse = 0x12,
  Q931NoAnswer = 0x13,
  Q931SubscriberAbsent = 0x14,
  Q931CallRejected = 0x15,
  Q931NumberChanged = 0x16,
  Q931Redirection = 0x17,
  Q931DestinationOutOfOrder = 0x1b,
  Q931InvalidNumberFormat = 0x1c,
  Q931NormalUnspecified = 0x1f,
  Q931StatusEnquiryResponse = 0x1e,
  Q931NoCircuitChannelAvailable = 0x22,
  Q931NetworkOutOfOrder = 0x26,
  Q931TemporaryFailure = 0x29,
  Q931Congestion = 0x2a,
  Q931RequestedCircuitUnAvailable = 0x2c,
  Q931ResourcesUnavailable = 0x2f,
  Q931IncompatibleDestination = 0x58,
  Q931ProtocolErrorUnspecified = 0x6f,
  Q931RecoveryOnTimerExpiry = 0x66,
  Q931InvalidCallReference = 0x51,
  Q931ErrorInCauseIE = 0
}
enum  Q931SignalInfo {
  Q931SignalDialToneOn,
  Q931SignalRingBackToneOn,
  Q931SignalInterceptToneOn,
  Q931SignalNetworkCongestionToneOn,
  Q931SignalBusyToneOn,
  Q931SignalConfirmToneOn,
  Q931SignalAnswerToneOn,
  Q931SignalCallWaitingTone,
  Q931SignalOffhookWarningTone,
  Q931SignalPreemptionToneOn,
  Q931SignalTonesOff = 0x3f,
  Q931SignalAlertingPattern0 = 0x40,
  Q931SignalAlertingPattern1,
  Q931SignalAlertingPattern2,
  Q931SignalAlertingPattern3,
  Q931SignalAlertingPattern4,
  Q931SignalAlertingPattern5,
  Q931SignalAlertingPattern6,
  Q931SignalAlertingPattern7,
  Q931SignalAlretingOff = 0x4f,
  Q931SignalErrorInIE = 0x100
}
enum  Q931NumberingPlanCodes {
  Q931UnknownPlan = 0x00,
  Q931ISDNPlan = 0x01,
  Q931DataPlan = 0x03,
  Q931TelexPlan = 0x04,
  Q931NationalStandardPlan = 0x08,
  Q931PrivatePlan = 0x09,
  Q931ReservedPlan = 0x0f
}
enum  Q931TypeOfNumberCodes {
  Q931UnknownType = 0x00,
  Q931InternationalType = 0x01,
  Q931NationalType = 0x02,
  Q931NetworkSpecificType = 0x03,
  Q931SubscriberType = 0x04,
  Q931AbbreviatedType = 0x06,
  Q931ReservedType = 0x07
}
enum  Q931CodingStandard {
  Q931CCITTStd = 0,
  Q931ReservedInternationalStd,
  Q931NationalStd,
  Q931NetworkStd
}
enum  Q931TransferMode {
  Q931TransferCircuitMode = 0,
  Q931TransferPacketMode = 2
}
enum  Q931TransferRate {
  Q931TransferRatePacketMode = 0x00,
  Q931TransferRate64Kbps = 0x10,
  Q931TransferRate128kbps = 0x11,
  Q931TransferRate384kbps = 0x13,
  Q931TransferRate1536kbps = 0x15,
  Q931TransferRate1920kbps = 0x17
}
enum  Q931UserInfoLayer1Protocol {
  Q931UserInfoLayer1CCITTStdRate = 1,
  Q931UserInfoLayer1G711ULaw,
  Q931UserInfoLayer1G711ALaw,
  Q931UserInfoLayer1G721ADPCM,
  Q931UserInfoLayer1G722G725,
  Q931UserInfoLayer1H261,
  Q931UserInfoLayer1NonCCITTStdRate,
  Q931UserInfoLayer1CCITTStdRateV120,
  Q931UserInfoLayer1X31
}

Functions

EXTERN int ooQ931Decode (struct OOH323CallData *call, Q931Message *msg, int length, ASN1OCTET *data)
 This function is invoked to decode a Q931 message.
EXTERN int ooDecodeUUIE (Q931Message *q931Msg)
 This function is used to decode the UUIE of the message from the list of ies.
EXTERN int ooEncodeUUIE (Q931Message *q931msg)
 This function is used to encode the UUIE field of the Q931 message.
EXTERN Q931InformationElementooQ931GetIE (const Q931Message *q931msg, int ieCode)
 This function is invoked to retrieve an IE element from a Q931 message.
EXTERN void ooQ931Print (const Q931Message *q931msg)
 This function is invoked to print a Q931 message.
EXTERN int ooCreateQ931Message (Q931Message **msg, int msgType)
 This function is invoked to create an outgoing Q931 message.
EXTERN ASN1USINT ooGenerateCallReference (void)
 This function is invoked to generate a unique call reference number.
EXTERN int ooGenerateCallIdentifier (H225CallIdentifier *callid)
 This function is used to generate a unique call identifier for the call.
EXTERN int ooFreeQ931Message (Q931Message *q931Msg)
 This function is invoked to release the memory used up by a Q931 message.
EXTERN int ooGetOutgoingQ931Msgbuf (struct OOH323CallData *call, ASN1OCTET *msgbuf, int *len, int *msgType)
 This function is invoked to retrive the outgoing message buffer for Q931 message.
EXTERN int ooSendReleaseComplete (struct OOH323CallData *call)
 This function is invoked to send a ReleaseComplete message for the currently active call.
EXTERN int ooSendCallProceeding (struct OOH323CallData *call)
 This function is invoked to send a call proceeding message in response to received setup message.
EXTERN int ooSendAlerting (struct OOH323CallData *call)
 This function is invoked to send alerting message in response to received setup message.
EXTERN int ooSendFacility (struct OOH323CallData *call)
 This function is invoked to send Facility message.
EXTERN int ooQ931SendDTMFAsKeyPadIE (struct OOH323CallData *call, const char *data)
 This function is used to send dtmf data as Q931 keypad information element as part of information message.
EXTERN int ooSendConnect (struct OOH323CallData *call)
 This function is invoked to send a Connect message in response to received setup message.
EXTERN int ooH323MakeCall (char *dest, char *callToken, ooCallOptions *opts)
 This function is used to send a SETUP message for outgoing call.
int ooH323CallAdmitted (struct OOH323CallData *call)
 Helper function used to make a call once it is approved by the Gk.
EXTERN int ooH323HandleCallFwdRequest (struct OOH323CallData *call)
 This function is used to handle a call forward request sent to local endpoint by remote endpoint.
EXTERN int ooH323ForwardCall (char *callToken, char *dest)
 This function is used for forwarding/redirecting a call to third party.
EXTERN int ooH323HangCall (char *callToken, OOCallClearReason reason)
 This function is used to hangup a currently active call.
EXTERN int ooAcceptCall (struct OOH323CallData *call)
 Function to accept a call by sending connect.
EXTERN int ooH323MakeCall_helper (struct OOH323CallData *call)
int ooParseDestination (struct OOH323CallData *call, char *dest, char *parsedIP, unsigned len, OOAliases **aliasList)
 This function is used to parse the destination.
int ooGenerateCallToken (char *callToken, size_t size)
 This function is used to generate a new call token.
EXTERN int ooSendAsTunneledMessage (struct OOH323CallData *call, ASN1OCTET *msgbuf, int h245Len, int h245MsgType, int associatedChan)
 This function sends an encoded H.245 message buffer as a tunneled H.245 Facility message.
int ooEncodeH225Message (struct OOH323CallData *call, Q931Message *pq931Msg, ASN1OCTET *msgbuf, size_t size)
 This function is used to encode an H.225 message.
int ooCallEstbTimerExpired (void *data)
 This is a callback function which is called when there is no CONNECT response from the remote endpoint after the SETUP has been sent and timeout period has passed.
EXTERN int ooQ931SetKeypadIE (Q931Message *pmsg, const char *data)
 This function is used to add a keypad IE to a Q931 message for sending dtmf.
EXTERN int ooSetBearerCapabilityIE (Q931Message *pmsg, enum Q931CodingStandard codingStandard, enum Q931InformationTransferCapability capability, enum Q931TransferMode transferMode, enum Q931TransferRate transferRate, enum Q931UserInfoLayer1Protocol userInfoLayer1)
 This function is used to add a bearer capability IE to a Q931 message.
EXTERN int ooQ931SetCalledPartyNumberIE (Q931Message *pmsg, const char *number, unsigned plan, unsigned type)
 This function is used to add a called party number ie to a q931 message.
EXTERN int ooQ931SetCallingPartyNumberIE (Q931Message *pmsg, const char *number, unsigned plan, unsigned type, unsigned presentation, unsigned screening)
 This function is used to add a CallingPartyNumber ie to a q931 message.
EXTERN int ooQ931SetCauseIE (Q931Message *pmsg, enum Q931CauseValues cause, unsigned coding, unsigned location)
 This function is used to set a cause ie for a q931 message.
EXTERN int ooQ931GetCauseAndReasonCodeFromCallClearReason (OOCallClearReason clearReason, enum Q931CauseValues *cause, unsigned *reasonCode)
 This function is used to convert a call clear reason to cause and reason code.
EXTERN OOCallClearReason ooGetCallClearReasonFromCauseAndReasonCode (enum Q931CauseValues cause, unsigned reasonCode)
 This function is used to convert a cause value and reason code received in ReleaseComplete message from remote endpoint into a CallClearReason.
EXTERN const char * ooGetMsgTypeText (int msgType)
 This function is used to retrieve the description text for a message type.
EXTERN const char * ooGetQ931CauseValueText (int val)
 This function is used to retrieve the text description for a Q931 Cause value in Cause IE.


Detailed Description

This file contains functions to support call signalling.

Definition in file ooq931.h.


This file was last modified on 28 May 2010.
Objective Open H.323 Stack, 0.9.1