You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(68) |
Jul
(27) |
Aug
(1) |
Sep
(9) |
Oct
(16) |
Nov
(64) |
Dec
(18) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(11) |
Feb
(5) |
Mar
(20) |
Apr
(9) |
May
(8) |
Jun
(8) |
Jul
(2) |
Aug
|
Sep
(11) |
Oct
(34) |
Nov
(23) |
Dec
(34) |
2005 |
Jan
(41) |
Feb
(25) |
Mar
(25) |
Apr
(32) |
May
(27) |
Jun
(9) |
Jul
(36) |
Aug
(6) |
Sep
(3) |
Oct
(11) |
Nov
(2) |
Dec
(21) |
2006 |
Jan
(14) |
Feb
(8) |
Mar
(18) |
Apr
(6) |
May
|
Jun
(17) |
Jul
(14) |
Aug
(26) |
Sep
(34) |
Oct
(24) |
Nov
(48) |
Dec
(64) |
2007 |
Jan
(72) |
Feb
(21) |
Mar
(50) |
Apr
(41) |
May
(35) |
Jun
(50) |
Jul
(33) |
Aug
(32) |
Sep
(50) |
Oct
(85) |
Nov
(43) |
Dec
(33) |
2008 |
Jan
(10) |
Feb
(29) |
Mar
(15) |
Apr
(45) |
May
(5) |
Jun
(2) |
Jul
(14) |
Aug
(3) |
Sep
|
Oct
|
Nov
(3) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
(9) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <st...@us...> - 2003-06-18 21:00:31
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv32087 Modified Files: wx.cc Log Message: Some sizing tweaks for the call list. Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- wx.cc 18 Jun 2003 16:39:18 -0000 1.33 +++ wx.cc 18 Jun 2003 21:00:28 -0000 1.34 @@ -100,11 +100,9 @@ IAXCalls(wxWindow *parent, int nCalls); void IAXCalls::OnSelect(wxListEvent &evt); int IAXCalls::HandleStateEvent(struct iaxc_ev_call_state c); - inline void IAXCalls::AutoSize() { - for(int i=0;i<nCalls;i++) - SetColumnWidth(i,wxLIST_AUTOSIZE); - } - + void IAXCalls::OnSize(wxSizeEvent& evt); + void IAXCalls::AutoSize(); + int IAXCalls::GetTotalHeight(); int nCalls; protected: @@ -113,6 +111,7 @@ BEGIN_EVENT_TABLE(IAXCalls, wxListCtrl) EVT_LIST_ITEM_SELECTED(ID_CALLS, IAXCalls::OnSelect) + EVT_SIZE(IAXCalls::OnSize) END_EVENT_TABLE() IAXCalls::IAXCalls(wxWindow *parent, int inCalls) @@ -144,12 +143,48 @@ AutoSize(); } +int IAXCalls::GetTotalHeight() { + // Return height to be what we need +#if 0 + // this doesn't work when called very early; the main area size + // isn't set yet. So, we'll just guess, and see how this work on + // platforms. + int x,y, y2; + ((wxScrolledWindow *)m_mainWin)->GetVirtualSize(&x, &y); + y2 = ((wxWindow *)m_headerWin)->GetSize().y; + fprintf(stderr, "GetTotalHeight: y=%d, y2=%d\n", y, y2); + return y+y2; +#endif + // GTK actual: 19*nCalls + 23 + return 20*nCalls + 25 + 15; +} + +void IAXCalls::AutoSize() { + // Set column widths. + int width = 0; + + // first columns are auto-sized + for(int i=0;i<=1;i++) { + SetColumnWidth(i,wxLIST_AUTOSIZE); + width+=GetColumnWidth(i); + } + + // last column is at least the remainder in width. + // minus some padding + int min=GetClientSize().x - width - 5; + SetColumnWidth(2,wxLIST_AUTOSIZE); + if(GetColumnWidth(2) < min) + SetColumnWidth(2,min); +} + +void IAXCalls::OnSize(wxSizeEvent& evt) { + AutoSize(); + wxListCtrl::OnSize(evt); +} + int IAXCalls::HandleStateEvent(struct iaxc_ev_call_state c) { - fprintf(stderr, "Updating state for item %d state=%x\n", c.callNo, c.state); - - // first, handle inactive calls if(!(c.state & IAXC_CALL_STATE_ACTIVE)) { //fprintf(stderr, "state for item %d is free\n", c.callNo); @@ -196,7 +231,6 @@ void IAXCalls::OnSelect(wxListEvent &evt) { int selected = evt.m_itemIndex; //GetSelection(); - fprintf(stderr, "User Selected item %d\n", selected); iaxc_select_call(selected); } @@ -345,7 +379,8 @@ int nCalls = wxGetApp().optNumCalls; // XXX need to fix sizes better. - topsizer->Add(calls = new IAXCalls(this, nCalls), 1, wxEXPAND); + topsizer->Add(calls = new IAXCalls(aPanel, nCalls), 0, wxEXPAND); + topsizer->SetItemMinSize(calls, -1, calls->GetTotalHeight()+5); } @@ -380,6 +415,7 @@ SetSizer(panelSizer); panelSizer->SetSizeHints(this); + #ifdef __WXGTK__ // window used for getting keyboard state GdkWindowAttr attr; @@ -483,7 +519,7 @@ strncpy( pass , tok.GetNextToken().c_str(), 256); strncpy( host , tok.GetNextToken().c_str(), 256); - fprintf(stderr, "Registering user %s pass %s host %s\n", + //fprintf(stderr, "Registering user %s pass %s host %s\n", user, pass, host); iaxc_register(user, pass, host); } |
From: <st...@us...> - 2003-06-18 16:39:22
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv23009/simpleclient/wx Modified Files: wx.cc Log Message: Modularize the event callback mechanism to use either PostEvent, or the Immediate processing model with GuiLock that we'd been using. The GuiLock stuff was causing the multiple register windows (on Win32 only), because the menu select event was getting processed over and over, until one of the handlers finally returned, and took it off of the event queue. With PostEvent processing for the callback, this doesn't happen anymore, because the queue isn't getting run from other threads. Also, resolve (with a hack) the hang on exit experienced with windows. Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- wx.cc 17 Jun 2003 23:09:58 -0000 1.32 +++ wx.cc 18 Jun 2003 16:39:18 -0000 1.33 @@ -24,7 +24,6 @@ #define LEVEL_MIN -50 #define DEFAULT_SILENCE_THRESHOLD 1 // positive is "auto" -#define TRY_GUILOCK class IAXClient : public wxApp { @@ -44,7 +43,7 @@ // forward decls for callbacks extern "C" { - int iaxc_callback(iaxc_event e); + static int iaxc_callback(iaxc_event e); int doTestCall(int ac, char **av); } @@ -77,9 +76,8 @@ ID_REGISTER, ID_CALLS = 400, - - CALLBACK_STATUS = 1000, - CALLBACK_LEVELS, + + IAXCLIENT_EVENT = 500, ID_MAX }; @@ -101,7 +99,7 @@ public: IAXCalls(wxWindow *parent, int nCalls); void IAXCalls::OnSelect(wxListEvent &evt); - int IAXCalls::OnStateCallback(struct iaxc_ev_call_state c); + int IAXCalls::HandleStateEvent(struct iaxc_ev_call_state c); inline void IAXCalls::AutoSize() { for(int i=0;i<nCalls;i++) SetColumnWidth(i,wxLIST_AUTOSIZE); @@ -118,10 +116,10 @@ END_EVENT_TABLE() IAXCalls::IAXCalls(wxWindow *parent, int inCalls) - : nCalls(inCalls), - wxListCtrl(parent, ID_CALLS, + : wxListCtrl(parent, ID_CALLS, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL, - wxDefaultValidator, _T("calls")) + wxDefaultValidator, _T("calls")), + nCalls(inCalls) { // initialze IAXCalls control long i; @@ -138,7 +136,7 @@ Hide(); for(i=0;i<nCalls;i++) { - long tmp = InsertItem(i,wxString::Format("%d", i+1), 0); + InsertItem(i,wxString::Format("%ld", i+1), 0); // XXX ??? SetItemData(tmp,i); SetItem(i, 2, _T("No call")); } @@ -146,16 +144,15 @@ AutoSize(); } -int IAXCalls::OnStateCallback(struct iaxc_ev_call_state c) +int IAXCalls::HandleStateEvent(struct iaxc_ev_call_state c) { - if (!wxThread::IsMain()) wxMutexGuiEnter(); fprintf(stderr, "Updating state for item %d state=%x\n", c.callNo, c.state); // first, handle inactive calls if(!(c.state & IAXC_CALL_STATE_ACTIVE)) { - fprintf(stderr, "state for item %d is free\n", c.callNo); + //fprintf(stderr, "state for item %d is free\n", c.callNo); SetItem(c.callNo, 2, _T("No call") ); SetItem(c.callNo, 1, _T("") ); } else { @@ -189,11 +186,10 @@ if((c.state & IAXC_CALL_STATE_SELECTED) && !(GetItemState(c.callNo,wxLIST_STATE_SELECTED|wxLIST_STATE_SELECTED))) { - fprintf(stderr, "setting call %d to selected\n", c.callNo); + //fprintf(stderr, "setting call %d to selected\n", c.callNo); SetItemState(c.callNo,wxLIST_STATE_SELECTED,wxLIST_STATE_SELECTED); } AutoSize(); - if (!wxThread::IsMain()) wxMutexGuiLeave(); return 0; } @@ -221,6 +217,11 @@ void IAXFrame::OnNotify(void); void IAXFrame::OnRegisterMenu(wxCommandEvent &evt); + // Handlers for library-initiated events + void IAXFrame::HandleEvent(wxCommandEvent &evt); + int IAXFrame::HandleIAXEvent(iaxc_event *e); + int IAXFrame::HandleStatusEvent(char *msg); + int IAXFrame::HandleLevelEvent(float input, float output); bool IAXFrame::GetPTTState(); void IAXFrame::CheckPTT(); @@ -238,12 +239,6 @@ bool pttState; // is the PTT button pressed? bool silenceMode; // are we in silence suppression mode? -#ifndef TRY_GUILOCK - // values set by callbacks - int inputLevel; - int outputLevel; - wxString statusString; -#endif protected: DECLARE_EVENT_TABLE() @@ -257,27 +252,6 @@ void IAXFrame::OnNotify() { -#ifndef TRY_GUILOCK - static wxString lastStatus; - static int lastInputLevel = 0; - static int lastOutputLevel = 0; - - if(statusString != lastStatus) { - SetStatusText(statusString); - lastStatus = statusString; - } - - if(lastInputLevel != inputLevel) { - input->SetValue(inputLevel); - lastInputLevel = inputLevel; - } - - if(lastOutputLevel != outputLevel) { - output->SetValue(outputLevel); - lastOutputLevel = outputLevel; - } -#endif - if(pttMode) CheckPTT(); } @@ -297,13 +271,6 @@ wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *row3sizer = new wxBoxSizer(wxHORIZONTAL); pttMode = false; -#ifndef TRY_GUILOCK - inputLevel = 0; - outputLevel = 0; - statusString = _T("Welcome to IAXClient"); -#endif - - /* add status bar first; otherwise, sizer doesn't take it into * account */ @@ -377,6 +344,7 @@ if(wxGetApp().optNumCalls > 1) { int nCalls = wxGetApp().optNumCalls; + // XXX need to fix sizes better. topsizer->Add(calls = new IAXCalls(this, nCalls), 1, wxEXPAND); } @@ -493,6 +461,7 @@ } void IAXFrame::OnRegisterMenu(wxCommandEvent &evt) { + wxTextEntryDialog dialog(this, _T("Register with a remote asterisk server"), _T("Format is user:password@hostname"), @@ -553,6 +522,73 @@ } +int IAXFrame::HandleStatusEvent(char *msg) +{ + theFrame->SetStatusText(msg); + return 1; +} + +int IAXFrame::HandleLevelEvent(float input, float output) +{ + int inputLevel, outputLevel; + + if (input < LEVEL_MIN) + input = LEVEL_MIN; + else if (input > LEVEL_MAX) + input = LEVEL_MAX; + inputLevel = (int)input - (LEVEL_MIN); + + if (output < LEVEL_MIN) + output = LEVEL_MIN; + else if (input > LEVEL_MAX) + output = LEVEL_MAX; + outputLevel = (int)output - (LEVEL_MIN); + + static int lastInputLevel = 0; + static int lastOutputLevel = 0; + + + if(lastInputLevel != inputLevel) { + theFrame->input->SetValue(inputLevel); + lastInputLevel = inputLevel; + } + + if(lastOutputLevel != outputLevel) { + theFrame->output->SetValue(outputLevel); + lastOutputLevel = outputLevel; + } + + return 1; +} + + +int IAXFrame::HandleIAXEvent(iaxc_event *e) +{ + int ret = 0; + switch(e->type) { + case IAXC_EVENT_LEVELS: + ret = HandleLevelEvent(e->ev.levels.input, e->ev.levels.output); + break; + case IAXC_EVENT_TEXT: + ret = HandleStatusEvent(e->ev.text.message); + break; + case IAXC_EVENT_STATE: + ret = theFrame->calls->HandleStateEvent(e->ev.call); + break; + default: + break; // not handled + } + return ret; +} + +void IAXFrame::HandleEvent(wxCommandEvent &evt) +{ + iaxc_event *e = (iaxc_event *)evt.GetClientData(); + //fprintf(stderr, "In HandleEvent\n"); + HandleIAXEvent(e); + free (e); +} + BEGIN_EVENT_TABLE(IAXFrame, wxFrame) EVT_BUTTON(0,IAXFrame::OnDTMF) @@ -570,14 +606,15 @@ EVT_BUTTON(ID_DIAL,IAXFrame::OnDial) EVT_BUTTON(ID_HANG,IAXFrame::OnHangup) - EVT_MENU(ID_QUIT,IAXFrame::OnQuit) EVT_MENU(ID_PTT,IAXFrame::OnPTTChange) EVT_MENU(ID_SILENCE,IAXFrame::OnSilenceChange) EVT_MENU(ID_REGISTER,IAXFrame::OnRegisterMenu) - + EVT_MENU(ID_QUIT,IAXFrame::OnQuit) + EVT_MENU(IAXCLIENT_EVENT, IAXFrame::HandleEvent) END_EVENT_TABLE() + IAXFrame::~IAXFrame() { #ifdef __WXGTK__ @@ -632,7 +669,6 @@ theFrame->Show(TRUE); SetTopWindow(theFrame); - // just one call for now! iaxc_initialize(AUDIO_INTERNAL_PA, wxGetApp().optNumCalls); iaxc_set_encode_format(IAXC_FORMAT_GSM); @@ -665,74 +701,34 @@ * * So, this isn't ideal, but it works, until I can figure out a better way */ - int status_callback(char *msg) - { -#ifdef TRY_GUILOCK - static wxString lastStatus; - if(lastStatus == msg) return 1; + // handle events via posting. +#ifdef USE_GUILOCK + static int iaxc_callback(iaxc_event e) + { + int ret; if (!wxThread::IsMain()) wxMutexGuiEnter(); - theFrame->SetStatusText(msg); - lastStatus = msg; + ret = theFrame->HandleIAXEvent(&e); if (!wxThread::IsMain()) wxMutexGuiLeave(); -#else - theFrame->statusString = wxString(msg); -#endif - return 1; + return ret; } - - int levels_callback(float input, float output) +#else + static int iaxc_callback(iaxc_event e) { - int inputLevel, outputLevel; - - if (input < LEVEL_MIN) - input = LEVEL_MIN; - else if (input > LEVEL_MAX) - input = LEVEL_MAX; - inputLevel = (int)input - (LEVEL_MIN); - - if (output < LEVEL_MIN) - output = LEVEL_MIN; - else if (input > LEVEL_MAX) - output = LEVEL_MAX; - outputLevel = (int)output - (LEVEL_MIN); - -#ifdef TRY_GUILOCK - static int lastInputLevel = 0; - static int lastOutputLevel = 0; + iaxc_event *copy; + wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, IAXCLIENT_EVENT); - if (!wxThread::IsMain()) wxMutexGuiEnter(); + copy = (iaxc_event *)malloc(sizeof(iaxc_event)); + memcpy(copy,&e,sizeof(iaxc_event)); - if(lastInputLevel != inputLevel) { - theFrame->input->SetValue(inputLevel); - lastInputLevel = inputLevel; - } + evt.SetClientData(copy); - if(lastOutputLevel != outputLevel) { - theFrame->output->SetValue(outputLevel); - lastOutputLevel = outputLevel; - } + //fprintf(stderr, "Posting Event\n"); + wxPostEvent(theFrame, evt); - if (!wxThread::IsMain()) wxMutexGuiLeave(); -#else - theFrame->inputLevel = (int)input - (LEVEL_MIN); - theFrame->outputLevel = (int)output - (LEVEL_MIN); -#endif - return 1; + // pretend we handle all events. + return 1; } +#endif - - int iaxc_callback(iaxc_event e) - { - switch(e.type) { - case IAXC_EVENT_LEVELS: - return levels_callback(e.ev.levels.input, e.ev.levels.output); - case IAXC_EVENT_TEXT: - return status_callback(e.ev.text.message); - case IAXC_EVENT_STATE: - return theFrame->calls->OnStateCallback(e.ev.call); - default: - return 0; // not handled - } - } } |
From: <st...@us...> - 2003-06-18 16:39:21
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv23009/lib Modified Files: iaxclient_lib.c Log Message: Modularize the event callback mechanism to use either PostEvent, or the Immediate processing model with GuiLock that we'd been using. The GuiLock stuff was causing the multiple register windows (on Win32 only), because the menu select event was getting processed over and over, until one of the handlers finally returned, and took it off of the event queue. With PostEvent processing for the callback, this doesn't happen anymore, because the queue isn't getting run from other threads. Also, resolve (with a hack) the hang on exit experienced with windows. Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- iaxclient_lib.c 17 Jun 2003 22:53:27 -0000 1.23 +++ iaxclient_lib.c 18 Jun 2003 16:39:18 -0000 1.24 @@ -251,6 +251,7 @@ } void iaxc_shutdown() { + MUTEXLOCK(&iaxc_lock); switch (iAudioType) { case AUDIO_INTERNAL: #ifdef USE_WIN_AUDIO @@ -261,6 +262,7 @@ pa_shutdown_audio(); break; } + MUTEXUNLOCK(&iaxc_lock); MUTEXDESTROY(&iaxc_lock); } @@ -337,9 +339,12 @@ if(procThreadQuitFlag >= 0) { procThreadQuitFlag = 1; - THREADJOIN(procThread); + // It will die eventually on it's own? + // causes deadlock with wx GUI on MSW.. XXX FixME? + //THREADJOIN(procThread); } procThreadQuitFlag = -1; + return 0; } |
From: <st...@us...> - 2003-06-17 23:10:01
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv9762 Modified Files: wx.cc Log Message: show file menu on Mac (for register, but not quit). Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- wx.cc 17 Jun 2003 22:53:28 -0000 1.31 +++ wx.cc 17 Jun 2003 23:09:58 -0000 1.32 @@ -335,9 +335,7 @@ wxMenuBar *menuBar = new wxMenuBar(); -#ifndef __WXMAC__ menuBar->Append(fileMenu, _T("&File")); -#endif menuBar->Append(optionsMenu, _T("&Options")); SetMenuBar(menuBar); |
From: <st...@us...> - 2003-06-17 22:53:31
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv6863/simpleclient/wx Modified Files: wx.cc Log Message: Another big commit: 1) Replace the "RadioBox" control with a ListCntrl control, for the call list. This has expandable columns, and displays each data type in it's own column. 2) Some locking for the library: try to prevent us from doing the processing loop while moving the calls around from the front-end. 3) REGISTRATION, and better incoming call support. Incoming calls now are not auto-answered, but are answered when you select them. You can register with an IAX server (tested for IAX1 only so far). Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- wx.cc 17 Jun 2003 02:08:57 -0000 1.30 +++ wx.cc 17 Jun 2003 22:53:28 -0000 1.31 @@ -6,6 +6,8 @@ #endif #include "wx/cmdline.h" +#include "wx/listctrl.h" +#include "wx/tokenzr.h" #include "iaxclient.h" @@ -72,8 +74,9 @@ ID_PTT = 300, ID_MUTE, ID_SILENCE, + ID_REGISTER, - ID_CALLBOX = 400, + ID_CALLS = 400, CALLBACK_STATUS = 1000, CALLBACK_LEVELS, @@ -93,6 +96,115 @@ }; +class IAXCalls : public wxListCtrl +{ + public: + IAXCalls(wxWindow *parent, int nCalls); + void IAXCalls::OnSelect(wxListEvent &evt); + int IAXCalls::OnStateCallback(struct iaxc_ev_call_state c); + inline void IAXCalls::AutoSize() { + for(int i=0;i<nCalls;i++) + SetColumnWidth(i,wxLIST_AUTOSIZE); + } + + int nCalls; + +protected: + DECLARE_EVENT_TABLE() +}; + +BEGIN_EVENT_TABLE(IAXCalls, wxListCtrl) + EVT_LIST_ITEM_SELECTED(ID_CALLS, IAXCalls::OnSelect) +END_EVENT_TABLE() + +IAXCalls::IAXCalls(wxWindow *parent, int inCalls) + : nCalls(inCalls), + wxListCtrl(parent, ID_CALLS, + wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL, + wxDefaultValidator, _T("calls")) +{ + // initialze IAXCalls control + long i; + + wxListItem item; + item.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_IMAGE; + item.m_image = -1; + item.m_text = _T("Call"); + InsertColumn(0, item); + item.m_text = _T("State"); + InsertColumn(1, item); + item.m_text = _T("Remote"); + InsertColumn(2, item); + + Hide(); + for(i=0;i<nCalls;i++) { + long tmp = InsertItem(i,wxString::Format("%d", i+1), 0); + // XXX ??? SetItemData(tmp,i); + SetItem(i, 2, _T("No call")); + } + Show(); + AutoSize(); +} + +int IAXCalls::OnStateCallback(struct iaxc_ev_call_state c) +{ + if (!wxThread::IsMain()) wxMutexGuiEnter(); + + fprintf(stderr, "Updating state for item %d state=%x\n", c.callNo, c.state); + + + // first, handle inactive calls + if(!(c.state & IAXC_CALL_STATE_ACTIVE)) { + fprintf(stderr, "state for item %d is free\n", c.callNo); + SetItem(c.callNo, 2, _T("No call") ); + SetItem(c.callNo, 1, _T("") ); + } else { + // set remote + SetItem(c.callNo, 2, c.remote ); + + bool outgoing = c.state & IAXC_CALL_STATE_OUTGOING; + bool ringing = c.state & IAXC_CALL_STATE_RINGING; + bool complete = c.state & IAXC_CALL_STATE_COMPLETE; + + if(outgoing) { + if(ringing) + SetItem(c.callNo, 1, _T("r") ); + else if(complete) + SetItem(c.callNo, 1, _T("o") ); + else // not accepted yet.. + SetItem(c.callNo, 1, _T("c") ); + } else { + if(ringing) + SetItem(c.callNo, 1, _T("R") ); + else if(complete) + SetItem(c.callNo, 1, _T("I") ); + else // not accepted yet.. shouldn't happen! + SetItem(c.callNo, 1, _T("C") ); + } + // XXX do something more noticable if it's incoming, ringing! + } + + + // select if necessary + if((c.state & IAXC_CALL_STATE_SELECTED) && + !(GetItemState(c.callNo,wxLIST_STATE_SELECTED|wxLIST_STATE_SELECTED))) + { + fprintf(stderr, "setting call %d to selected\n", c.callNo); + SetItemState(c.callNo,wxLIST_STATE_SELECTED,wxLIST_STATE_SELECTED); + } + AutoSize(); + if (!wxThread::IsMain()) wxMutexGuiLeave(); + + return 0; +} + +void IAXCalls::OnSelect(wxListEvent &evt) { + int selected = evt.m_itemIndex; //GetSelection(); + fprintf(stderr, "User Selected item %d\n", selected); + iaxc_select_call(selected); +} + + class IAXFrame : public wxFrame { public: @@ -106,8 +218,8 @@ void IAXFrame::OnQuit(wxEvent &evt); void IAXFrame::OnPTTChange(wxCommandEvent &evt); void IAXFrame::OnSilenceChange(wxCommandEvent &evt); - void IAXFrame::OnCallBoxSelect(wxCommandEvent &evt); void IAXFrame::OnNotify(void); + void IAXFrame::OnRegisterMenu(wxCommandEvent &evt); bool IAXFrame::GetPTTState(); @@ -120,7 +232,7 @@ wxTextCtrl *iaxDest; wxStaticText *muteState; - wxRadioBox *callBox; + IAXCalls *calls; bool pttMode; // are we in PTT mode? bool pttState; // is the PTT button pressed? @@ -202,9 +314,18 @@ /* NOTE: Mac doesn't use a File/Exit item, and Application/Quit is automatically added for us */ -#ifndef __WXMAC__ wxMenu *fileMenu = new wxMenu(); + fileMenu->Append(ID_REGISTER, _T("&Register\tCtrl-R")); + +// Mac: no quit item (it goes in app menu) +// Win: "exit" item. +// Linux and others: Quit. +#if !defined(__WXMAC__) +#if defined(__WXMSW__) fileMenu->Append(ID_QUIT, _T("E&xit\tCtrl-X")); +#else + fileMenu->Append(ID_QUIT, _T("&Quit\tCtrl-Q")); +#endif #endif wxMenu *optionsMenu = new wxMenu(); @@ -256,22 +377,12 @@ // Add call appearances if(wxGetApp().optNumCalls > 1) { - int i; int nCalls = wxGetApp().optNumCalls; - wxString *labels = new wxString[nCalls]; - for(i=0;i<nCalls;i++) - labels[i] = wxString::Format("%d: No Call", i); - - callBox = new wxRadioBox(aPanel, ID_CALLBOX, _T("Calls"), - wxDefaultPosition, wxDefaultSize, - nCalls, labels, - 1, wxRA_SPECIFY_COLS); - - topsizer->Add(callBox, 0, wxEXPAND); - + topsizer->Add(calls = new IAXCalls(this, nCalls), 1, wxEXPAND); } + /* Destination */ topsizer->Add(iaxDest = new wxTextCtrl(aPanel, -1, _T("guest@ast1/8068"), wxDefaultPosition, wxDefaultSize),0,wxEXPAND); @@ -383,6 +494,34 @@ exit(0); } +void IAXFrame::OnRegisterMenu(wxCommandEvent &evt) { + wxTextEntryDialog dialog(this, + _T("Register with a remote asterisk server"), + _T("Format is user:password@hostname"), + _T("iaxuser:iaxpass@ast1"), + wxOK | wxCANCEL); + + if(dialog.ShowModal() == wxID_OK) + { + wxString value = dialog.GetValue(); + wxStringTokenizer tok(value, _T(":@")); + char user[256], pass[256], host[256]; + + if(tok.CountTokens() != 3) { + theFrame->SetStatusText("error in registration format"); + return; + } + + strncpy( user , tok.GetNextToken().c_str(), 256); + strncpy( pass , tok.GetNextToken().c_str(), 256); + strncpy( host , tok.GetNextToken().c_str(), 256); + + fprintf(stderr, "Registering user %s pass %s host %s\n", + user, pass, host); + iaxc_register(user, pass, host); + } +} + void IAXFrame::OnPTTChange(wxCommandEvent &evt) { pttMode = evt.IsChecked(); @@ -415,10 +554,6 @@ } } -void IAXFrame::OnCallBoxSelect(wxCommandEvent &evt) { - int selected = evt.GetSelection(); - iaxc_select_call(selected); -} BEGIN_EVENT_TABLE(IAXFrame, wxFrame) @@ -440,8 +575,8 @@ EVT_MENU(ID_QUIT,IAXFrame::OnQuit) EVT_MENU(ID_PTT,IAXFrame::OnPTTChange) EVT_MENU(ID_SILENCE,IAXFrame::OnSilenceChange) + EVT_MENU(ID_REGISTER,IAXFrame::OnRegisterMenu) - EVT_RADIOBOX(ID_CALLBOX, IAXFrame::OnCallBoxSelect) END_EVENT_TABLE() @@ -588,47 +723,6 @@ return 1; } - int state_callback(struct iaxc_ev_call_state c) - { - wxString label; - - label += wxString::Format("%d: ", c.callNo); - - if(!(c.state & IAXC_CALL_STATE_ACTIVE)) { - label += _T("No Call"); - } else { - if(c.state & IAXC_CALL_STATE_COMPLETE) - if(c.state & IAXC_CALL_STATE_OUTGOING) - label += _T("O"); - else - label += _T("I"); - else - if(c.state & IAXC_CALL_STATE_OUTGOING) - label += _T("o"); - else - label += _T("i"); - - label += wxString::Format(" %s", c.remote); - } - - if (!wxThread::IsMain()) wxMutexGuiEnter(); -#if 0 -#ifdef __WXMSW__ - // XXX figure out why MSW has this problem figuring out which method - // to call... - theFrame->callBox->wxRadioBoxBase::SetLabel(c.callNo, label); -#else - theFrame->callBox->SetLabel(c.callNo, label); -#endif -#endif - theFrame->callBox->SetString(c.callNo, label); - if((c.state & IAXC_CALL_STATE_SELECTED) && - (theFrame->callBox->GetSelection() != c.callNo)) - theFrame->callBox->SetSelection(c.callNo); - if (!wxThread::IsMain()) wxMutexGuiLeave(); - - return 0; - } int iaxc_callback(iaxc_event e) { @@ -638,7 +732,7 @@ case IAXC_EVENT_TEXT: return status_callback(e.ev.text.message); case IAXC_EVENT_STATE: - return state_callback(e.ev.call); + return theFrame->calls->OnStateCallback(e.ev.call); default: return 0; // not handled } |
From: <st...@us...> - 2003-06-17 22:53:31
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv6863/lib Modified Files: iaxclient.h iaxclient_lib.c iaxclient_lib.h Log Message: Another big commit: 1) Replace the "RadioBox" control with a ListCntrl control, for the call list. This has expandable columns, and displays each data type in it's own column. 2) Some locking for the library: try to prevent us from doing the processing loop while moving the calls around from the front-end. 3) REGISTRATION, and better incoming call support. Incoming calls now are not auto-answered, but are answered when you select them. You can register with an IAX server (tested for IAX1 only so far). Index: iaxclient.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- iaxclient.h 16 Jun 2003 23:01:29 -0000 1.12 +++ iaxclient.h 17 Jun 2003 22:53:27 -0000 1.13 @@ -50,8 +50,9 @@ #define IAXC_CALL_STATE_FREE 0 #define IAXC_CALL_STATE_ACTIVE (1<<1) #define IAXC_CALL_STATE_OUTGOING (1<<2) -#define IAXC_CALL_STATE_COMPLETE (1<<3) -#define IAXC_CALL_STATE_SELECTED (1<<4) +#define IAXC_CALL_STATE_RINGING (1<<3) +#define IAXC_CALL_STATE_COMPLETE (1<<4) +#define IAXC_CALL_STATE_SELECTED (1<<5) #define IAXC_TEXT_TYPE_STATUS 1 #define IAXC_TEXT_TYPE_NOTICE 2 @@ -97,6 +98,7 @@ int iaxc_start_processing_thread(); int iaxc_stop_processing_thread(); void iaxc_call(char *num); +void iaxc_register(char *user, char *pass, char *host); void iaxc_answer_call(int callNo); void iaxc_dump_call(void); void iaxc_reject_call(void); Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- iaxclient_lib.c 17 Jun 2003 02:06:42 -0000 1.22 +++ iaxclient_lib.c 17 Jun 2003 22:53:27 -0000 1.23 @@ -6,10 +6,25 @@ #include <varargs.h> #endif +struct iaxc_registration { + struct iax_session *session; + int firstpass; + struct timeval last; + char host[256]; + char user[256]; + char pass[256]; + long refresh; + struct iaxc_registration *next; +}; + +struct iaxc_registration *registrations = NULL; + static int iAudioType; static int iEncodeType; +MUTEX iaxc_lock; + int netfd; int port; int c, i; @@ -23,7 +38,6 @@ struct timeval lastouttm; -static struct iaxc_call * find_call(struct iax_session *session); static void do_iax_event(); static THREAD procThread; @@ -162,15 +176,26 @@ } if(selected_call >= 0) { - calls[selected_call].state &= ~IAXC_CALL_STATE_SELECTED; - iaxc_do_state_callback(selected_call); + calls[selected_call].state &= ~IAXC_CALL_STATE_SELECTED; + iaxc_do_state_callback(selected_call); } - calls[callNo].state |= IAXC_CALL_STATE_SELECTED; - selected_call = callNo; - iaxc_do_state_callback(selected_call); + if(callNo >= 0) { + calls[callNo].state |= IAXC_CALL_STATE_SELECTED; + + + // if it's an incoming call, and ringing, answer it. + if( !(calls[selected_call].state & IAXC_CALL_STATE_OUTGOING) && + (calls[selected_call].state & IAXC_CALL_STATE_RINGING)) { + iaxc_answer_call(selected_call); + } else { + // otherwise just update state (answer does this for us) + iaxc_do_state_callback(selected_call); + } + // should do callback to say all are unselected... + } } /* external API accessor */ @@ -187,6 +212,8 @@ * Win32, etc) */ os_init(); + MUTEXINIT(&iaxc_lock); + if ( (port = iax_init(0) < 0)) { iaxc_usermsg(IAXC_ERROR, "Fatal error: failed to initialize iax with port %d", port); return -1; @@ -234,6 +261,7 @@ pa_shutdown_audio(); break; } + MUTEXDESTROY(&iaxc_lock); } @@ -243,16 +271,43 @@ iax_set_formats(fmt); } +void iaxc_refresh_registrations() { + struct iaxc_registration *cur; + struct timeval now; + + gettimeofday(&now,NULL); + + for(cur = registrations; cur != NULL; cur=cur->next) { + if(iaxc_usecdiff(&now, &cur->last) > cur->refresh ) { + fprintf(stderr, "refreshing registration %s:%s@%s\n", + cur->host, cur->user, cur->pass, 300); + + cur->session = iax_session_new(); + if(!cur->session) { + iaxc_usermsg(IAXC_ERROR, "Can't make new registration session"); + return; + } + + iax_register(cur->session, cur->host, cur->user, cur->pass, 300); + cur->last = now; + } + } +} + void iaxc_process_calls(void) { #ifdef USE_WIN_AUDIO - win_flush_audio_output_buffers(); - if (iAudioType == AUDIO_INTERNAL) { - win_prepare_audio_buffers(); - } + win_flush_audio_output_buffers(); + if (iAudioType == AUDIO_INTERNAL) { + win_prepare_audio_buffers(); + } #endif - iaxc_service_network(netfd); - service_audio(); + MUTEXLOCK(&iaxc_lock); + iaxc_service_network(netfd); + service_audio(); + iaxc_refresh_registrations(); + + MUTEXUNLOCK(&iaxc_lock); } THREADFUNCDECL(iaxc_processor) @@ -395,13 +450,18 @@ iaxc_clear_call(callNo); break; case IAX_EVENT_ACCEPT: - calls[callNo].state |= IAXC_CALL_STATE_COMPLETE; + calls[callNo].state |= IAXC_CALL_STATE_RINGING; iaxc_do_state_callback(callNo); iaxc_usermsg(IAXC_STATUS,"Call %d ringing", callNo); // issue_prompt(f); break; case IAX_EVENT_ANSWER: - iaxc_answer_call(callNo); + calls[callNo].state &= ~IAXC_CALL_STATE_RINGING; + calls[callNo].state |= IAXC_CALL_STATE_COMPLETE; + iaxc_do_state_callback(callNo); + iaxc_usermsg(IAXC_STATUS,"Call %d answered", callNo); + //iaxc_answer_call(callNo); + // notify the user? break; case IAX_EVENT_VOICE: handle_audio_event(e, callNo); @@ -414,6 +474,39 @@ } } +void iaxc_register(char *user, char *pass, char *host) +{ + struct iaxc_registration *newreg; + + newreg = malloc(sizeof (struct iaxc_registration)); + if(!newreg) { + iaxc_usermsg(IAXC_ERROR, "Can't make new registration"); + return; + } + + newreg->session = iax_session_new(); + if(!newreg->session) { + iaxc_usermsg(IAXC_ERROR, "Can't make new registration session"); + return; + } + + gettimeofday(&newreg->last,NULL); + newreg->refresh = 60*1000*1000; // 60 seconds, in usecs + + strncpy(newreg->host, host, 256); + strncpy(newreg->user, user, 256); + strncpy(newreg->pass, pass, 256); + + // so we notify the user. + newreg->firstpass = 1; + + // send out the initial registration timeout 300 seconds + iax_register(newreg->session, host, user, pass, 300); + + // add it to the list; + newreg->next = registrations; + registrations = newreg; +} void iaxc_call(char *num) { @@ -454,34 +547,42 @@ void iaxc_answer_call(int callNo) { - iax_answer(calls[selected_call].session); + fprintf(stderr, "iaxc answering call %d\n", callNo); + calls[callNo].state |= IAXC_CALL_STATE_COMPLETE; + calls[callNo].state &= ~IAXC_CALL_STATE_RINGING; + iax_answer(calls[callNo].session); + iaxc_do_state_callback(callNo); } void iaxc_dump_call(void) { int toDump = selected_call; - if(toDump < 0) - { - iaxc_usermsg(IAXC_ERROR, "Error: tried to dump but no call selected"); - return; + MUTEXLOCK(&iaxc_lock); + if(toDump < 0) { + iaxc_usermsg(IAXC_ERROR, "Error: tried to dump but no call selected"); + } else { + iax_hangup(calls[selected_call].session,"Dumped Call"); + iaxc_usermsg(IAXC_STATUS, "Hanging up call %d", toDump); + iaxc_clear_call(toDump); } - - iax_hangup(calls[selected_call].session,"Dumped Call"); - iaxc_usermsg(IAXC_STATUS, "Hanging up call %d", toDump); - iaxc_clear_call(toDump); + MUTEXUNLOCK(&iaxc_lock); } void iaxc_reject_call(void) { + MUTEXLOCK(&iaxc_lock); // XXX should take callNo? iax_reject(calls[selected_call].session, "Call rejected manually."); iaxc_clear_call(selected_call); + MUTEXUNLOCK(&iaxc_lock); } void iaxc_send_dtmf(char digit) { + MUTEXLOCK(&iaxc_lock); if(selected_call >= 0) iax_send_dtmf(calls[selected_call].session,digit); + MUTEXUNLOCK(&iaxc_lock); } static int iaxc_find_call_by_session(struct iax_session *session) @@ -520,19 +621,69 @@ do_iax_event(); /* do pending event if any */ } +static void iaxc_handle_regreply(struct iax_event *e) { + struct iaxc_registration *cur; + // find the registration session + + for(cur = registrations; cur != NULL; cur=cur->next) + if(cur->session == e->session) break; + + if(!cur) { + iaxc_usermsg(IAXC_ERROR, "Unexpected registration reply"); + return; + } + + if(cur->firstpass) { + cur->firstpass = 0; + +#ifdef IAXC_IAX2 + if(e->etype == IAX_EVENT_REGACK ) { + iaxc_usermsg(IAXC_STATUS, "Registration accepted"); + } else if(e->etype == IAX_EVENT_REGREJ ) { + iaxc_usermsg(IAXC_STATUS, "Registration rejected"); + } +#else // IAX1 + + if(e->event.regreply.status == IAX_REG_SUCCESS) + iaxc_usermsg(IAXC_STATUS, "Registration accepted"); + else if(e->event.regreply.status == IAX_REG_REJECT) + iaxc_usermsg(IAXC_STATUS, "Registration rejected"); + // XXX should remove from registrations list? + else if(e->event.regreply.status == IAX_REG_TIMEOUT) + iaxc_usermsg(IAXC_STATUS, "Registration timed out"); + else + iaxc_usermsg(IAXC_ERROR, "Unknown registration event"); +#endif + } + + // XXX I think the session is no longer valid.. at least, that's + // what miniphone does, and re-using the session doesn't seem to + // work! + cur->session = NULL; +} + + static void do_iax_event() { struct iax_event *e = 0; int callNo; + struct iax_session *session; while ( (e = iax_get_event(0))) { + // first, see if this is an event for one of our calls. callNo = iaxc_find_call_by_session(e->session); if(callNo >= 0) { iaxc_handle_network_event(e, callNo); - iax_event_free(e); - } else { - if(e->etype != IAX_EVENT_CONNECT) { - iaxc_usermsg(IAXC_STATUS, "Huh? This is an event for a non-existant session?"); - } + } else if +#ifndef IAXC_IAX2 + ( e->etype == IAX_EVENT_REGREP ) +#else + ((e->etype == IAX_EVENT_REGACK ) || (e->etype == IAX_EVENT_REGREJ )) +#endif + { + iaxc_handle_regreply(e); + } else if(e->etype == IAX_EVENT_REGREQ ) { + iaxc_usermsg(IAXC_ERROR, "Registration requested by someone, but we don't understand!"); + } else if(e->etype == IAX_EVENT_CONNECT) { callNo = iaxc_next_free_call(); @@ -540,6 +691,7 @@ iaxc_usermsg(IAXC_STATUS, "Incoming Call, but no appearances"); // XXX Reject this call!, or just ignore? iax_reject(e->session, "Too many calls, we're busy!"); + goto bail; } #ifndef IAXC_IAX2 @@ -576,7 +728,7 @@ calls[callNo].gsmin = 0; calls[callNo].gsmout = 0; calls[callNo].session = e->session; - calls[callNo].state = IAXC_CALL_STATE_ACTIVE; + calls[callNo].state = IAXC_CALL_STATE_ACTIVE|IAXC_CALL_STATE_RINGING; // should we even accept? or, we accept, but @@ -584,11 +736,15 @@ iax_accept(calls[callNo].session); iax_ring_announce(calls[callNo].session); - // should we select this call? - iaxc_select_call(callNo); + iaxc_do_state_callback(callNo); + iaxc_usermsg(IAXC_STATUS, "Incoming call on line %d", callNo); - iax_event_free(e); + + } else { + iaxc_usermsg(IAXC_STATUS, "Event (type %d) for a non-existant session. Dropping", e->etype); } +bail: + iax_event_free(e); } } Index: iaxclient_lib.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- iaxclient_lib.h 16 Jun 2003 23:01:29 -0000 1.16 +++ iaxclient_lib.h 17 Jun 2003 22:53:28 -0000 1.17 @@ -112,6 +112,7 @@ extern double iaxc_silence_threshold; extern int iaxc_audio_output_mode; extern iaxc_event_callback_t iaxc_event_callback; +extern MUTEX iaxc_lock; /* external audio functions */ void iaxc_external_service_audio(); |
From: <st...@us...> - 2003-06-17 02:09:00
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv9954 Modified Files: wx.cc Log Message: make the call are _not_ grow in height (not really useful). Still need to make it actually take the full width when it starts. Might need to use a different set of widgets here; the radiobox (a group of radio buttons) doesn't seem to work all that well, and besides, we want more than a radio button and a text label. Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- wx.cc 16 Jun 2003 23:12:28 -0000 1.29 +++ wx.cc 17 Jun 2003 02:08:57 -0000 1.30 @@ -268,7 +268,7 @@ nCalls, labels, 1, wxRA_SPECIFY_COLS); - topsizer->Add(callBox, 1, wxEXPAND); + topsizer->Add(callBox, 0, wxEXPAND); } |
From: <st...@us...> - 2003-06-17 02:06:45
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv9885/lib Modified Files: iaxclient_lib.c Log Message: possibly get correct call information with IAX2. not well tested.. Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- iaxclient_lib.c 16 Jun 2003 23:22:25 -0000 1.21 +++ iaxclient_lib.c 17 Jun 2003 02:06:42 -0000 1.22 @@ -557,7 +557,19 @@ strncpy(calls[callNo].remote, "unknown", IAXC_EVENT_BUFSIZ); #else - // XXX TODO + if(e->ies.called_number) + strncpy(calls[callNo].local,e->ies.called_number, + IAXC_EVENT_BUFSIZ); + else + strncpy(calls[callNo].local,"unknown", + IAXC_EVENT_BUFSIZ); + + if(e->ies.calling_number) + strncpy(calls[callNo].remote, + e->ies.calling_number, IAXC_EVENT_BUFSIZ); + else + strncpy(calls[callNo].remote, + "unknown", IAXC_EVENT_BUFSIZ); #endif iaxc_usermsg(IAXC_STATUS, "Call from (%s)", calls[callNo].remote); |
From: <st...@us...> - 2003-06-16 23:39:44
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv26222 Modified Files: TODO Log Message: some todo items are now done. Index: TODO =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/TODO,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TODO 16 Jun 2003 16:10:14 -0000 1.1 +++ TODO 16 Jun 2003 23:39:41 -0000 1.2 @@ -34,7 +34,22 @@ really robust enough for our needs once we do this stuff. -2) Call handling: + +2) Codecs: (I think that someone is working on this) + + Currently, the library assumes that all calls will be GSM only, + and further assumes that all frames will be 20ms. It can + control the frame size (within reason) for frames it sends out, + but should deal gracefully with incoming frames that aren't + 20ms. + + Codecs should probably be implemented via a similar set of + structure abstractions as audio drivers, above. They also need + to handle incoming packets which may switch formats abruptly(?). + +DONE (or, at least, mostly done): +============================================================== +Call handling currently, the library really only supports one call, and not very well. It should have a collection of calls (either an array, or a linked list), and keep track of the current state of @@ -62,19 +77,7 @@ testcall would just ask for a single call, so it wouldn't have to worry about a lot of this. -3) Codecs: (I think that someone is working on this) - - Currently, the library assumes that all calls will be GSM only, - and further assumes that all frames will be 20ms. It can - control the frame size (within reason) for frames it sends out, - but should deal gracefully with incoming frames that aren't - 20ms. - - Codecs should probably be implemented via a similar set of - structure abstractions as audio drivers, above. They also need - to handle incoming packets which may switch formats abruptly(?). - -4) Events: +Events: We might want to consolidate the (currently three) callbacks that the library makes to clients, into a single callback, that passes back a structure with event info. I was thinking of a |
From: <st...@us...> - 2003-06-16 23:22:28
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv23988 Modified Files: iaxclient_lib.c Log Message: ensure we don't send state updates for out of range calls (like -1) Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- iaxclient_lib.c 16 Jun 2003 23:01:29 -0000 1.20 +++ iaxclient_lib.c 16 Jun 2003 23:22:25 -0000 1.21 @@ -121,6 +121,7 @@ void iaxc_do_state_callback(int callNo) { iaxc_event e; + if(callNo < 0 || callNo >= nCalls) return; e.type = IAXC_EVENT_STATE; e.ev.call.callNo = callNo; e.ev.call.state = calls[callNo].state; |
From: <st...@us...> - 2003-06-16 23:12:31
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv22737 Modified Files: wx.cc Log Message: Wxwindows 2.4.0 (but undocumented?) SetLabel is now SetString.. Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- wx.cc 16 Jun 2003 23:01:29 -0000 1.28 +++ wx.cc 16 Jun 2003 23:12:28 -0000 1.29 @@ -612,6 +612,7 @@ } if (!wxThread::IsMain()) wxMutexGuiEnter(); +#if 0 #ifdef __WXMSW__ // XXX figure out why MSW has this problem figuring out which method // to call... @@ -619,6 +620,8 @@ #else theFrame->callBox->SetLabel(c.callNo, label); #endif +#endif + theFrame->callBox->SetString(c.callNo, label); if((c.state & IAXC_CALL_STATE_SELECTED) && (theFrame->callBox->GetSelection() != c.callNo)) theFrame->callBox->SetSelection(c.callNo); |
From: <st...@us...> - 2003-06-16 23:01:32
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv20862/simpleclient/wx Modified Files: wx.cc Log Message: A pretty big commit. 1) Change the overall "event" callback mechanism, to use a structure/union, with just one callback for all events. clients can accept or decline each event, in which case the library might take a "default" action for the event. (currently, the library will ignore all events except for text, which it will print to stderr/stdout). 2) Totally rework call handling, and allow the library to manage multiple calls. Call state is more or less followed through the lifetime of the call, but may not be right in all cases. 3) Implement call appearances based on all of this in wx. 4) Make testcall work with this (only one call). 5) Try to keep Faizan's "WinIAX" client up to date with the API changes, haven't tested the changes there, but they should work for one call. 6) #define out the WIN AUDIO stuff, it's pretty far behind now, and would need some work to get going. portaudio seems to handle the gory details for us very nicely. Need to do more testing with all of this, but this now allows you to make IAXClient -> IAXClient calls. Of course, allowing people to reject calls would be nice too, but I suppose you can always hang up :) Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- wx.cc 12 Jun 2003 22:47:01 -0000 1.27 +++ wx.cc 16 Jun 2003 23:01:29 -0000 1.28 @@ -33,6 +33,7 @@ bool optNoDialPad; wxString optDestination; + long optNumCalls; }; DECLARE_APP(IAXClient) @@ -41,8 +42,7 @@ // forward decls for callbacks extern "C" { - void status_callback(char *msg); - int levels_callback(float input, float output); + int iaxc_callback(iaxc_event e); int doTestCall(int ac, char **av); } @@ -73,6 +73,8 @@ ID_MUTE, ID_SILENCE, + ID_CALLBOX = 400, + CALLBACK_STATUS = 1000, CALLBACK_LEVELS, @@ -91,7 +93,6 @@ }; - class IAXFrame : public wxFrame { public: @@ -105,8 +106,10 @@ void IAXFrame::OnQuit(wxEvent &evt); void IAXFrame::OnPTTChange(wxCommandEvent &evt); void IAXFrame::OnSilenceChange(wxCommandEvent &evt); + void IAXFrame::OnCallBoxSelect(wxCommandEvent &evt); void IAXFrame::OnNotify(void); + bool IAXFrame::GetPTTState(); void IAXFrame::CheckPTT(); void IAXFrame::SetPTT(bool state); @@ -117,6 +120,8 @@ wxTextCtrl *iaxDest; wxStaticText *muteState; + wxRadioBox *callBox; + bool pttMode; // are we in PTT mode? bool pttState; // is the PTT button pressed? bool silenceMode; // are we in silence suppression mode? @@ -249,6 +254,24 @@ topsizer->Add(row1sizer,1,wxEXPAND); + // Add call appearances + if(wxGetApp().optNumCalls > 1) { + int i; + int nCalls = wxGetApp().optNumCalls; + wxString *labels = new wxString[nCalls]; + + for(i=0;i<nCalls;i++) + labels[i] = wxString::Format("%d: No Call", i); + + callBox = new wxRadioBox(aPanel, ID_CALLBOX, _T("Calls"), + wxDefaultPosition, wxDefaultSize, + nCalls, labels, + 1, wxRA_SPECIFY_COLS); + + topsizer->Add(callBox, 1, wxEXPAND); + + } + /* Destination */ topsizer->Add(iaxDest = new wxTextCtrl(aPanel, -1, _T("guest@ast1/8068"), wxDefaultPosition, wxDefaultSize),0,wxEXPAND); @@ -392,6 +415,12 @@ } } +void IAXFrame::OnCallBoxSelect(wxCommandEvent &evt) { + int selected = evt.GetSelection(); + iaxc_select_call(selected); +} + + BEGIN_EVENT_TABLE(IAXFrame, wxFrame) EVT_BUTTON(0,IAXFrame::OnDTMF) EVT_BUTTON(1,IAXFrame::OnDTMF) @@ -411,6 +440,8 @@ EVT_MENU(ID_QUIT,IAXFrame::OnQuit) EVT_MENU(ID_PTT,IAXFrame::OnPTTChange) EVT_MENU(ID_SILENCE,IAXFrame::OnSilenceChange) + + EVT_RADIOBOX(ID_CALLBOX, IAXFrame::OnCallBoxSelect) END_EVENT_TABLE() @@ -431,6 +462,8 @@ { // declare our CmdLine options and stuff. p.AddSwitch(_T("d"),_T("disable-dialpad"),_T("Disable Dial Pad")); + p.AddOption(_T("n"),_T("calls"),_T("number of call appearances"), + wxCMD_LINE_VAL_NUMBER,wxCMD_LINE_PARAM_OPTIONAL); p.AddParam(_T("destination"),wxCMD_LINE_VAL_STRING,wxCMD_LINE_PARAM_OPTIONAL); } @@ -441,6 +474,9 @@ optNoDialPad = true; //fprintf(stderr, "-d option found\n"); } + if(p.Found(_T("n"), &optNumCalls)) { + //fprintf(stderr, "got nCalls (%d)", optNumCalls); + } if(p.GetParamCount() >= 1) { optDestination=p.GetParam(0); //fprintf(stderr, "dest is %s\n", optDestination.c_str()); @@ -452,6 +488,7 @@ bool IAXClient::OnInit() { optNoDialPad = false; + optNumCalls = 4; if(!wxApp::OnInit()) return false; @@ -461,14 +498,13 @@ theFrame->Show(TRUE); SetTopWindow(theFrame); - - iaxc_initialize(AUDIO_INTERNAL_PA); + + // just one call for now! + iaxc_initialize(AUDIO_INTERNAL_PA, wxGetApp().optNumCalls); iaxc_set_encode_format(IAXC_FORMAT_GSM); iaxc_set_silence_threshold(-99); - iaxc_set_levels_callback(levels_callback); - iaxc_set_error_callback(status_callback); - iaxc_set_status_callback(status_callback); + iaxc_set_event_callback(iaxc_callback); iaxc_start_processing_thread(); @@ -496,11 +532,11 @@ * * So, this isn't ideal, but it works, until I can figure out a better way */ - void status_callback(char *msg) + int status_callback(char *msg) { #ifdef TRY_GUILOCK static wxString lastStatus; - if(lastStatus == msg) return; + if(lastStatus == msg) return 1; if (!wxThread::IsMain()) wxMutexGuiEnter(); theFrame->SetStatusText(msg); @@ -509,7 +545,7 @@ #else theFrame->statusString = wxString(msg); #endif - + return 1; } int levels_callback(float input, float output) @@ -549,6 +585,59 @@ theFrame->inputLevel = (int)input - (LEVEL_MIN); theFrame->outputLevel = (int)output - (LEVEL_MIN); #endif - return 0; + return 1; + } + + int state_callback(struct iaxc_ev_call_state c) + { + wxString label; + + label += wxString::Format("%d: ", c.callNo); + + if(!(c.state & IAXC_CALL_STATE_ACTIVE)) { + label += _T("No Call"); + } else { + if(c.state & IAXC_CALL_STATE_COMPLETE) + if(c.state & IAXC_CALL_STATE_OUTGOING) + label += _T("O"); + else + label += _T("I"); + else + if(c.state & IAXC_CALL_STATE_OUTGOING) + label += _T("o"); + else + label += _T("i"); + + label += wxString::Format(" %s", c.remote); + } + + if (!wxThread::IsMain()) wxMutexGuiEnter(); +#ifdef __WXMSW__ + // XXX figure out why MSW has this problem figuring out which method + // to call... + theFrame->callBox->wxRadioBoxBase::SetLabel(c.callNo, label); +#else + theFrame->callBox->SetLabel(c.callNo, label); +#endif + if((c.state & IAXC_CALL_STATE_SELECTED) && + (theFrame->callBox->GetSelection() != c.callNo)) + theFrame->callBox->SetSelection(c.callNo); + if (!wxThread::IsMain()) wxMutexGuiLeave(); + + return 0; + } + + int iaxc_callback(iaxc_event e) + { + switch(e.type) { + case IAXC_EVENT_LEVELS: + return levels_callback(e.ev.levels.input, e.ev.levels.output); + case IAXC_EVENT_TEXT: + return status_callback(e.ev.text.message); + case IAXC_EVENT_STATE: + return state_callback(e.ev.call); + default: + return 0; // not handled + } } } |
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv20862/lib Modified Files: Makefile audio_encode.c audio_encode.h audio_portaudio.c audio_portaudio.h iaxclient.h iaxclient_lib.c iaxclient_lib.h Log Message: A pretty big commit. 1) Change the overall "event" callback mechanism, to use a structure/union, with just one callback for all events. clients can accept or decline each event, in which case the library might take a "default" action for the event. (currently, the library will ignore all events except for text, which it will print to stderr/stdout). 2) Totally rework call handling, and allow the library to manage multiple calls. Call state is more or less followed through the lifetime of the call, but may not be right in all cases. 3) Implement call appearances based on all of this in wx. 4) Make testcall work with this (only one call). 5) Try to keep Faizan's "WinIAX" client up to date with the API changes, haven't tested the changes there, but they should work for one call. 6) #define out the WIN AUDIO stuff, it's pretty far behind now, and would need some work to get going. portaudio seems to handle the gory details for us very nicely. Need to do more testing with all of this, but this now allows you to make IAXClient -> IAXClient calls. Of course, allowing people to reject calls would be nice too, but I suppose you can always hang up :) Index: Makefile =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/Makefile,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile 9 Jun 2003 16:04:57 -0000 1.12 +++ Makefile 16 Jun 2003 23:01:29 -0000 1.13 @@ -35,7 +35,6 @@ iaxclient_lib.o OBJS_WIN32=\ - audio_win32.o \ winfuncs.o \ portaudio/pa_win_wmme/pa_win_wmme.o Index: audio_encode.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_encode.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- audio_encode.c 11 Jun 2003 23:09:00 -0000 1.7 +++ audio_encode.c 16 Jun 2003 23:01:29 -0000 1.8 @@ -20,8 +20,6 @@ double ilevel, olevel; - if(!iaxc_levels_callback) return; - gettimeofday(&now,NULL); if(last.tv_sec != 0 && iaxc_usecdiff(&now,&last) < 100000) return; @@ -37,7 +35,7 @@ else olevel = 0.0; - iaxc_levels_callback(vol_to_db(ilevel), vol_to_db(olevel)); + iaxc_do_levels_callback(vol_to_db(ilevel), vol_to_db(olevel)); } static int input_postprocess(void *audio, int len, void *out) @@ -81,7 +79,7 @@ static int output_postprocess(void *audio, int len) { - int l = len; + unsigned long l = len; if(!output_compand) { char *argv[2]; @@ -97,7 +95,7 @@ return 0; } -int send_encoded_audio(struct peer *most_recent_answer, void *data, int iEncodeType) +int send_encoded_audio(struct iaxc_call *most_recent_answer, void *data, int iEncodeType) { gsm_frame fo; int silent; @@ -129,7 +127,7 @@ /* decode encoded audio; return the number of bytes decoded * negative indicates error * XXX out MUST be 160 bytes */ -int decode_audio(struct peer *p, void *out, void *data, int len, int iEncodeType) +int decode_audio(struct iaxc_call *call, void *out, void *data, int len, int iEncodeType) { int ret; int datalen; @@ -145,10 +143,10 @@ fprintf(stderr, "Weird gsm frame, not a multiple of 33.\n"); return -1; } - if (!p->gsmin) - p->gsmin = gsm_create(); + if (!call->gsmin) + call->gsmin = gsm_create(); - if(gsm_decode(p->gsmin, data, out)) + if(gsm_decode(call->gsmin, data, out)) return -1; output_postprocess(out, 160); return 33; Index: audio_encode.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_encode.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- audio_encode.h 3 Jun 2003 23:03:25 -0000 1.4 +++ audio_encode.h 16 Jun 2003 23:01:29 -0000 1.5 @@ -9,8 +9,8 @@ #define ENCODE_GSM 1 -int send_encoded_audio(struct peer *most_recent_answer, void *data, int iEncodeType); -int decode_audio(struct peer *p, void *out, void *data, int len, int iEncodeType); +int send_encoded_audio(struct iaxc_call *most_recent_answer, void *data, int iEncodeType); +int decode_audio(struct iaxc_call *p, void *out, void *data, int len, int iEncodeType); int check_encoded_audio_length(struct iax_event *e, int iEncodeType); void increment_encoded_data_count(int *i, int iEncodeType); Index: audio_portaudio.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_portaudio.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- audio_portaudio.c 2 Jun 2003 22:01:58 -0000 1.7 +++ audio_portaudio.c 16 Jun 2003 23:01:29 -0000 1.8 @@ -21,7 +21,55 @@ #include "iaxclient_lib.h" -PABLIO_Stream *stream; + +static PABLIO_Stream *stream; +static const PaDeviceInfo **inputDevices; +static const PaDeviceInfo **outputDevices; +static int nInputDevices; +static int nOutputDevices; + +/* scan devices and stash pointers to dev structures. + * But, these structures only remain valid while Pa is initialized, + * which, with pablio, is only while it's running! + * Also, storing these things in two separate arrays loses the actual + * PaDeviceID's associated with devices (since their index in these + * input/output arrays isn't the same as their index in the combined + * array */ +static int pa_scan_devices() { + int nDevices; + int i; + + /* we may be called multiple times */ + if(inputDevices){ + free(inputDevices); + inputDevices=NULL; + } + + if(outputDevices){ + free(outputDevices); + outputDevices=NULL; + } + + nInputDevices = nOutputDevices = 0; + + nDevices = Pa_CountDevices(); + + /* allocate in/out arrays big enough for all devices */ + inputDevices = malloc(nDevices * sizeof(PaDeviceInfo *)); + outputDevices = malloc(nDevices * sizeof(PaDeviceInfo *)); + + for(i=0;i<nDevices;i++) + { + const PaDeviceInfo *d; + d=Pa_GetDeviceInfo(i); + + if(d->maxInputChannels > 0) + inputDevices[nInputDevices++] = d; + + if(d->maxOutputChannels > 0) + outputDevices[nOutputDevices++] = d; + } +} int pa_initialize_audio() { PaError err; @@ -59,7 +107,7 @@ WriteAudioStream(stream, fr, SAMPLES_PER_FRAME * FRAMES_PER_BLOCK); } -void pa_send_audio(struct timeval *lastouttm, struct peer *most_recent_answer, int iEncodeType) { +void pa_send_audio(struct timeval *lastouttm, struct iaxc_call *most_recent_answer, int iEncodeType) { SAMPLE samples[SAMPLES_PER_FRAME * FRAMES_PER_BLOCK]; /* send all available complete frames */ Index: audio_portaudio.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_portaudio.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- audio_portaudio.h 16 Jun 2003 15:47:54 -0000 1.6 +++ audio_portaudio.h 16 Jun 2003 23:01:29 -0000 1.7 @@ -32,5 +32,5 @@ void handle_paerror(PaError err, char *where); void pa_read_audio_input(); void pa_play_recv_audio(void *fr, int fr_size); -void pa_send_audio(struct timeval *outtm, struct peer *most_recent_answer, int iEncodeType); +void pa_send_audio(struct timeval *outtm, struct iaxc_call *most_recent_answer, int iEncodeType); Index: iaxclient.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- iaxclient.h 13 Jun 2003 18:57:24 -0000 1.11 +++ iaxclient.h 16 Jun 2003 23:01:29 -0000 1.12 @@ -42,8 +42,22 @@ #define IAXC_FORMAT_H263 (1 << 19) /* H.263 Video */ -#if 0 -/* not yet implemented */ + +#define IAXC_EVENT_TEXT 1 +#define IAXC_EVENT_LEVELS 2 +#define IAXC_EVENT_STATE 3 + +#define IAXC_CALL_STATE_FREE 0 +#define IAXC_CALL_STATE_ACTIVE (1<<1) +#define IAXC_CALL_STATE_OUTGOING (1<<2) +#define IAXC_CALL_STATE_COMPLETE (1<<3) +#define IAXC_CALL_STATE_SELECTED (1<<4) + +#define IAXC_TEXT_TYPE_STATUS 1 +#define IAXC_TEXT_TYPE_NOTICE 2 +#define IAXC_TEXT_TYPE_ERROR 3 + + #define IAXC_EVENT_BUFSIZ 256 struct iaxc_ev_levels { @@ -52,28 +66,30 @@ }; struct iaxc_ev_text { + int type; char message[IAXC_EVENT_BUFSIZ]; }; -struct iaxc_ev_call { - char callerid[IAXC_EVENT_BUFSIZ]; -} +struct iaxc_ev_call_state { + int callNo; + int state; + char remote[IAXC_EVENT_BUFSIZ]; + char local[IAXC_EVENT_BUFSIZ]; +}; typedef struct iaxc_event_struct { int type; union { - struct iaxc_ev_levels levels; - struct iaxc_ev_text text; - struct iaxc_ev_call call; - } event; - struct iaxc_event_struct *next; + struct iaxc_ev_levels levels; + struct iaxc_ev_text text; + struct iaxc_ev_call_state call; + } ev; } iaxc_event; typedef int (*iaxc_event_callback_t)(iaxc_event e); -void iaxc_set_event_callback(iaxc_message_callback_t func); -#endif +void iaxc_set_event_callback(iaxc_event_callback_t func); -int iaxc_initialize(int audType); +int iaxc_initialize(int audType, int nCalls); void iaxc_shutdown(); void iaxc_set_encode_format(int fmt); void iaxc_process_calls(); @@ -81,7 +97,7 @@ int iaxc_start_processing_thread(); int iaxc_stop_processing_thread(); void iaxc_call(char *num); -void iaxc_answer_call(void); +void iaxc_answer_call(int callNo); void iaxc_dump_call(void); void iaxc_reject_call(void); void iaxc_send_dtmf(char digit); @@ -89,14 +105,7 @@ void iaxc_millisleep(long ms); void iaxc_set_silence_threshold(double thr); void iaxc_set_audio_output(int mode); - -typedef int (*iaxc_levels_callback_t)(float input, float output); -void iaxc_set_levels_callback(iaxc_levels_callback_t func); - -typedef void (*iaxc_message_callback_t)(char *); -void iaxc_set_status_callback(iaxc_message_callback_t func); -void iaxc_set_error_callback(iaxc_message_callback_t func); - +int iaxc_select_call(int callNo); #ifdef __cplusplus } Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- iaxclient_lib.c 13 Jun 2003 22:44:42 -0000 1.19 +++ iaxclient_lib.c 16 Jun 2003 23:01:29 -0000 1.20 @@ -16,15 +16,14 @@ char rcmd[RBUFSIZE]; int iaxc_audio_output_mode = 0; // Normal -static int answered_call; -static struct iax_session *newcall; -static struct peer *most_recent_answer=NULL; -static struct peer *peers; +static int selected_call; // XXX to be protected by mutex? +static struct iaxc_call* calls; +static int nCalls; // number of calls for this library session struct timeval lastouttm; -static struct peer * find_peer(struct iax_session *session); +static struct iaxc_call * find_call(struct iax_session *session); static void do_iax_event(); static THREAD procThread; @@ -33,12 +32,7 @@ /* QuitFlag: 0: Running 1: Should Quit, -1: Not Running */ static int procThreadQuitFlag = -1; - -iaxc_levels_callback_t iaxc_levels_callback = NULL; - -void iaxc_set_levels_callback(iaxc_levels_callback_t func) { - iaxc_levels_callback = func; -} +iaxc_event_callback_t iaxc_event_callback = NULL; void iaxc_set_silence_threshold(double thr) { iaxc_silence_threshold = thr; @@ -56,52 +50,140 @@ } +void iaxc_set_event_callback(iaxc_event_callback_t func) { + iaxc_event_callback = func; +} + // Messaging functions static void default_message_callback(char *message) { fprintf(stderr, "IAXCLIENT: "); fprintf(stderr, message); fprintf(stderr, "\n"); } -iaxc_message_callback_t iaxc_error_callback = default_message_callback; -iaxc_message_callback_t iaxc_status_callback = default_message_callback; -void iaxc_set_error_callback(iaxc_message_callback_t func) { - iaxc_error_callback = func; -} +// Post Events back to clients +void iaxc_post_event(iaxc_event e) { + if(iaxc_event_callback) + { + int rv; + rv = iaxc_event_callback(e); + if(rv < 0) + default_message_callback("IAXCLIENT: BIG PROBLEM, event callback returned failure!"); + // > 0 means processed + if(rv > 0) return; -void iaxc_set_status_callback(iaxc_message_callback_t func) { - iaxc_status_callback = func; + // else, fall through to "defaults" + } + + switch(e.type) + { + case IAXC_EVENT_TEXT: + default_message_callback(e.ev.text.message); + // others we just ignore too + return; + } } -#define IAXC_ERROR 1 -#define IAXC_STATUS 2 + +#define IAXC_ERROR IAXC_TEXT_TYPE_ERROR +#define IAXC_STATUS IAXC_TEXT_TYPE_STATUS +#define IAXC_NOTICE IAXC_TEXT_TYPE_NOTICE static iaxc_usermsg(int type, const char *fmt, ...) { va_list args; - char buf[256]; + iaxc_event e; + + e.type=IAXC_EVENT_TEXT; + e.ev.text.type=type; va_start(args, fmt); #ifdef WIN32 - _vsnprintf(buf, 250, fmt, args); + _vsnprintf(e.ev.text.message, IAXC_EVENT_BUFSIZ, fmt, args); #else - vsnprintf(buf, 250, fmt, args); + vsnprintf(e.ev.text.message, IAXC_EVENT_BUFSIZ, fmt, args); #endif va_end(args); - if(type == IAXC_ERROR) - iaxc_error_callback(buf); - else - iaxc_status_callback(buf); + iaxc_post_event(e); +} + + +void iaxc_do_levels_callback(float input, float output) +{ + iaxc_event e; + e.type = IAXC_EVENT_LEVELS; + e.ev.levels.input = input; + e.ev.levels.output = output; + iaxc_post_event(e); +} + +void iaxc_do_state_callback(int callNo) +{ + iaxc_event e; + e.type = IAXC_EVENT_STATE; + e.ev.call.callNo = callNo; + e.ev.call.state = calls[callNo].state; + strncpy(e.ev.call.remote, calls[callNo].remote, IAXC_EVENT_BUFSIZ); + iaxc_post_event(e); +} + +static int iaxc_next_free_call() { + int i; + for(i=0;i<nCalls;i++) + if(calls[i].session==NULL) + return i; + + return -1; +} + +static int iaxc_clear_call(int toDump) +{ + if(selected_call == toDump) iaxc_select_call(-1); + + // XXX libiax should handle cleanup, I think.. + calls[toDump].session = NULL; + calls[toDump].state = IAXC_CALL_STATE_FREE; + iaxc_do_state_callback(toDump); } +/* select a call. -1 == no call */ +/* XXX Locking?? Start/stop audio?? */ +int iaxc_select_call(int callNo) { + if(callNo < -1 || callNo >= nCalls) { + iaxc_usermsg(IAXC_ERROR, "Error: tried to select out_of_range call %d", callNo); + return -1; + } + + if(!calls[callNo].session) { + iaxc_usermsg(IAXC_ERROR, "Error: tried to select inactive call", callNo); + return -1; + } + + if(selected_call >= 0) { + calls[selected_call].state &= ~IAXC_CALL_STATE_SELECTED; + iaxc_do_state_callback(selected_call); + } + + calls[callNo].state |= IAXC_CALL_STATE_SELECTED; + + selected_call = callNo; + iaxc_do_state_callback(selected_call); +} + +/* external API accessor */ +int iaxc_selected_call() { + return selected_call; +} // Parameters: // audType - Define whether audio is handled by library or externally -int iaxc_initialize(int audType) { - /* get time of day in milliseconds, offset by tick count (see our - gettimeofday() implementation) */ +int iaxc_initialize(int audType, int inCalls) { + int i; + + /* os-specific initializations: init gettimeofday fake stuff in + * Win32, etc) */ os_init(); if ( (port = iax_init(0) < 0)) { @@ -110,16 +192,26 @@ } netfd = iax_get_fd(); + nCalls = inCalls; + /* initialize calls */ + if(nCalls == 0) nCalls = 1; /* 0 == Default? */ + + /* calloc zeroes for us */ + calls = calloc(sizeof(struct iaxc_call), nCalls); + if(!calls) + { + iaxc_usermsg(IAXC_ERROR, "Fatal error: can't allocate memory"); + return -1; + } iAudioType = audType; - answered_call=0; - newcall=0; + selected_call = -1; + gettimeofday(&lastouttm,NULL); switch (iAudioType) { case AUDIO_INTERNAL: -#ifdef WIN32 +#ifdef USE_WIN_AUDIO if (win_initialize_audio() != 0) return -1; -#else #endif break; case AUDIO_INTERNAL_PA: @@ -133,9 +225,8 @@ void iaxc_shutdown() { switch (iAudioType) { case AUDIO_INTERNAL: -#ifdef WIN32 +#ifdef USE_WIN_AUDIO win_shutdown_audio(); -#else #endif break; case AUDIO_INTERNAL_PA: @@ -153,7 +244,7 @@ void iaxc_process_calls(void) { -#ifdef WIN32 +#ifdef USE_WIN_AUDIO win_flush_audio_output_buffers(); if (iAudioType == AUDIO_INTERNAL) { win_prepare_audio_buffers(); @@ -195,37 +286,24 @@ procThreadQuitFlag = -1; } -void start_call_processing() { - if (!answered_call) { - while(1) { - iaxc_service_network(netfd); - if (answered_call) - break; - } - } -#ifdef WIN32 - _beginthread(iaxc_process_calls, 0, NULL); -#else -#endif -} int service_audio() { /* do audio input stuff for buffers that have received data from audio in device already. Must do them in serial number order (the order in which they were originally queued). */ - if(answered_call) /* send audio only if call answered */ + if(selected_call >= 0) /* send audio only if call answered */ { switch (iAudioType) { case AUDIO_INTERNAL: iaxc_service_network(netfd); -#ifdef WIN32 - win_process_audio_buffers(&lastouttm, most_recent_answer, iEncodeType); +#ifdef USE_WIN_AUDIO + win_process_audio_buffers(&lastouttm, &calls[selected_call], iEncodeType); #endif iaxc_service_network(netfd); break; case AUDIO_INTERNAL_PA: iaxc_service_network(netfd); - pa_send_audio(&lastouttm, most_recent_answer, iEncodeType); + pa_send_audio(&lastouttm, &calls[selected_call], iEncodeType); break; default: iaxc_service_network(netfd); @@ -235,25 +313,33 @@ } } else { static int i=0; - if((i++ % 50 == 0) && iaxc_levels_callback) iaxc_levels_callback(-99,-99); + if(i++ % 50 == 0) iaxc_do_levels_callback(-99,-99); } return 0; } -void handle_audio_event(struct iax_event *e, struct peer *p) { +void handle_audio_event(struct iax_event *e, int callNo) { int total_consumed = 0; int cur; short fr[160]; + struct iaxc_call *call; + + call = &calls[callNo]; + + if(callNo != selected_call) { + /* drop audio for unselected call? */ + return; + } #ifdef IAXC_IAX2 while(total_consumed < e->datalen) { - cur = decode_audio(p, fr, + cur = decode_audio(call, fr, e->data,e->datalen-total_consumed, iEncodeType); #else while(total_consumed < e->event.voice.datalen) { - cur = decode_audio(p, fr, + cur = decode_audio(call, fr, e->event.voice.data,e->event.voice.datalen-total_consumed, iEncodeType); #endif @@ -265,7 +351,7 @@ if(iaxc_audio_output_mode != 0) continue; switch (iAudioType) { case AUDIO_INTERNAL: -#ifdef WIN32 +#ifdef USE_WIN_AUDIO win_flush_audio_output_buffers(); win_play_recv_audio(fr, sizeof(fr)); #else @@ -283,7 +369,7 @@ } } -void iaxc_handle_network_event(struct iax_event *e, struct peer *p) +void iaxc_handle_network_event(struct iax_event *e, int callNo) { // int len,n; // WHOUT *wh,*wh1; @@ -295,37 +381,34 @@ case IAX_EVENT_HANGUP: #ifndef IAXC_IAX2 /* IAX2 barfs from this. Should we do this or not? */ - iax_hangup(most_recent_answer->session, "Byeee!"); + iax_hangup(calls[callNo].session, "Byeee!"); #endif iaxc_usermsg(IAXC_STATUS, "Call disconnected by remote"); - free(most_recent_answer); - most_recent_answer = 0; - answered_call = 0; - peers = 0; - newcall = 0; + // XXX does the session go away now? + iaxc_clear_call(callNo); break; case IAX_EVENT_REJECT: - iaxc_usermsg(IAXC_STATUS, "Authentication rejected by remote"); + iaxc_usermsg(IAXC_STATUS, "Call rejected by remote"); + iaxc_clear_call(callNo); break; case IAX_EVENT_ACCEPT: - iaxc_usermsg(IAXC_STATUS,"RING RING"); + calls[callNo].state |= IAXC_CALL_STATE_COMPLETE; + iaxc_do_state_callback(callNo); + iaxc_usermsg(IAXC_STATUS,"Call %d ringing", callNo); // issue_prompt(f); break; case IAX_EVENT_ANSWER: - iaxc_answer_call(); + iaxc_answer_call(callNo); break; case IAX_EVENT_VOICE: - handle_audio_event(e, p); - break; -// default : - //fprintf(f, "Don't know how to handle that format %d\n", e->event.voice.format); + handle_audio_event(e, callNo); break; case IAX_EVENT_RINGA: break; default: - iaxc_usermsg(IAXC_STATUS, "Unknown event: %d", e->etype); + iaxc_usermsg(IAXC_STATUS, "Unknown event: %d for call %d", e->etype, callNo); break; } } @@ -333,81 +416,80 @@ void iaxc_call(char *num) { - struct peer *peer; + int callNo; + struct iax_session *newsession; - if(!newcall) - newcall = iax_session_new(); - else { - iaxc_usermsg(IAXC_STATUS, "Call already in progress"); + callNo = iaxc_next_free_call(); + if(callNo < 0) { + iaxc_usermsg(IAXC_STATUS, "No free call appearances"); return; } - if ( !(peer = malloc(sizeof(struct peer)))) { - iaxc_usermsg(IAXC_ERROR, "Warning: Unable to allocate memory!"); + newsession = iax_session_new(); + if(!newsession) { + iaxc_usermsg(IAXC_ERROR, "Can't make new session"); return; } - peer->time = time(0); - peer->session = newcall; - peer->gsmin = 0; - peer->gsmout = 0; + calls[callNo].session = newsession; - peer->next = peers; - peers = peer; + /* XXX ??? */ + calls[callNo].gsmin = 0; + calls[callNo].gsmout = 0; + + strncpy(calls[callNo].remote,num,IAXC_EVENT_BUFSIZ); + calls[callNo].state = IAXC_CALL_STATE_ACTIVE | IAXC_CALL_STATE_OUTGOING; - most_recent_answer = peer; #ifdef IAXC_IAX2 - iax_call(peer->session, "7001234567", "IAXClient User", num, NULL, 0); + iax_call(calls[callNo].session, "7001234567", "IAXClient User", num, NULL, 0); #else - iax_call(peer->session, "7001234567", num, NULL, 10); + iax_call(calls[callNo].session, "7001234567", num, NULL, 10); #endif + + // does state stuff + iaxc_select_call(callNo); } -void iaxc_answer_call(void) +void iaxc_answer_call(int callNo) { - if(most_recent_answer) - iax_answer(most_recent_answer->session); - iaxc_usermsg(IAXC_STATUS,"Connected"); - answered_call = 1; + iax_answer(calls[selected_call].session); } void iaxc_dump_call(void) { - if(most_recent_answer) + int toDump = selected_call; + if(toDump < 0) { - iax_hangup(most_recent_answer->session,""); - free(most_recent_answer); + iaxc_usermsg(IAXC_ERROR, "Error: tried to dump but no call selected"); + return; } - iaxc_usermsg(IAXC_STATUS, "Hanging up"); - answered_call = 0; - most_recent_answer = 0; - answered_call = 0; - peers = 0; - newcall = 0; + + iax_hangup(calls[selected_call].session,"Dumped Call"); + iaxc_usermsg(IAXC_STATUS, "Hanging up call %d", toDump); + iaxc_clear_call(toDump); } void iaxc_reject_call(void) { - iax_reject(most_recent_answer->session, "Call rejected manually."); - most_recent_answer = 0; + // XXX should take callNo? + iax_reject(calls[selected_call].session, "Call rejected manually."); + iaxc_clear_call(selected_call); } void iaxc_send_dtmf(char digit) { - if(most_recent_answer) - iax_send_dtmf(most_recent_answer->session,digit); + if(selected_call >= 0) + iax_send_dtmf(calls[selected_call].session,digit); } -static struct peer *find_peer(struct iax_session *session) +static int iaxc_find_call_by_session(struct iax_session *session) { - struct peer *cur = peers; - while(cur) { - if (cur->session == session) - return cur; - cur = cur->next; - } - return NULL; + int i; + for(i=0;i<nCalls;i++) + if (calls[i].session == session) + return i; + return -1; } /* handle all network requests, and a pending scheduled event, if any */ @@ -438,74 +520,66 @@ } static void do_iax_event() { - int sessions = 0; struct iax_event *e = 0; - struct peer *peer; + int callNo; while ( (e = iax_get_event(0))) { - peer = find_peer(e->session); - if(peer) { - iaxc_handle_network_event(e, peer); + callNo = iaxc_find_call_by_session(e->session); + if(callNo >= 0) { + iaxc_handle_network_event(e, callNo); iax_event_free(e); } else { if(e->etype != IAX_EVENT_CONNECT) { iaxc_usermsg(IAXC_STATUS, "Huh? This is an event for a non-existant session?"); } - sessions++; + + callNo = iaxc_next_free_call(); - if(sessions >= MAX_SESSIONS) { - iaxc_usermsg(IAXC_STATUS, "Missed a call... too many sessions open."); + if(callNo < 0) { + iaxc_usermsg(IAXC_STATUS, "Incoming Call, but no appearances"); + // XXX Reject this call!, or just ignore? + iax_reject(e->session, "Too many calls, we're busy!"); } -#ifndef IAXC_IAX2 - if(e->event.connect.callerid && e->event.connect.dnid) - iaxc_usermsg(IAXC_STATUS, "Call from '%s' for '%s'", e->event.connect.callerid, - e->event.connect.dnid); - else if(e->event.connect.dnid) { - iaxc_usermsg(IAXC_STATUS, "Call from '%s'", e->event.connect.dnid); - } else if(e->event.connect.callerid) { - iaxc_usermsg(IAXC_STATUS, "Call from '%s'", e->event.connect.callerid); - } else -#endif - iaxc_usermsg(IAXC_STATUS, "Call from"); +#ifndef IAXC_IAX2 + if(e->event.connect.dnid) + strncpy(calls[callNo].local,e->event.connect.dnid, + IAXC_EVENT_BUFSIZ); + else + strncpy(calls[callNo].local,"unknown", + IAXC_EVENT_BUFSIZ); - iaxc_usermsg(IAXC_STATUS, " (%s)", inet_ntoa(iax_get_peer_addr(e->session).sin_addr)); + if(e->event.connect.callerid) + strncpy(calls[callNo].remote, + e->event.connect.callerid, IAXC_EVENT_BUFSIZ); + else + strncpy(calls[callNo].remote, + "unknown", IAXC_EVENT_BUFSIZ); +#else + // XXX TODO +#endif + iaxc_usermsg(IAXC_STATUS, "Call from (%s)", calls[callNo].remote); - if(most_recent_answer) { - iaxc_usermsg(IAXC_STATUS, "Incoming call ignored, there's already a call waiting for answer... \ -please accept or reject first"); - iax_reject(e->session, "Too many calls, we're busy!"); - } else { - if ( !(peer = malloc(sizeof(struct peer)))) { - iaxc_usermsg(IAXC_STATUS, "Warning: Unable to allocate memory!"); - return; - } + calls[callNo].gsmin = 0; + calls[callNo].gsmout = 0; + calls[callNo].session = e->session; + calls[callNo].state = IAXC_CALL_STATE_ACTIVE; - peer->time = time(0); - peer->session = e->session; - peer->gsmin = 0; - peer->gsmout = 0; - peer->next = peers; - peers = peer; + // should we even accept? or, we accept, but + // don't necessarily answer.. + iax_accept(calls[callNo].session); + iax_ring_announce(calls[callNo].session); - iax_accept(peer->session); - iax_ring_announce(peer->session); - most_recent_answer = peer; - iaxc_usermsg(IAXC_STATUS, "Incoming call!"); - } + // should we select this call? + iaxc_select_call(callNo); + iaxc_usermsg(IAXC_STATUS, "Incoming call on line %d", callNo); iax_event_free(e); -// issue_prompt(f); } } } -int iaxc_was_call_answered() -{ - return answered_call; -} - -void iaxc_external_audio_event(struct iax_event *e, struct peer *p) +void iaxc_external_audio_event(struct iax_event *e, struct iaxc_call *call) { // To be coded in the future return; Index: iaxclient_lib.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- iaxclient_lib.h 13 Jun 2003 18:57:24 -0000 1.15 +++ iaxclient_lib.h 16 Jun 2003 23:01:29 -0000 1.16 @@ -68,35 +68,50 @@ #include "iax-client.h" // LibIAX functions #include "gsm.h" -struct peer { - int time; - gsm gsmin; - gsm gsmout; - - struct iax_session *session; - struct peer *next; -}; long iaxc_usecdiff( struct timeval *timeA, struct timeval *timeB ); -void iaxc_handle_network_event(struct iax_event *e, struct peer *p); +void iaxc_handle_network_event(struct iax_event *e, int callNo); void iaxc_service_network(int netfd); +void iaxc_do_levels_callback(float input, float output); +#if 0 +/* Audio Driver Abstraction TODO */ +struct audio_driver_struct { + char *name; + int (*initialize)(struct audio_driver_struct *d); + +}; +typedef struct audio_driver_struct *iaxc_audio_driver; + +#endif #include "iaxclient.h" + + +struct iaxc_call { + /* to be replaced with codec-structures, with codec-private data */ + gsm gsmin; + gsm gsmout; + + /* the "state" of this call */ + int state; + char remote[IAXC_EVENT_BUFSIZ]; + char local[IAXC_EVENT_BUFSIZ]; + + struct iax_session *session; +}; + #include "audio_encode.h" #include "audio_portaudio.h" -#ifdef WIN32 +#ifdef USE_WIN_AUDIO #include "audio_win32.h" #endif - extern double iaxc_silence_threshold; extern int iaxc_audio_output_mode; -extern iaxc_levels_callback_t iaxc_levels_callback; -extern iaxc_message_callback_t iaxc_error_callback; -extern iaxc_message_callback_t iaxc_status_callback; +extern iaxc_event_callback_t iaxc_event_callback; /* external audio functions */ void iaxc_external_service_audio(); |
From: <st...@us...> - 2003-06-16 23:01:31
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/testcall In directory sc8-pr-cvs1:/tmp/cvs-serv20862/simpleclient/testcall Modified Files: testcall.c Log Message: A pretty big commit. 1) Change the overall "event" callback mechanism, to use a structure/union, with just one callback for all events. clients can accept or decline each event, in which case the library might take a "default" action for the event. (currently, the library will ignore all events except for text, which it will print to stderr/stdout). 2) Totally rework call handling, and allow the library to manage multiple calls. Call state is more or less followed through the lifetime of the call, but may not be right in all cases. 3) Implement call appearances based on all of this in wx. 4) Make testcall work with this (only one call). 5) Try to keep Faizan's "WinIAX" client up to date with the API changes, haven't tested the changes there, but they should work for one call. 6) #define out the WIN AUDIO stuff, it's pretty far behind now, and would need some work to get going. portaudio seems to handle the gory details for us very nicely. Need to do more testing with all of this, but this now allows you to make IAXClient -> IAXClient calls. Of course, allowing people to reject calls would be nice too, but I suppose you can always hang up :) Index: testcall.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/testcall/testcall.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- testcall.c 9 Jun 2003 21:01:13 -0000 1.8 +++ testcall.c 16 Jun 2003 23:01:29 -0000 1.9 @@ -23,6 +23,7 @@ #include "iaxclient.h" static int answered_call; +int do_levels = 0; /* routine called at exit to shutdown audio I/O and close nicely. NOTE: If all this isnt done, the system doesnt not handle this @@ -40,9 +41,24 @@ } int levels_callback(float input, float output) { - fprintf(stderr, "IN: %f OUT: %f\n", input, output); + if(do_levels) fprintf(stderr, "IN: %f OUT: %f\n", input, output); } +int iaxc_callback(iaxc_event e) +{ + switch(e.type) { + case IAXC_EVENT_LEVELS: + return levels_callback(e.ev.levels.input, e.ev.levels.output); + case IAXC_EVENT_TEXT: + return 0; // don't handle + case IAXC_EVENT_STATE: + return 0; + default: + return 0; // not handled + } +} + + void usage() { fprintf(stderr, "Usage is XXX\n"); @@ -55,7 +71,6 @@ char c; int i; char *dest = "guest@10.23.1.31/9999"; - int do_levels = 0; double silence_threshold = -99; @@ -90,12 +105,12 @@ /* activate the exit handler */ atexit(killem); - iaxc_initialize(AUDIO_INTERNAL_PA); + iaxc_initialize(AUDIO_INTERNAL_PA,1); iaxc_set_encode_format(IAXC_FORMAT_GSM); iaxc_set_silence_threshold(silence_threshold); if(do_levels) - iaxc_set_levels_callback(levels_callback); + iaxc_set_event_callback(iaxc_callback); fprintf(f, "\n\ |
From: <st...@us...> - 2003-06-16 23:01:31
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/WinIAX In directory sc8-pr-cvs1:/tmp/cvs-serv20862/simpleclient/WinIAX Modified Files: WinIAX.cpp Log Message: A pretty big commit. 1) Change the overall "event" callback mechanism, to use a structure/union, with just one callback for all events. clients can accept or decline each event, in which case the library might take a "default" action for the event. (currently, the library will ignore all events except for text, which it will print to stderr/stdout). 2) Totally rework call handling, and allow the library to manage multiple calls. Call state is more or less followed through the lifetime of the call, but may not be right in all cases. 3) Implement call appearances based on all of this in wx. 4) Make testcall work with this (only one call). 5) Try to keep Faizan's "WinIAX" client up to date with the API changes, haven't tested the changes there, but they should work for one call. 6) #define out the WIN AUDIO stuff, it's pretty far behind now, and would need some work to get going. portaudio seems to handle the gory details for us very nicely. Need to do more testing with all of this, but this now allows you to make IAXClient -> IAXClient calls. Of course, allowing people to reject calls would be nice too, but I suppose you can always hang up :) Index: WinIAX.cpp =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/WinIAX/WinIAX.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- WinIAX.cpp 13 Jun 2003 22:32:00 -0000 1.1 +++ WinIAX.cpp 16 Jun 2003 23:01:29 -0000 1.2 @@ -14,6 +14,7 @@ #define LEVEL_MIN -50 #define TIMER_PROCESS_CALLS 1001 +int iaxc_callback(iaxc_event e); int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, @@ -176,12 +177,12 @@ // TMessageBox("OnInitDialog"); double silence_threshold = -99; - iaxc_initialize(AUDIO_INTERNAL_PA); + iaxc_initialize(AUDIO_INTERNAL_PA,1); iaxc_set_encode_format(IAXC_FORMAT_GSM); iaxc_set_silence_threshold(silence_threshold); - iaxc_set_error_callback(status_callback); - iaxc_set_levels_callback(levels_callback); + iaxc_set_event_callback(iaxc_callback); + iaxc_start_processing_thread(); PostMessage(GetDlgItem(m_hwndMainDlg,IDC_PROG_OUTPUT),PBM_SETRANGE,0,LEVEL_MIN-LEVEL_MAX); PostMessage(GetDlgItem(m_hwndMainDlg,IDC_PROG_INPUT),PBM_SETRANGE,0,LEVEL_MIN-LEVEL_MAX); @@ -218,9 +219,10 @@ { iaxc_dump_call(); } -void status_callback(char *msg) +int status_callback(char *msg) { SetDlgItemText(m_hwndMainDlg,IDC_ST_STATUS,msg); + return 1 } int levels_callback(float input, float output) @@ -248,9 +250,24 @@ // Set // theFrame->input->SetValue(inputLevel); // theFrame->output->SetValue(outputLevel); - return 0; + return 1; } +int iaxc_callback(iaxc_event e) +{ + switch(e.type) { + case IAXC_EVENT_LEVELS: + return levels_callback(e.ev.levels.input, e.ev.levels.output); + case IAXC_EVENT_TEXT: + return status_callback(e.ev.text.message); +// case IAXC_EVENT_STATE: +// return state_callback(e.ev.call); + default: + return 0; // not handled + } +} + + void SendDTMF(char num) { iaxc_send_dtmf(num); @@ -279,4 +296,4 @@ { iaxc_process_calls(); } -} \ No newline at end of file +} |
From: <st...@us...> - 2003-06-16 22:02:41
|
Update of /cvsroot/iaxclient/iaxclient/lib/portaudio/pablio In directory sc8-pr-cvs1:/tmp/cvs-serv11667 Modified Files: pablio.c pablio.h Log Message: revert changes. They broke on Win32 (probably need to init Pablio before I can get default devices?), plus, we may never use the new entrypoint. Index: pablio.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/portaudio/pablio/pablio.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- pablio.c 16 Jun 2003 15:02:58 -0000 1.3 +++ pablio.c 16 Jun 2003 22:02:38 -0000 1.4 @@ -193,9 +193,8 @@ * PABLIO_READ, PABLIO_WRITE, or PABLIO_READ_WRITE, * and either PABLIO_MONO or PABLIO_STEREO */ -PaError OpenAudioStreamByID( PABLIO_Stream **rwblPtr, double sampleRate, - PaSampleFormat format, long flags , - PaDeviceID inID, PaDeviceID outID) +PaError OpenAudioStream( PABLIO_Stream **rwblPtr, double sampleRate, + PaSampleFormat format, long flags ) { long bytesPerSample; long doRead = 0; @@ -265,11 +264,11 @@ * audio drivers. */ err = Pa_OpenStream( &aStream->stream, - (doRead ? inID : paNoDevice), + (doRead ? Pa_GetDefaultInputDeviceID() : paNoDevice), (doRead ? aStream->samplesPerFrame : 0 ), format, NULL, - (doWrite ? outID : paNoDevice), + (doWrite ? Pa_GetDefaultOutputDeviceID() : paNoDevice), (doWrite ? aStream->samplesPerFrame : 0 ), format, NULL, @@ -291,14 +290,6 @@ CloseAudioStream( aStream ); *rwblPtr = NULL; return err; -} - -PaError OpenAudioStream( PABLIO_Stream **rwblPtr, double sampleRate, - PaSampleFormat format, long flags ) -{ - return OpenAudioStreamByID(rwblPtr, sampleRate, format, flags, - Pa_GetDefaultInputDeviceID(), - Pa_GetDefaultOutputDeviceID()); } /************************************************************/ Index: pablio.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/portaudio/pablio/pablio.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pablio.h 16 Jun 2003 14:47:44 -0000 1.2 +++ pablio.h 16 Jun 2003 22:02:38 -0000 1.3 @@ -101,13 +101,6 @@ PaError OpenAudioStream( PABLIO_Stream **aStreamPtr, double sampleRate, PaSampleFormat format, long flags ); -/* same as OpenAudioStream, except you can specify DeviceIDs for input - * and output devices Added for IAXCLIENT */ -PaError OpenAudioStreamByID( PABLIO_Stream **rwblPtr, double sampleRate, - PaSampleFormat format, long flags , - PaDeviceID inID, PaDeviceID outID); - - PaError CloseAudioStream( PABLIO_Stream *aStream ); #ifdef __cplusplus |
From: <st...@us...> - 2003-06-16 16:10:18
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv12012 Added Files: TODO Log Message: some TODO thoughts and notes. --- NEW FILE: TODO --- TODO items: 1) Audio driver work: Properly abstract audio drivers (currently, we use only portaudio, but we may also want to support others. The most likely candidate here would be zaptel devices. Instead of the "switch" statements in the code, define an audio driver structure, with - function pointers for actual driver entry points. initialization: (scans available devices, sets up data structures) destruction: (stops everything, cleans up) "start": starts audio for a particular call? "stop": stops audio for a particular call? "playsound": plays a particular sound: can be used for incoming call notification, ringback, dialtone etc? "select": select input and output devices to use? [maybe extend this for zap devices to have "ring", etc functions?] - Common audio driver data members: a) perhaps an array of devices the driver has found, with for each device, a device name, an indication of whether this device is the default input or output, and whether this device supports input, output, or both. For portaudio, we probably want to switch to the "standard" portaudio callback interface, and away from pablio, which isn't really robust enough for our needs once we do this stuff. 2) Call handling: currently, the library really only supports one call, and not very well. It should have a collection of calls (either an array, or a linked list), and keep track of the current state of each call. An array might be easiest to manage, and would map well to a softphone client. We would then just refer to calls by their index, and a GUI client might present these like call appearances on their display. Incoming calls might come in on the first free call appearance, and outgoing calls by default would do the same. The state of each call might be similar to phonecore (incoming_incomplete, incoming, outgoing_incomplete, outgoing), but we'd also have to keep track of which call, if any, we currenly have "selected" -- i.e. which one we should connect to the audio system. We'd need to send events to the client whenever a call changed "state" in any way. We can make the number of calls in the array defined at runtime when the library is initialized. A very simple client like testcall would just ask for a single call, so it wouldn't have to worry about a lot of this. 3) Codecs: (I think that someone is working on this) Currently, the library assumes that all calls will be GSM only, and further assumes that all frames will be 20ms. It can control the frame size (within reason) for frames it sends out, but should deal gracefully with incoming frames that aren't 20ms. Codecs should probably be implemented via a similar set of structure abstractions as audio drivers, above. They also need to handle incoming packets which may switch formats abruptly(?). 4) Events: We might want to consolidate the (currently three) callbacks that the library makes to clients, into a single callback, that passes back a structure with event info. I was thinking of a structure with an event type, and then a union of different structures depending on the event type. The only thing is that we might want to decide whether or not, or how clients will "register" for different event types, even if they're handled through the same callback mechanism. Ideally, the library would handle all of the events itself, via some "default" handlers. (I.e. for messages, it might just print them to stdout or stderr. For incoming calls, it might accept them by default). So, the choices then are whether the client should register for individual events, or perhaps it can just decline events as they happen, and then the library could handle them. |
From: <st...@us...> - 2003-06-16 15:47:57
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv8801 Modified Files: audio_portaudio.h Log Message: remove duplicated definitions. Index: audio_portaudio.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_portaudio.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- audio_portaudio.h 10 Jun 2003 13:15:53 -0000 1.5 +++ audio_portaudio.h 16 Jun 2003 15:47:54 -0000 1.6 @@ -8,13 +8,6 @@ #include "winpoop.h" #endif -/* Values for flags for OpenAudioStream(). */ -#define PABLIO_READ (1<<0) -#define PABLIO_WRITE (1<<1) -#define PABLIO_READ_WRITE (PABLIO_READ|PABLIO_WRITE) -#define PABLIO_MONO (1<<2) -#define PABLIO_STEREO (1<<3) - /* ** Note that many of the older ISA sound cards on PCs do NOT support ** full duplex audio (simultaneous record and playback). |
From: <st...@us...> - 2003-06-16 15:03:01
|
Update of /cvsroot/iaxclient/iaxclient/lib/portaudio/pablio In directory sc8-pr-cvs1:/tmp/cvs-serv1855 Modified Files: pablio.c Log Message: oops. Index: pablio.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/portaudio/pablio/pablio.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pablio.c 16 Jun 2003 14:47:44 -0000 1.2 +++ pablio.c 16 Jun 2003 15:02:58 -0000 1.3 @@ -296,7 +296,7 @@ PaError OpenAudioStream( PABLIO_Stream **rwblPtr, double sampleRate, PaSampleFormat format, long flags ) { - return OpenAudioStreamByID(rwblPtr, samplerate, format, flags, + return OpenAudioStreamByID(rwblPtr, sampleRate, format, flags, Pa_GetDefaultInputDeviceID(), Pa_GetDefaultOutputDeviceID()); } |
From: <st...@us...> - 2003-06-16 14:47:48
|
Update of /cvsroot/iaxclient/iaxclient/lib/portaudio/pablio In directory sc8-pr-cvs1:/tmp/cvs-serv31709/pablio Modified Files: pablio.c pablio.h Log Message: add ability to open Pablio while specifying deviceIDs for input/output Index: pablio.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/portaudio/pablio/pablio.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pablio.c 14 Apr 2003 23:47:16 -0000 1.1 +++ pablio.c 16 Jun 2003 14:47:44 -0000 1.2 @@ -193,8 +193,9 @@ * PABLIO_READ, PABLIO_WRITE, or PABLIO_READ_WRITE, * and either PABLIO_MONO or PABLIO_STEREO */ -PaError OpenAudioStream( PABLIO_Stream **rwblPtr, double sampleRate, - PaSampleFormat format, long flags ) +PaError OpenAudioStreamByID( PABLIO_Stream **rwblPtr, double sampleRate, + PaSampleFormat format, long flags , + PaDeviceID inID, PaDeviceID outID) { long bytesPerSample; long doRead = 0; @@ -264,11 +265,11 @@ * audio drivers. */ err = Pa_OpenStream( &aStream->stream, - (doRead ? Pa_GetDefaultInputDeviceID() : paNoDevice), + (doRead ? inID : paNoDevice), (doRead ? aStream->samplesPerFrame : 0 ), format, NULL, - (doWrite ? Pa_GetDefaultOutputDeviceID() : paNoDevice), + (doWrite ? outID : paNoDevice), (doWrite ? aStream->samplesPerFrame : 0 ), format, NULL, @@ -290,6 +291,14 @@ CloseAudioStream( aStream ); *rwblPtr = NULL; return err; +} + +PaError OpenAudioStream( PABLIO_Stream **rwblPtr, double sampleRate, + PaSampleFormat format, long flags ) +{ + return OpenAudioStreamByID(rwblPtr, samplerate, format, flags, + Pa_GetDefaultInputDeviceID(), + Pa_GetDefaultOutputDeviceID()); } /************************************************************/ Index: pablio.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/portaudio/pablio/pablio.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pablio.h 14 Apr 2003 23:47:16 -0000 1.1 +++ pablio.h 16 Jun 2003 14:47:44 -0000 1.2 @@ -101,6 +101,13 @@ PaError OpenAudioStream( PABLIO_Stream **aStreamPtr, double sampleRate, PaSampleFormat format, long flags ); +/* same as OpenAudioStream, except you can specify DeviceIDs for input + * and output devices Added for IAXCLIENT */ +PaError OpenAudioStreamByID( PABLIO_Stream **rwblPtr, double sampleRate, + PaSampleFormat format, long flags , + PaDeviceID inID, PaDeviceID outID); + + PaError CloseAudioStream( PABLIO_Stream *aStream ); #ifdef __cplusplus |
From: <st...@us...> - 2003-06-13 23:43:00
|
Update of /cvsroot/iaxclient/iaxclient/lib/gsm/win32lib/Release In directory sc8-pr-cvs1:/tmp/cvs-serv14698/win32lib/Release Removed Files: gsm.lib Log Message: Remove unneeded Win32 build and binaries. --- gsm.lib DELETED --- |
From: <st...@us...> - 2003-06-13 23:43:00
|
Update of /cvsroot/iaxclient/iaxclient/lib/gsm/win32lib In directory sc8-pr-cvs1:/tmp/cvs-serv14698/win32lib Removed Files: gsm.dsp gsm.dsw gsm.ncb gsm.opt gsm.plg Log Message: Remove unneeded Win32 build and binaries. --- gsm.dsp DELETED --- --- gsm.dsw DELETED --- --- gsm.ncb DELETED --- --- gsm.opt DELETED --- --- gsm.plg DELETED --- |
From: <st...@us...> - 2003-06-13 23:24:04
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/WinIAX In directory sc8-pr-cvs1:/tmp/cvs-serv11866 Modified Files: WinIAX.dsp Log Message: update project files from tili Index: WinIAX.dsp =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/WinIAX/WinIAX.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- WinIAX.dsp 13 Jun 2003 22:32:00 -0000 1.1 +++ WinIAX.dsp 13 Jun 2003 23:24:01 -0000 1.2 @@ -53,7 +53,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 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 /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib comctl32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib winmm.lib ..\..\lib\Release\iaxclient_lib.lib ..\..\lib\sox\Release\sox.lib /nologo /subsystem:windows /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib comctl32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib winmm.lib ..\..\lib\Release\iaxclient_lib.lib /nologo /subsystem:windows /machine:I386 !ELSEIF "$(CFG)" == "WinIAX - Win32 Debug" @@ -69,7 +69,7 @@ # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\lib\sox" /I "../../lib/gsm/src" /I "../../lib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../lib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -79,7 +79,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 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 /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib winmm.lib ws2_32.lib comctl32.lib ..\..\lib\Debug\iaxclient_lib.lib ..\..\lib\sox\Debug\sox.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib winmm.lib ws2_32.lib comctl32.lib ..\..\lib\Debug\iaxclient_lib.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF |
From: <st...@us...> - 2003-06-13 23:22:27
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv11623 Modified Files: iaxclient_lib.dsp Added Files: iaxclient_lib.dsw Log Message: new project files contributed by Tili Index: iaxclient_lib.dsp =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.dsp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- iaxclient_lib.dsp 30 Apr 2003 19:07:08 -0000 1.2 +++ iaxclient_lib.dsp 13 Jun 2003 23:22:24 -0000 1.3 @@ -1,196 +1,276 @@ -# Microsoft Developer Studio Project File - Name="iaxclient_lib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=iaxclient_lib - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "iaxclient_lib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "iaxclient_lib.mak" CFG="iaxclient_lib - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "iaxclient_lib - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "iaxclient_lib - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "iaxclient_lib - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "iaxclient_lib - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I ".\libiax\src" /I ".\gsm\inc" /I ".\portaudio_v18\pa_common" /I ".\portaudio_v18\pablio" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "iaxclient_lib - Win32 Release" -# Name "iaxclient_lib - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\audio_encode.c -# End Source File -# Begin Source File - -SOURCE=.\audio_portaudio.c -# End Source File -# Begin Source File - -SOURCE=.\audio_win32.c -# End Source File -# Begin Source File - -SOURCE=.\libiax\src\iax.c -# End Source File -# Begin Source File - -SOURCE=.\iaxclient_lib.c -# End Source File -# Begin Source File - -SOURCE=.\libiax\src\md5.c -# End Source File -# Begin Source File - -SOURCE=.\portaudio_v18\pa_common\pa_lib.c -# End Source File -# Begin Source File - -SOURCE=.\portaudio_v18\pa_win_wmme\pa_win_wmme.c -# End Source File -# Begin Source File - -SOURCE=.\portaudio_v18\pablio\pablio.c -# End Source File -# Begin Source File - -SOURCE=.\portaudio_v18\pablio\ringbuffer.c -# End Source File -# Begin Source File - -SOURCE=.\winfuncs.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\libiax\src\answer.h -# End Source File -# Begin Source File - -SOURCE=.\audio_encode.h -# End Source File -# Begin Source File - -SOURCE=.\audio_portaudio.h -# End Source File -# Begin Source File - -SOURCE=.\audio_win32.h -# End Source File -# Begin Source File - -SOURCE=.\libiax\src\busy.h -# End Source File -# Begin Source File - -SOURCE=.\libiax\src\dialtone.h -# End Source File -# Begin Source File - -SOURCE=.\libiax\src\frame.h -# End Source File -# Begin Source File - -SOURCE=".\libiax\src\iax-client.h" -# End Source File -# Begin Source File - -SOURCE=.\libiax\src\iax.h -# End Source File -# Begin Source File - -SOURCE=.\iaxclient_lib.h -# End Source File -# Begin Source File - -SOURCE=.\libiax\src\md5.h -# End Source File -# Begin Source File - -SOURCE=.\libiax\src\ring10.h -# End Source File -# Begin Source File - -SOURCE=.\libiax\src\ringtone.h -# End Source File -# Begin Source File - -SOURCE=.\libiax\src\winpoop.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\gsm\win32lib\Release\gsm.lib -# End Source File -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="iaxclient_lib" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=iaxclient_lib - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "iaxclient_lib.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "iaxclient_lib.mak" CFG="iaxclient_lib - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "iaxclient_lib - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "iaxclient_lib - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "iaxclient_lib - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I ".\libiax\src" /I ".\gsm\inc" /I ".\portaudio\pa_common" /I ".\portaudio\pablio" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "iaxclient_lib - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I ".\libiax\src" /I ".\gsm\inc" /I ".\portaudio\pa_common" /I ".\portaudio\pablio" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "iaxclient_lib - Win32 Release" +# Name "iaxclient_lib - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\gsm\src\add.c +# End Source File +# Begin Source File + +SOURCE=.\audio_encode.c +# End Source File +# Begin Source File + +SOURCE=.\audio_portaudio.c +# End Source File +# Begin Source File + +SOURCE=.\audio_win32.c +# End Source File +# Begin Source File + +SOURCE=.\gsm\src\code.c +# End Source File +# Begin Source File + +SOURCE=.\sox\compand.c +# End Source File +# Begin Source File + +SOURCE=.\gsm\src\decode.c +# End Source File +# Begin Source File + +SOURCE=.\gsm\src\gsm_create.c +# End Source File +# Begin Source File + +SOURCE=.\gsm\src\gsm_decode.c +# End Source File +# Begin Source File + +SOURCE=.\gsm\src\gsm_destroy.c +# End Source File +# Begin Source File + +SOURCE=.\gsm\src\gsm_encode.c +# End Source File +# Begin Source File + +SOURCE=.\gsm\src\gsm_explode.c +# End Source File +# Begin Source File + +SOURCE=.\gsm\src\gsm_implode.c +# End Source File +# Begin Source File + +SOURCE=.\gsm\src\gsm_option.c +# End Source File +# Begin Source File + +SOURCE=.\gsm\src\gsm_print.c +# End Source File +# Begin Source File + +SOURCE=.\libiax\src\iax.c +# End Source File +# Begin Source File + +SOURCE=.\iaxclient_lib.c +# End Source File +# Begin Source File + +SOURCE=.\gsm\src\long_term.c +# End Source File +# Begin Source File + +SOURCE=.\gsm\src\lpc.c +# End Source File +# Begin Source File + +SOURCE=.\libiax\src\md5.c +# End Source File +# Begin Source File + +SOURCE=.\portaudio\pa_common\pa_lib.c +# End Source File +# Begin Source File + +SOURCE=.\portaudio\pa_win_wmme\pa_win_wmme.c +# End Source File +# Begin Source File + +SOURCE=.\portaudio\pablio\pablio.c +# End Source File +# Begin Source File + +SOURCE=.\gsm\src\preprocess.c +# End Source File +# Begin Source File + +SOURCE=.\portaudio\pablio\ringbuffer.c +# End Source File +# Begin Source File + +SOURCE=.\gsm\src\rpe.c +# End Source File +# Begin Source File + +SOURCE=.\gsm\src\short_term.c +# End Source File +# Begin Source File + +SOURCE=.\sox\soxcompat.c +# End Source File +# Begin Source File + +SOURCE=.\gsm\src\table.c +# End Source File +# Begin Source File + +SOURCE=.\winfuncs.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\libiax\src\answer.h +# End Source File +# Begin Source File + +SOURCE=.\audio_encode.h +# End Source File +# Begin Source File + +SOURCE=.\audio_portaudio.h +# End Source File +# Begin Source File + +SOURCE=.\audio_win32.h +# End Source File +# Begin Source File + +SOURCE=.\libiax\src\busy.h +# End Source File +# Begin Source File + +SOURCE=.\libiax\src\dialtone.h +# End Source File +# Begin Source File + +SOURCE=.\libiax\src\frame.h +# End Source File +# Begin Source File + +SOURCE=".\libiax\src\iax-client.h" +# End Source File +# Begin Source File + +SOURCE=.\libiax\src\iax.h +# End Source File +# Begin Source File + +SOURCE=.\iaxclient_lib.h +# End Source File +# Begin Source File + +SOURCE=.\gsm\src\k6opt.h +# End Source File +# Begin Source File + +SOURCE=.\libiax\src\md5.h +# End Source File +# Begin Source File + +SOURCE=.\libiax\src\ring10.h +# End Source File +# Begin Source File + +SOURCE=.\libiax\src\ringtone.h +# End Source File +# Begin Source File + +SOURCE=.\sox\sox.h +# End Source File +# Begin Source File + +SOURCE=.\libiax\src\winpoop.h +# End Source File +# End Group +# End Target +# End Project |
From: <st...@us...> - 2003-06-13 22:48:31
|
Update of /cvsroot/iaxclient/iaxclient In directory sc8-pr-cvs1:/tmp/cvs-serv6710 Modified Files: README Log Message: updated README to add Tili to contributors, and note about WinIAX client. Index: README =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/README,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- README 13 Jun 2003 15:49:23 -0000 1.1 +++ README 13 Jun 2003 22:48:23 -0000 1.2 @@ -16,7 +16,7 @@ There are also sample clients, which use the library, included here. Currently, these are all stored under the "simpleclient" directory, and -there are two of them: +there are three of them: simpleclient/testcall: A simple command-line oriented test program, useful for testing and debugging. It supports @@ -26,6 +26,10 @@ client. This client also supports all of the same platforms as the library itself. +simpleclient/WinIAX: A MSVC/Win32 client. This only works with + Win32, obviously, and was contributed by + Faizan "Tili" Naqvi <fa...@ti...> + The home page for iaxclient is "http://iaxclient.sourceforge.net/" @@ -79,6 +83,7 @@ Steve Kann <st...@st...> Shawn Lawrence <sha...@te...> +Faizan "Tili" Naqvi <fa...@ti...> In addition to including libiax, IAXCLIENT is also based in part on code included in test clients within libiax itself. |