修改三方通话功能,在发起三方通话时,先保持住主叫,然后再拉回主叫到会议

TransferSession.cpp 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #include "StdAfx.h"
  2. #include "TransferSession.h"
  3. #include "CallSession.h"
  4. #include "ProxyShell.h"
  5. #include "MC.h"
  6. CTransferSession::CTransferSession(CCallSession* pParent, long SubId, PendingCallInfo* pInfo) : CSubSession(pParent, SubId, pInfo),
  7. m_PeerLineId(pInfo->nAssoLine), m_IsPlayTone(false)
  8. {
  9. }
  10. CTransferSession::~CTransferSession(void)
  11. {
  12. }
  13. /*****************************************************************
  14. **【函数名称】 OnDialCancel
  15. **【函数功能】 呼叫取消处理
  16. **【参数】
  17. **【返回值】
  18. *****************************************************************/
  19. void CTransferSession::_onDialCancel( void )
  20. {
  21. // 对原通话执行取消静音操作
  22. m_pParent->lineMute(m_pInfo->nHostLine, false);
  23. // 主控线路状态修正
  24. if(m_pParent->isExist(m_pInfo->nHostLine, m_HostLineParty))
  25. {
  26. CProxyShell::GetInstance().onLineStateUpdated(m_pInfo->nHostLine, m_pParent->id(),
  27. SESSION_INVALID_SUB_CALL, (VIRTUAL_LINE_STATE)m_pInfo->nHostLineStatus, m_pInfo->szPreCallerNum, m_pInfo->szPreCalleeNum);
  28. } // end if
  29. }
  30. /*****************************************************************
  31. **【函数名称】 _onDialOK
  32. **【函数功能】 呼叫成功后续处理
  33. **【参数】
  34. **【返回值】
  35. *****************************************************************/
  36. void CTransferSession::_onDialOK( void )
  37. {
  38. // 对原通话执行取消静音操作
  39. m_pParent->lineMute(m_pInfo->nHostLine, false);
  40. // 主会话中线路替换
  41. m_pParent->removeLine(m_pInfo->nAssoLine, CALL_PARTY_PENDING);
  42. m_pParent->removeLine(m_pInfo->nHostLine, m_HostLineParty);
  43. m_pParent->insertLine(m_pInfo->nAssoLine, m_HostLineParty, true);
  44. // 主控线路挂机
  45. CMC::GetInstance().dropCall(m_pInfo->nHostLine, true);
  46. }
  47. /*****************************************************************
  48. **【函数名称】 _onDialing
  49. **【函数功能】 呼叫振铃处理
  50. **【参数】
  51. **【返回值】
  52. *****************************************************************/
  53. void CTransferSession::_onDialRing( void )
  54. {
  55. m_IsPlayTone = true;
  56. // 对原通话执行静音操作
  57. m_pParent->lineMute(m_pInfo->nHostLine, true);
  58. }