Technical Helpweb

- more articles

Log application name and version in log

Introduction:  

Every time an application connects to the LLC you will see something similar to the following for every application connecting.

Nov 23 2010 09:47:51: App 300 data: name Unknown, v Unknown (SK v 10.04.00.66), pid 7045, from host RH4.lab, started at Nov 23 2010 09:47:51

You will also see the following for each application connected when the logs roll over.

Nov 24 2010 00:00:00: +++++++++++Application Connection++++++++++
Nov 24 2010 00:00:00: App#: 300
Nov 24 2010 00:00:00: Name: Unknown v Unknown (SK v 10.04.00.66)
Nov 24 2010 00:00:00: PID:  7045
Nov 24 2010 00:00:00: Host: RH4.lab (10.129.50.139)
Nov 24 2010 00:00:00: Started at: Nov 23 2010 09:47:51
Nov 24 2010 00:00:00: +++++++++++++++++++++++++++++++++++++++++++

When running multiple applications  this can cause confusion as you may not know which applications are connected. 

The SwitchKit API provides the sk_appDescriptionData( ) function so that you can populate the logs with useful information such as the application name and version number:

Nov 23 2010 09:47:53: App 301 data: name CallProcessingApp v 1.2  (SK v 10.04.00.66), pid 7200, from host RH4.macrose, started at Nov 23 2010 09:47:53

or when the logs roll over:

Nov 24 2010 00:00:00: +++++++++++Application Connection++++++++++
Nov 24 2010 00:00:00: App#: 301
Nov 24 2010 00:00:00: Name: CallProcessingApp v 1.2 (10.04.00.66)
Nov 24 2010 00:00:00: PID:  7200
Nov 24 2010 00:00:00: Host: RH4.lab (10.129.50.139)
Nov 24 2010 00:00:00: Started at: Nov 23 2010 09:47:53
+++++++++++++++++++++++++++++++++++++++++++

Details: 

The sk_appDescriptionData( ) function is defined as follows:

void sk_appDescriptionData(char *anAppName,char *aShortName, char *anAppVersion, char *aUserData)

or if you are using the threadsafe libraries

void skts_appDescriptionData(char *anAppName,char *aShortName, char *anAppVersion, char *aUserData);

The arguments are defined as follows:

*anAppName - a char string used as a descriptive name for the application this should be set to the same as the aLabel argument in sk_createConnection() in order to be available for query via sk_getSpecificConnectionLabel() and skts_getSpecificConnectionLabel().

*aShortName - a char string used as the name of the applciation when it connectes to the llc in the the maintenance.log log file. It not passed to the LLC.

*anAppVersion - a char string used as the version of the application software,  this is also used when the application connectes to the llc in the the maintenance.log log file. 

*aUserData - this is stored by the API, but is only used by the application

The below is an example snippet of code that will create a connection to a local LLC running on port 1312 and print data to the log similar to the example above:

int X_APP=300; //App id used in maintenence_llc log when application connects 
char MODULE_NAME[] = "CallProcessingApp"; //named displayed in the maintenence_llc when the application connects
char SHORTNAME[]= "CallProcessingApp"
char VERSION_NUM[] = "1.2";
char REVISION_DATE[] ="11/23/10";

sk_appDescriptionData((char *)MODULE_NAME ,(char*)SHORTNAME,(char*)VERSION_NUM,(char*)REVISION_DATE);

 void * test = sk_createConnectionWithID(
       1, //connection ID to the llc
       MODULE_NAME,
       X_APP,
       0,
       "127.0.0.1",
        1312,
       "",
        0);
  if (test  == NULL){
      cout << "error has occured creating connection to LLC" <<endl;
      cout <<endl<<"To quit the application, press <crtl>-c"<<endl;
      return( -1);
      }


Product List:

Dialogic® MSP Multi-Services Platform SwitchKit API

Dialogic® CSP Converged Services Platform SwitchKit API

 

Related Documentation:  

http://www.dialogic.com/webhelp/MSP1010/10.4.0/WebHelp/sk_programmer/connection/sk_app1.htm




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:

First published: 03-Dec-2010
Open access: Product rule: ; Page rule: Auto

Service Center Logon