From: <sb...@us...> - 2007-10-02 19:37:26
|
Revision: 1164 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1164&view=rev Author: sbalea Date: 2007-10-02 12:37:29 -0700 (Tue, 02 Oct 2007) Log Message: ----------- Several changes to stresstest: - timed operation: stresstest will quit after a given timeout (controlled by the -t <timeout> CLI parameter, default never) - return codes that signal error conditions 0 - normal termination -1 - connection could not be established -2 - no media received - eliminate some unused code, move stuff around, beautify the code a little Modified Paths: -------------- trunk/simpleclient/stresstest/stresstest.c Modified: trunk/simpleclient/stresstest/stresstest.c =================================================================== --- trunk/simpleclient/stresstest/stresstest.c 2007-10-02 19:11:39 UTC (rev 1163) +++ trunk/simpleclient/stresstest/stresstest.c 2007-10-02 19:37:29 UTC (rev 1164) @@ -32,6 +32,11 @@ #define MAX_CALLS 1 +#define TEST_OK 0 +#define TEST_NO_CONNECTION -1 +#define TEST_NO_MEDIA -2 +#define TEST_UNKNOWN_ERROR -99 + //int format = IAXC_FORMAT_THEORA | IAXC_FORMAT_SPEEX; int format = IAXC_FORMAT_H263 | IAXC_FORMAT_H263_PLUS | IAXC_FORMAT_H264 | IAXC_FORMAT_MPEG4 | IAXC_FORMAT_THEORA; int formatp = IAXC_FORMAT_H264; //IAXC_FORMAT_THEORA; @@ -42,6 +47,7 @@ int fragsize = 1400; int call_established = 0; +int running = 0; // Forward declaration void process_text_message(char *message); @@ -51,34 +57,42 @@ int send_video = 1; int send_audio = 1; int print_netstats = 0; +int timeout = 0; +int video_frames_count = 0; +int audio_frames_count = 0; +struct timeval start_time; + // Audio-cosmetic... struct iaxc_sound sound_ringOUT, sound_ringIN; -/* routine called at exit to shutdown audio I/O and close nicely. -NOTE: If all this isnt done, the system doesnt not handle this -cleanly and has to be rebooted. What a pile of doo doo!! */ -void killem(void) +/* routine used to shutdown and close nicely.*/ +void hangup_and_exit(int code) { + fprintf(stderr,"Dump call\n"); + iaxc_dump_call(); + fprintf(stderr,"Sleep for 500 msec\n"); + iaxc_millisleep(500); + fprintf(stderr,"Stop processing thread\n"); + iaxc_stop_processing_thread(); fprintf(stderr,"Calling iaxc_shutdown..."); iaxc_shutdown(); - fprintf(stderr,"Done\nProgram terminated correctly.\n"); - exit(0); + fprintf(stderr,"Exiting with code %d\n", code); + exit(code); } void signal_handler(int signum) { if ( signum == SIGTERM || signum == SIGINT ) { - killem(); - exit(0); + running = 0; } } -void fatal_error(char *err) { - killem(); +void fatal_error(char *err) +{ fprintf(stderr, "FATAL ERROR: %s\n", err); - exit(1); + exit(TEST_UNKNOWN_ERROR); } int levels_callback(float input, float output) { @@ -123,17 +137,6 @@ return 0; } -void hangup_and_exit(void) -{ - iaxc_dump_call(); - fprintf(stderr,"Dumped call\n"); - iaxc_millisleep(1000); - fprintf(stderr,"Sleeped for 1000 msec\n"); - iaxc_stop_processing_thread(); - fprintf(stderr,"Stopped processing thread\n"); - killem(); -} - void process_text_message(char *message) { unsigned int prefs; @@ -170,6 +173,7 @@ "-a stop sending audio\n" "-l run file in a loop\n" "-n dump periodic netstats to stderr\n" + "-t <timeout> terminate after timeout seconds and report status via return code\n" "\n" ); exit(1); @@ -184,22 +188,10 @@ fprintf(stderr, "Call answered\n"); call_established = 1; } - // Finished the phase of handshaking for the call in entry - if (s.state == (IAXC_CALL_STATE_ACTIVE|IAXC_CALL_STATE_RINGING)) - { - fprintf(stderr,"Auto-Answering to caller %s on line %d...\n",s.remote,s.callNo); - //iaxc_unquelch(s.callNo); - iaxc_millisleep(1000); - iaxc_answer_call(s.callNo); - iaxc_select_call(s.callNo); - call_established = 1; - //iaxc_millisleep(1000); - return 0; - } if (s.state == IAXC_CALL_STATE_FREE) { - fprintf(stderr,"Disconnect from other end\n"); - hangup_and_exit(); + fprintf(stderr,"Call terminated\n"); + running = 0; } return 0; @@ -219,7 +211,11 @@ case IAXC_EVENT_STATE: return test_mode_state_callback(e.ev.call); case IAXC_EVENT_VIDEO: + video_frames_count++; + break; case IAXC_EVENT_AUDIO: + audio_frames_count++; + break; default: break; } @@ -236,6 +232,7 @@ int video_frame_index; static struct slice_set_t slice_set; unsigned short source_id; + struct timeval now; /* install signal handler to catch CRTL-Cs */ signal(SIGINT, signal_handler); @@ -275,6 +272,11 @@ case 'n': print_netstats = 1; break; + case 't': + if ( i+1 >= argc ) + usage(); + timeout = 1000 * atoi(argv[++i]); + break; default: usage(); } @@ -297,7 +299,10 @@ // Load ogg file load_ogg_file(ogg_file); } - + + // Get start time for timeouts + gettimeofday(&start_time, NULL); + // Initialize iaxclient iaxc_video_format_set(formatp, format, framerate, bitrate, width, height, fragsize); iaxc_set_test_mode(1); @@ -306,8 +311,8 @@ iaxc_set_formats(IAXC_FORMAT_SPEEX, IAXC_FORMAT_SPEEX); iaxc_video_bypass_jitter(0); - iaxc_set_audio_prefs(0); - iaxc_set_video_prefs(0); + iaxc_set_audio_prefs(IAXC_AUDIO_PREF_RECV_REMOTE_ENCODED); + iaxc_set_video_prefs(IAXC_VIDEO_PREF_RECV_REMOTE_ENCODED); iaxc_set_event_callback(test_mode_callback); // Crank the engine @@ -322,9 +327,15 @@ // Wait for the call to be established; while ( !call_established ) + { + gettimeofday(&now, NULL); + if ( timeout > 0 && iaxci_msecdiff(&now, &start_time) > timeout ) + hangup_and_exit(TEST_NO_CONNECTION); iaxc_millisleep(5); + } - while ( 42 ) + running = 1; + while ( running ) { // We only need this if we actually want to send something if ( ogg_file && ( send_audio || send_video ) ) @@ -346,8 +357,17 @@ // Tight spinloops are bad, mmmkay? iaxc_millisleep(5); + + // Exit after a positive timeout + gettimeofday(&now, NULL); + if ( timeout > 0 && iaxci_msecdiff(&now, &start_time) > timeout ) + running = 0; } - hangup_and_exit(); + fprintf(stderr, "Received %d audio frames and %d video frames\n", audio_frames_count, video_frames_count); + if ( audio_frames_count == 0 && video_frames_count == 0 ) + hangup_and_exit(TEST_NO_MEDIA); + else + hangup_and_exit(TEST_OK); return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-10 15:10:43
|
Revision: 1186 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1186&view=rev Author: sbalea Date: 2007-10-10 08:10:47 -0700 (Wed, 10 Oct 2007) Log Message: ----------- Do not depend on internal APIs in stresstest This works on Linux but fails on Mac. Modified Paths: -------------- trunk/simpleclient/stresstest/stresstest.c Modified: trunk/simpleclient/stresstest/stresstest.c =================================================================== --- trunk/simpleclient/stresstest/stresstest.c 2007-10-09 16:02:48 UTC (rev 1185) +++ trunk/simpleclient/stresstest/stresstest.c 2007-10-10 15:10:47 UTC (rev 1186) @@ -223,6 +223,11 @@ return 0; } +long msecdiff(struct timeval *t0, struct timeval *t1) +{ + return (t1->tv_sec - t0->tv_sec) * 1000L + (t1->tv_usec - t0->tv_usec) / 1000L; +} + int main(int argc, char **argv) { int i; @@ -329,7 +334,7 @@ while ( !call_established ) { gettimeofday(&now, NULL); - if ( timeout > 0 && iaxci_msecdiff(&now, &start_time) > timeout ) + if ( timeout > 0 && msecdiff(&start_time, &now) > timeout ) hangup_and_exit(TEST_NO_CONNECTION); iaxc_millisleep(5); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-10 15:23:34
|
Revision: 1188 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1188&view=rev Author: sbalea Date: 2007-10-10 08:23:33 -0700 (Wed, 10 Oct 2007) Log Message: ----------- Get another instance of iaxci_msecdiff Modified Paths: -------------- trunk/simpleclient/stresstest/stresstest.c Modified: trunk/simpleclient/stresstest/stresstest.c =================================================================== --- trunk/simpleclient/stresstest/stresstest.c 2007-10-10 15:13:04 UTC (rev 1187) +++ trunk/simpleclient/stresstest/stresstest.c 2007-10-10 15:23:33 UTC (rev 1188) @@ -365,7 +365,7 @@ // Exit after a positive timeout gettimeofday(&now, NULL); - if ( timeout > 0 && iaxci_msecdiff(&now, &start_time) > timeout ) + if ( timeout > 0 && msecdiff(&start_time, &now) > timeout ) running = 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpg...@us...> - 2007-10-16 23:37:07
|
Revision: 1202 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1202&view=rev Author: jpgrayson Date: 2007-10-16 16:36:40 -0700 (Tue, 16 Oct 2007) Log Message: ----------- Make static things static. Make const things const. Make local things local. Make unused things gone. Modified Paths: -------------- trunk/simpleclient/stresstest/stresstest.c Modified: trunk/simpleclient/stresstest/stresstest.c =================================================================== --- trunk/simpleclient/stresstest/stresstest.c 2007-10-16 23:34:48 UTC (rev 1201) +++ trunk/simpleclient/stresstest/stresstest.c 2007-10-16 23:36:40 UTC (rev 1202) @@ -37,35 +37,31 @@ #define TEST_NO_MEDIA -2 #define TEST_UNKNOWN_ERROR -99 -//int format = IAXC_FORMAT_THEORA | IAXC_FORMAT_SPEEX; -int format = IAXC_FORMAT_H263 | IAXC_FORMAT_H263_PLUS | IAXC_FORMAT_H264 | IAXC_FORMAT_MPEG4 | IAXC_FORMAT_THEORA; -int formatp = IAXC_FORMAT_H264; //IAXC_FORMAT_THEORA; -int framerate = 15; -int bitrate = 200000; -int width = 320; -int height = 240; -int fragsize = 1400; +static const int format = + IAXC_FORMAT_H263 | + IAXC_FORMAT_H263_PLUS | + IAXC_FORMAT_H264 | + IAXC_FORMAT_MPEG4 | + IAXC_FORMAT_THEORA; +static int formatp = IAXC_FORMAT_THEORA; +static int framerate = 15; +static int bitrate = 200000; +static int width = 320; +static int height = 240; +static int fragsize = 1400; -int call_established = 0; -int running = 0; +static int call_established = 0; +static int running = 0; -// Forward declaration -void process_text_message(char *message); +static int send_video = 1; +static int send_audio = 1; +static int print_netstats = 0; +static int timeout = 0; +static int video_frames_count = 0; +static int audio_frames_count = 0; -char caption[80] = ""; +static struct timeval start_time; -int send_video = 1; -int send_audio = 1; -int print_netstats = 0; -int timeout = 0; -int video_frames_count = 0; -int audio_frames_count = 0; - -struct timeval start_time; - -// Audio-cosmetic... -struct iaxc_sound sound_ringOUT, sound_ringIN; - /* routine used to shutdown and close nicely.*/ void hangup_and_exit(int code) { @@ -163,17 +159,15 @@ void usage() { - printf( - "\n" - "Usage is: tescall <options>\n\n" + printf("Usage is: stresstest <options>\n\n" "available options:\n" - "-F <codec,framerate,bitrate,width,height,fragsize> set video parameters\n" - "-o <filename> media file to run\n" - "-v stop sending video\n" - "-a stop sending audio\n" - "-l run file in a loop\n" - "-n dump periodic netstats to stderr\n" - "-t <timeout> terminate after timeout seconds and report status via return code\n" + " -F <codec,framerate,bitrate,width,height,fragsize> set video parameters\n" + " -o <filename> media file to run\n" + " -v stop sending video\n" + " -a stop sending audio\n" + " -l run file in a loop\n" + " -n dump periodic netstats to stderr\n" + " -t <timeout> terminate after timeout seconds and report status via return code\n" "\n" ); exit(1); @@ -230,29 +224,25 @@ int main(int argc, char **argv) { - int i; - char mydest[80], *dest = NULL; - char *ogg_file = NULL; - int loop = 0; - int video_frame_index; - static struct slice_set_t slice_set; - unsigned short source_id; - struct timeval now; + int i; + char *dest = NULL; + char *ogg_file = NULL; + int loop = 0; /* install signal handler to catch CRTL-Cs */ signal(SIGINT, signal_handler); signal(SIGTERM, signal_handler); /* Parse command line */ - for(i=1;i<argc;i++) + for ( i = 1; i < argc; i++) { - if(argv[i][0] == '-') + if ( argv[i][0] == '-' ) { - switch(argv[i][1]) + switch ( argv[i][1] ) { case 'F': /* set video params */ { - formatp = 1<<atoi(argv[++i]); + formatp = 1 << atoi(argv[++i]); framerate = atoi(argv[++i]); bitrate = atoi(argv[++i]); width = atoi(argv[++i]); @@ -296,20 +286,17 @@ return -1; } - if ( ogg_file == NULL ) - fprintf(stderr, "No media file, running dry\n"); - if ( ogg_file ) - { - // Load ogg file load_ogg_file(ogg_file); - } + else + fprintf(stderr, "No media file, running dry\n"); // Get start time for timeouts gettimeofday(&start_time, NULL); // Initialize iaxclient - iaxc_video_format_set(formatp, format, framerate, bitrate, width, height, fragsize); + 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!"); @@ -333,6 +320,7 @@ // Wait for the call to be established; while ( !call_established ) { + struct timeval now; gettimeofday(&now, NULL); if ( timeout > 0 && msecdiff(&start_time, &now) > timeout ) hangup_and_exit(TEST_NO_CONNECTION); @@ -342,6 +330,8 @@ running = 1; while ( running ) { + struct timeval now; + // We only need this if we actually want to send something if ( ogg_file && ( send_audio || send_video ) ) { @@ -351,7 +341,9 @@ if ( !loop && audio_is_eos() ) break; if ( send_audio && op != NULL && op->bytes > 0 ) - iaxc_push_audio(op->packet, op->bytes, SPEEX_SAMPLING_RATE / 1000 * SPEEX_FRAME_DURATION); + iaxc_push_audio(op->packet, op->bytes, + SPEEX_SAMPLING_RATE * + SPEEX_FRAME_DURATION / 1000); op = get_next_video_op(); if ( !loop && video_is_eos() ) @@ -369,7 +361,9 @@ running = 0; } - fprintf(stderr, "Received %d audio frames and %d video frames\n", audio_frames_count, video_frames_count); + fprintf(stderr, "Received %d audio frames and %d video frames\n", + audio_frames_count, video_frames_count); + if ( audio_frames_count == 0 && video_frames_count == 0 ) hangup_and_exit(TEST_NO_MEDIA); else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpg...@us...> - 2007-10-16 23:40:00
|
Revision: 1203 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1203&view=rev Author: jpgrayson Date: 2007-10-16 16:40:00 -0700 (Tue, 16 Oct 2007) Log Message: ----------- Avoid C99-ism. Whitespace. Modified Paths: -------------- trunk/simpleclient/stresstest/stresstest.c Modified: trunk/simpleclient/stresstest/stresstest.c =================================================================== --- trunk/simpleclient/stresstest/stresstest.c 2007-10-16 23:36:40 UTC (rev 1202) +++ trunk/simpleclient/stresstest/stresstest.c 2007-10-16 23:40:00 UTC (rev 1203) @@ -175,7 +175,7 @@ int test_mode_state_callback(struct iaxc_ev_call_state s) { - printf("Call #%d state %d\n",s.callNo, s.state); + printf("Call #%d state %d\n", s.callNo, s.state); if ( s.state & IAXC_CALL_STATE_COMPLETE ) { @@ -195,23 +195,23 @@ { switch ( e.type ) { - case IAXC_EVENT_LEVELS: - return levels_callback(e.ev.levels.input, e.ev.levels.output); - case IAXC_EVENT_NETSTAT: - return netstat_callback(e.ev.netstats); - case IAXC_EVENT_TEXT: - process_text_message(e.ev.text.message); - break; - case IAXC_EVENT_STATE: - return test_mode_state_callback(e.ev.call); - case IAXC_EVENT_VIDEO: - video_frames_count++; - break; - case IAXC_EVENT_AUDIO: - audio_frames_count++; - break; - default: - break; + case IAXC_EVENT_LEVELS: + return levels_callback(e.ev.levels.input, e.ev.levels.output); + case IAXC_EVENT_NETSTAT: + return netstat_callback(e.ev.netstats); + case IAXC_EVENT_TEXT: + process_text_message(e.ev.text.message); + break; + case IAXC_EVENT_STATE: + return test_mode_state_callback(e.ev.call); + case IAXC_EVENT_VIDEO: + video_frames_count++; + break; + case IAXC_EVENT_AUDIO: + audio_frames_count++; + break; + default: + break; } return 0; @@ -228,6 +228,7 @@ char *dest = NULL; char *ogg_file = NULL; int loop = 0; + int callNo; /* install signal handler to catch CRTL-Cs */ signal(SIGINT, signal_handler); @@ -311,7 +312,7 @@ iaxc_start_processing_thread(); // Dial out - int callNo = iaxc_call(dest); + callNo = iaxc_call(dest); if (callNo <= 0) iaxc_select_call(callNo); else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpg...@us...> - 2007-10-30 21:08:05
|
Revision: 1248 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1248&view=rev Author: jpgrayson Date: 2007-10-30 14:07:50 -0700 (Tue, 30 Oct 2007) Log Message: ----------- Stress test updates. * remove bogus include * Add -c command line option for specifying the connection timeout separately from the call duration timeout. Modified Paths: -------------- trunk/simpleclient/stresstest/stresstest.c Modified: trunk/simpleclient/stresstest/stresstest.c =================================================================== --- trunk/simpleclient/stresstest/stresstest.c 2007-10-30 21:06:10 UTC (rev 1247) +++ trunk/simpleclient/stresstest/stresstest.c 2007-10-30 21:07:50 UTC (rev 1248) @@ -23,7 +23,6 @@ #include <signal.h> #include "iaxclient.h" -#include "slice.h" #include "file.h" #ifdef WIN32 @@ -57,7 +56,8 @@ static int send_video = 1; static int send_audio = 1; static int print_netstats = 0; -static int timeout = 0; +static int call_timeout_ms = 0; +static int connect_timeout_ms = 5000; static int video_frames_count = 0; static int audio_frames_count = 0; @@ -193,7 +193,8 @@ " -a stop sending audio\n" " -l run file in a loop\n" " -n dump periodic netstats to log file\n" - " -t <timeout> terminate after timeout seconds and report status via return code\n" + " -t <TIMEOUT> terminate call after TIMEOUT seconds\n" + " -c <TIMEOUT> try connecting for TIMEOUT seconds (default 5)\n" " -L <FILE> log to FILE\n" "\n" ); @@ -269,14 +270,14 @@ switch ( argv[i][1] ) { case 'F': /* set video params */ - { - formatp = 1 << atoi(argv[++i]); - framerate = atoi(argv[++i]); - bitrate = atoi(argv[++i]); - width = atoi(argv[++i]); - height = atoi(argv[++i]); - fragsize = atoi(argv[++i]); - } + if ( i+6 >= argc ) + usage(); + formatp = 1 << atoi(argv[++i]); + framerate = atoi(argv[++i]); + bitrate = atoi(argv[++i]); + width = atoi(argv[++i]); + height = atoi(argv[++i]); + fragsize = atoi(argv[++i]); break; case 'o': if ( i+1 >= argc ) @@ -298,8 +299,13 @@ case 't': if ( i+1 >= argc ) usage(); - timeout = 1000 * atoi(argv[++i]); + call_timeout_ms = 1000 * atoi(argv[++i]); break; + case 'c': + if ( i+1 >= argc ) + usage(); + connect_timeout_ms = 1000 * atoi(argv[++i]); + break; case 'L': if ( i+1 >= argc ) usage(); @@ -314,7 +320,7 @@ usage(); } } else - dest=argv[i]; + dest = argv[i]; } if ( dest == NULL ) @@ -355,11 +361,12 @@ mylog("Failed to make call to '%s'", dest); // Wait for the call to be established; - while ( !call_established ) + while ( !call_established && running ) { struct timeval now; gettimeofday(&now, NULL); - if ( timeout > 0 && msecdiff(&start_time, &now) > timeout ) + if ( connect_timeout_ms > 0 && + msecdiff(&start_time, &now) > connect_timeout_ms ) hangup_and_exit(TEST_NO_CONNECTION); iaxc_millisleep(5); } @@ -394,7 +401,8 @@ // Exit after a positive timeout gettimeofday(&now, NULL); - if ( timeout > 0 && msecdiff(&start_time, &now) > timeout ) + if ( call_timeout_ms > 0 && + msecdiff(&start_time, &now) > call_timeout_ms ) running = 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |