如何在iOS通话期间接收DTMF接收?

时间:2018-01-01 09:25:14

标签: ios iphone linphone linphone-sdk

我是linphone的新手。任何人都可以指导我如何在通话期间收到dtmf iOS版。我在 LinphoneCoreVTable 中尝试了这个方法。

.dtmf_received = linphone_iphone_notify_dtmf_received.

但是当这种方法打电话时我不知道。

1 个答案:

答案 0 :(得分:1)

你必须实现在收到dtmf时调用的函数。

功能界面如下:

/**
 * Callback for being notified of DTMFs received.
 * @param lc the linphone core
 * @param call the call that received the dtmf
 * @param dtmf the ascii code of the dtmf
 */
typedef void (*LinphoneCoreCbsDtmfReceivedCb)(LinphoneCore* lc, LinphoneCall *call, int dtmf);

与呼叫状态更改相同:

的VTable

.call_state_changed = (LinphoneCoreCallStateChangedCb)linphone_iphone_call_state,

接口

/**
 * Call state notification callback.
 * @param lc the LinphoneCore
 * @param call the call object whose state is changed.
 * @param cstate the new state of the call
 * @param message a non NULL informational message about the state.
 */
typedef void (*LinphoneCoreCbsCallStateChangedCb)(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate, const char *message);

方法

static void linphone_iphone_call_state(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState state, const char *message) {
    [(__bridge LinphoneManager *)linphone_core_get_user_data(lc) onCall:call StateChanged:state withMessage:message];
}