Use the new Lock::acuire to reacquire a mutex lock.
Never attempt to send a DTMF twice over signaling. git-svn-id: http://yate.null.ro/svn/yate/trunk@5093 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
abb27cc76f
commit
09486d57ec
|
@ -1380,6 +1380,7 @@ bool SigChannel::msgTone(Message& msg, const char* tone)
|
|||
{
|
||||
if (!(tone && *tone))
|
||||
return true;
|
||||
bool trySig = true;
|
||||
Lock lock(m_mutex);
|
||||
DDebug(this,DebugCall,"Tone. '%s' %s[%p]",tone,(m_call ? "" : ". No call "),this);
|
||||
// Outgoing, overlap dialing call: try it first
|
||||
|
@ -1387,9 +1388,9 @@ bool SigChannel::msgTone(Message& msg, const char* tone)
|
|||
lock.drop();
|
||||
if (sendSigTone(msg,tone))
|
||||
return true;
|
||||
lock.acquire(m_mutex);
|
||||
trySig = false;
|
||||
}
|
||||
// Re-aquire lock
|
||||
Lock lock2(m_mutex);
|
||||
// Try to send: through the circuit, in band or through the signalling protocol
|
||||
SignallingCircuit* cic = getCircuit();
|
||||
if (cic) {
|
||||
|
@ -1402,10 +1403,8 @@ bool SigChannel::msgTone(Message& msg, const char* tone)
|
|||
return true;
|
||||
if (!m_call)
|
||||
return true;
|
||||
lock2.drop();
|
||||
lock.drop();
|
||||
sendSigTone(msg,tone);
|
||||
return true;
|
||||
return trySig && sendSigTone(msg,tone);
|
||||
}
|
||||
|
||||
bool SigChannel::msgText(Message& msg, const char* text)
|
||||
|
|
Loading…
Reference in New Issue