更新時間:2019-11-20
用戶點對點音頻通話。
主被叫客戶端均已注冊。
呼叫ID作為一路通話的唯一標識,UI應(yīng)保存并管理,以用于后繼的呼叫相關(guān)操作。
//c code TSDK_RESULT ret; ret = tsdk_start_call(&callid, call_number, FALSE); if (TSDK_SUCCESS != ret) { LOG_D_CALL_ERROR("start call failed. result=%#x", ret); return -1; } return TSDK_SUCCESS; |
//c code case TSDK_E_CALL_EVT_CALL_OUTGOING: { CHECK_POINTER(data); TSDK_S_CALL_INFO* callInfo = (TSDK_S_CALL_INFO*)data; TSDK_S_CALL_INFO* notifyInfo = new TSDK_S_CALL_INFO; memset(notifyInfo, 0, sizeof(TSDK_S_CALL_INFO)); memcpy_s(notifyInfo, sizeof(TSDK_S_CALL_INFO), callInfo, sizeof(TSDK_S_CALL_INFO)); ::PostMessage(maindlg->GetSafeHwnd(), WM_CALL_STARTCALL, WPARAM(notifyInfo), NULL); break; } case TSDK_E_CALL_EVT_CALL_INCOMING: { CHECK_POINTER(data); TSDK_S_CALL_INFO* callInfo = (TSDK_S_CALL_INFO*)data; TSDK_S_CALL_INFO* notifyInfo = new TSDK_S_CALL_INFO; memset(notifyInfo, 0, sizeof(TSDK_S_CALL_INFO)); memcpy_s(notifyInfo, sizeof(TSDK_S_CALL_INFO), callInfo, sizeof(TSDK_S_CALL_INFO)); ::PostMessage(maindlg->GetSafeHwnd(), WM_CALL_INCOMMING, (WPARAM)notifyInfo, NULL); break; } |
//c code case TSDK_E_CALL_EVT_CALL_RINGBACK: { LOG_D_CALL_INFO("call ringback"); break; } |
被叫若拒絕呼叫參見結(jié)束通話(或呼叫)章節(jié)描述。
//c code TSDK_RESULT ret; ret = tsdk_accept_call(callid, (TSDK_BOOL)isVideo); if (TSDK_SUCCESS != ret) { LOG_D_CALL_ERROR("accept call failed. result=%#x", ret); return -1; } return TSDK_SUCCESS; |
RTP通道已建立,可以進行一些二次撥號等操作。
//c code case TSDK_E_CALL_EVT_CALL_RTP_CREATED: { LOG_D_CALL_INFO("call rtp created Event"); break; } |
//c code case TSDK_E_CALL_EVT_CALL_CONNECTED: { TSDK_S_CALL_INFO* callInfo = (TSDK_S_CALL_INFO*)data; TSDK_S_CALL_INFO* notifyInfo = new TSDK_S_CALL_INFO; memset(notifyInfo, 0, sizeof(TSDK_S_CALL_INFO)); memcpy_s(notifyInfo, sizeof(TSDK_S_CALL_INFO), callInfo, sizeof(TSDK_S_CALL_INFO)); ::PostMessage(maindlg->GetSafeHwnd(), WM_CALL_CONNECTED, (WPARAM)notifyInfo, NULL); break; } |
無。