| CONTACT | DEVELOPER CENTER | PARTNERS | SITEMAP
GO
Useful Links
  • Search Helpweb
    
    

Dialogic Support Helpweb

Dialogic® Signaling and SS7 Products

How to Programmatically Bring a Dialogic® SS7 Sub System in service

Summary:
This document describes the steps needed to programmatically bringing a Dialogic® SS7 Sub System in service

Solution: 
Host based Dialogic® SS7 protocols can be started via the configuration file config.txt. As an example, the following line starts the SCCP protocol: “SCCP_CONFIG 2 0x08 0x0102 0x00000001” . The management options mask of 0x00000001 has bit 0 set which causes the user in service (UIS) message to be sent by the s7_mgt module for each SCCP subsystem. A drawback to this approach is the inability of the solution to recover from any outage conditions. The better approach is to programmatically send the user in service message from the client application. This approach provides a mechanism for the application to determine when an outage occurs and when the outage is resolved.

The following is a summary of the code necessary to send the UIS message from an application. First step is to determine if the gct system is running which can be done a number of ways. GCT_link is one of the approaches with the code implementation of:

if (GCT_LINK() ) return – GCT_link will return a value of zero if the GCT state is running

The next step is to use the getm api to get a message that is then used to send the UIS message. The following code is an example of the getm api.

if ((m = getm(SCP_MSG_SCMG_REQ, ssn, RESPONSE(ttu_mod_id), 6)) != 0) 

where m is defined as a MSG*;
SCP_MSG_SCMG_REQ is a management request from the user type ssn;
ssn is defined as an unsigned char or u8 and is the local sub system number ;
RESPONSE sets the response request field for the message;
6 is the length of the message sent

Finally a return of other than zero indicates a failure for the getm call.

After the getm api is called, the application should set the source and destination information for the msg to be sent. The following are samples: m->hdr.src = 0x0d

m->hdr.dst = TCP_TASK_ID where 0x0d is application task ID 0 and TCP_TASK_ID is the TCAP module. After the source and destination has been set, the application calls the get_param macro to get a pointer to the parameter section of the message requested. This is done with the following line: pptr = get_param(m) where pptr is defined as an unsigned char (u8) pointer.

The parameter area of the message should then be initialized to zero and the state request and format bytes should be set using the rpackbytes api. The format of these two api calls is: rpackbytes(pptr, 0, (u32)SCPMPT_NSTATE_REQ, 1); rpackbytes(pptr, 1, (u32)format_id, 1);

The first rpackbytes sets byte zero of the message to an N-State request message type. The second call to rpackbytes sets byte 1 to a format id of 1 or an in service message.

Finally, the message composed needs to be sent to the message destination and is accomplished using the following:
if (GCT_send(m->hdr.dst, (HDR *)m) != 0).

GCT_send sends the in service message to the TCAP subsystem as defined when the destination subsystem was set in the sample above and m is a pointer to the message assembled in the previous steps. The value returned for the api call should be zero if the call was successful. If the api call failed, the application must release the message in order to avoid a resource leak. relm((HDR *)m); releases the message resource back to the system.

The complete code sample looks like the following:

int i;
int retStatus = 0;
unsigned char format_id = 1; /* 1=UIS, 2=UOS, 7=Congestion */
unsigned char ssn = 0x66;
static unsigned char ttu_mod_id = 0x0d;
MSG *m;
u8 *pptr; /* u8 is #defined as unsigned char */

if (retStatus = GCT_link() != 0)
return;

if ((m = getm(SCP_MSG_SCMG_REQ, ssn, RESPONSE(ttu_mod_id), 6)) != 0)
{
m->hdr.src = ttu_mod_id;
m->hdr.dst = TCP_TASK_ID;
pptr = get_param(m);
memset((void *)pptr, 0, m->len);

rpackbytes(pptr, 0, (u32)SCPMPT_NSTATE_REQ, 1);
rpackbytes(pptr, 1, (u32)format_id, 1);

if (GCT_send(m->hdr.dst, (HDR *)m) != 0)
{
fprintf(stderr, "ss7test: *** failed to send UIS message ***\n");
relm((HDR *)m);
}
}




Feedback

Please rate the usefulness of this page:  

0 - not useful at all
1 - potentially useful
2 - quite useful
3 - very useful
4 - exactly the information I needed     

Please enter a comment about this page: