[ekiga] Opal: Fixed call auto-answer.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] Opal: Fixed call auto-answer.
- Date: Sun, 21 Oct 2012 16:51:41 +0000 (UTC)
commit 34393b2d9ecc821bfd5740d70b2410f9f66f5b5c
Author: Damien Sandras <dsandras beip be>
Date: Sun Oct 21 18:48:39 2012 +0200
Opal: Fixed call auto-answer.
It seems the way we were doing things triggered a bug in the new
OPAL code. It has been fixed and we are now doing things properly.
Alert-Info based auto-answer has been removed for 4.0. It could lead to
any incoming call to be answered and not just the one we wanted.
Moreover, an option should be present to allow or disallow it.
Otherwise, anybody could trigger an auto-answered call to any Ekiga
user, which would not be very nice.
lib/engine/components/opal/h323-endpoint.cpp | 5 ----
lib/engine/components/opal/opal-call.cpp | 12 +++++++---
lib/engine/components/opal/opal-call.h | 6 ++++-
lib/engine/components/opal/sip-endpoint.cpp | 29 --------------------------
lib/engine/components/opal/sip-endpoint.h | 3 --
5 files changed, 13 insertions(+), 42 deletions(-)
---
diff --git a/lib/engine/components/opal/h323-endpoint.cpp b/lib/engine/components/opal/h323-endpoint.cpp
index b83ae3b..ce5dbac 100644
--- a/lib/engine/components/opal/h323-endpoint.cpp
+++ b/lib/engine/components/opal/h323-endpoint.cpp
@@ -441,11 +441,6 @@ Opal::H323::EndPoint::OnIncomingConnection (OpalConnection & connection,
if (!forward_uri.empty () && manager.get_forward_on_no_answer ())
call->set_no_answer_forward (manager.get_reject_delay (), forward_uri);
- else if (manager.get_auto_answer ()) {
- PTRACE (3, "Opal::H323::EndPoint\tAuto-Answering incoming connection");
- call->answer ();
- return true;
- }
else
call->set_reject_delay (manager.get_reject_delay ());
}
diff --git a/lib/engine/components/opal/opal-call.cpp b/lib/engine/components/opal/opal-call.cpp
index defc3cf..8993905 100644
--- a/lib/engine/components/opal/opal-call.cpp
+++ b/lib/engine/components/opal/opal-call.cpp
@@ -43,8 +43,9 @@
#include <opal/pcss.h>
#include <sip/sippdu.h>
-#include "opal-call.h"
#include "call.h"
+#include "opal-call.h"
+#include "opal-call-manager.h"
#include "call-core.h"
using namespace Opal;
@@ -92,10 +93,10 @@ private:
};
-Opal::Call::Call (OpalManager& _manager,
+Opal::Call::Call (Opal::CallManager& _manager,
Ekiga::ServiceCore& _core,
const std::string& uri)
- : OpalCall (_manager), Ekiga::Call (), core (_core), remote_uri (uri),
+ : OpalCall (_manager), Ekiga::Call (), core (_core), manager(_manager), remote_uri (uri),
call_setup(false), jitter(0), outgoing(false)
{
notification_core = core.get<Ekiga::NotificationCore> ("notification-core");
@@ -137,7 +138,7 @@ Opal::Call::answer ()
if (!is_outgoing () && !IsEstablished ()) {
PSafePtr<OpalPCSSConnection> connection = GetConnectionAs<OpalPCSSConnection>();
if (connection != NULL) {
- connection->AcceptIncoming();
+ connection->AcceptIncoming ();
}
}
}
@@ -509,6 +510,9 @@ Opal::Call::OnAnswerCall (OpalConnection & connection,
parse_info (connection);
+ if (manager.get_auto_answer ())
+ return OpalConnection::AnswerCallNow;
+
return OpalCall::OnAnswerCall (connection, caller);
}
diff --git a/lib/engine/components/opal/opal-call.h b/lib/engine/components/opal/opal-call.h
index a2bc650..66b53a9 100644
--- a/lib/engine/components/opal/opal-call.h
+++ b/lib/engine/components/opal/opal-call.h
@@ -51,6 +51,7 @@ class GMManager;
namespace Opal {
+ class CallManager;
class Call
: public OpalCall,
public Ekiga::Call,
@@ -59,7 +60,9 @@ namespace Opal {
public:
- Call (OpalManager &_manager, Ekiga::ServiceCore& _core, const std::string & uri);
+ Call (CallManager &_manager,
+ Ekiga::ServiceCore& _core,
+ const std::string & uri);
~Call ();
@@ -221,6 +224,7 @@ private:
* Variables
*/
Ekiga::ServiceCore& core;
+ CallManager & manager;
boost::shared_ptr<Ekiga::NotificationCore> notification_core;
std::string local_party_name;
diff --git a/lib/engine/components/opal/sip-endpoint.cpp b/lib/engine/components/opal/sip-endpoint.cpp
index dbc63d8..5b4239a 100644
--- a/lib/engine/components/opal/sip-endpoint.cpp
+++ b/lib/engine/components/opal/sip-endpoint.cpp
@@ -133,7 +133,6 @@ Opal::Sip::EndPoint::EndPoint (Opal::CallManager & _manager,
{
boost::shared_ptr<Ekiga::ChatCore> chat_core = core.get<Ekiga::ChatCore> ("chat-core");
- auto_answer_call = false;
protocol_name = "sip";
uri_prefix = "sip:";
listen_port = (_listen_port > 0 ? _listen_port : 5060);
@@ -864,11 +863,6 @@ Opal::Sip::EndPoint::OnIncomingConnection (OpalConnection &connection,
if (!forward_uri.empty () && manager.get_forward_on_no_answer ())
call->set_no_answer_forward (manager.get_reject_delay (), forward_uri);
- else if (auto_answer_call || manager.get_auto_answer ()) {
- auto_answer_call = false;
- PTRACE (3, "Opal::Sip::EndPoint\tAuto-Answering incoming connection");
- call->answer ();
- }
else // Pending
call->set_reject_delay (manager.get_reject_delay ());
}
@@ -878,29 +872,6 @@ Opal::Sip::EndPoint::OnIncomingConnection (OpalConnection &connection,
}
-PBoolean
-Opal::Sip::EndPoint::OnReceivedINVITE (OpalTransport& transport,
- SIP_PDU* pdu)
-{
- if (pdu == NULL)
- return SIPEndPoint::OnReceivedINVITE (transport, pdu);
-
- PString str;
- int appearance;
-
- pdu->GetMIME ().GetAlertInfo (str, appearance);
- static const char ringanswer[] = "Ring Answer";
- PINDEX pos = str.Find (ringanswer);
-
- if (pos != P_MAX_INDEX) {
- PTRACE (3, "Opal::Sip::EndPoint\tRing Answer in AlertInfo header, will Auto-Answer incoming connection");
- auto_answer_call = true;
- }
-
- return SIPEndPoint::OnReceivedINVITE (transport, pdu);
-}
-
-
bool
Opal::Sip::EndPoint::OnReceivedMESSAGE (OpalTransport & transport,
SIP_PDU & pdu)
diff --git a/lib/engine/components/opal/sip-endpoint.h b/lib/engine/components/opal/sip-endpoint.h
index d133038..e133e16 100644
--- a/lib/engine/components/opal/sip-endpoint.h
+++ b/lib/engine/components/opal/sip-endpoint.h
@@ -157,8 +157,6 @@ namespace Opal {
void OnDialogInfoReceived (const SIPDialogNotification & info);
- PBoolean OnReceivedINVITE (OpalTransport & transport, SIP_PDU * pdu);
-
bool OnReceivedMESSAGE (OpalTransport & transport,
SIP_PDU & pdu);
@@ -211,7 +209,6 @@ namespace Opal {
std::string outbound_proxy;
unsigned listen_port;
- bool auto_answer_call;
boost::weak_ptr<Opal::Bank> bank;
boost::shared_ptr<SIP::Dialect> dialect;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]