Specifications
3 SS7MD Board-Specific Configuration and Operation
20
3.4.3 Dynamic Operation
The application controls dynamic changes to switching by sending the
MVD_MSG_SC_LISTEN message to the board. This message contains the liu_id (in the
range 0 to one less than the number of LIUs), the timeslot number on the T1/E1/J1
interface and the switch channel number (sc_channel) to which the timeslot should
listen. The message is directed to the correct board by calling the GCT_set_instance( )
function prior to calling the GCT_send( ) function.
When a new call arrives, the application will need to issue two listen commands
(although they will not necessarily both apply to the SS7 board). One connects the
voice circuit in the forward direction and the other connects voice circuit in the
backward direction. See Figure 1. Switch Connections.
3.4.4 Example Code for Building and Sending MVD_MSG_SC_LISTEN
Message
The following code demonstrates how to build and send a MVD_MSG_SC_LISTEN
message to the DSI SS7MD Board to listen to a switch timeslot.
/*
* Example function for building and sending an MVD_MSG_SC_LISTEN
* message to an SS7 signaling card.
*
* The only change that the user needs to make is to fill in the
* OUR_MOD_ID definition below so that it is equal to the module_id
* of the application module.
*/
#define OUR_MOD_ID (0xef)
#include "system.h" /* Definitions of u8, u16 etc */
#include "msg.h" /* Definitions of HDR, MSG etc */
#include "libc.h" /* Used only for memset prototype */
#include "sysgct.h" /* Prototypes for GCT_xxx */
#include "pack.h" /* Prototypes for rpackbytes */
#include "ss7_inc.h" /* Message & module definitions */
/*
* Macro to generate the value for use in the rsp_req field of the
* message header in order to request a confirmation message:
*/
#define RESPONSE(module) (((unsigned short) 1) << ((module) & 0x0f))
/*
* Function to drive an SCbus / CT Bus timeslot
* onto a timeslot on a PCM port:
*/
int listen_to_scbus(board_id, liu_id, timeslot, sc_channel)
int board_id; /* board_id (0, 1, 2 ...) */
int liu_id; /* PCM port id (0 .. one less than no. of LIUs) */
int timeslot; /* Timeslot on the PCM port (1 .. 31) */
int sc_channel; /* SCbus / CT Bus channel number */
{
MSG *m;
u8 *pptr;
/*
* Allocate a message (and fill in type, id, rsp_req & len):
*/
if ((m = getm(MVD_MSG_SC_LISTEN, 0, RESPONSE(OUR_MOD_ID), MVDML_SCLIS)) != 0)
{