From: <jpg...@us...> - 2007-06-22 14:43:05
|
Revision: 1042 http://svn.sourceforge.net/iaxclient/?rev=1042&view=rev Author: jpgrayson Date: 2007-06-22 07:42:57 -0700 (Fri, 22 Jun 2007) Log Message: ----------- Deallocate some resources at iaxc_shutdown() time. - destroy event_queue_mutex - free() calls Modified Paths: -------------- trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2007-06-14 22:23:39 UTC (rev 1041) +++ trunk/lib/iaxclient_lib.c 2007-06-22 14:42:57 UTC (rev 1042) @@ -663,6 +663,10 @@ #ifdef WIN32 closesocket(iax_get_fd()); //fd: #endif + + free(calls); + + MUTEXDESTROY(&event_queue_lock); MUTEXDESTROY(&iaxc_lock); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <sb...@us...> - 2007-09-12 14:46:06
|
Revision: 1121 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1121&view=rev Author: sbalea Date: 2007-09-12 07:46:09 -0700 (Wed, 12 Sep 2007) Log Message: ----------- Behavioral improvements: - default to no call selected upon initialization - stop ringing on a voice event only when doing an outgoing call Patch provided by Erik Bunce Modified Paths: -------------- trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2007-09-12 14:25:23 UTC (rev 1120) +++ trunk/lib/iaxclient_lib.c 2007-09-12 14:46:09 UTC (rev 1121) @@ -607,7 +607,7 @@ return -1; } - selected_call = 0; + selected_call = -1; for ( i = 0; i < max_calls; i++ ) { @@ -1215,7 +1215,8 @@ break; case IAX_EVENT_VOICE: handle_audio_event(e, callNo); - if (calls[callNo].state & IAXC_CALL_STATE_RINGING) + if ((calls[callNo].state & IAXC_CALL_STATE_OUTGOING) && + (calls[callNo].state & IAXC_CALL_STATE_RINGING) ) { calls[callNo].state &= ~IAXC_CALL_STATE_RINGING; iaxci_do_state_callback(callNo); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <do...@us...> - 2007-09-13 13:50:57
|
Revision: 1133 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1133&view=rev Author: dohpaz Date: 2007-09-13 06:50:59 -0700 (Thu, 13 Sep 2007) Log Message: ----------- Only NOTICE (warn) of video codec negotiation failure if incoming call wanted video. Also remove condition that could not be reached because it was handled earlier. Modified Paths: -------------- trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2007-09-12 19:54:25 UTC (rev 1132) +++ trunk/lib/iaxclient_lib.c 2007-09-13 13:50:59 UTC (rev 1133) @@ -1704,21 +1704,14 @@ video_format = iaxc_choose_codec(video_format); } } - } - if ( !video_format ) - { - if ( format ) + /* All video negotiations failed, then warn */ + if ( !video_format ) { iaxci_usermsg(IAXC_NOTICE, - "Notice: could not negotiate common video codec"); + "Notice: could not negotiate common video codec"); iaxci_usermsg(IAXC_NOTICE, - "Notice: switching to audio-only call"); - } else - { - iax_reject(e->session, - "Could not negotiate common audio and video codec"); - return; + "Notice: switching to audio-only call"); } } #endif /* USE_VIDEO */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-02 19:11:38
|
Revision: 1163 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1163&view=rev Author: sbalea Date: 2007-10-02 12:11:39 -0700 (Tue, 02 Oct 2007) Log Message: ----------- Do not attempt to destroy the audio driver when in test mode (crash potential) Modified Paths: -------------- trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2007-10-01 05:23:11 UTC (rev 1162) +++ trunk/lib/iaxclient_lib.c 2007-10-02 19:11:39 UTC (rev 1163) @@ -665,7 +665,6 @@ get_iaxc_lock(); - audio_driver.destroy(&audio_driver); if ( !test_mode ) { audio_driver.destroy(&audio_driver); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpg...@us...> - 2007-10-03 17:28:00
|
Revision: 1168 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1168&view=rev Author: jpgrayson Date: 2007-10-03 10:27:30 -0700 (Wed, 03 Oct 2007) Log Message: ----------- Whitespace and formatting. Modified Paths: -------------- trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2007-10-03 17:19:09 UTC (rev 1167) +++ trunk/lib/iaxclient_lib.c 2007-10-03 17:27:30 UTC (rev 1168) @@ -655,7 +655,7 @@ #endif IAXC_FORMAT_SPEEX; audio_format_preferred = IAXC_FORMAT_SPEEX; - + return 0; } @@ -758,7 +758,7 @@ get_iaxc_lock(); service_network(); - if ( !test_mode ) + if ( !test_mode ) service_audio(); // Check registration refresh once a second @@ -788,7 +788,7 @@ while ( !video_proc_thread_flag ) { - if (selected_call >= 0) + if ( selected_call >= 0 ) call = &calls[selected_call]; else call = NULL; @@ -922,7 +922,7 @@ \deprecated Q: Why do we continuously send IAXC_EVENT_LEVELS events when there is no selected call? - + A: So that certain users of iaxclient do not have to reset their vu meters when a call ends -- they can just count on getting level callbacks. This is a bit of a hack @@ -1088,7 +1088,7 @@ #ifdef WIN32 //fd: start: for some reason it loops here. Try to avoid it cycles_max--; - if (cycles_max<0) + if ( cycles_max < 0 ) { iaxc_millisleep(0); } @@ -1110,9 +1110,9 @@ continue; if ( !test_mode ) - audio_driver.output(&audio_driver, fr, + audio_driver.output(&audio_driver, fr, fr_samples - samples - mainbuf_delta); - + } while ( total_consumed < e->datalen ); } @@ -1197,8 +1197,8 @@ break; case IAX_EVENT_VOICE: handle_audio_event(e, callNo); - if ((calls[callNo].state & IAXC_CALL_STATE_OUTGOING) && - (calls[callNo].state & IAXC_CALL_STATE_RINGING) ) + if ( (calls[callNo].state & IAXC_CALL_STATE_OUTGOING) && + (calls[callNo].state & IAXC_CALL_STATE_RINGING) ) { calls[callNo].state &= ~IAXC_CALL_STATE_RINGING; iaxci_do_state_callback(callNo); @@ -1336,13 +1336,13 @@ get_iaxc_lock(); // if no call is selected, get a new appearance - if (selected_call < 0) + if ( selected_call < 0 ) { callNo = iaxc_first_free_call(); } else { // use selected call if not active, otherwise, get a new appearance - if (calls[selected_call].state & IAXC_CALL_STATE_ACTIVE) + if ( calls[selected_call].state & IAXC_CALL_STATE_ACTIVE ) { callNo = iaxc_first_free_call(); } else @@ -1351,14 +1351,14 @@ } } - if (callNo < 0) + if ( callNo < 0 ) { iaxci_usermsg(IAXC_STATUS, "No free call appearances"); goto iaxc_call_bail; } newsession = iax_session_new(); - if (!newsession) + if ( !newsession ) { iaxci_usermsg(IAXC_ERROR, "Can't make new session"); goto iaxc_call_bail; @@ -1368,7 +1368,7 @@ codec_destroy( callNo ); - if (ext) + if ( ext ) { strncpy(calls[callNo].remote_name, num, IAXC_EVENT_BUFSIZ); strncpy(calls[callNo].remote, ++ext, IAXC_EVENT_BUFSIZ); @@ -1378,10 +1378,10 @@ strncpy(calls[callNo].remote, "" , IAXC_EVENT_BUFSIZ); } - if (callerid_number != NULL) + if ( callerid_number != NULL ) strncpy(calls[callNo].callerid_number, callerid_number, IAXC_EVENT_BUFSIZ); - - if (callerid_name != NULL) + + if ( callerid_name != NULL ) strncpy(calls[callNo].callerid_name, callerid_name, IAXC_EVENT_BUFSIZ); strncpy(calls[callNo].local , calls[callNo].callerid_name, IAXC_EVENT_BUFSIZ); @@ -1394,7 +1394,7 @@ calls[callNo].last_ping = calls[callNo].last_activity; #ifdef USE_VIDEO - if (video) + if ( video ) iaxc_video_format_get_cap(&video_format_preferred, &video_format_capability); #endif @@ -1424,7 +1424,8 @@ EXPORT void iaxc_answer_call(int callNo) { - if (callNo < 0) return; + if ( callNo < 0 ) + return; calls[callNo].state |= IAXC_CALL_STATE_COMPLETE; calls[callNo].state &= ~IAXC_CALL_STATE_RINGING; @@ -1434,8 +1435,7 @@ EXPORT void iaxc_blind_transfer_call(int callNo, const char * dest_extension) { - if ((callNo < 0) || - !(calls[callNo].state & IAXC_CALL_STATE_ACTIVE)) + if ( callNo < 0 || !(calls[callNo].state & IAXC_CALL_STATE_ACTIVE) ) return; iax_transfer(calls[callNo].session, dest_extension); @@ -1443,9 +1443,9 @@ EXPORT void iaxc_setup_call_transfer(int sourceCallNo, int targetCallNo) { - if ((sourceCallNo < 0) || (targetCallNo < 0) || - ((calls[sourceCallNo].state & IAXC_CALL_STATE_ACTIVE) == 0) || - ((calls[targetCallNo].state & IAXC_CALL_STATE_ACTIVE) == 0)) + if ( sourceCallNo < 0 || targetCallNo < 0 || + !(calls[sourceCallNo].state & IAXC_CALL_STATE_ACTIVE) || + !(calls[targetCallNo].state & IAXC_CALL_STATE_ACTIVE) ) return; iax_setup_transfer(calls[sourceCallNo].session, calls[targetCallNo].session); @@ -1453,9 +1453,9 @@ static void iaxc_dump_one_call(int callNo) { - if (callNo < 0) + if ( callNo < 0 ) return; - if (calls[callNo].state == IAXC_CALL_STATE_FREE) + if ( calls[callNo].state == IAXC_CALL_STATE_FREE ) return; iax_hangup(calls[callNo].session,"Dumped Call"); @@ -1475,7 +1475,7 @@ EXPORT void iaxc_dump_call(void) { - if (selected_call >= 0) + if ( selected_call >= 0 ) { get_iaxc_lock(); iaxc_dump_one_call(selected_call); @@ -1485,7 +1485,7 @@ EXPORT void iaxc_reject_call(void) { - if (selected_call >= 0) + if ( selected_call >= 0 ) { iaxc_reject_call_number(selected_call); } @@ -1493,7 +1493,7 @@ EXPORT void iaxc_reject_call_number( int callNo ) { - if (callNo >= 0) + if ( callNo >= 0 ) { get_iaxc_lock(); iax_reject(calls[callNo].session, "Call rejected manually."); @@ -1504,10 +1504,10 @@ EXPORT void iaxc_send_dtmf(char digit) { - if (selected_call >= 0) + if ( selected_call >= 0 ) { get_iaxc_lock(); - if (calls[selected_call].state & IAXC_CALL_STATE_ACTIVE) + if ( calls[selected_call].state & IAXC_CALL_STATE_ACTIVE ) iax_send_dtmf(calls[selected_call].session,digit); put_iaxc_lock(); } @@ -1515,10 +1515,10 @@ EXPORT void iaxc_send_text(const char * text) { - if (selected_call >= 0) + if ( selected_call >= 0 ) { get_iaxc_lock(); - if (calls[selected_call].state & IAXC_CALL_STATE_ACTIVE) + if ( calls[selected_call].state & IAXC_CALL_STATE_ACTIVE ) iax_send_text(calls[selected_call].session, text); put_iaxc_lock(); } @@ -1526,10 +1526,10 @@ EXPORT void iaxc_send_url(const char * url, int link) { - if (selected_call >= 0) + if ( selected_call >= 0 ) { get_iaxc_lock(); - if (calls[selected_call].state & IAXC_CALL_STATE_ACTIVE) + if ( calls[selected_call].state & IAXC_CALL_STATE_ACTIVE ) iax_send_url(calls[selected_call].session, url, link); put_iaxc_lock(); } @@ -1539,7 +1539,7 @@ { int i; for ( i = 0; i < max_calls; i++ ) - if (calls[i].session == session) + if ( calls[i].session == session ) return i; return -1; } @@ -1549,7 +1549,8 @@ { struct iaxc_registration *reg; for (reg = registrations; reg != NULL; reg = reg->next) - if (reg->session == session) break; + if ( reg->session == session ) + break; return reg; } @@ -1563,7 +1564,7 @@ iax_destroy(reg->session); reg->session = NULL; - if (e->etype == IAX_EVENT_REGREJ) + if ( e->etype == IAX_EVENT_REGREJ ) { // we were rejected, so end the registration iaxc_remove_registration_by_id(reg->id); @@ -1662,7 +1663,7 @@ /* first, see if they even want video */ video_format = (e->ies.format & IAXC_VIDEO_FORMAT_MASK); - if (video_format) + if ( video_format ) { /* next, try _their_ preferred format */ video_format &= video_format_capability; @@ -1679,7 +1680,7 @@ /* finally, see if we have one in common */ video_format = video_format_capability & (e->ies.capability & IAXC_VIDEO_FORMAT_MASK); - + /* now choose amongst these, if we got one */ if ( video_format ) { @@ -1758,23 +1759,23 @@ #endif // first, see if this is an event for one of our calls. callNo = iaxc_find_call_by_session(e->session); - if (callNo >= 0) + if ( callNo >= 0 ) { iaxc_handle_network_event(e, callNo); - } else if ((reg = iaxc_find_registration_by_session(e->session)) != NULL) + } else if ( (reg = iaxc_find_registration_by_session(e->session)) != NULL ) { iaxc_handle_regreply(e,reg); - } else if ((e->etype == IAX_EVENT_REGACK) || (e->etype == IAX_EVENT_REGREJ)) + } else if ( e->etype == IAX_EVENT_REGACK || e->etype == IAX_EVENT_REGREJ ) { iaxci_usermsg(IAXC_ERROR, "Unexpected registration reply"); - } else if (e->etype == IAX_EVENT_REGREQ) + } else if ( e->etype == IAX_EVENT_REGREQ ) { iaxci_usermsg(IAXC_ERROR, "Registration requested by someone, but we don't understand!"); - } else if (e->etype == IAX_EVENT_CONNECT) + } else if ( e->etype == IAX_EVENT_CONNECT ) { iaxc_handle_connect(e); - } else if (e->etype == IAX_EVENT_TIMEOUT) + } else if ( e->etype == IAX_EVENT_TIMEOUT ) { iaxci_usermsg(IAXC_STATUS, "Timeout for a non-existant session. Dropping", @@ -1854,7 +1855,7 @@ { if ( test_mode ) return 0; - + int ret = 0; get_iaxc_lock(); ret = audio_driver.play_sound(s,ring); @@ -1866,7 +1867,7 @@ { if ( test_mode ) return 0; - + int ret = 0; get_iaxc_lock(); ret = audio_driver.stop_sound(id); @@ -1877,7 +1878,7 @@ EXPORT int iaxc_quelch(int callNo, int MOH) { struct iax_session *session = calls[callNo].session; - if (!session) + if ( !session ) return -1; return iax_quelch_moh(session, MOH); @@ -1899,13 +1900,11 @@ } #ifdef LIBVER - EXPORT char* iaxc_version(char * ver) { strncpy(ver, LIBVER, IAXC_EVENT_BUFSIZ); return ver; } - #endif EXPORT unsigned int iaxc_get_audio_prefs(void) @@ -1937,17 +1936,17 @@ EXPORT int iaxc_push_audio(void *data, unsigned int size, unsigned int samples) { struct iaxc_call *call; - - if (selected_call < 0) + + if ( selected_call < 0 ) return -1; - + call = &calls[selected_call]; if ( audio_prefs & IAXC_AUDIO_PREF_SEND_DISABLE ) return 0; - + //fprintf(stderr, "iaxc_push_audio: sending audio size %d\n", size); - + if ( iax_send_voice(call->session, call->format, data, size, samples) == -1 ) { fprintf(stderr, "iaxc_push_audio: failed to send audio frame of size %d on call %d\n", size, selected_call); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpg...@us...> - 2007-10-03 17:30:06
|
Revision: 1169 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1169&view=rev Author: jpgrayson Date: 2007-10-03 10:30:10 -0700 (Wed, 03 Oct 2007) Log Message: ----------- Remove C99-isms that prevent building with msvc compiler. Modified Paths: -------------- trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2007-10-03 17:27:30 UTC (rev 1168) +++ trunk/lib/iaxclient_lib.c 2007-10-03 17:30:10 UTC (rev 1169) @@ -1809,10 +1809,11 @@ EXPORT int iaxc_audio_devices_set(int input, int output, int ring) { + int ret; + if ( test_mode ) return 0; - int ret = 0; get_iaxc_lock(); ret = audio_driver.select_devices(&audio_driver, input, output, ring); put_iaxc_lock(); @@ -1853,10 +1854,11 @@ EXPORT int iaxc_play_sound(struct iaxc_sound *s, int ring) { + int ret; + if ( test_mode ) return 0; - int ret = 0; get_iaxc_lock(); ret = audio_driver.play_sound(s,ring); put_iaxc_lock(); @@ -1865,10 +1867,11 @@ EXPORT int iaxc_stop_sound(int id) { + int ret; + if ( test_mode ) return 0; - int ret = 0; get_iaxc_lock(); ret = audio_driver.stop_sound(id); put_iaxc_lock(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpg...@us...> - 2007-10-10 18:42:40
|
Revision: 1191 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1191&view=rev Author: jpgrayson Date: 2007-10-10 11:42:43 -0700 (Wed, 10 Oct 2007) Log Message: ----------- Fix gratuitious whitespace issue. Modified Paths: -------------- trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2007-10-10 18:42:17 UTC (rev 1190) +++ trunk/lib/iaxclient_lib.c 2007-10-10 18:42:43 UTC (rev 1191) @@ -1702,9 +1702,9 @@ if ( !video_format ) { iaxci_usermsg(IAXC_NOTICE, - "Notice: could not negotiate common video codec"); + "Notice: could not negotiate common video codec"); iaxci_usermsg(IAXC_NOTICE, - "Notice: switching to audio-only call"); + "Notice: switching to audio-only call"); } } #endif /* USE_VIDEO */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <do...@us...> - 2007-10-11 19:49:55
|
Revision: 1193 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1193&view=rev Author: dohpaz Date: 2007-10-11 12:49:59 -0700 (Thu, 11 Oct 2007) Log Message: ----------- If an outgoing calls ringing has stopped do to incoming audio, the call is complete. Modified Paths: -------------- trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2007-10-11 17:42:33 UTC (rev 1192) +++ trunk/lib/iaxclient_lib.c 2007-10-11 19:49:59 UTC (rev 1193) @@ -1201,6 +1201,7 @@ (calls[callNo].state & IAXC_CALL_STATE_RINGING) ) { calls[callNo].state &= ~IAXC_CALL_STATE_RINGING; + calls[callNo].state |= IAXC_CALL_STATE_COMPLETE; iaxci_do_state_callback(callNo); iaxci_usermsg(IAXC_STATUS,"Call %d progress", callNo); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-10-18 16:36:18
|
Revision: 1212 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1212&view=rev Author: sbalea Date: 2007-10-18 09:36:17 -0700 (Thu, 18 Oct 2007) Log Message: ----------- Fix the registration issue that was reported by Andrea Suisani IAX_EVENT_NULL was interpreted as a registration reply and thus the registration session management got confused. Modified Paths: -------------- trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2007-10-18 16:33:21 UTC (rev 1211) +++ trunk/lib/iaxclient_lib.c 2007-10-18 16:36:17 UTC (rev 1212) @@ -1770,8 +1770,13 @@ #endif // first, see if this is an event for one of our calls. callNo = iaxc_find_call_by_session(e->session); - if ( callNo >= 0 ) + if ( e->etype == IAX_EVENT_NULL ) { + // Should we do something here? + // Right now we do nothing, just go with the flow + // and let the event be deallocated. + } else if ( callNo >= 0 ) + { iaxc_handle_network_event(e, callNo); } else if ( (reg = iaxc_find_registration_by_session(e->session)) != NULL ) { @@ -1791,11 +1796,6 @@ iaxci_usermsg(IAXC_STATUS, "Timeout for a non-existant session. Dropping", e->etype); - } else if ( e->etype == IAX_EVENT_NULL ) - { - // Should we do something here? - // Right now we do nothing, just go with the flow - // and let the event be deallocated. } else { iaxci_usermsg(IAXC_STATUS, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sb...@us...> - 2007-11-02 16:30:23
|
Revision: 1259 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1259&view=rev Author: sbalea Date: 2007-11-02 09:30:27 -0700 (Fri, 02 Nov 2007) Log Message: ----------- Make sure that encoders and decoders are properly destroyed upon iaxclient shutdown. Fix provided by Teri Schoech. Modified Paths: -------------- trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2007-11-02 16:15:36 UTC (rev 1258) +++ trunk/lib/iaxclient_lib.c 2007-11-02 16:30:27 UTC (rev 1259) @@ -670,7 +670,25 @@ video_destroy(); #endif } - + + /* destroy enocders and decoders for all existing calls */ + if ( calls ) + { + int i; + for ( i=0 ; i<max_calls ; i++ ) + { + if ( calls[i].encoder ) + calls[i].encoder->destroy(calls[i].encoder); + if ( calls[i].decoder ) + calls[i].decoder->destroy(calls[i].decoder); + if ( calls[i].vencoder ) + calls[i].vdecoder->destroy(calls[i].vencoder); + if ( calls[i].vdecoder ) + calls[i].vencoder->destroy(calls[i].vdecoder); + } + free(calls); + calls = NULL; + } put_iaxc_lock(); #ifdef WIN32 closesocket(iax_get_fd()); //fd: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bc...@us...> - 2007-11-26 22:02:38
|
Revision: 1284 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1284&view=rev Author: bcholew Date: 2007-11-26 14:02:43 -0800 (Mon, 26 Nov 2007) Log Message: ----------- Be consistent when destroying encoders and decoders. Modified Paths: -------------- trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2007-11-25 12:32:28 UTC (rev 1283) +++ trunk/lib/iaxclient_lib.c 2007-11-26 22:02:43 UTC (rev 1284) @@ -682,9 +682,9 @@ if ( calls[i].decoder ) calls[i].decoder->destroy(calls[i].decoder); if ( calls[i].vencoder ) - calls[i].vdecoder->destroy(calls[i].vencoder); + calls[i].vencoder->destroy(calls[i].vencoder); if ( calls[i].vdecoder ) - calls[i].vencoder->destroy(calls[i].vdecoder); + calls[i].vdecoder->destroy(calls[i].vdecoder); } free(calls); calls = NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpg...@us...> - 2008-04-04 21:37:03
|
Revision: 1395 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1395&view=rev Author: jpgrayson Date: 2008-04-04 14:37:07 -0700 (Fri, 04 Apr 2008) Log Message: ----------- Fix to always define iaxc_version(). When LIBVER is not defined, just return an empty string. Modified Paths: -------------- trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2008-04-04 21:36:17 UTC (rev 1394) +++ trunk/lib/iaxclient_lib.c 2008-04-04 21:37:07 UTC (rev 1395) @@ -1910,13 +1910,14 @@ return audio_driver.mic_boost_set( &audio_driver, enable ) ; } -#ifdef LIBVER EXPORT char* iaxc_version(char * ver) { +#ifndef LIBVER +#define LIBVER "" +#endif strncpy(ver, LIBVER, IAXC_EVENT_BUFSIZ); return ver; } -#endif EXPORT unsigned int iaxc_get_audio_prefs(void) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpg...@us...> - 2008-04-15 22:22:44
|
Revision: 1409 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1409&view=rev Author: jpgrayson Date: 2008-04-15 15:21:25 -0700 (Tue, 15 Apr 2008) Log Message: ----------- Whitespace. Modified Paths: -------------- trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2008-04-15 22:20:42 UTC (rev 1408) +++ trunk/lib/iaxclient_lib.c 2008-04-15 22:21:25 UTC (rev 1409) @@ -756,7 +756,9 @@ cur->session = iax_session_new(); if ( !cur->session ) { - iaxci_usermsg(IAXC_ERROR, "Can't make new registration session"); + iaxci_usermsg(IAXC_ERROR, + "Can't make new registration " + "session"); return; } iax_register(cur->session, cur->host, cur->user, cur->pass, cur->refresh); @@ -1025,17 +1027,12 @@ #endif struct iaxc_call *call; - if ( callNo < 0 ) + /* drop audio for unselected call? */ + if ( callNo < 0 || callNo != selected_call ) return; call = &calls[callNo]; - if ( callNo != selected_call ) - { - /* drop audio for unselected call? */ - return; - } - samples = fr_samples; format = call->format & IAXC_AUDIO_FORMAT_MASK; @@ -1055,13 +1052,16 @@ if ( bytes_decoded < 0 ) { iaxci_usermsg(IAXC_STATUS, - "Bad or incomplete voice packet. Unable to decode. dropping"); + "Bad or incomplete voice packet. " + "Unable to decode. dropping"); return; } /* Pass encoded audio back to the app if required */ if ( audio_prefs & IAXC_AUDIO_PREF_RECV_REMOTE_ENCODED ) - iaxci_do_audio_callback(callNo, e->ts, IAXC_SOURCE_REMOTE, + iaxci_do_audio_callback(callNo, + e->ts, + IAXC_SOURCE_REMOTE, 1, format & IAXC_AUDIO_FORMAT_MASK, e->datalen - total_consumed, e->data + total_consumed); @@ -1083,8 +1083,13 @@ // the number to obtain the size in bytes. // format will also be 0 since this is raw audio int size = (fr_samples - samples - mainbuf_delta) * 2; - iaxci_do_audio_callback(callNo, e->ts, IAXC_SOURCE_REMOTE, - 0, 0, size, (unsigned char *)fr); + iaxci_do_audio_callback(callNo, + e->ts, + IAXC_SOURCE_REMOTE, + 0, + 0, + size, + (unsigned char *)fr); } if ( iaxci_audio_output_mode ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpg...@us...> - 2008-04-24 17:15:52
|
Revision: 1424 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1424&view=rev Author: jpgrayson Date: 2008-04-24 10:15:57 -0700 (Thu, 24 Apr 2008) Log Message: ----------- Only print video-related warning message if video is enabled. Modified Paths: -------------- trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2008-04-24 14:18:28 UTC (rev 1423) +++ trunk/lib/iaxclient_lib.c 2008-04-24 17:15:57 UTC (rev 1424) @@ -1170,11 +1170,13 @@ case IAX_EVENT_ACCEPT: calls[callNo].format = e->ies.format & IAXC_AUDIO_FORMAT_MASK; calls[callNo].vformat = e->ies.format & IAXC_VIDEO_FORMAT_MASK; +#if USE_VIDEO if ( !(e->ies.format & IAXC_VIDEO_FORMAT_MASK) ) { iaxci_usermsg(IAXC_NOTICE, "Failed video codec negotiation."); } +#endif iaxci_usermsg(IAXC_STATUS,"Call %d accepted", callNo); break; case IAX_EVENT_ANSWER: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jpg...@us...> - 2008-07-01 16:14:05
|
Revision: 1439 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1439&view=rev Author: jpgrayson Date: 2008-07-01 09:14:08 -0700 (Tue, 01 Jul 2008) Log Message: ----------- Fix problem where outgoing calls would be in the active state (IAXC_CALL_STATE_ACTIVE) prior to the other end even ACCEPTing the call. This potentially allowed TEXT, DTMF, and other frames to go out prior to the call being ACCEPTed by the other end. Recent versions of asterisk (1.4.19+) have security fixes in-place that don't take to kindly to this kind of bogus protocol. - The fix is to only put the call into the active state after we have received an ACCEPT frame from the other end. Modified Paths: -------------- trunk/lib/iaxclient_lib.c Modified: trunk/lib/iaxclient_lib.c =================================================================== --- trunk/lib/iaxclient_lib.c 2008-07-01 15:52:43 UTC (rev 1438) +++ trunk/lib/iaxclient_lib.c 2008-07-01 16:14:08 UTC (rev 1439) @@ -1194,6 +1194,7 @@ iaxc_clear_call(callNo); break; case IAX_EVENT_ACCEPT: + calls[callNo].state |= IAXC_CALL_STATE_ACTIVE; calls[callNo].format = e->ies.format & IAXC_AUDIO_FORMAT_MASK; calls[callNo].vformat = e->ies.format & IAXC_VIDEO_FORMAT_MASK; #if USE_VIDEO @@ -1203,6 +1204,7 @@ "Failed video codec negotiation."); } #endif + iaxci_do_state_callback(callNo); iaxci_usermsg(IAXC_STATUS,"Call %d accepted", callNo); break; case IAX_EVENT_ANSWER: @@ -1372,7 +1374,7 @@ } else { // use selected call if not active, otherwise, get a new appearance - if ( calls[selected_call].state & IAXC_CALL_STATE_ACTIVE ) + if ( calls[selected_call].state & IAXC_CALL_STATE_ACTIVE ) { callNo = iaxc_first_free_call(); } else @@ -1426,7 +1428,7 @@ strncpy(calls[callNo].local , calls[callNo].callerid_name, IAXC_EVENT_BUFSIZ); strncpy(calls[callNo].local_context, "default", IAXC_EVENT_BUFSIZ); - calls[callNo].state = IAXC_CALL_STATE_ACTIVE | IAXC_CALL_STATE_OUTGOING; + calls[callNo].state = IAXC_CALL_STATE_OUTGOING; /* reset activity and ping "timers" */ iaxc_note_activity(callNo); @@ -1530,7 +1532,7 @@ EXPORT void iaxc_dump_call_number( int callNo ) { - if ( ( callNo >= 0 ) && ( callNo < max_calls ) ) + if ( callNo >= 0 && callNo < max_calls ) { get_iaxc_lock(); iaxc_dump_one_call(callNo); @@ -1558,7 +1560,7 @@ EXPORT void iaxc_reject_call_number( int callNo ) { - if ( ( callNo >= 0 ) && ( callNo < max_calls ) ) + if ( callNo >= 0 && callNo < max_calls ) { get_iaxc_lock(); iax_reject(calls[callNo].session, "Call rejected manually."); @@ -1591,13 +1593,13 @@ EXPORT void iaxc_send_text_call(int callNo, const char * text) { - if ( callNo < 0 || !(calls[callNo].state & IAXC_CALL_STATE_ACTIVE) ) - return; - - get_iaxc_lock(); - if ( calls[callNo].state & IAXC_CALL_STATE_ACTIVE ) - iax_send_text(calls[callNo].session, text); - put_iaxc_lock(); + if ( callNo >= 0 && callNo < max_calls ) + { + get_iaxc_lock(); + if ( calls[callNo].state & IAXC_CALL_STATE_ACTIVE ) + iax_send_text(calls[callNo].session, text); + put_iaxc_lock(); + } } EXPORT void iaxc_send_url(const char * url, int link) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |