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

CfgSipAccount.cpp 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #include "StdAfx.h"
  2. #include "CfgSipAccount.h"
  3. #include "DBCtrl.h"
  4. CCfgSipAccount::CCfgSipAccount(void)
  5. {
  6. }
  7. CCfgSipAccount::~CCfgSipAccount(void)
  8. {
  9. __free();
  10. }
  11. /*****************************************************************
  12. **【函数名称】 __free
  13. **【函数功能】 释放所有sip账户信息
  14. **【参数】
  15. **【返回值】
  16. ****************************************************************/
  17. void CCfgSipAccount::__free( void )
  18. {
  19. while(m_nCount > 0)
  20. {
  21. SIP_ACCOUNT* pAccount = RemoveHead();
  22. ASSERT(pAccount != NULL);
  23. delete pAccount;
  24. }
  25. }
  26. /*****************************************************************
  27. **【函数名称】 load
  28. **【函数功能】 加载所有sip账户信息
  29. **【参数】
  30. **【返回值】
  31. ****************************************************************/
  32. bool CCfgSipAccount::load( void )
  33. {
  34. IOtlRecordset* pAccountRcd = IOtlConnection::getInstance()->QueryRecords(_T("SELECT id, account, auth_account, password, proxy_addr, proxy_port, reg, reg_interval FROM conf_sip_account ORDER BY id ASC"));
  35. if (NULL == pAccountRcd)
  36. return false;
  37. while(!pAccountRcd->IsEOF())
  38. {
  39. SIP_ACCOUNT* pSipAccount = new SIP_ACCOUNT;
  40. ASSERT(pSipAccount != NULL);
  41. ZeroMemory(pSipAccount, sizeof(SIP_ACCOUNT));
  42. pAccountRcd->MoveNextRow();
  43. pSipAccount->Id = pAccountRcd->GetValueIntByIndex(1);
  44. lstrcpy(pSipAccount->Account, pAccountRcd->GetValueStrByIndex(2));
  45. lstrcpy(pSipAccount->AuthAccount, pAccountRcd->GetValueStrByIndex(3));
  46. lstrcpy(pSipAccount->Password, pAccountRcd->GetValueStrByIndex(4));
  47. lstrcpy(pSipAccount->Proxy, pAccountRcd->GetValueStrByIndex(5));
  48. pSipAccount->ProxyPort = pAccountRcd->GetValueIntByIndex(6);
  49. if(lstrcmp(CONST_DEF_SIP_REG_TRUE, pAccountRcd->GetValueStrByIndex(7)) == 0)
  50. pSipAccount->IsReg = true;
  51. else
  52. pSipAccount->IsReg = false;
  53. pSipAccount->RegInterval = pAccountRcd->GetValueIntByIndex(8);
  54. AddTail(pSipAccount);
  55. } // end while
  56. IOtlRecordset::DestroyInstance(pAccountRcd); // 释放记录集
  57. return true;
  58. }
  59. /*****************************************************************
  60. **【函数名称】 getAccount
  61. **【函数功能】 获取指定sip账户信息
  62. **【参数】
  63. **【返回值】
  64. ****************************************************************/
  65. SIP_ACCOUNT* CCfgSipAccount::getAccount( int AccountId )
  66. {
  67. CNode* pNodeCur = m_pNodeHead;
  68. while(pNodeCur != NULL)
  69. {
  70. SIP_ACCOUNT* pAccount = pNodeCur->data;
  71. ASSERT(pAccount != NULL);
  72. if(pAccount->Id == AccountId)
  73. return pAccount;
  74. pNodeCur = pNodeCur->pNext;
  75. }
  76. return NULL;
  77. }