diff --git a/TODO b/TODO index e4fd4291f7065c5d00a8203f53b648279b83784d..745302dc2df14b0002472b7046a6fa666ff07158 100644 --- a/TODO +++ b/TODO @@ -17,7 +17,7 @@ For sflphone-qt: --------------- Add samplerate combobox if sample rate is compiled Save account status if modified in configuration - +Bug when moving sflphone and clicking inside the lcd From FIXME: diff --git a/src/audio/audiortp.cpp b/src/audio/audiortp.cpp index caff8b83b0692f02c8c5c24cad6e0c1492d4692b..095829f826805832b1078f10ab787cd9f7b4bbdc 100644 --- a/src/audio/audiortp.cpp +++ b/src/audio/audiortp.cpp @@ -54,8 +54,9 @@ AudioRtp::createNewSession (SIPCall *ca) { // something should stop the thread before... if ( _RTXThread != 0 ) { - _debug("Try to create a new audio rtp thread...\n"); - return -1; + _debug("AudioRTP Failure: Thread already exists..., stopping it\n"); + delete _RTXThread; _RTXThread = 0; + //return -1; } // Start RTP Send/Receive threads @@ -64,6 +65,7 @@ AudioRtp::createNewSession (SIPCall *ca) { try { if (_RTXThread->start() != 0) { + _debug("AudioRTP Failure: unable to start RTX Thread\n"); return -1; } } catch(...) { diff --git a/src/iaxvoiplink.cpp b/src/iaxvoiplink.cpp index 6b0a22b939603719b7dfde12644e3c72ebfda62f..fe59762514db00d668b9ddc1afa74bd97436e763 100644 --- a/src/iaxvoiplink.cpp +++ b/src/iaxvoiplink.cpp @@ -292,6 +292,19 @@ IAXVoIPLink::newOutgoingCall(const CallID& id, const std::string& toUrl) return call; } +bool +IAXVoIPLink::answer(const CallID& id) +{ + IAXCall* call = getIAXCall(id); + if (call==0) { _debug("Call doesn't exists\n"); return false; } + _mutexIAX.enterMutex(); + iax_answer(call->getSession()); + _mutexIAX.leaveMutex(); + call->setState(Call::Active); + call->setConnectionState(Call::Connected); + return true; +} + bool IAXVoIPLink::hangup(const CallID& id) { @@ -335,6 +348,44 @@ IAXVoIPLink::offhold(const CallID& id) return true; } +bool +IAXVoIPLink::transfer(const CallID& id, const std::string& to) +{ + IAXCall* call = getIAXCall(id); + if (call==0) { _debug("Call doesn't exists\n"); return false; } + + char callto[to.length()+1]; + strcpy(callto, to.c_str()); + + _mutexIAX.enterMutex(); + iax_transfer(call->getSession(), callto); + _mutexIAX.leaveMutex(); + + // should we remove it? + // removeCall(id); +} + +bool +IAXVoIPLink::refuse(const CallID& id) +{ + IAXCall* call = getIAXCall(id); + if (call==0) { _debug("Call doesn't exists\n"); return false; } + _mutexIAX.enterMutex(); + iax_reject(call->getSession(), "Call rejected manually."); + _mutexIAX.leaveMutex(); + removeCall(id); +} + +bool +IAXVoIPLink::carryingDTMFdigits(const CallID& id, char code) +{ + IAXCall* call = getIAXCall(id); + if (call==0) { _debug("Call doesn't exists\n"); return false; } + _mutexIAX.enterMutex(); + iax_send_dtmf(call->getSession(), code); + _mutexIAX.leaveMutex(); +} + bool IAXVoIPLink::iaxOutgoingInvite(IAXCall* call) { diff --git a/src/iaxvoiplink.h b/src/iaxvoiplink.h index c6e35fa089e5f6380c9236a45430a9205e1260fe..9a2f2d04f1e9e57ae984840b35efa7bbbc38784d 100644 --- a/src/iaxvoiplink.h +++ b/src/iaxvoiplink.h @@ -51,15 +51,15 @@ public: bool setUnregister (void); Call* newOutgoingCall(const CallID& id, const std::string& toUrl); - bool answer(const CallID& id) {return false;} + bool answer(const CallID& id); bool hangup(const CallID& id); bool cancel(const CallID& id) { return false; } bool onhold(const CallID& id); bool offhold(const CallID& id); - bool transfer(const CallID& id, const std::string& to) { return false; } - bool refuse (const CallID& id) { return false; } - bool carryingDTMFdigits(const CallID& id, char code) { return false; } + bool transfer(const CallID& id, const std::string& to); + bool refuse (const CallID& id); + bool carryingDTMFdigits(const CallID& id, char code); bool sendMessage(const std::string& to, const std::string& body) { return false; } public: // iaxvoiplink only diff --git a/src/sipvoiplink.cpp b/src/sipvoiplink.cpp index 05dce99b3308a958594a7642de97627e1ff51e2c..b1b2a8b78868272bec0d53e1c9b5be0baa71a3cb 100644 --- a/src/sipvoiplink.cpp +++ b/src/sipvoiplink.cpp @@ -613,6 +613,13 @@ SIPVoIPLink::onhold(const CallID& id) SIPCall* call = getSIPCall(id); if (call==0) { _debug("Call doesn't exist\n"); return false; } + // Stop sound + call->setAudioStart(false); + call->setState(Call::Hold); + _debug("SIP: Stopping AudioRTP when onhold\n"); + _audiortp.closeRtpSession(); + + int did = call->getDid(); eXosip_lock (); @@ -661,12 +668,6 @@ SIPVoIPLink::onhold(const CallID& id) osip_message_set_content_type (invite, "application/sdp"); } - // Stop sound - call->setAudioStart(false); - call->setState(Call::Hold); - _debug("SIP: Stopping AudioRTP when onhold\n"); - _audiortp.closeRtpSession(); - // send request _debug("< Send on hold request\n"); eXosip_lock (); diff --git a/tools/sflphone-bash/call b/tools/sflphone-bash/call index d6b965e6d38ecca94b687cd7db99cadad4cbc3a0..fae1284358ad3d1a841100606891655d693331dd 100755 --- a/tools/sflphone-bash/call +++ b/tools/sflphone-bash/call @@ -30,7 +30,7 @@ if [ -z `$pidof 'sflphoned'` ]; then echo -en "\n"; fi -callstring="call someone with $callid $telephonenumber\n" +callstring="call someone SIP0 $callid $telephonenumber\n" echo "Calling $telephonenumber..." echo -en $callstring | $netcat