]> sjero.net Git - linphone/blobdiff - coreapi/TunnelManager.cc
Merge branch 'master' of git://git.linphone.org/linphone
[linphone] / coreapi / TunnelManager.cc
index d1020b1b2782f6d431fefa607771a1ea4bd05173..409f9c42a83635c41ba6ff2890b7166aae46d9f6 100644 (file)
@@ -189,7 +189,7 @@ bool TunnelManager::isStarted() {
 }
 
 bool TunnelManager::isReady() const {
-       return mTunnelClient && mTunnelClient->isReady();
+       return mTunnelClient && mTunnelClient->isReady() && mReady;
 }
 
 int TunnelManager::customSendto(struct _RtpTransport *t, mblk_t *msg , int flags, const struct sockaddr *to, socklen_t tolen){
@@ -214,6 +214,7 @@ TunnelManager::TunnelManager(LinphoneCore* lc) :TunnelClientController()
 ,mEnabled(false)
 ,mTunnelClient(NULL)
 ,mAutoDetectStarted(false)
+,mReady(false)
 ,mHttpProxyPort(0){
 
        mExosipTransport.data=this;
@@ -271,6 +272,7 @@ void TunnelManager::processTunnelEvent(const Event &ev){
                if (lProxy) {
                        linphone_proxy_config_done(lProxy);
                }
+               mReady=true;
        }else if (mEnabled && !mTunnelClient->isReady()){
                /* we got disconnected from the tunnel */
                if (lProxy && linphone_proxy_config_is_registered(lProxy)) {
@@ -278,6 +280,7 @@ void TunnelManager::processTunnelEvent(const Event &ev){
                        linphone_proxy_config_edit(lProxy);
                        linphone_core_iterate(mCore);
                }
+               mReady=false;
        }
 }
 
@@ -317,7 +320,7 @@ void TunnelManager::enable(bool isEnable) {
                
                mEnabled=false;
                stopClient();
-               
+               mReady=false;
                linphone_core_set_rtp_transport_factories(mCore,NULL);
 
                eXosip_transport_hook_register(NULL);