Hei,

I am currently investigating SIP monitoring of many servers with one SIPp 
script.  This requires that I can pass account information along in the command 
line.  I noticed that the "default" handling of the [authentication] tag is 
incorrect in source.

Basically the documentation says that it can be passed, the code defaults the 
internal strings from the command line, but then they are overwritten by empty 
stings (if the username= is not present).

Of course this is a little unintended.  Im not sure what the developers want to 
do with "getKeywordParam" since it trys to be a little clever in my view 
(clearing passed strings if it does not find something to put in them).

I quickly edited the call.cpp file and ensured that the defaults are set AFTER 
the keyword search and enclose that here.  Note the "memsets" are not required, 
but perhaps someone is being very carefull because getKeywordParam 
functionality is not so clearly defined.

Best regards,

--- call.cpp.old        2007-05-09 12:28:55.000000000 +0200
+++ call.cpp    2007-05-09 12:21:06.000000000 +0200
@@ -2257,13 +2257,18 @@
 
         auth_marker = src;
         auth_marker_len = strchr(src, ']') - src;
-        strcpy(my_auth_user, service);
-        strcpy(my_auth_pass, auth_password);
         /* Look for optional username and password parameters */
         /* add aka_OP, aka_AMF, aka_K */
+        memset(my_auth_user,0,KEYWORD_SIZE); // not needed as getKeywordParam 
writes '\0'
         key = getKeywordParam(src, "username=", my_auth_user);
-        memset(my_auth_pass,0,KEYWORD_SIZE);
+        if(!key)                             // Since get keyword empties 
string on not found must default here
+           strcpy(my_auth_user, service);
+
+        memset(my_auth_pass,0,KEYWORD_SIZE); // not needed as getKeywordParam 
writes '\0'
         key = getKeywordParam(src, "password=", my_auth_pass);
+        if(!key)                             // Since get keyword empties 
string on not found must default here
+           strcpy(my_auth_pass, auth_password);
+
         memset(my_aka_OP,0,KEYWORD_SIZE);
         key = getKeywordParam(src, "aka_OP=", my_aka_OP);
         memset(my_aka_AMF,0,KEYWORD_SIZE);



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Sipp-users mailing list
Sipp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to