From: <jpg...@us...> - 2007-12-05 23:29:37
|
Revision: 1299 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1299&view=rev Author: jpgrayson Date: 2007-12-05 15:29:41 -0800 (Wed, 05 Dec 2007) Log Message: ----------- Fix header. Improve error checking. Modified Paths: -------------- trunk/simpleclient/stresstest/stresstest.c Modified: trunk/simpleclient/stresstest/stresstest.c =================================================================== --- trunk/simpleclient/stresstest/stresstest.c 2007-12-04 13:24:13 UTC (rev 1298) +++ trunk/simpleclient/stresstest/stresstest.c 2007-12-05 23:29:41 UTC (rev 1299) @@ -1,18 +1,21 @@ /* -* vtestcall: make a single video test call with IAXCLIENT +* stresstest: simple program for applying IAX2 protocol stress to asterisk. * -* IAX Support for talking to Asterisk and other Gnophone clients +* Copyrights: +* Copyright (C) 2007, Wimba, Inc. * -* Copyright (C) 1999, Linux Support Services, Inc. -* -* Mark Spencer <mar...@li...> -* Stefano Falsetto <fal...@gn...> +* Contributors: * Mihai Balea <mihai AT hates DOT ms> +* Peter Grayson <jpg...@gm...> * * This program is free software, distributed under the terms of -* the GNU Lesser (Library) General Public License +* the GNU Lesser (Library) General Public License. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <stdarg.h> #include <stdio.h> #include <stdlib.h> @@ -256,7 +259,6 @@ char *dest = NULL; char *ogg_file = NULL; int loop = 0; - int callNo; /* install signal handler to catch CRTL-Cs */ signal(SIGINT, signal_handler); @@ -319,8 +321,11 @@ default: usage(); } - } else + } + else + { dest = argv[i]; + } } if ( dest == NULL ) @@ -341,6 +346,7 @@ iaxc_video_format_set(formatp, format, framerate, bitrate, width, height, fragsize); iaxc_set_test_mode(1); + if (iaxc_initialize(MAX_CALLS)) fatal_error("cannot initialize iaxclient!"); @@ -351,14 +357,12 @@ iaxc_set_event_callback(test_mode_callback); // Crank the engine - iaxc_start_processing_thread(); + if ( iaxc_start_processing_thread() < 0 ) + fatal_error("failed iaxc_start_processing_thread()\n"); // Dial out - callNo = iaxc_call(dest); - if (callNo <= 0) - iaxc_select_call(callNo); - else - mylog("Failed to make call to '%s'", dest); + if ( iaxc_call(dest) < 0 ) + fatal_error("failed iaxc_call()"); // Wait for the call to be established; while ( !call_established && running ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |