From bbeb2217dbaad57a221186442bba2f8842240eaf Mon Sep 17 00:00:00 2001 From: pescuma Date: Mon, 1 Feb 2010 02:03:39 +0000 Subject: iax: 0.2.0.0 + Allow more than one protocol instance git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@221 c086bb3d-8645-0410-b8da-73a8550f86e7 --- Protocols/IAX/Docs/iax_changelog.txt | 3 + Protocols/IAX/Docs/iax_readme.txt | 5 +- Protocols/IAX/Docs/iax_version.txt | 2 +- Protocols/IAX/Docs/langpack_iax.txt | 34 + Protocols/IAX/IAXProto.cpp | 171 ++- Protocols/IAX/IAXProto.h | 4 +- Protocols/IAX/commons.h | 3 +- Protocols/IAX/iax.cpp | 47 +- Protocols/IAX/iax.dsp | 54 +- Protocols/IAX/lib/iaxclient/Dll/iaxclient.dll | Bin 0 -> 290816 bytes Protocols/IAX/lib/iaxclient/Dll/iaxclient.lib | Bin 0 -> 16682 bytes Protocols/IAX/lib/iaxclient/Dll/iaxclient_ptrs.h | 1396 ++++++++++++++++++++++ Protocols/IAX/res/IAX-away.ico | Bin 1150 -> 2038 bytes Protocols/IAX/res/IAX-dnd.ico | Bin 1150 -> 2038 bytes Protocols/IAX/res/IAX-freechat.ico | Bin 1150 -> 2038 bytes Protocols/IAX/res/IAX-invisible.ico | Bin 1150 -> 2038 bytes Protocols/IAX/res/IAX-na.ico | Bin 1150 -> 2038 bytes Protocols/IAX/res/IAX-occupied.ico | Bin 1150 -> 2038 bytes Protocols/IAX/res/IAX-onthephone.ico | Bin 1150 -> 2038 bytes Protocols/IAX/res/IAX-outtolunch.ico | Bin 1150 -> 2038 bytes Protocols/IAX/res/proto_IAX.dll | Bin 16488 -> 23656 bytes Protocols/IAX/resource.h | 3 +- Protocols/IAX/resource.rc | 24 +- 23 files changed, 1646 insertions(+), 100 deletions(-) create mode 100644 Protocols/IAX/lib/iaxclient/Dll/iaxclient.dll create mode 100644 Protocols/IAX/lib/iaxclient/Dll/iaxclient.lib create mode 100644 Protocols/IAX/lib/iaxclient/Dll/iaxclient_ptrs.h (limited to 'Protocols') diff --git a/Protocols/IAX/Docs/iax_changelog.txt b/Protocols/IAX/Docs/iax_changelog.txt index 39ca60b..c30a6a5 100644 --- a/Protocols/IAX/Docs/iax_changelog.txt +++ b/Protocols/IAX/Docs/iax_changelog.txt @@ -2,6 +2,9 @@ IAX protocol Changelog: +. 0.2.0.0 + + Allow more than one protocol instance + . 0.1.3.0 + Added protocol icons + Added popups diff --git a/Protocols/IAX/Docs/iax_readme.txt b/Protocols/IAX/Docs/iax_readme.txt index 4dd5a8c..c8c2c9e 100644 --- a/Protocols/IAX/Docs/iax_readme.txt +++ b/Protocols/IAX/Docs/iax_readme.txt @@ -1,7 +1,7 @@ IAX protocol ------------ -CAUTION: THIS IS A ALPHA STAGE PLUGIN. IT CAN DO VERY BAD THINGS. USE AT YOUR OWN RISK. +CAUTION: THIS IS A BETA STAGE PLUGIN. IT CAN DO VERY BAD THINGS. USE AT YOUR OWN RISK. This is a protocol that make voice calls using Inter-Asterisk eXchange (IAX) protocol. It is based in the IAXCLient library and in the work of sje in his IAX plugin. @@ -9,11 +9,8 @@ Currently it allows to make and receive calls. All the GUI is handled by Voice S I've created this protocol with 2 goals: have an IAX implementation using the new protocol API and improve voice service. -WARNING: You can create only one instance of the protocol. If you create the second one miranda will crash and keep crashing at each startup. I'll fix it soon - Todo: -- More than one instance - Use netlib to send/receive packages? - Ask for new password at first login if "Save password" is not checked diff --git a/Protocols/IAX/Docs/iax_version.txt b/Protocols/IAX/Docs/iax_version.txt index af5513a..3e9d57c 100644 --- a/Protocols/IAX/Docs/iax_version.txt +++ b/Protocols/IAX/Docs/iax_version.txt @@ -1 +1 @@ -IAX protocol 0.1.3.0 \ No newline at end of file +IAX protocol 0.2.0.0 \ No newline at end of file diff --git a/Protocols/IAX/Docs/langpack_iax.txt b/Protocols/IAX/Docs/langpack_iax.txt index 6b6a4fc..1f136ef 100644 --- a/Protocols/IAX/Docs/langpack_iax.txt +++ b/Protocols/IAX/Docs/langpack_iax.txt @@ -1,2 +1,36 @@ ; IAX protocol ; Author: Pescuma + +[IAX] + +[Username] +[%s plugin connections] + +; Infos +[You have %d voicemail message(s)] +[No more slots to make calls. You need to drop some calls.] + +; Errors +[IAX needs Voice Service plugin to work!] +[Could not load iaxclient module] +[Error loading iaxclient dll] +[Failed to initialize iaxclient lib] +[Failed to initialize IAX threads] +[Error registering with IAX server] +[Registration rejected] +[Registration timeout] +[Error making call (callNo=%d)] + +; Options +[Protocols] +[Protocol icon] + +[Server:] +[Username:] +[Password:] +[Save password] + +[Caller ID] +[Name:] +[Number:] +[These are only used if the server allows.] \ No newline at end of file diff --git a/Protocols/IAX/IAXProto.cpp b/Protocols/IAX/IAXProto.cpp index 97cb972..7ac23bb 100644 --- a/Protocols/IAX/IAXProto.cpp +++ b/Protocols/IAX/IAXProto.cpp @@ -27,8 +27,90 @@ static INT_PTR CALLBACK DlgOptions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP static int static_iaxc_callback(iaxc_event e, void *param); -IAXProto::IAXProto(const char *aProtoName, const TCHAR *aUserName) +IAXProto::IAXProto(HMEMORYMODULE iaxclient, const char *aProtoName, const TCHAR *aUserName) + : iaxclient(iaxclient) { +#define LOAD(_F_) * (void **) & iax._F_ = (void *) MemoryGetProcAddress(iaxclient, "iaxc_" #_F_) + LOAD(set_event_callback); + LOAD(set_event_callpost); + LOAD(free_event); + LOAD(get_event_levels); + LOAD(get_event_text); + LOAD(get_event_state); + LOAD(set_preferred_source_udp_port); + LOAD(get_bind_port); + LOAD(initialize); + LOAD(shutdown); + LOAD(set_formats); + LOAD(set_min_outgoing_framesize); + LOAD(set_callerid); + LOAD(start_processing_thread); + LOAD(stop_processing_thread); + LOAD(call); + LOAD(call_ex); + LOAD(unregister); + * (void **) & iax.register_ = (void *) MemoryGetProcAddress(iaxclient, "iaxc_register"); + LOAD(register_ex); + LOAD(send_busy_on_incoming_call); + LOAD(answer_call); + LOAD(key_radio); + LOAD(unkey_radio); + LOAD(blind_transfer_call); + LOAD(setup_call_transfer); + LOAD(dump_all_calls); + LOAD(dump_call_number); + LOAD(dump_call); + LOAD(reject_call); + LOAD(reject_call_number); + LOAD(send_dtmf); + LOAD(send_text); + LOAD(send_text_call); + LOAD(send_url); + LOAD(get_call_state); + LOAD(millisleep); + LOAD(set_silence_threshold); + LOAD(set_audio_output); + LOAD(select_call); + LOAD(first_free_call); + LOAD(selected_call); + LOAD(quelch); + LOAD(unquelch); + LOAD(mic_boost_get); + LOAD(mic_boost_set); + LOAD(version); + LOAD(set_jb_target_extra); + LOAD(set_networking); + LOAD(get_netstats); + LOAD(audio_devices_get); + LOAD(audio_devices_set); + LOAD(input_level_get); + LOAD(output_level_get); + LOAD(input_level_set); + LOAD(output_level_set); + LOAD(play_sound); + LOAD(stop_sound); + LOAD(get_filters); + LOAD(set_filters); + LOAD(set_speex_settings); + LOAD(get_audio_prefs); + LOAD(set_audio_prefs); + LOAD(video_devices_get); + LOAD(video_device_set); + LOAD(get_video_prefs); + LOAD(set_video_prefs); + LOAD(video_format_get_cap); + LOAD(video_format_set_cap); + LOAD(video_format_set); + LOAD(video_params_change); + LOAD(set_holding_frame); + LOAD(video_bypass_jitter); + LOAD(is_camera_working); + LOAD(YUV420_to_RGB32); + LOAD(set_test_mode); + LOAD(push_audio); + LOAD(push_video); + LOAD(debug_iax_set); + InitializeCriticalSection(&cs); reg_id = -1; @@ -111,6 +193,8 @@ IAXProto::~IAXProto() mir_free(m_szModuleName); DeleteCriticalSection(&cs); + + MemoryFreeLibrary(iaxclient); } @@ -178,10 +262,10 @@ INT_PTR __cdecl IAXProto::SetStatus( int iNewStatus ) TCHAR server_port[1024]; mir_sntprintf(server_port, MAX_REGS(server_port), _T("%s:%d"), opts.host, opts.port); - reg_id = iaxc_register(TcharToUtf8(opts.username), opts.password, TcharToUtf8(server_port)); + reg_id = iax.register_(TcharToUtf8(opts.username), opts.password, TcharToUtf8(server_port)); if (reg_id < 0) { - Error(_T("Error registering with IAX")); + Error(_T("Error registering with IAX server")); Disconnect(); return -1; } @@ -325,9 +409,9 @@ void IAXProto::Disconnect() if (reg_id >= 0) { - iaxc_dump_all_calls(); + iax.dump_all_calls(); - iaxc_unregister(reg_id); + iax.unregister(reg_id); reg_id = -1; } @@ -353,12 +437,15 @@ int IAXProto::text_callback(iaxc_ev_text &text) } case IAXC_TEXT_TYPE_NOTICE: { - Info(_T("Notice: %s"), Utf8ToTchar(text.message)); + if (strncmp("Originating an ", text.message, 15) == 0) + Trace(_T("Notice: %s"), Utf8ToTchar(text.message)); + else + Info(_T("%s"), Utf8ToTchar(text.message)); // To avoid translate return 1; } case IAXC_TEXT_TYPE_ERROR: { - Error(Utf8ToTchar(text.message)); + Error(_T("%s"), Utf8ToTchar(text.message)); // To avoid translate return 1; } case IAXC_TEXT_TYPE_FATALERROR: @@ -431,7 +518,7 @@ int IAXProto::state_callback(iaxc_ev_call_state &call) } else { - if (call.callNo == iaxc_selected_call()) + if (call.callNo == iax.selected_call()) NotifyCall(call.callNo, VOICE_STATE_TALKING, NULL, name, number); else NotifyCall(call.callNo, VOICE_STATE_ON_HOLD, NULL, name, number); @@ -576,6 +663,12 @@ INT_PTR __cdecl IAXProto::OnEvent( PROTOEVENTTYPE iEventType, WPARAM wParam, LPA INT_PTR __cdecl IAXProto::OnModulesLoaded(WPARAM wParam, LPARAM lParam) { + if (!ServiceExists(MS_VOICESERVICE_REGISTER)) + { + Error(_T("IAX needs Voice Service plugin to work!")); + return 1; + } + TCHAR buffer[MAX_PATH]; mir_sntprintf(buffer, MAX_REGS(buffer), TranslateT("%s plugin connections"), m_tszUserName); @@ -586,28 +679,22 @@ INT_PTR __cdecl IAXProto::OnModulesLoaded(WPARAM wParam, LPARAM lParam) nl_user.ptszDescriptiveName = buffer; hNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nl_user); - if (!ServiceExists(MS_VOICESERVICE_REGISTER)) - { - Error(_T("IAX needs Voice Service plugin to work!")); - return 1; - } - - iaxc_set_event_callback(&static_iaxc_callback, this); + iax.set_event_callback(&static_iaxc_callback, this); // TODO Handle network out port - iaxc_set_preferred_source_udp_port(-1); - if (iaxc_initialize(NUM_LINES)) + iax.set_preferred_source_udp_port(-1); + if (iax.initialize(NUM_LINES)) { - Error(_T("Failed to initialize iaxc lib")); + Error(_T("Failed to initialize iaxclient lib")); return 1; } - iaxc_set_formats(IAXC_FORMAT_SPEEX, + iax.set_formats(IAXC_FORMAT_SPEEX, IAXC_FORMAT_ULAW|IAXC_FORMAT_ALAW|IAXC_FORMAT_GSM|IAXC_FORMAT_SPEEX|IAXC_FORMAT_ILBC); - iaxc_set_speex_settings(1,-1,-1,0,8000,3); - iaxc_set_silence_threshold(-99); + iax.set_speex_settings(1,-1,-1,0,8000,3); + iax.set_silence_threshold(-99); - if (iaxc_start_processing_thread()) + if (iax.start_processing_thread()) { Error(_T("Failed to initialize IAX threads")); return 1; @@ -636,9 +723,9 @@ INT_PTR __cdecl IAXProto::OnOptionsInit(WPARAM wParam, LPARAM lParam) INT_PTR __cdecl IAXProto::OnPreShutdown(WPARAM wParam, LPARAM lParam) { - iaxc_stop_processing_thread(); + iax.stop_processing_thread(); - iaxc_shutdown(); + iax.shutdown(); return 0; } @@ -704,7 +791,7 @@ void IAXProto::ConfigureDevices() int input; int output; int ring; - iaxc_audio_devices_get(&devs, &nDevs, &input, &output, &ring); + iax.audio_devices_get(&devs, &nDevs, &input, &output, &ring); int expectedOutput = GetDevice(devs, nDevs, true); if (expectedOutput == -1) @@ -715,22 +802,22 @@ void IAXProto::ConfigureDevices() expectedInput = input; if (input != expectedInput || output != expectedOutput || ring != expectedOutput) - iaxc_audio_devices_set(expectedInput, expectedOutput, expectedOutput); + iax.audio_devices_set(expectedInput, expectedOutput, expectedOutput); int expectedBoost = DBGetContactSettingByte(NULL, "VoiceService", "MicBoost", TRUE); - if (expectedBoost != iaxc_mic_boost_get()) - iaxc_mic_boost_set(expectedBoost); + if (expectedBoost != iax.mic_boost_get()) + iax.mic_boost_set(expectedBoost); - int filters = iaxc_get_filters(); + int filters = iax.get_filters(); int expectedFilters; if (DBGetContactSettingByte(NULL, "VoiceService", "EchoCancelation", TRUE)) expectedFilters = filters | IAXC_FILTER_ECHO; else expectedFilters = filters & ~IAXC_FILTER_ECHO; if (expectedFilters != filters) - iaxc_set_filters(expectedFilters); + iax.set_filters(expectedFilters); } @@ -750,14 +837,14 @@ INT_PTR __cdecl IAXProto::VoiceCall(WPARAM wParam, LPARAM lParam) ConfigureDevices(); - int callNo = iaxc_first_free_call(); + int callNo = iax.first_free_call(); if (callNo < 0 || callNo >= NUM_LINES) { Info(_T("No more slots to make calls. You need to drop some calls.")); return 2; } - iaxc_select_call(-1); + iax.select_call(-1); char buff[512]; mir_snprintf(buff, MAX_REGS(buff), "%s:%s@%s/%s", @@ -770,10 +857,10 @@ INT_PTR __cdecl IAXProto::VoiceCall(WPARAM wParam, LPARAM lParam) if (myName[0] == 0 && myNumber[0] == 0) myName = opts.username; - callNo = iaxc_call_ex(buff, TcharToUtf8(myName), TcharToUtf8(myNumber), FALSE); + callNo = iax.call_ex(buff, TcharToUtf8(myName), TcharToUtf8(myNumber), FALSE); if (callNo < 0 || callNo >= NUM_LINES) { - Error(_T("Error making call (callNo=%d)."), callNo); + Error(_T("Error making call (callNo=%d)"), callNo); return 3; } @@ -795,7 +882,7 @@ INT_PTR __cdecl IAXProto::VoiceAnswerCall(WPARAM wParam, LPARAM lParam) ConfigureDevices(); - if (iaxc_select_call(callNo) < 0) + if (iax.select_call(callNo) < 0) return 3; return 0; @@ -812,10 +899,10 @@ INT_PTR __cdecl IAXProto::VoiceDropCall(WPARAM wParam, LPARAM lParam) if (callNo < 0 || callNo >= NUM_LINES) return 2; - if (iaxc_get_call_state(callNo) & IAXC_CALL_STATE_RINGING) - iaxc_reject_call_number(callNo); + if (iax.get_call_state(callNo) & IAXC_CALL_STATE_RINGING) + iax.reject_call_number(callNo); else - iaxc_dump_call_number(callNo); + iax.dump_call_number(callNo); return 0; } @@ -831,10 +918,10 @@ INT_PTR __cdecl IAXProto::VoiceHoldCall(WPARAM wParam, LPARAM lParam) if (callNo < 0 || callNo >= NUM_LINES) return 2; - if (callNo != iaxc_selected_call()) + if (callNo != iax.selected_call()) return 3; - iaxc_select_call(-1); + iax.select_call(-1); NotifyCall(callNo, VOICE_STATE_ON_HOLD); return 0; } @@ -864,7 +951,7 @@ INT_PTR __cdecl IAXProto::VoiceSendDTMF(WPARAM wParam, LPARAM lParam) if (callNo < 0 || callNo >= NUM_LINES) return 2; - if (callNo != iaxc_selected_call()) + if (callNo != iax.selected_call()) return 3; if (c >= _T('a') && c <= _T('d')) @@ -873,7 +960,7 @@ INT_PTR __cdecl IAXProto::VoiceSendDTMF(WPARAM wParam, LPARAM lParam) if (!IsValidDTMF(c)) return 4; - iaxc_send_dtmf((char) c); + iax.send_dtmf((char) c); return 0; } diff --git a/Protocols/IAX/IAXProto.h b/Protocols/IAX/IAXProto.h index 7eaf36b..3e841c9 100644 --- a/Protocols/IAX/IAXProto.h +++ b/Protocols/IAX/IAXProto.h @@ -29,6 +29,8 @@ typedef int (__cdecl IAXProto::*IAXEventFunc)(WPARAM, LPARAM); class IAXProto : public PROTO_INTERFACE { private: + HMEMORYMODULE iaxclient; + IAXCLIENT iax; HANDLE hNetlibUser; HANDLE hCallStateEvent; int reg_id; @@ -53,7 +55,7 @@ public: OptPageControl accountManagerCtrls[5]; OptPageControl optionsCtrls[7]; - IAXProto(const char *aProtoName, const TCHAR *aUserName); + IAXProto(HMEMORYMODULE iaxclient, const char *aProtoName, const TCHAR *aUserName); virtual ~IAXProto(); virtual HANDLE __cdecl AddToList( int flags, PROTOSEARCHRESULT* psr ) { return 0; } diff --git a/Protocols/IAX/commons.h b/Protocols/IAX/commons.h index 350ebea..0f45841 100644 --- a/Protocols/IAX/commons.h +++ b/Protocols/IAX/commons.h @@ -64,10 +64,11 @@ Boston, MA 02111-1307, USA. #include "../../plugins/utils/mir_icons.h" #include "../../plugins/utils/mir_log.h" #include "../../plugins/utils/utf8_helpers.h" +#include "../../plugins/utils/MemoryModule.h" #include "../../plugins/voiceservice/m_voice.h" #include "../../plugins/voiceservice/m_voiceservice.h" -#include +#include #include "resource.h" #include "popup.h" diff --git a/Protocols/IAX/iax.cpp b/Protocols/IAX/iax.cpp index 20b8af4..4d77e4f 100644 --- a/Protocols/IAX/iax.cpp +++ b/Protocols/IAX/iax.cpp @@ -30,7 +30,7 @@ PLUGININFOEX pluginInfo={ #else "IAX protocol (Ansi)", #endif - PLUGIN_MAKE_VERSION(0,1,3,0), + PLUGIN_MAKE_VERSION(0,2,0,0), "Provides support for Inter-Asterisk eXchange (IAX) protocol", "Ricardo Pescuma Domenecci", "pescuma@miranda-im.org", @@ -52,6 +52,8 @@ MM_INTERFACE mmi; UTF8_INTERFACE utfi; LIST_INTERFACE li; +void * iaxclientDllCode = NULL; + std::vector hHooks; int ModulesLoaded(WPARAM wParam, LPARAM lParam); @@ -100,13 +102,14 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) static IAXProto *IAXProtoInit(const char* pszProtoName, const TCHAR* tszUserName) { - if (instances.getCount() != 0) + HMEMORYMODULE iaxclient = MemoryLoadLibrary((const char *) iaxclientDllCode); + if (iaxclient == NULL) { - MessageBox(NULL, TranslateT("Only one instance is allowed.\nI will crash now."), _T("IAX"), MB_OK | MB_ICONERROR); + MessageBox(NULL, TranslateT("Error loading iaxclient dll"), TranslateT("IAX"), MB_OK | MB_ICONERROR); return NULL; } - - IAXProto *proto = new IAXProto(pszProtoName, tszUserName); + + IAXProto *proto = new IAXProto(iaxclient, pszProtoName, tszUserName); instances.insert(proto); return proto; } @@ -119,11 +122,40 @@ static int IAXProtoUninit(IAXProto *proto) } +static void * LoadDllFromResource(LPCTSTR lpName) +{ + HRSRC hRes = FindResource(hInst, lpName, RT_RCDATA); + if (hRes == NULL) + return NULL; + + HGLOBAL hResLoad = LoadResource(hInst, hRes); + if (hResLoad == NULL) + return NULL; + + return LockResource(hResLoad); +} + + extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) { pluginLink = link; - CHECK_VERSION("IAX") + CHECK_VERSION("IAX"); + + iaxclientDllCode = LoadDllFromResource(MAKEINTRESOURCE(IDR_IAXCLIENT_DLL)); + if (iaxclientDllCode == NULL) + { + MessageBox(NULL, TranslateT("Could not load iaxclient module"), TranslateT("IAX"), MB_OK | MB_ICONERROR); + return -1; + } + + HMEMORYMODULE iaxclient = MemoryLoadLibrary((const char *) iaxclientDllCode); + if (iaxclient == NULL) + { + MessageBox(NULL, TranslateT("Error loading iaxclient dll"), TranslateT("IAX"), MB_OK | MB_ICONERROR); + return -1; + } + MemoryFreeLibrary(iaxclient); // TODO Assert results here mir_getMMI(&mmi); @@ -154,6 +186,9 @@ extern "C" int __declspec(dllexport) Unload(void) // Called when all the modules are loaded int ModulesLoaded(WPARAM wParam, LPARAM lParam) { + if (!ServiceExists(MS_VOICESERVICE_REGISTER)) + MessageBox(NULL, TranslateT("IAX needs Voice Service plugin to work!"), _T("IAX"), MB_OK | MB_ICONERROR); + // Add our modules to the KnownModules list CallService("DBEditorpp/RegisterSingleModule", (WPARAM) MODULE_NAME, 0); diff --git a/Protocols/IAX/iax.dsp b/Protocols/IAX/iax.dsp index 84257b4..47f40d2 100644 --- a/Protocols/IAX/iax.dsp +++ b/Protocols/IAX/iax.dsp @@ -57,7 +57,7 @@ BSC32=bscmake.exe LINK32=link.exe # ADD BASE LINK32 user32.lib shell32.lib wininet.lib gdi32.lib /nologo /base:"0x67100000" /dll /machine:I386 /filealign:0x200 # SUBTRACT BASE LINK32 /pdb:none /map -# ADD LINK32 libgsm.lib libiax2.lib libiaxclient.lib libogg.lib libportaudio.lib libportmixer.lib libspeex.lib ws2_32.lib kernel32.lib user32.lib /nologo /base:"0x3EC20000" /dll /map /debug /debugtype:both /machine:I386 /out:"..\..\bin\release\Plugins\iax.dll" /pdbtype:sept /libpath:"lib/iaxclient/Release" /filealign:0x200 /ALIGN:4096 /ignore:4108 +# ADD LINK32 kernel32.lib user32.lib /nologo /base:"" /dll /map /debug /debugtype:both /machine:I386 /out:"..\..\bin\release\Plugins\iax.dll" /pdbtype:sept /libpath:"lib/iaxclient/Release" /filealign:0x200 /ALIGN:4096 /ignore:4108 # SUBTRACT LINK32 /profile /pdb:none !ELSEIF "$(CFG)" == "iax - Win32 Debug" @@ -86,7 +86,7 @@ BSC32=bscmake.exe LINK32=link.exe # ADD BASE LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..bin\release\Plugins\iax.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108 # SUBTRACT BASE LINK32 /profile /pdb:none -# ADD LINK32 libgsm.lib libiax2.lib libiaxclient.lib libogg.lib libportaudio.lib libportmixer.lib libspeex.lib ws2_32.lib kernel32.lib user32.lib /nologo /base:"0x3EC20000" /dll /incremental:yes /debug /machine:I386 /out:"..\..\bin\debug\Plugins\iax.dll" /libpath:"lib/iaxclient/Debug" /filealign:0x200 /ALIGN:4096 /ignore:4108 +# ADD LINK32 kernel32.lib user32.lib /nologo /base:"" /dll /incremental:yes /debug /machine:I386 /out:"..\..\bin\debug\Plugins\iax.dll" /libpath:"lib/iaxclient/Debug" /filealign:0x200 /ALIGN:4096 /ignore:4108 # SUBTRACT LINK32 /profile /pdb:none !ELSEIF "$(CFG)" == "iax - Win32 Unicode Debug" @@ -115,7 +115,7 @@ BSC32=bscmake.exe LINK32=link.exe # ADD BASE LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x32100000" /dll /incremental:yes /debug /machine:I386 /out:"..\..\bin\debug\Plugins\iax.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108 # SUBTRACT BASE LINK32 /profile /pdb:none -# ADD LINK32 libgsm.lib libiax2.lib libiaxclient.lib libogg.lib libportaudio.lib libportmixer.lib libspeex.lib ws2_32.lib kernel32.lib user32.lib /nologo /base:"0x3EC20000" /dll /incremental:yes /debug /machine:I386 /out:"..\..\bin\debug unicode\Plugins\iaxW.dll" /libpath:"lib/iaxclient/Debug" /filealign:0x200 /ALIGN:4096 /ignore:4108 +# ADD LINK32 kernel32.lib user32.lib /nologo /base:"" /dll /incremental:yes /debug /machine:I386 /out:"..\..\bin\debug unicode\Plugins\iaxW.dll" /libpath:"lib/iaxclient/Debug" /filealign:0x200 /ALIGN:4096 /ignore:4108 # SUBTRACT LINK32 /profile /pdb:none !ELSEIF "$(CFG)" == "iax - Win32 Unicode Release" @@ -144,7 +144,7 @@ BSC32=bscmake.exe LINK32=link.exe # ADD BASE LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x32100000" /dll /map /machine:I386 /out:"..\..\bin\release\Plugins\iax.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108 # SUBTRACT BASE LINK32 /profile /pdb:none -# ADD LINK32 libgsm.lib libiax2.lib libiaxclient.lib libogg.lib libportaudio.lib libportmixer.lib libspeex.lib ws2_32.lib kernel32.lib user32.lib /nologo /base:"0x3EC20000" /dll /map /debug /debugtype:both /machine:I386 /out:"..\..\bin\release unicode\Plugins\iaxW.dll" /pdbtype:sept /libpath:"lib/iaxclient/Release" /filealign:0x200 /ALIGN:4096 /ignore:4108 +# ADD LINK32 kernel32.lib user32.lib /nologo /base:"" /dll /map /debug /debugtype:both /machine:I386 /out:"..\..\bin\release unicode\Plugins\iaxW.dll" /pdbtype:sept /libpath:"lib/iaxclient/Release" /filealign:0x200 /ALIGN:4096 /ignore:4108 # SUBTRACT LINK32 /profile /pdb:none !ENDIF @@ -168,6 +168,10 @@ SOURCE=.\IAXProto.h # End Source File # Begin Source File +SOURCE=..\..\plugins\utils\MemoryModule.h +# End Source File +# Begin Source File + SOURCE=..\..\plugins\utils\mir_icons.h # End Source File # Begin Source File @@ -196,43 +200,7 @@ SOURCE=.\resource.h # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # Begin Source File -SOURCE=".\res\IAX-away.ico" -# End Source File -# Begin Source File - -SOURCE=".\res\IAX-dnd.ico" -# End Source File -# Begin Source File - -SOURCE=".\res\IAX-freechat.ico" -# End Source File -# Begin Source File - -SOURCE=".\res\IAX-invisible.ico" -# End Source File -# Begin Source File - -SOURCE=".\res\IAX-na.ico" -# End Source File -# Begin Source File - -SOURCE=".\res\IAX-occupied.ico" -# End Source File -# Begin Source File - -SOURCE=".\res\IAX-offline.ico" -# End Source File -# Begin Source File - -SOURCE=".\res\IAX-online.ico" -# End Source File -# Begin Source File - -SOURCE=".\res\IAX-onthephone.ico" -# End Source File -# Begin Source File - -SOURCE=".\res\IAX-outtolunch.ico" +SOURCE=.\lib\iaxclient\Dll\iaxclient.dll # End Source File # Begin Source File @@ -256,6 +224,10 @@ SOURCE=.\IAXProto.cpp # End Source File # Begin Source File +SOURCE=..\..\plugins\utils\MemoryModule.c +# End Source File +# Begin Source File + SOURCE=..\..\plugins\utils\mir_icons.cpp # End Source File # Begin Source File diff --git a/Protocols/IAX/lib/iaxclient/Dll/iaxclient.dll b/Protocols/IAX/lib/iaxclient/Dll/iaxclient.dll new file mode 100644 index 0000000..fd421f5 Binary files /dev/null and b/Protocols/IAX/lib/iaxclient/Dll/iaxclient.dll differ diff --git a/Protocols/IAX/lib/iaxclient/Dll/iaxclient.lib b/Protocols/IAX/lib/iaxclient/Dll/iaxclient.lib new file mode 100644 index 0000000..266c334 Binary files /dev/null and b/Protocols/IAX/lib/iaxclient/Dll/iaxclient.lib differ diff --git a/Protocols/IAX/lib/iaxclient/Dll/iaxclient_ptrs.h b/Protocols/IAX/lib/iaxclient/Dll/iaxclient_ptrs.h new file mode 100644 index 0000000..663ee7e --- /dev/null +++ b/Protocols/IAX/lib/iaxclient/Dll/iaxclient_ptrs.h @@ -0,0 +1,1396 @@ +/* + * iaxclient: a cross-platform IAX softphone library + * + * Copyrights: + * Copyright (C) 2003-2006, Horizon Wimba, Inc. + * Copyright (C) 2007, Wimba, Inc. + * + * Contributors: + * Steve Kann + * Frik Strecker + * Mihai Balea + * Peter Grayson + * Bill Cholewka + * Erik Bunce + * + * This program is free software, distributed under the terms of + * the GNU Lesser (Library) General Public License. + */ +#ifndef _iaxclient_h +#define _iaxclient_h + +#ifdef __cplusplus +extern "C" { +#endif + +/*! + \file iaxclient.h + \brief The IAXClient API + + + + \note This is the include file which declares all external API functions to + IAXClient. It should include all functions and declarations needed + by IAXClient library users, but not include internal structures, or + require the inclusion of library internals (or sub-libraries) +*/ + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +#ifdef _MSC_VER +typedef int socklen_t; +#endif +#include +#if defined(WIN32) || defined(_WIN32_WCE) +#include +#include +#else +#include +#endif +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +#if defined(WIN32) || defined(_WIN32_WCE) +#if defined(_MSC_VER) + typedef int (__stdcall *iaxc_sendto_t)(SOCKET, const void *, size_t, int, + const struct sockaddr *, socklen_t); + typedef int (__stdcall *iaxc_recvfrom_t)(SOCKET, void *, size_t, int, + struct sockaddr *, socklen_t *); +#else + typedef int PASCAL (*iaxc_sendto_t)(SOCKET, const char *, int, int, + const struct sockaddr *, int); + typedef int PASCAL (*iaxc_recvfrom_t)(SOCKET, char *, int, int, + struct sockaddr *, int *); +#endif +#else + /*! + Defines the portotype for an application provided sendto implementation. + */ + typedef int (*iaxc_sendto_t)(int, const void *, size_t, int, + const struct sockaddr *, socklen_t); + /*! + Defines the portotype for an application provided recvfrom implementation. + */ + typedef int (*iaxc_recvfrom_t)(int, void *, size_t, int, + struct sockaddr *, socklen_t *); +#endif + +/*! + Mask containing all potentially valid audio formats +*/ +#define IAXC_AUDIO_FORMAT_MASK ((1<<16)-1) + +/*! + Mask containing all potentially valid video formats +*/ +#define IAXC_VIDEO_FORMAT_MASK (((1<<25)-1) & ~IAXC_AUDIO_FORMAT_MASK) + +/* payload formats : WARNING: must match libiax values!!! */ +/* Data formats for capabilities and frames alike */ +#define IAXC_FORMAT_G723_1 (1 << 0) /*!< G.723.1 compression */ +#define IAXC_FORMAT_GSM (1 << 1) /*!< GSM compression */ +#define IAXC_FORMAT_ULAW (1 << 2) /*!< Raw mu-law data (G.711) */ +#define IAXC_FORMAT_ALAW (1 << 3) /*!< Raw A-law data (G.711) */ +#define IAXC_FORMAT_G726 (1 << 4) /*!< ADPCM, 32kbps */ +#define IAXC_FORMAT_ADPCM (1 << 5) /*!< ADPCM IMA */ +#define IAXC_FORMAT_SLINEAR (1 << 6) /*!< Raw 16-bit Signed Linear (8000 Hz) PCM */ +#define IAXC_FORMAT_LPC10 (1 << 7) /*!< LPC10, 180 samples/frame */ +#define IAXC_FORMAT_G729A (1 << 8) /*!< G.729a Audio */ +#define IAXC_FORMAT_SPEEX (1 << 9) /*!< Speex Audio */ +#define IAXC_FORMAT_ILBC (1 << 10) /*!< iLBC Audio */ + +#define IAXC_FORMAT_MAX_AUDIO (1 << 15) /*!< Maximum audio format value */ +#define IAXC_FORMAT_JPEG (1 << 16) /*!< JPEG Images */ +#define IAXC_FORMAT_PNG (1 << 17) /*!< PNG Images */ +#define IAXC_FORMAT_H261 (1 << 18) /*!< H.261 Video */ +#define IAXC_FORMAT_H263 (1 << 19) /*!< H.263 Video */ +#define IAXC_FORMAT_H263_PLUS (1 << 20) /*!< H.263+ Video */ +#define IAXC_FORMAT_H264 (1 << 21) /*!< H264 Video */ +#define IAXC_FORMAT_MPEG4 (1 << 22) /*!< MPEG4 Video */ +#define IAXC_FORMAT_THEORA (1 << 24) /*!< Theora Video */ +#define IAXC_FORMAT_MAX_VIDEO (1 << 24) /*!< Maximum Video format value*/ + +#define IAXC_EVENT_TEXT 1 /*!< Indicates a text event */ +#define IAXC_EVENT_LEVELS 2 /*!< Indicates a level event */ +#define IAXC_EVENT_STATE 3 /*!< Indicates a call state change event */ +#define IAXC_EVENT_NETSTAT 4 /*!< Indicates a network statistics update event */ +#define IAXC_EVENT_URL 5 /*!< Indicates a URL push via IAX(2) */ +#define IAXC_EVENT_VIDEO 6 /*!< Indicates a video event */ +#define IAXC_EVENT_REGISTRATION 8 /*!< Indicates a registration event */ +#define IAXC_EVENT_DTMF 9 /*!< Indicates a DTMF event */ +#define IAXC_EVENT_AUDIO 10 /*!< Indicates an audio event */ +#define IAXC_EVENT_VIDEOSTATS 11 /*!< Indicates a video statistics update event */ +#define IAXC_EVENT_VIDCAP_ERROR 12 /*!< Indicates a video capture error occurred */ +#define IAXC_EVENT_VIDCAP_DEVICE 13 /*!< Indicates a possible video capture device insertion/removal */ + +#define IAXC_CALL_STATE_FREE 0 /*!< Indicates a call slot is free */ +#define IAXC_CALL_STATE_ACTIVE (1<<1) /*!< Indicates a call is active */ +#define IAXC_CALL_STATE_OUTGOING (1<<2) /*!< Indicates a call is outgoing */ +#define IAXC_CALL_STATE_RINGING (1<<3) /*!< Indicates a call is ringing */ +#define IAXC_CALL_STATE_COMPLETE (1<<4) /*!< Indicates a completed call */ +#define IAXC_CALL_STATE_SELECTED (1<<5) /*!< Indicates the call is selected */ +#define IAXC_CALL_STATE_BUSY (1<<6) /*!< Indicates a call is busy */ +#define IAXC_CALL_STATE_TRANSFER (1<<7) /*!< Indicates the call transfer has been released */ +#define IAXC_CALL_STATE_KEYED (1<<8) /*!< Indicates the call radio is activated */ + +/*! Indicates that text is for an IAXClient status change */ +#define IAXC_TEXT_TYPE_STATUS 1 +/*! Indicates that text is an IAXClient warning message */ +#define IAXC_TEXT_TYPE_NOTICE 2 +/*! Represents that text is for an IAXClient error message */ +#define IAXC_TEXT_TYPE_ERROR 3 +/*! + Represents that text is for an IAXClient fatal error message. + + The User Agent should probably display error message text, then die +*/ +#define IAXC_TEXT_TYPE_FATALERROR 4 +/*! Represents a message sent from the server across the IAX stream*/ +#define IAXC_TEXT_TYPE_IAX 5 + +/* registration replys, corresponding to IAX_EVENTs*/ +#define IAXC_REGISTRATION_REPLY_ACK 18 /*!< Indicates the registration was accepted (See IAX_EVENT_REGACC) */ +#define IAXC_REGISTRATION_REPLY_REJ 30 /*!< Indicates the registration was rejected (See IAX_EVENT_REGREJ) */ +#define IAXC_REGISTRATION_REPLY_TIMEOUT 6 /*!< Indicates the registration timed out (See IAX_EVENT_TIMEOUT) */ + +#define IAXC_URL_URL 1 /*!< URL received */ +#define IAXC_URL_LDCOMPLETE 2 /*!< URL loading complete */ +#define IAXC_URL_LINKURL 3 /*!< URL link request */ +#define IAXC_URL_LINKREJECT 4 /*!< URL link reject */ +#define IAXC_URL_UNLINK 5 /*!< URL unlink */ + +/* The source of the video or audio data triggering the event. */ +#define IAXC_SOURCE_LOCAL 1 /*!< Indicates that the event data source is local */ +#define IAXC_SOURCE_REMOTE 2 /*!< Indicates that the event data source is remote */ + +/*! + The maximum size of a string contained within an event + */ +#define IAXC_EVENT_BUFSIZ 256 + +/*! + A structure containing information about an audio level event. +*/ +struct iaxc_ev_levels { + /*! + The input level in dB. + */ + float input; + + /*! + The output level in dB. + */ + float output; +}; + +/*! + A structure containing information about a text event. +*/ +struct iaxc_ev_text { + /*! + The type of text event. + + Valid values are from the IAXC_TEXT_TYPE_{} family of defines. + \see IAXC_TEXT_TYPE_STATUS, IAXC_TEXT_TYPE_NOTICE, IAXC_TEXT_TYPE_ERROR, + IAXC_TEXT_TYPE_FATALERROR, IAXC_TEXT_TYPE_IAX + */ + int type; + + /*! + The call the text is associated with or -1 if general text. + */ + int callNo; + + /*! + The UTF8 encoded text of the message. + */ + char message[IAXC_EVENT_BUFSIZ]; +}; + +/*! + A structure containing information about a call state change event. +*/ +struct iaxc_ev_call_state { + /*! + The call number whose state this is + */ + int callNo; + + /*! + The call state represented using the IAXC_CALL_STATE_{} defines. + + \see IAXC_CALL_STATE_FREE, IAXC_CALL_STATE_ACTIVE, IAXC_CALL_STATE_OUTGOING, + IAXC_CALL_STATE_RINGING, IAXC_CALL_STATE_COMPLETE, IAXC_CALL_STATE_SELECTED, + IAXC_CALL_STATE_BUSY, IAXC_CALL_STATE_TRANSFER + */ + int state; + + /*! + The audio format of the call. + + \see IAXC_FORMAT_G723_1, IAXC_FORMAT_GSM, IAXC_FORMAT_ULAW, IAXC_FORMAT_ALAW, + IAXC_FORMAT_G726, IAXC_FORMAT_ADPCM, IAXC_FORMAT_SLINEAR, IAXC_FORMAT_LPC10, + IAXC_FORMAT_G729A, IAXC_FORMAT_SPEEX, IAXC_FORMAT_ILBC, IAXC_FORMAT_MAX_AUDIO + */ + int format; + + /*! + The audio format of the call. + + \see IAXC_FORMAT_JPEG, IAXC_FORMAT_PNG, IAXC_FORMAT_H261, IAXC_FORMAT_H263, + IAXC_FORMAT_H263_PLUS, IAXC_FORMAT_H264, IAXC_FORMAT_MPEG4, + IAXC_FORMAT_THEORA, IAXC_FORMAT_MAX_VIDEO + */ + int vformat; + + /*! + The remote number. + */ + char remote[IAXC_EVENT_BUFSIZ]; + + /*! + The remote name. + */ + char remote_name[IAXC_EVENT_BUFSIZ]; + + /*! + The local number. + */ + char local[IAXC_EVENT_BUFSIZ]; + + /*! + The local calling context. + */ + char local_context[IAXC_EVENT_BUFSIZ]; +}; + +/*! + A structure containing information about a set of network statistics. +*/ +struct iaxc_netstat { + /*! + The amount of observed jitter. + */ + int jitter; + + /*! + The lost frame percentage. + */ + int losspct; + + /*! + The number of missing frames. + */ + int losscnt; + + /*! + The number of frames received. + */ + int packets; + + /*! + The observed delay. + */ + int delay; + + /*! + The number of frames dropped. + */ + int dropped; + + /*! + The number of frames received out of order. + */ + int ooo; +}; + +/*! + A structure containing information about a network statistics event. +*/ +struct iaxc_ev_netstats { + /*! + The call whose statistics these are. + */ + int callNo; + + /*! + The Round Trip Time + */ + int rtt; + + /*! + The locally observed network statistics. + */ + struct iaxc_netstat local; + + /*! + The remotely (peer) observed network statistics. + */ + struct iaxc_netstat remote; +}; + +/*! + A structure containing video statistics data. +*/ +struct iaxc_video_stats +{ + unsigned long received_slices; /*!< Number of received slices. */ + unsigned long acc_recv_size; /*!< Accumulated size of inbound slices. */ + unsigned long sent_slices; /*!< Number of sent slices. */ + unsigned long acc_sent_size; /*!< Accumulated size of outbound slices. */ + + unsigned long dropped_frames; /*!< Number of frames dropped by the codec (incomplete frames). */ + unsigned long inbound_frames; /*!< Number of frames decoded by the codec (complete frames). */ + unsigned long outbound_frames; /*!< Number of frames sent to the encoder. */ + + float avg_inbound_fps; /*!< Average fps of inbound complete frames. */ + unsigned long avg_inbound_bps; /*!< Average inbound bitrate. */ + float avg_outbound_fps; /*!< Average fps of outbound frames. */ + unsigned long avg_outbound_bps; /*!< Average outbound bitrate. */ + + struct timeval start_time; /*!< Timestamp of the moment we started measuring. */ +}; + +/*! + A structure containing information about a video statistics event. +*/ +struct iaxc_ev_video_stats { + /*! + The call whose statistics these are. + */ + int callNo; + + /*! + The video statistics for the call. + */ + struct iaxc_video_stats stats; +}; + +/*! + A structure containing information about an URL event. +*/ +struct iaxc_ev_url { + /*! + The call this is for. + */ + int callNo; + + /*! + The type of URL received. See the IAXC_URL_{} defines. + + \see IAXC_URL_URL, IAXC_URL_LINKURL, IAXC_URL_LDCOMPLETE, IAXC_URL_UNLINK, + IAXC_URL_LINKREJECT + */ + int type; + + /*! + The received URL. + */ + char url[IAXC_EVENT_BUFSIZ]; +}; + +/*! + A structure containing data for a video event. +*/ +struct iaxc_ev_video { + /*! + The call this video data is for. + + Will be -1 for local video. + */ + int callNo; + + /*! + Timestamp of the video + */ + unsigned int ts; + + /*! + The format of the video data. + + \see IAXC_FORMAT_JPEG, IAXC_FORMAT_PNG, IAXC_FORMAT_H261, IAXC_FORMAT_H263, + IAXC_FORMAT_H263_PLUS, IAXC_FORMAT_H264, IAXC_FORMAT_MPEG4, + IAXC_FORMAT_THEORA, IAXC_FORMAT_MAX_VIDEO + */ + int format; + + /*! + The width of the video. + */ + int width; + + /*! + The height of the video. + */ + int height; + + /*! + Is the data encoded. + + 1 for encoded data, 0 for raw. + */ + int encoded; + + /*! + The source of the data. + + \see IAXC_SOURCE_LOCAL, IAXC_SOURCE_REMOTE + */ + int source; + + /*! + The size of the video data in bytes. + */ + int size; + + /*! + The buffer containing the video data. + */ + char *data; +}; + +/*! + A structure containing data for an audio event. +*/ +struct iaxc_ev_audio +{ + /*! + The call this audio data is for. + */ + int callNo; + + /*! + Timestamp of the video + */ + unsigned int ts; + + /*! + The format of the data. + + \see IAXC_FORMAT_G723_1, IAXC_FORMAT_GSM, IAXC_FORMAT_ULAW, IAXC_FORMAT_ALAW, + IAXC_FORMAT_G726, IAXC_FORMAT_ADPCM, IAXC_FORMAT_SLINEAR, IAXC_FORMAT_LPC10, + IAXC_FORMAT_G729A, IAXC_FORMAT_SPEEX, IAXC_FORMAT_ILBC, IAXC_FORMAT_MAX_AUDIO + */ + int format; + + /*! + Is the data encoded. + + 1 for encoded data, 0 for raw. + */ + int encoded; + + /*! + The source of the data. + + \see IAXC_SOURCE_LOCAL, IAXC_SOURCE_REMOTE + */ + int source; + + /*! + The size of the audio data in bytes. + */ + int size; + + /*! + The buffer containing the audio data. + */ + unsigned char *data; +}; + +/*! + A structure containing information about a registration event +*/ +struct iaxc_ev_registration { + /*! + Indicates the registration id this event corresponds to. + + \see iaxc_register + */ + int id; + + /*! + The registration reply. + + The values are from the IAXC_REGISTRATION_REPLY_{} family of macros. + \see IAX_EVENT_REGACC, IAX_EVENT_REGREJ, IAX_EVENT_TIMEOUT + */ + int reply; + + /*! + The number of 'voicemail' messages. + */ + int msgcount; +}; + +/*! + A structure containing information about a DTMF event + */ +struct iaxc_ev_dtmf { + /*! + The call this DTMF event is for. + */ + int callNo; + + /*! + The digit represented by this DTMF tone + */ + char digit; +}; + +/*! + A structure describing a single IAXClient event. +*/ +typedef struct iaxc_event_struct { + /*! + Points to the next entry in the event queue + \internal + */ + struct iaxc_event_struct *next; + + /*! + The type uses one of the IAXC_EVENT_{} macros to describe which type of + event is being presented + */ + int type; + + /*! + Contains the data specific to the type of event. + */ + union { + /*! Contains level data if type = IAXC_EVENT_LEVELS */ + struct iaxc_ev_levels levels; + /*! Contains text data if type = IAXC_EVENT_TEXT */ + struct iaxc_ev_text text; + /*! Contains call state data if type = IAXC_EVENT_STATE */ + struct iaxc_ev_call_state call; + /*! Contains network statistics if type = IAXC_EVENT_NETSTAT */ + struct iaxc_ev_netstats netstats; + /*! Contains video statistics if type = IAXC_EVENT_VIDEOSTATS */ + struct iaxc_ev_video_stats videostats; + /*! Contains url data if type = IAXC_EVENT_URL */ + struct iaxc_ev_url url; + /*! Contains video data if type = IAXC_EVENT_VIDEO */ + struct iaxc_ev_video video; + /*! Contains audio data if type = IAXC_EVENT_AUDIO */ + struct iaxc_ev_audio audio; + /*! Contains registration data if type = IAXC_EVENT_REGISTRATION */ + struct iaxc_ev_registration reg; + /*! Contains DTMF data if type = IAXC_EVENT_DTMF */ + struct iaxc_ev_dtmf dtmf; + } ev; +} iaxc_event; + +/*! + Defines the prototype for event callback handlers + \param e The event structure being passed to the callback + + \return The result of processing the event; > 0 if successfully handled the event, 0 if not handled, < 0 to indicate an error occurred processing the event. +*/ +typedef int (*iaxc_event_callback_t)(iaxc_event e, void *param); + +/*! + A structure containing information about a video capture device. +*/ +struct iaxc_video_device { + /*! + The "human readable" name of the device + */ + const char *name; + + /*! + unique id of the device + */ + const char *id_string; + + /*! + iaxclient id of the device + */ + int id; +}; + +#define IAXC_AD_INPUT (1<<0) /*!< Device is usable for input*/ +#define IAXC_AD_OUTPUT (1<<1) /*!< Device is usable for output */ +#define IAXC_AD_RING (1<<2) /*!< Device is usable for ring */ +#define IAXC_AD_INPUT_DEFAULT (1<<3) /*!< Indicates the default input device */ +#define IAXC_AD_OUTPUT_DEFAULT (1<<4) /*!< Indicates the default output device */ +#define IAXC_AD_RING_DEFAULT (1<<5) /*!< Indicates the default ring device */ + +/*! + A structure containing information about an audio device. +*/ +struct iaxc_audio_device { + /*! + The "human readable" name of the device + */ + const char * name; + + /*! + Capability flags, defined using the IAXC_AD_{} macros. + */ + long capabilities; + + /*! + The device driver specific ID. + */ + int devID; +}; + +/*! + A structure describing a sound to IAXClient +*/ +struct iaxc_sound { + short *data; /*!< Sound sample data in 8KHz 16-bit signed format. */ + long len; /*!< Length of sample in frames. */ + int malloced; /*!< Should the library free() the data after it is played? */ + int channel; /*!< The channel used: 0 for output, 1 for ring. */ + int repeat; /*!< Number of times to repeat (-1 = infinite). */ + long pos; /*!< \internal use: current play position. */ + int id; /*!< \internal use: sound ID. */ + struct iaxc_sound *next; /*!< \internal use: next in list. */ +}; + +#define IAXC_FILTER_DENOISE (1<<0) /*!< Noise reduction filter */ +#define IAXC_FILTER_AGC (1<<1) /*!< Automatic Gain Control */ +#define IAXC_FILTER_ECHO (1<<2) /*!< Echo cancellation filter */ +#define IAXC_FILTER_AAGC (1<<3) /*!< Analog (mixer-based) Automatic Gain Control */ +#define IAXC_FILTER_CN (1<<4) /*!< Send Comfort Noise (CN) frames when silence is detected */ +#define IAXC_FILTER_DEREVERB (1<<5) /*!< Reverb reduction filter */ + +/* + Functions and flags for setting and getting audio callback preferences + The application can request to receive local/remote, raw/encoded audio + through the callback mechanism. Please note that changing callback + settings will overwrite all previous settings. +*/ +/*! + Indicates the preference that local audio should be passed to the registered callback in a raw 8KHz 16-bit signed format. +*/ +#define IAXC_AUDIO_PREF_RECV_LOCAL_RAW (1 << 0) + +/*! + Indicates the preference that local audio should be passed to the registered callback in the current encoded format. +*/ +#define IAXC_AUDIO_PREF_RECV_LOCAL_ENCODED (1 << 1) + +/*! + Indicates the preference that remote audio should be passed to the registered callback in a raw 8KHz 16-bit signed format. +*/ +#define IAXC_AUDIO_PREF_RECV_REMOTE_RAW (1 << 2) + +/*! + Indicates the preference that remote audio should be passed to the registered callback in the current encoded format. +*/ +#define IAXC_AUDIO_PREF_RECV_REMOTE_ENCODED (1 << 3) + +/*! + Indicates the preference that sending of audio should be disabled. +*/ +#define IAXC_AUDIO_PREF_SEND_DISABLE (1 << 4) + + +/* + * Acceptable range for video rezolution + */ +#define IAXC_VIDEO_MAX_WIDTH 704 /*!< Maximum video width */ +#define IAXC_VIDEO_MAX_HEIGHT 576 /*!< Maximum video height */ +#define IAXC_VIDEO_MIN_WIDTH 80 /*!< Minimum video width */ +#define IAXC_VIDEO_MIN_HEIGHT 60 /*!< Minimum video height */ + +/* + Video callback preferences + The client application can obtain any combination of + remote/local, encoded/raw video through the event callback + mechanism + Use these flags to specify what kind of video do you want to receive + */ + +/*! + Indicates the preference that local video should be passed to the registered callback in a raw format (typically YUV420). +*/ +#define IAXC_VIDEO_PREF_RECV_LOCAL_RAW (1 << 0) + +/*! + Indicates the preference that local video should be passed to the registered callback in the current encoded format. +*/ +#define IAXC_VIDEO_PREF_RECV_LOCAL_ENCODED (1 << 1) + +/*! + Indicates the preference that remote video should be passed to the registered callback in a raw format (typically YUV420). +*/ +#define IAXC_VIDEO_PREF_RECV_REMOTE_RAW (1 << 2) + +/*! + Indicates the preference that remote video should be passed to the registered callback in the current encoded format. +*/ +#define IAXC_VIDEO_PREF_RECV_REMOTE_ENCODED (1 << 3) + +/*! + Indicates the preference that sending of video should be disabled. +*/ +#define IAXC_VIDEO_PREF_SEND_DISABLE (1 << 4) + +/*! + This flag specifies that you want raw video in RGB32 format + + RGB32: FFRRGGBB aligned 4 bytes per pixel + When this flag is set, iaxclient will convert YUV420 raw video into + RGB32 before passing it to the main app. + */ +#define IAXC_VIDEO_PREF_RECV_RGB32 (1 << 5) + +/*! + Use this flag to disable/enable camera hardware + */ +#define IAXC_VIDEO_PREF_CAPTURE_DISABLE (1 << 6) + + + +typedef struct _IAXCLIENT { + + /*! + Sets the callback to call with IAXClient events + \param func The callback function to call with events + \param param User data to pass to the callback function + */ + void (*set_event_callback)(iaxc_event_callback_t func, void *param); + + /*! + Sets iaxclient to post a pointer to a copy of event using o/s specific Post method + \param handle + \param id + */ + int (*set_event_callpost)(void *handle, int id); + + /*! + frees event delivered via o/s specific Post method + \param e The event to free + */ + void (*free_event)(iaxc_event *e); + + + /* Event Accessors */ + /*! + Returns the levels data associated with event \a e. + \param e The event to retrieve the levels from. + */ + struct iaxc_ev_levels * (*get_event_levels)(iaxc_event *e); + + /*! + Returns the text data associated with event \a e. + \param e The event to retrieve text from. + */ + struct iaxc_ev_text * (*get_event_text)(iaxc_event *e); + + /*! + Returns the event state data associated with event \a e. + \param e The event to retrieve call state from. + */ + struct iaxc_ev_call_state * (*get_event_state)(iaxc_event *e); + + /*! + Set Preferred UDP Port: + \param sourceUdpPort The source UDP port to prefer + 0 Use the default port (4569), <0 Uses a dynamically assigned port, and + >0 tries to bind to the specified port + + \note must be called before iaxc_initialize() + */ + void (*set_preferred_source_udp_port)(int sourceUdpPort); + + /*! + Returns the UDP port that has been bound to. + + \return The UDP port bound to; -1 if no port or + */ + int (*get_bind_port)(); + + /*! + Initializes the IAXClient library + \param num_calls The maximum number of simultaneous calls to handle. + + This initializes the IAXClient + */ + int (*initialize)(int num_calls); + + /*! + Shutsdown the IAXClient library. + + This should be called by applications utilizing iaxclient before they exit. + It dumps all calls, and releases any audio/video drivers being used. + + \note It is unsafe to call most IAXClient API's after calling this! + */ + void (*shutdown)(); + + /*! + Sets the formats to be used + \param preferred The single preferred audio format + \param allowed A mask containing all audio formats to allow + + \see IAXC_FORMAT_G723_1, IAXC_FORMAT_GSM, IAXC_FORMAT_ULAW, IAXC_FORMAT_ALAW, + IAXC_FORMAT_G726, IAXC_FORMAT_ADPCM, IAXC_FORMAT_SLINEAR, IAXC_FORMAT_LPC10, + IAXC_FORMAT_G729A, IAXC_FORMAT_SPEEX, IAXC_FORMAT_ILBC, IAXC_FORMAT_MAX_AUDIO + */ + void (*set_formats)(int preferred, int allowed); + + /*! + Sets the minimum outgoing frame size. + \param samples The minimum number of samples to include in an outgoing frame. + */ + void (*set_min_outgoing_framesize)(int samples); + + /*! + Sets the caller id \a name and \a number. + \param name The caller id name. + \param number The caller id number. + */ + void (*set_callerid)(const char * name, const char * number); + + /*! + Starts all the internal processing thread(s). + + \note Should be called after iaxc_initialize, but before any call processing + related functions. + */ + int (*start_processing_thread)(); + + /*! + Stops all the internal processing thread(s). + + \note Should be called before iaxc_shutdown. + */ + int (*stop_processing_thread)(); + + /*! + Initiates a call to an end point + \param num The entity to call in the format of [user[:password]]@@peer[:portno][/exten[@@context]] + + \return The call number upon sucess; -1 otherwise. + + \note This is the same as calling iaxc_call_ex(num, NULL, NULL, 1). + */ + int (*call)(const char * num); + + /*! + Initiates a call to an end point + \param num The entity to call in the format of [user[:password]]@@peer[:portno][/exten[@@context]] + \param callerid_name The local caller id name to use + \param callerid_number The local caller id number to use + \param video 0 indicates no-video. Any non-zero value indicates video is requested + + \return The call number upon sucess; -1 otherwise. + */ + int (*call_ex)(const char* num, const char* callerid_name, const char* callerid_number, int video); + + /*! + Unregisters IAXClient from a server + \param id The registration number returned by iaxc_register. + */ + int (*unregister)( int id ); + + /*! + Registers the IAXClient instance with an IAX server + \param user The username to register as + \param pass The password to register with + \param host The address of the host/peer to register with + + \return The registration id number upon success; -1 otherwise. + */ + int (*register_)(const char * user, const char * pass, const char * host); + + /*! + Registers the IAXClient instance with an IAX server + \param user The username to register as + \param pass The password to register with + \param host The address of the host/peer to register with + \param refresh The registration refresh period + + \return The registration id number upon success; -1 otherwise. + */ + int (*register_ex)(const char * user, const char * pass, const char * host, int refresh); + + /*! + Respond to incoming call \a callNo as busy. + */ + void (*send_busy_on_incoming_call)(int callNo); + + /*! + Answers the incoming call \a callNo. + \param callNo The number of the call to answer. + */ + void (*answer_call)(int callNo); + + /*! + Radio Transmitter and Receiver Control Activiate + \param callNo The number of the call to activate + */ + void (*key_radio)(int callNo); + + /*! + Radio Transmitter and Receiver Control Deactivate + \param callNo The number of the call to deactivate + */ + void (*unkey_radio)(int callNo); + + /*! + Initiate a blind call transfer of \a callNo to \a number. + \param callNo The active call to transfer. + \param number The number to transfer the call to. See draft-guy-iax-03 section 8.4.1 for further details. + */ + void (*blind_transfer_call)(int callNo, const char * number); + + /*! + Setup a transfer of \a sourceCallNo to \a targetCallNo. + \param sourceCallNo The number of the active call session to transfer. + \param targetCallNo The active call session to be transferred to. + + This is used in performing as the final step in an attended call transfer. + */ + void (*setup_call_transfer)(int sourceCallNo, int targetCallNo); + + /*! + Hangs up and frees all non-free calls. + */ + void (*dump_all_calls)(void); + + /*! + Hangs up and frees call \a callNo + \param callNo The call number to reject. + */ + void (*dump_call_number)( int callNo ); + + /*! + Hangs up and frees the currently selected call. + */ + void (*dump_call)(void); + + /*! + Rejects the currently selected call. + + \note This is pretty much a useless API, since the act of selecting a call + will answer it. + */ + void (*reject_call)(void); + + /*! + Rejects the incoming call \a callNo. + \param callNo The call number to reject. + */ + void (*reject_call_number)(int callNo); + + /*! + Sends a DTMF digit to the currently selected call. + \param digit The DTMF digit to send (0-9, A-D, *, #). + */ + void (*send_dtmf)(char digit); + + /*! + Sends text to the currently selected call. + */ + void (*send_text)(const char * text); + + /*! + Sends \a text to call \a callNo + */ + void (*send_text_call)(int callNo, const char * text); + + /*! + Sends a URL across the currently selected call + \param url The URL to send across. + \param link If non-zero the URL is a link + */ + void (*send_url)(const char *url, int link); /* link == 1 ? AST_HTML_LINKURL : AST_HTML_URL */ + + /*! + Returns the state of a call + */ + int (*get_call_state)(int callNo); + + /*! + Suspends thread execution for an interval measured in milliseconds + \param ms The number of milliseconds to sleep + */ + void (*millisleep)(long ms); + + /*! + Sets the silence threshold to \a thr. + \param thr The threshold value in dB. A value of 0.0f effectively mutes audio input. + */ + void (*set_silence_threshold)(float thr); + + /*! + Sets the audio output to \a mode. + \param mode The audio mode 0 indicates remote audio should be played; non-zero prevents remote audio from being played. + */ + void (*set_audio_output)(int mode); + + /*! + Sets \a callNo as the currently selected call + \param callNo The call to select or < 0 to indicate no selected call. + + \note Will answer an incoming ringing call as a side effect. Personally I + believe this behavior is undesirable and feel it renders iaxc_reject_call + pretty much useless. + */ + int (*select_call)(int callNo); + + /*! + Returns the first free call number. + */ + int (*first_free_call)(); + + /*! + Returns the number of the currently selected call. + */ + int (*selected_call)(); + + /*! + Causes the audio channel for \a callNo to QUELCH (be squelched). + \param callNo The number of the active, accepted call to quelch. + \param MOH If non-zero Music On Hold should be played on the QUELCH'd call. + */ + int (*quelch)(int callNo, int MOH); + + /*! + Causes the audio channel for \a callNo to be UNQUELCH (unsquelched). + */ + int (*unquelch)(int callNo); + + /*! + Returns the current mic boost setting. + + \return 0 if mic boost is disabled; otherwise non-zero. + */ + int (*mic_boost_get)( void ) ; + + /*! + Sets the mic boost setting. + \param enable If non-zero enable the mic boost; otherwise disable. + */ + int (*mic_boost_set)( int enable ) ; + + /*! + Returns a copy of IAXClient library version + \param ver A buffer to store the version string in. It MUST be at least + IAXC_EVENT_BUFSIZ bytes in size. + + \return the version string (as stored in \a ver). + */ + char* (*version)(char *ver); + + /*! + Fine tune jitterbuffer control + \param value + */ + void (*set_jb_target_extra)( long value ); + + /*! + Application-defined networking; give substitute sendto and recvfrom + functions. + \param st The send function to use. + \param rf The receive function to use. + + \note Must be called before iaxc_initialize! + */ + void (*set_networking)(iaxc_sendto_t st, iaxc_recvfrom_t rf) ; + + /*! + wrapper for libiax2 get_netstats + \param call + \param rtt + \param local + \param remote + */ + int (*get_netstats)(int call, int *rtt, struct iaxc_netstat *local, struct iaxc_netstat *remote); + + + /*! Get audio device information: + \param devs Returns an array of iaxc_audio_device structures. + The array will will be valid as long as iaxc is initialized. + \param nDevs Returns the number of devices in the devs array + \param input Returns the currently selected input device + \param output Returns the currently selected output device + \param ring Returns the currently selected ring device + */ + int (*audio_devices_get)(struct iaxc_audio_device **devs, int *nDevs, int *input, int *output, int *ring); + + /*! + Sets the current audio devices + \param input The device to use for audio input + \param output The device to use for audio output + \param ring The device to use to present ring sounds + */ + int (*audio_devices_set)(int input, int output, int ring); + + /*! + Get the audio device input level. + + \return the input level in the range of 0.0f minimum to 1.0f maximum. + */ + float (*input_level_get)(); + + /*! + Get the audio device output level. + + \return the input level in the range of 0.0f minimum to 1.0f maximum. + */ + float (*output_level_get)(); + + /*! + Sets the audio input level to \a level. + \param level The level in the range from 0.0f (min) to 1.0f (max). + */ + int (*input_level_set)(float level); + + /*! + Sets the audio output level to \a level. + \param level The level in the range from 0.0f (min) to 1.0f (max). + */ + int (*output_level_set)(float level); + + /*! + Play a sound. + \param sound An iaxc_sound structure. + \param ring 0 to play through output device or 1 to play through the "ring" device. + + \return The id number of the sound being played + */ + int (*play_sound)(struct iaxc_sound *sound, int ring); + + /*! + Stop sound \a id from being played. + \param id The id of a sound to stop as returned from iaxc_play_sound. + */ + int (*stop_sound)(int id); + + /*! + Returns the set of audio filters being applied. + + The IAXC_FILTER_{} defines are used to specify the filters. + \see IAXC_FILTER_DENOISE, IAXC_FILTER_AGC, IAXC_FILTER_ECHO, IAXC_FILTER_AAGC, + IAXC_FILTER_CN + */ + int (*get_filters)(void); + + /*! + Sets the current audio filters to apply. + \param filters The combination of all the audio filters to use (IAXC_FILTER_{} defines). + + The IAXC_FILTER_{} defines are used to specify the filters. + \see IAXC_FILTER_DENOISE, IAXC_FILTER_AGC, IAXC_FILTER_ECHO, IAXC_FILTER_AAGC, + IAXC_FILTER_CN + */ + void (*set_filters)(int filters); + + /*! + Sets speex specific codec settings + \param decode_enhance 1/0 perceptual enhancement for decoder + \param quality: Generally, set either quality (0-9) or bitrate. -1 for "default" + \param bitrate in kbps. Applies to CBR only; -1 for default. + (overrides "quality" for CBR mode) + \param vbr Variable bitrate mode: 0/1 + \param abr mode/rate: 0 for not ABR, bitrate for ABR mode + \param complexity Algorithmic complexity. Think -N for gzip. + Higher numbers take more CPU for better quality. 3 is + default and good choice. + + A good choice is (1,-1,-1,0,8000,3): 8kbps ABR + */ + void (*set_speex_settings)(int decode_enhance, float quality, int bitrate, int vbr, int abr, int complexity); + + /*! + Returns the various audio delivery preferences. + + The preferences are represented using the AIXC_AUDIO_PREF_{} family of defines. + */ + unsigned int (*get_audio_prefs)(void); + + /*! + Set the various audio delivery preferences + \param prefs The desired preferences to use. They are represented using the AIXC_AUDIO_PREF_{} family of defines. + + \return 0 on success and -1 on error. + + \see IAXC_AUDIO_PREF_RECV_LOCAL_RAW, IAXC_AUDIO_PREF_RECV_LOCAL_ENCODED, + IAXC_AUDIO_PREF_RECV_REMOTE_RAW, IAXC_AUDIO_PREF_RECV_REMOTE_ENCODED, + IAXC_AUDIO_PREF_SEND_DISABLE + */ + int (*set_audio_prefs)(unsigned int prefs); + + /*! + Get video capture device information. + WARNING: the array pointed to by parameter 'devs' below is owned + by iaxclient, and may be freed on subsequent calls to + this function. + \param devs Returns an array of iaxc_video_device structures. + The array will only be valid until this function is + called again (if the device list changes), or until + iaxc is shutdown. + \param nDevs Returns the number of devices in the devs array + \param devId Returns the id of the currently selected video capture device + + \return -1 on error, 0 if no change to the device list, 1 if it's been updated + */ + int (*video_devices_get)(struct iaxc_video_device **devs, int *nDevs, int *devId); + + /*! + Sets the current video capture device + \param devId The id of the device to use for video capture + */ + int (*video_device_set)(int devId); + + /*! + Returns the current video preferences. + + The preferences are represented using the AIXC_VIDEO_PREF_{} family of macros. + + \see IAXC_VIDEO_PREF_RECV_LOCAL_RAW, IAXC_VIDEO_PREF_RECV_LOCAL_ENCODED, + IAXC_VIDEO_PREF_RECV_REMOTE_RAW, IAXC_VIDEO_PREF_RECV_REMOTE_ENCODED, + IAXC_VIDEO_PREF_SEND_DISABLE, IAXC_VIDEO_PREF_RECV_RGB32, + IAXC_VIDEO_PREF_CAPTURE_DISABLE + */ + unsigned int (*get_video_prefs)(void); + + /*! + Sets the current video preferences. + \param prefs The desired preferences to use. They are represented using the IAXC_VIDEO_PREF_{} family of defines. + + Please note that this overwrites all previous preferences. In other + words, a read-modify-write must be done to change a single preference. + + \return 0 on success and -1 on error. + + \see IAXC_VIDEO_PREF_RECV_LOCAL_RAW, IAXC_VIDEO_PREF_RECV_LOCAL_ENCODED, + IAXC_VIDEO_PREF_RECV_REMOTE_RAW, IAXC_VIDEO_PREF_RECV_REMOTE_ENCODED, + IAXC_VIDEO_PREF_SEND_DISABLE, IAXC_VIDEO_PREF_RECV_RGB32, + IAXC_VIDEO_PREF_CAPTURE_DISABLE + */ + int (*set_video_prefs)(unsigned int prefs); + + /*! + Returns the video format settings + \param preferred Receives the single preferred video format + \param allowed Receives the mask of the allowed video formats + + \see IAXC_FORMAT_JPEG, IAXC_FORMAT_PNG, IAXC_FORMAT_H261, IAXC_FORMAT_H263, + IAXC_FORMAT_H263_PLUS, IAXC_FORMAT_H264, IAXC_FORMAT_MPEG4, + IAXC_FORMAT_THEORA, IAXC_FORMAT_MAX_VIDEO + */ + void (*video_format_get_cap)(int *preferred, int *allowed); + + /*! + Sets the video format capabilities + \param preferred The single preferred video format + \param allowed The mask of the allowed video formats + + \see IAXC_FORMAT_JPEG, IAXC_FORMAT_PNG, IAXC_FORMAT_H261, IAXC_FORMAT_H263, + IAXC_FORMAT_H263_PLUS, IAXC_FORMAT_H264, IAXC_FORMAT_MPEG4, + IAXC_FORMAT_THEORA, IAXC_FORMAT_MAX_VIDEO + */ + void (*video_format_set_cap)(int preferred, int allowed); + + /*! + Sets the allowed/preferred video formats + \param preferred The single preferred video format + \param allowed The mask of the allowed video formats + \param framerate The video frame rate in fps. + \param bitrate The video bitrate in bps. + \param width The width of the video. + \param height The height of the video. + \param fs The video fragment size. + + \see IAXC_FORMAT_JPEG, IAXC_FORMAT_PNG, IAXC_FORMAT_H261, IAXC_FORMAT_H263, + IAXC_FORMAT_H263_PLUS, IAXC_FORMAT_H264, IAXC_FORMAT_MPEG4, + IAXC_FORMAT_THEORA, IAXC_FORMAT_MAX_VIDEO + */ + void (*video_format_set)(int preferred, int allowed, int framerate, int bitrate, int width, int height, int fs); + + /*! + Change video params for the current call on the fly + This will destroy the existing encoder and create a new one + use negative values for parameters that should not change + \param framerate The video frame rate in fps. + \param bitrate The video bitrate in bps. + \param width The width of the video. + \param height The height of the video. + \param fs The video fragment size. + */ + void (*video_params_change)(int framerate, int bitrate, int width, int height, int fs); + + /*! Set holding frame to be used in some kind of video calls */ + int (*set_holding_frame)(char *); + + /*! + Helper function to control use of jitter buffer for video events + + \todo make this a video pref, perhaps? + */ + + int (*video_bypass_jitter)(int); + + /*! + Returns 1 if the default camera is working; 0 otherwise + */ + int (*is_camera_working)(); + + /*! + Converts a YUV420 image to RGB32 + \param width The width of the image + \param height The height of the image + \param src The buffer containing the source image + \param dest The buffer to write the converted image to. The buffer should be \a width * height * 4 bytes in size. + + Converts the image based on the forumulas found at + http://en.wikipedia.org/wiki/YUV + */ + void (*YUV420_to_RGB32)(int width, int height, const char *src, char *dest); + + /* + * Test mode functionality + * In test mode, iaxclient will do the following: + * - skip audio and video hardware initialization + * - wait for outgoing media to be provided by the main application + * - return incoming media to the calling application if required, via callbacks + * - not generate any meaningful statistics + * Test mode is designed to be used without a GUI, and with multiple instances of iaxclient + * running on the same machine. However, some applications might actually benefit from having + * this level of control. + * iaxc_set_test_mode() should be called before iaxc_initialize() + */ + void (*set_test_mode)(int); + + /*! + \brief Sends compressed audio data to the currently selected call. + \param data compressed audio data + \param size Size of the compressed audio data in bytes + \param samples The number of (uncompressed) samples represented by the compressed audio data. We normally use 20ms packets at a sampling rate of 8000Hz, so this would be 160. + + \note Data must be in the audio format that was negotiated for the current call + otherwise bad magic may occur on the recieving side. + */ + int (*push_audio)(void *data, unsigned int size, unsigned int samples); + + /*! + \brief Sends compressed video data to the currently selected call. + \param data compressed video data + \param size Size of the compressed video data in bytes + \param fragment If true, split video frames larger than the current fragsize into multiple fragments, otherwise send the data as jumbo frames. + + \note Data must be in the video format that was negotiated for the current call + otherwise bad magic may occur on the recieving side. + */ + int (*push_video)(void *data, unsigned int size, int fragment); + + /*! + Sets the IAX debug set to \a enable. + \param enable If non-zero enable iax protocol debugging + */ + void (*debug_iax_set)(int enable); + +} IAXCLIENT; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Protocols/IAX/res/IAX-away.ico b/Protocols/IAX/res/IAX-away.ico index 1ce5071..60cc977 100644 Binary files a/Protocols/IAX/res/IAX-away.ico and b/Protocols/IAX/res/IAX-away.ico differ diff --git a/Protocols/IAX/res/IAX-dnd.ico b/Protocols/IAX/res/IAX-dnd.ico index 549e7f8..60cc977 100644 Binary files a/Protocols/IAX/res/IAX-dnd.ico and b/Protocols/IAX/res/IAX-dnd.ico differ diff --git a/Protocols/IAX/res/IAX-freechat.ico b/Protocols/IAX/res/IAX-freechat.ico index 666d252..60cc977 100644 Binary files a/Protocols/IAX/res/IAX-freechat.ico and b/Protocols/IAX/res/IAX-freechat.ico differ diff --git a/Protocols/IAX/res/IAX-invisible.ico b/Protocols/IAX/res/IAX-invisible.ico index 58eb675..60cc977 100644 Binary files a/Protocols/IAX/res/IAX-invisible.ico and b/Protocols/IAX/res/IAX-invisible.ico differ diff --git a/Protocols/IAX/res/IAX-na.ico b/Protocols/IAX/res/IAX-na.ico index d05d5ed..60cc977 100644 Binary files a/Protocols/IAX/res/IAX-na.ico and b/Protocols/IAX/res/IAX-na.ico differ diff --git a/Protocols/IAX/res/IAX-occupied.ico b/Protocols/IAX/res/IAX-occupied.ico index 8e71e2c..60cc977 100644 Binary files a/Protocols/IAX/res/IAX-occupied.ico and b/Protocols/IAX/res/IAX-occupied.ico differ diff --git a/Protocols/IAX/res/IAX-onthephone.ico b/Protocols/IAX/res/IAX-onthephone.ico index 51be5e7..60cc977 100644 Binary files a/Protocols/IAX/res/IAX-onthephone.ico and b/Protocols/IAX/res/IAX-onthephone.ico differ diff --git a/Protocols/IAX/res/IAX-outtolunch.ico b/Protocols/IAX/res/IAX-outtolunch.ico index 580d084..60cc977 100644 Binary files a/Protocols/IAX/res/IAX-outtolunch.ico and b/Protocols/IAX/res/IAX-outtolunch.ico differ diff --git a/Protocols/IAX/res/proto_IAX.dll b/Protocols/IAX/res/proto_IAX.dll index 91d5833..c9952a3 100644 Binary files a/Protocols/IAX/res/proto_IAX.dll and b/Protocols/IAX/res/proto_IAX.dll differ diff --git a/Protocols/IAX/resource.h b/Protocols/IAX/resource.h index 83420fa..f24c102 100644 --- a/Protocols/IAX/resource.h +++ b/Protocols/IAX/resource.h @@ -5,6 +5,7 @@ #define IDD_OPTIONS 119 #define IDD_OPTIONS_OLD 120 #define IDI_PROTO 160 +#define IDR_IAXCLIENT_DLL 161 #define IDD_ACCMGRUI 227 #define IDC_USERNAME 1000 #define IDC_PASSWORD 1001 @@ -21,7 +22,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 161 +#define _APS_NEXT_RESOURCE_VALUE 162 #define _APS_NEXT_COMMAND_VALUE 40005 #define _APS_NEXT_CONTROL_VALUE 1087 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/Protocols/IAX/resource.rc b/Protocols/IAX/resource.rc index d6094d3..98f881c 100644 --- a/Protocols/IAX/resource.rc +++ b/Protocols/IAX/resource.rc @@ -13,6 +13,25 @@ ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// Neutral resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU) +#ifdef _WIN32 +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// RT_RCDATA +// + +IDR_IAXCLIENT_DLL RCDATA DISCARDABLE "lib\\iaxclient\\Dll\\iaxclient.dll" +#endif // Neutral resources +///////////////////////////////////////////////////////////////////////////// + + ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources @@ -30,7 +49,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US IDD_ACCMGRUI DIALOGEX 0, 0, 186, 134 STYLE DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN LTEXT "Server:",IDC_STATIC,0,0,53,12,SS_CENTERIMAGE EDITTEXT IDC_HOST,54,0,92,12,ES_AUTOHSCROLL @@ -47,7 +66,7 @@ END IDD_OPTIONS DIALOGEX 0, 0, 216, 158 STYLE DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN GROUPBOX "AIX",IDC_STATIC,3,4,209,76 LTEXT "Server:",IDC_STATIC,14,17,53,12,SS_CENTERIMAGE @@ -94,7 +113,6 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDI_PROTO ICON DISCARDABLE "res\\Logo.ico" - #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3