ooq931.h

来自「一个非常美妙的proxy。功能强大。基于sip的协议。如果还要的话」· C头文件 代码 · 共 767 行 · 第 1/2 页

H
767
字号
 *  * @param msg      Reference to the pointer of type Q931 message. * @param msgType  Type of Q931 message to be created * * @return         Completion status - 0 on success, -1 on failure */EXTERN int ooCreateQ931Message(Q931Message **msg, int msgType);/** * This function is invoked to generate a unique call reference number.  * * @return         - call reference number */EXTERN ASN1USINT ooGenerateCallReference(void);/** * This function is used to generate a unique call identifier for the call. * @param callid      Pointer to the callid structure, which will be populated *                    with the generated callid. * * @return            OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooGenerateCallIdentifier(H225CallIdentifier *callid);/** * This function is invoked to release the memory used up by a Q931 message  *  * @param q931Msg  Pointer to a Q931 message which has to be freed. * * @return         Completion status - 0 on success, -1 on failure */EXTERN int ooFreeQ931Message(Q931Message *q931Msg);/** * This function is invoked to retrive the outgoing message buffer for  * Q931 message * * @param call     Pointer to call for which outgoing Q931 message has to be  *                 retrieved. * @param msgbuf   Pointer to a buffer in which retrieved message will *                 be returned. * @param len      Pointer to int in which length of the buffer will *                 be returned. * @param msgType  Pointer to integer in which message type of the ougoing *                 message is returned. * * @return         Completion status - 0 on success, -1 on failure */EXTERN int ooGetOutgoingQ931Msgbuf(struct OOH323CallData *call, ASN1OCTET * msgbuf, int* len, int *msgType);/** * This function is invoked to send a ReleaseComplete message for  * the currently active call. * * @param call    Pointer to the call for which ReleaseComplete message have  *                to be sent.   * * @return         Completion status - 0 on success, -1 on failure */EXTERN int ooSendReleaseComplete(struct OOH323CallData *call);/** * This function is invoked to send a call proceeding message in response to * received setup message. * * @param call    Pointer to the call for which CallProceeding message have to *                be sent.   * * @return        Completion status - 0 on success, -1 on failure */EXTERN int ooSendCallProceeding(struct OOH323CallData *call);/** * This function is invoked to send alerting message in response to received   * setup message.  * * @param call     Pointer to the call for which Alerting message have to be  *                 sent.   * * @return         Completion status - 0 on success, -1 on failure */EXTERN int ooSendAlerting(struct OOH323CallData *call);/** * This function is invoked to send Facility message. * * @param call     Pointer to the call for which Facility message have to be  *                 sent.   * * @return         Completion status - 0 on success, -1 on failure */EXTERN int ooSendFacility(struct OOH323CallData *call);/** * This function is used to send dtmf data as Q931 keypad information element * as part of information message. * @param call     Pointer to the call for dtmf data has to be sent. * @param data     Dtmf data to be sent. * * @return         OO_OK, on success; OO_FAILED, on failure. */EXTERN int ooQ931SendDTMFAsKeyPadIE          (struct OOH323CallData *call, const char* data);/** * This function is invoked to send a Connect message in response to received   * setup message.  * * @param call      Pointer to the call for which connect message has to be  *                  sent.   * * @return          Completion status - 0 on success, -1 on failure */EXTERN int ooSendConnect(struct OOH323CallData *call);/** * This function is used to send a SETUP message for outgoing call. It first * creates an H.225 TCP connection with the remote end point and then sends  * SETUP message over this connection. * @param dest      Destination - IP:Port/alias. * @param callToken Unique token for the new call. * @param opts      Call specific options. If passed a non-null value, these *                  options will override global endpoint settings. * * @return          OO_OK, on success. OO_FAILED, on failure */EXTERN int ooH323MakeCall(char *dest, char *callToken, ooCallOptions *opts);/** * Helper function used to make a call once it is approved by the Gk. * In case of no gk, this function is directly called to make a call. * @param call        Handle to the new call. * * @return            OO_OK, on success. OO_FAILED, on failure */int ooH323CallAdmitted( struct OOH323CallData *call);/** * This function is used to handle a call forward request sent to local * endpoint by remote endpoint. * @param call        Handle to the call which is being forwarded * * @return            OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooH323HandleCallFwdRequest(struct OOH323CallData *call);/** * This function is used for forwarding/redirecting a call to third party. * @param callToken   callToken for the call which has to be redirected. * @param dest        Address to which call has to be forwarded. Can be  *                    IP:Port or alias. * * @return            OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooH323ForwardCall(char* callToken, char *dest);/** * This function is used to hangup a currently active call. It sets the call * state to CLEARING and initiates closing of all logical channels. * @param callToken Unique token of the call to be hanged. * @param reason    Reason for ending call. * * @return          OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooH323HangCall(char * callToken, OOCallClearReason reason);/**  * Function to accept a call by sending connect. This function is used * as a helper function to ooSendConnect. * @param call      Pointer to the call for which connect has to be sent * * @return          OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooAcceptCall(struct OOH323CallData *call);/* * An helper function to ooMakeCall. * @param call      Pointer to the new call. * * @return          OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooH323MakeCall_helper(struct OOH323CallData *call);/** * This function is used to parse the destination * @param call      Handle to related call. * @param dest      Destination string to be parsed. * @param parsedIP  Pointer to buffer in which parsed ip:port will be returned. * @param len       Length of the buffer passed. * @param aliasList Aliase List in which new aliases will be added. * * @return          OO_OK, on success. OO_FAILED, on failure. */int ooParseDestination   (struct OOH323CallData *call, char *dest, char *parsedIP, unsigned len,    OOAliases** aliasList);/** * This function is used to generate a new call token * @param callToken Handle to the buffer in which new call token will be *                  returned * @param size      size of the buffer * * @return          OO_OK, on success. OO_FAILED, on failure. */int ooGenerateCallToken (char *callToken, size_t size);/** * This function sends an encoded H.245 message buffer as a tunneled  * H.245 Facility message. * @param call             Pointer to the call for which H.245 message has to *                         be tunneled. * @param msgbuf           Pointer to the encoded H.245 message to be tunneled. * * @param h245Len          Length of the encoded H.245 message buffer. * @param h245MsgType      Type of the H245 message * @param associatedChan   The logical channel number with which the tunneled *                         message is associated. In case of no channel, this *                         value should be 0. * * @return                 OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooSendAsTunneledMessage(struct OOH323CallData *call, ASN1OCTET* msgbuf,  int h245Len, int h245MsgType, int associatedChan);  /** * This function is used to encode an H.225 message. * @param call            Handle to the call. * @param pq931Msg        Pointer to the message to be encoded. * @param msgbuf          Pointer to the buffer in which encoded message will  *                        be returned. * @param size            Size of the buffer passed. * * @return                OO_OK, on success. OO_FAILED, on failure. */int ooEncodeH225Message(struct OOH323CallData *call, Q931Message *pq931Msg,                         char *msgbuf, int size);/** * 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. * @param data            The callback data registered at the time of timer  *                        creation. * * @return                OO_OK, on success. OO_FAILED, on failure. */int ooCallEstbTimerExpired(void *data);/** * This function is used to add a keypad IE to a Q931 message for sending dtmf. * @param pmsg            Q931 message to which keypad ie has to be *                        added. * @param data            DTMF data to be sent. * * @return                OO_OK on success, OO_FAILED, on failure. */EXTERN int ooQ931SetKeypadIE(Q931Message *pmsg, const char* data);/** * This function is used to add a bearer capability IE to a Q931 message. * @param pmsg            Q931 message to which bearer capability ie has to be *                        added. * @param codingStandard  Coding standard to be used. * @param capability      Information transfer capability * @param transferMode    Information transfer mode.(circuit/packet modes). * @param transferRate    Information transfer rate. * @param userInfoLayer1  User information layer 1 protocol. * * @return                OO_OK on success, OO_FAILED, on failure. */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 called party number ie to a q931 message. * @param pmsg            Q931 message to which CalledPartyNumber IE has to be *                        added. * @param number          Number for called party. * @param plan            Numbering Plan used * @param type            Type of number * * @return                OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooQ931SetCalledPartyNumberIE   (Q931Message *pmsg, const char *number, unsigned plan, unsigned type);/** * This function is used to add a CallingPartyNumber ie to a q931 message. * @param pmsg            Q931 message to which CallingPartyNumber IE has to be *                        added. * @param number          Number for calling party. * @param plan            Numbering Plan used * @param type            Type of number * @param presentation    Presentation of the address is allowed or restricted. * @param screening       Whether address was provided by endpoint or screened *                        by gatekeeper. * * @return                OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooQ931SetCallingPartyNumberIE   (Q931Message *pmsg, const char *number, unsigned plan, unsigned type,     unsigned presentation, unsigned screening);/**  * This function is used to set a cause ie for a q931 message. * @param pmsg        Valid Q931 Message * @param cause       Q931 Cause Value * @param coding      coding standard used. 0 for ITU-T standard coding * @param location    location. 0 for user. * * @return            OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooQ931SetCauseIE   (Q931Message *pmsg,enum Q931CauseValues cause, unsigned coding,     unsigned location);/** * This function is used to convert a call clear reason to cause and  * reason code. It is used when local user is endoing the call and  * sending releaseComplete. * @param clearReason   Reason for ending call. * @param cause         Pointer to Q931CauseVaules enum in which cause *                      will be returned. * @param reasonCode    Pointer to unsigned int in which reasonCode will *                      be returned. * * @return              OO_OK, on success. OO_FAILED, on failure. */EXTERN int ooQ931GetCauseAndReasonCodeFromCallClearReason   (OOCallClearReason clearReason, 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. * @param cause         cause value received. * @param reasonCode    reasonCode received. * * @return              Returns a CallClearReason. */EXTERN OOCallClearReason ooGetCallClearReasonFromCauseAndReasonCode   (enum Q931CauseValues cause, unsigned reasonCode);/** * This function is used to retrieve the description text for a  * message type. * * @param msgType  Message type. * @return         The text description string. */EXTERN const char* ooGetMsgTypeText (int msgType);/** * This function is used to retrieve the text description for a Q931 Cause * value in Cause IE. * @param val     Q931 Cause value * @return        The text description string */EXTERN const char* ooGetQ931CauseValueText (int val);/**  * @}  */#ifdef __cplusplus}#endif#endif /* __Q931HDR_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?