From: <jpg...@us...> - 2007-06-26 13:54:05
|
Revision: 1045 http://svn.sourceforge.net/iaxclient/?rev=1045&view=rev Author: jpgrayson Date: 2007-06-26 06:54:07 -0700 (Tue, 26 Jun 2007) Log Message: ----------- Small internal cleanups. Remove unneeded global variable. Rename static function iaxc_service_network() to just service_network() to avoid confusion with external api functions. Modified Paths: -------------- trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2007-06-25 20:14:01 UTC (rev 1044) +++ trunk/lib/iaxclient_lib.c 2007-06-26 13:54:07 UTC (rev 1045) @@ -93,16 +93,17 @@ static MUTEX event_queue_lock; static int netfd; -static int port; -//static int c, i; +// default to use port 4569 unless set by iaxc_set_preferred_source_udp_port +static int source_udp_port = IAX_DEFAULT_PORTNO; + int iaxci_audio_output_mode = 0; // Normal int selected_call; // XXX to be protected by mutex? struct iaxc_call* calls; int max_calls; // number of calls for this library session -static void iaxc_service_network(); +static void service_network(); static int service_audio(); /* external global networking replacements */ @@ -520,9 +521,6 @@ #endif } -// default to use port 4569 unless set by iaxc_set_preferred_source_udp_port -static int source_udp_port = 0; - // Note: Must be called before iaxc_initialize() EXPORT void iaxc_set_preferred_source_udp_port(int port) { @@ -577,6 +575,8 @@ if ( iaxc_sendto == (iaxc_sendto_t)sendto ) { + int port; + if ( (port = iax_init(source_udp_port)) < 0 ) { iaxci_usermsg(IAXC_ERROR, @@ -743,7 +743,7 @@ { get_iaxc_lock(); - iaxc_service_network(); + service_network(); service_audio(); // Check registration refresh once a second @@ -1717,7 +1717,7 @@ iaxci_usermsg(IAXC_STATUS, "Incoming call on line %d", callno); } -static void iaxc_service_network() +static void service_network() { struct iax_event *e = 0; int callNo; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |