From: <jpg...@us...> - 2007-10-03 17:37:56
|
Revision: 1170 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1170&view=rev Author: jpgrayson Date: 2007-10-03 10:37:45 -0700 (Wed, 03 Oct 2007) Log Message: ----------- Use floats exclusively instead of doubles to match the iaxclient API. Modified Paths: -------------- trunk/simpleclient/testcall/testcall.c Modified: trunk/simpleclient/testcall/testcall.c =================================================================== --- trunk/simpleclient/testcall/testcall.c 2007-10-03 17:30:10 UTC (rev 1169) +++ trunk/simpleclient/testcall/testcall.c 2007-10-03 17:37:45 UTC (rev 1170) @@ -27,7 +27,7 @@ #include "iaxclient.h" -#define LEVEL_INCREMENT 0.10 +#define LEVEL_INCREMENT 0.10f /* static int answered_call; */ static char *output_filename = NULL; @@ -163,8 +163,8 @@ char c; int i; char *dest = NULL; - double silence_threshold = -99; - double level; + float silence_threshold = -99.0f; + float level; f = stdout; @@ -185,7 +185,7 @@ break; case 's': if(i+1 >= argc) usage(); - silence_threshold = atof(argv[++i]); + silence_threshold = (float)atof(argv[++i]); break; case 'u': if(i+1 >= argc) usage(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpg...@us...> - 2008-04-23 14:58:44
|
Revision: 1418 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1418&view=rev Author: jpgrayson Date: 2008-04-23 07:58:50 -0700 (Wed, 23 Apr 2008) Log Message: ----------- Whitespace. Modified Paths: -------------- trunk/simpleclient/testcall/testcall.c Modified: trunk/simpleclient/testcall/testcall.c =================================================================== --- trunk/simpleclient/testcall/testcall.c 2008-04-23 14:32:05 UTC (rev 1417) +++ trunk/simpleclient/testcall/testcall.c 2008-04-23 14:58:50 UTC (rev 1418) @@ -47,14 +47,14 @@ if (initialized) iaxc_shutdown(); if (reg_id){ - iaxc_unregister(reg_id); + iaxc_unregister(reg_id); } return; } void signal_handler(int signum) { - if ( signum == SIGTERM || signum == SIGINT ) + if ( signum == SIGTERM || signum == SIGINT ) { killem(); exit(0); @@ -76,7 +76,7 @@ if((call.state & IAXC_CALL_STATE_RINGING)) { printf("Receiving Incoming Call Request...\n"); - if ( intercom ) + if ( intercom ) { printf("Intercom mode, answer automatically\n"); return iaxc_select_call(call.callNo); @@ -152,7 +152,7 @@ } void usage() -{ +{ fprintf(stderr, "Usage: testcall [-?] [-v] [-i] [-s SILENCE_THRESHOLD] [-u USERNAME -p PASSWORD -h HOST]\n"); exit(1); } @@ -170,7 +170,7 @@ for(i=1;i<argc;i++) { - if(argv[i][0] == '-') + if(argv[i][0] == '-') { switch(tolower(argv[i][1])) { @@ -215,11 +215,11 @@ /* activate the exit handler */ atexit(killem); - + /* install signal handler to catch CRTL-Cs */ signal(SIGINT, signal_handler); signal(SIGTERM, signal_handler); - + if ( iaxc_initialize(1) ) fatal_error("cannot initialize iaxclient!"); initialized = 1; @@ -233,7 +233,7 @@ list_devices(); //if(do_levels) - iaxc_set_event_callback(iaxc_callback); + iaxc_set_event_callback(iaxc_callback); fprintf(f, "\n\ @@ -262,19 +262,19 @@ reg_id = iaxc_register(username, password, host); printf("ready for keyboard input\n"); - + if(output_filename) { for(;;) iaxc_millisleep(10*1000); } - while((c = getc(stdin))) + while((c = getc(stdin))) { - switch (tolower(c)) + switch (tolower(c)) { case 'a': printf("Answering call 0\n"); iaxc_select_call(0); - break; + break; case 'g': level = iaxc_input_level_get(); level += LEVEL_INCREMENT; @@ -289,7 +289,7 @@ printf("Decreasing input level to %f\n", level); iaxc_input_level_set(level); break; - case 'h': + case 'h': level = iaxc_output_level_get(); level += LEVEL_INCREMENT; if ( level > 1.00 ) level = 1.00; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpg...@us...> - 2008-04-23 15:00:26
|
Revision: 1419 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1419&view=rev Author: jpgrayson Date: 2008-04-23 08:00:22 -0700 (Wed, 23 Apr 2008) Log Message: ----------- Fix bug where testcall would crash when CTRL-C was used to kill it. This avoids calling iaxc_shutdown() twice. Modified Paths: -------------- trunk/simpleclient/testcall/testcall.c Modified: trunk/simpleclient/testcall/testcall.c =================================================================== --- trunk/simpleclient/testcall/testcall.c 2008-04-23 14:58:50 UTC (rev 1418) +++ trunk/simpleclient/testcall/testcall.c 2008-04-23 15:00:22 UTC (rev 1419) @@ -44,12 +44,16 @@ cleanly and has to be rebooted. What a pile of doo doo!! */ void killem(void) { - if (initialized) + if ( initialized ) + { iaxc_shutdown(); - if (reg_id){ + initialized = 0; + } + if ( reg_id ) + { iaxc_unregister(reg_id); + reg_id = 0; } - return; } void signal_handler(int signum) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |