Results 1 to 3 of 3

Thread: TQ31facility and pika 6.6 API

  1. #1
    Jerki Guest

    Default TQ31facility and pika 6.6 API

    previously we have used TQ31facility to achieve call transfers on PRI trunks. It seems, TQ31facility is no more present under 6.6 version of API. Is there any substitute for it? How one can send raw facilities to the switch to rich suplementary services?
    Thanks in advance

  2. #2
    Join Date
    Jul 2008


    Hi Jarek,

    Although I certainly could be wrong, I don't remember a TQ931Facility structure ever being present. This type of functionality can be exercised as you mentioned through the raw messaging. Below is the basic idea:

    Fill in a generic Q931 message and set the messageType to the facility message type as per the switch. (for example, for the AT&T switch the FACILITY message is 0x62)

    typedef struct Q931Message
    TDecodedMessage common; /* MONTECARLO INTERNAL ONLY */
    PK_U8 messageType; /* Message type (eg. SETUP, DISC) */
    PK_U8 protDisc; /* Protocol discriminator */
    PK_U8 callRefLen; /* Call reference length */
    PK_U8 callRefFlag; /* Call refenence flag */
    PK_U16 callRefVal; /* Call reference value */
    PK_U16 ieDataLength; /* Raw message data */
    PK_U32 correlationID; /* Call correlation ID */
    } TQ931Message, *PQ931Message;

    2) Add the IEs you want. This show the construction of a facility IE.

    TQ931GenericIE ie; = PK_Q931_FACILITY;
    ie.length = 21;[0] = 0x91;[1] = 0xA1;[2] = 0x12;
    ...[19] = 0x00;[20] = 0x02;

    // Insert the facility IE into the message
    status = PK_Q931_AddRawIE(&msg, &ie);
    if (status != PK_SUCCESS) {
    // handle the error

    To handle an incoming message determine its type by the messageType field and then process the message appropriately retrieving the IEs you are interested in as shown in the code below. (Note: There is also a function called PK_Q931_GetIEInfo () that tells you what IEs are available on a particular message.)

    In the event handler

    void handleQ931Messages ()
    If (setup) processSetupMessage ();
    Else if (alert) processAlertMessage ();
    Else if (XXXXX) processXXXXXMessage ();

    void ProcessXXXXXMessage(TQ931Message *msg)
    TQ931GenericIE ie = { 0 }; = PK_Q931_FACILITY; // this is a facilty IE - not a facility message!
    // Retrieve the first occurrence of a facility IE
    PK_STATUS status = PK_Q931_GetRawIE(msg, &ie, 0);
    if (status == PK_SUCCESS) {
    // process the ie
    if (status != PK_Q931_ERR_IE_NOT_PRESENT) {
    // handle the error

    There are sometimes some twists but this is the basic idea. Hope it helps.


  3. #3
    Jerki Guest


    Hi Mark,
    thank you for your kind response. It is clear now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts