When exiting a fork by |exec suppress chan.disconnected and emit instead chan.replaced.
This should fix incorrect interactions with PBX functions. git-svn-id: http://yate.null.ro/svn/yate/trunk@4703 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
d74c554341
commit
334f8ff84b
1 changed files with 16 additions and 1 deletions
|
@ -53,6 +53,7 @@ protected:
|
|||
String* getNextDest();
|
||||
bool forkSlave(String* dest);
|
||||
bool callContinue();
|
||||
RefPointer<CallEndpoint> m_discPeer;
|
||||
ObjList m_slaves;
|
||||
String m_ringing;
|
||||
Regexp m_failures;
|
||||
|
@ -163,6 +164,19 @@ ForkMaster::~ForkMaster()
|
|||
s_calls.remove(this,false);
|
||||
CallEndpoint::commonMutex().unlock();
|
||||
clear(false);
|
||||
if (m_discPeer && !m_answered) {
|
||||
RefPointer<CallEndpoint> call = m_discPeer->getPeer();
|
||||
if (call) {
|
||||
Message* r = new Message("chan.replaced",0,true);
|
||||
r->addParam("id",id());
|
||||
r->addParam("newid",call->id());
|
||||
r->addParam("peerid",m_discPeer->id());
|
||||
r->userData(this);
|
||||
Engine::enqueue(r);
|
||||
call = 0;
|
||||
}
|
||||
}
|
||||
m_discPeer = 0;
|
||||
if (m_chanMsgs) {
|
||||
Message* msg = new Message("chan.hangup");
|
||||
msg->addParam("id",id());
|
||||
|
@ -174,7 +188,7 @@ ForkMaster::~ForkMaster()
|
|||
void ForkMaster::disconnected(bool final, const char* reason)
|
||||
{
|
||||
CallEndpoint::disconnected(final,reason);
|
||||
if (m_chanMsgs && !(final || m_answered)) {
|
||||
if (m_chanMsgs && !(final || m_answered || m_discPeer)) {
|
||||
Message* msg = new Message("chan.disconnected");
|
||||
msg->addParam("id",id());
|
||||
if (m_exec)
|
||||
|
@ -214,6 +228,7 @@ bool ForkMaster::forkSlave(String* dest)
|
|||
}
|
||||
Debug(&__plugin,DebugCall,"Call '%s' directly to target '%s'",
|
||||
peer->id().c_str(),dest->c_str());
|
||||
m_discPeer = peer;
|
||||
msgCopy.userData(peer);
|
||||
msgCopy.setParam("id",peer->id());
|
||||
msgCopy.clearParam("cdrtrack");
|
||||
|
|
Loading…
Reference in a new issue