Skip to content

Commit

Permalink
fix p2p calls so that they work again also requires updating libjingle
Browse files Browse the repository at this point in the history
  • Loading branch information
nickflink committed Apr 16, 2013
1 parent 94570e3 commit 3d03ede
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
28 changes: 22 additions & 6 deletions client/clientsignalingthread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,19 @@ ClientSignalingThread::ClientSignalingThread()
// Set debugging to verbose in libjingle if LOGGING on android.
talk_base::LogMessage::LogToDebug(talk_base::LS_VERBOSE);
#endif
sp_ssl_identity_.reset(NULL);
transport_protocol_ = cricket::ICEPROTO_HYBRID;
#ifdef TUENTI_CUSTOM_BUILD
transport_protocol_ = cricket::ICEPROTO_RFC5245;
#endif
#if ENABLE_SRTP
sdes_policy_ = cricket::SEC_ENABLED;
dtls_policy_ = cricket::SEC_ENABLED;
#else
dtls_policy_ = cricket::SEC_DISABLED;
sdes_policy_ = cricket::SEC_DISABLED;
#endif
sp_ssl_identity_.reset(NULL);
sp_network_manager_.reset(new talk_base::BasicNetworkManager());
my_status_.set_caps_node("http://github.com/lukeweber/webrtc-jingle");
my_status_.set_version("1.0-SNAPSHOT");
Expand Down Expand Up @@ -284,11 +297,7 @@ void ClientSignalingThread::OnConnected(){
&ClientSignalingThread::OnCallCreate);
sp_media_client_->SignalCallDestroy.connect(this,
&ClientSignalingThread::OnCallDestroy);
#if ENABLE_SRTP
sp_media_client_->set_secure(cricket::SEC_ENABLED);
#else
sp_media_client_->set_secure(cricket::SEC_DISABLED);
#endif
sp_media_client_->set_secure(sdes_policy_);
InitPresence();

#if XMPP_WHITESPACE_KEEPALIVE_ENABLED
Expand Down Expand Up @@ -381,7 +390,11 @@ void ClientSignalingThread::Login(const std::string &username,
buzz::Jid jid = buzz::Jid(username);
talk_base::InsecureCryptStringImpl pass;
pass.password() = password;

#if ENABLE_SRTP
sp_ssl_identity_.reset(talk_base::SSLIdentity::Generate(jid.Str()));
#else
sp_ssl_identity_.reset(NULL);
#endif
xcs_.set_user(jid.node());
xcs_.set_resource("voice");
#if ADD_RANDOM_RESOURCE_TO_JID
Expand Down Expand Up @@ -637,6 +650,9 @@ void ClientSignalingThread::LoginS() {
}
sp_session_manager_.reset(
new cricket::SessionManager(sp_port_allocator_.get(), signal_thread_));
sp_session_manager_->set_secure(dtls_policy_);
sp_session_manager_->set_identity(sp_ssl_identity_.get());
sp_session_manager_->set_transport_protocol(transport_protocol_);

if (xcs_.use_tls() == buzz::TLS_REQUIRED) {
talk_base::InitializeSSL();
Expand Down
4 changes: 4 additions & 0 deletions client/clientsignalingthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ class ClientSignalingThread
talk_base::scoped_ptr<buzz::XmppRosterModule> sp_roster_module_;
talk_base::scoped_ptr<tuenti::RosterHandler> sp_roster_handler_;
talk_base::scoped_ptr<talk_base::BasicNetworkManager> sp_network_manager_;
talk_base::scoped_ptr<talk_base::SSLIdentity> sp_ssl_identity_;

talk_base::Thread *signal_thread_;
talk_base::scoped_ptr<talk_base::Thread> main_thread_;
Expand All @@ -375,6 +376,9 @@ class ClientSignalingThread
ReceiveMessageTask *receive_message_task_;
cricket::SessionManagerTask *session_manager_task_;
cricket::Call* call_;
cricket::SecurePolicy sdes_policy_;
cricket::SecurePolicy dtls_policy_;
cricket::TransportProtocol transport_protocol_;
uint32 port_allocator_flags_;
uint32 port_allocator_filter_;
bool use_ssl_;
Expand Down

0 comments on commit 3d03ede

Please sign in to comment.