T-Box Basic dev
Loading...
Searching...
No Matches
voice.h
Go to the documentation of this file.
1
10
11#ifndef __TBOX_VOICE_H__
12#define __TBOX_VOICE_H__
13
14#include <stddef.h>
15#include <stdint.h>
16
17#ifdef __cplusplus
18extern "C"
19{
20#endif
21
29
31#define TBOX_RIL_PHONE_NUMBER_MAX 32U
33#define TBOX_RIL_ECALL_MSD_MAX 140U
34
49
58
67
77
86
97
106
142
152
162
173
182
191
204
214typedef void (*tbox_voice_callback_t)(const tbox_voice_event_t* event, void* context);
215
226
235
243int tbox_voice_dial(const tbox_voice_dial_request_t* request, uint32_t* call_id);
244
251int tbox_voice_answer(uint32_t call_id);
252
259int tbox_voice_hangup(uint32_t call_id);
260
267
274int tbox_voice_send_dtmf(char digit);
275
282int tbox_voice_set_volume(uint32_t volume);
283
290int tbox_voice_get_volume(uint32_t* volume);
291
299
307
318int tbox_voice_get_call(uint32_t call_id, tbox_call_event_t* call, size_t* length);
319
332
341
350int tbox_voice_set_ecall_msd(uint32_t call_id, const uint8_t* data, size_t length);
351
355
356#ifdef __cplusplus
357}
358#endif
359
360#endif /* __TBOX_VOICE_H__ */
#define TBOX_RIL_PHONE_NUMBER_MAX
包含结尾 NUL 的电话号码容量
Definition voice.h:31
tbox_ecall_status_t
eCall 状态。
Definition voice.h:111
int tbox_voice_get_volume(uint32_t *volume)
查询通话音量。
tbox_ecall_number_type_t
eCall 测试号码类型。
Definition voice.h:82
int tbox_voice_set_volume(uint32_t volume)
设置通话音量。
int tbox_voice_set_ecall_test_number(tbox_ecall_number_type_t type, const char *number)
设置测试 eCall 号码。
int tbox_voice_start_ecall(const tbox_ecall_request_t *request)
异步启动 eCall。
tbox_call_type_t
通话类别。
Definition voice.h:54
int tbox_voice_send_dtmf(char digit)
发送 DTMF。
int tbox_voice_hangup(uint32_t call_id)
挂断通话。
tbox_voice_audio_mode_t
音频承载方式。
Definition voice.h:102
int tbox_voice_get_call(uint32_t call_id, tbox_call_event_t *call, size_t *length)
查询指定通话。
tbox_ecall_variant_t
eCall 呼叫类型。
Definition voice.h:72
int tbox_voice_set_audio_mode(tbox_voice_audio_mode_t mode)
设置音频承载方式。
void(* tbox_voice_callback_t)(const tbox_voice_event_t *event, void *context)
语音事件回调。
Definition voice.h:214
int tbox_voice_set_ecall_msd(uint32_t call_id, const uint8_t *data, size_t length)
更新指定 eCall 的 MSD。
int tbox_voice_dial(const tbox_voice_dial_request_t *request, uint32_t *call_id)
发起通话。
tbox_ecall_trigger_t
eCall 触发方式。
Definition voice.h:63
int tbox_voice_register_callback(tbox_voice_callback_t callback, void *context)
注册语音事件回调。
tbox_voice_event_type_t
语音事件类别。
Definition voice.h:187
tbox_voice_slot_t
语音卡槽。
Definition voice.h:91
int tbox_voice_switch_active(void)
切换活动通话。
tbox_call_status_t
通话状态。
Definition voice.h:39
int tbox_voice_answer(uint32_t call_id)
接听通话。
int tbox_voice_get_audio_mode(tbox_voice_audio_mode_t *mode)
查询音频承载方式。
int tbox_voice_unregister_callback(void)
注销语音事件回调。
@ TBOX_ECALL_IN_BAND_TRANSFER
已切换到带内传输
Definition voice.h:126
@ TBOX_ECALL_MSD_NOT_ACKNOWLEDGED
MSD 未获确认
Definition voice.h:124
@ TBOX_ECALL_DIALING
正在拨号
Definition voice.h:116
@ TBOX_ECALL_AUTO_ANSWER_TIMEOUT
自动接听定时器超时
Definition voice.h:137
@ TBOX_ECALL_MSD_ACKNOWLEDGED
MSD 已确认
Definition voice.h:115
@ TBOX_ECALL_SENDING_START_IN_VOICE
通话期间开始发送 MSD
Definition voice.h:131
@ TBOX_ECALL_START_FAILED
发起失败
Definition voice.h:139
@ TBOX_ECALL_ACTIVE
通话中
Definition voice.h:118
@ TBOX_ECALL_T5_TIMEOUT
T5 定时器超时
Definition voice.h:133
@ TBOX_ECALL_SRVCC
已发生 SRVCC 切换
Definition voice.h:127
@ TBOX_ECALL_ALERTING
对端振铃
Definition voice.h:117
@ TBOX_ECALL_ONLY_DEREGISTRATION
要求立即去注册
Definition voice.h:128
@ TBOX_ECALL_DISCONNECTED
已断开
Definition voice.h:119
@ TBOX_ECALL_UNKNOWN
未知
Definition voice.h:112
@ TBOX_ECALL_T6_TIMEOUT
T6 定时器超时
Definition voice.h:134
@ TBOX_ECALL_START_SUCCEEDED
发起成功
Definition voice.h:138
@ TBOX_ECALL_START_NO_RETRY
无需重播
Definition voice.h:140
@ TBOX_ECALL_T7_TIMEOUT
T7 定时器超时
Definition voice.h:135
@ TBOX_ECALL_MAY_DEREGISTER
允许去注册
Definition voice.h:129
@ TBOX_ECALL_STARTING
正在启动
Definition voice.h:113
@ TBOX_ECALL_UPDATE_MSD
请求更新 MSD
Definition voice.h:125
@ TBOX_ECALL_LLACK_RECEIVED
已收到链路层确认
Definition voice.h:122
@ TBOX_ECALL_CALLBACK_UPDATE_MSD
PSAP 回呼期间请求更新 MSD.
Definition voice.h:130
@ TBOX_ECALL_REDIAL_TIMEOUT
重拨定时器超时
Definition voice.h:136
@ TBOX_ECALL_SENDING_MSD
正在发送 MSD
Definition voice.h:114
@ TBOX_ECALL_CLEARDOWN_RECEIVED
已收到清除确认
Definition voice.h:123
@ TBOX_ECALL_FAILED
失败
Definition voice.h:120
@ TBOX_ECALL_CALLBACK
回拨窗口
Definition voice.h:121
@ TBOX_ECALL_T2_TIMEOUT
T2 定时器超时
Definition voice.h:132
@ TBOX_ECALL_TEST_NUMBER
电话号码
Definition voice.h:83
@ TBOX_ECALL_TEST_URI
URI.
Definition voice.h:84
@ TBOX_CALL_VOICE
普通语音
Definition voice.h:55
@ TBOX_CALL_EMERGENCY
紧急呼叫
Definition voice.h:56
@ TBOX_VOICE_AUDIO_CODEC
模组编解码器
Definition voice.h:103
@ TBOX_VOICE_AUDIO_RTP
RTP.
Definition voice.h:104
@ TBOX_ECALL_EMERGENCY
紧急呼叫
Definition voice.h:74
@ TBOX_ECALL_RECONFIGURE
重新配置呼叫
Definition voice.h:75
@ TBOX_ECALL_TEST
测试呼叫
Definition voice.h:73
@ TBOX_ECALL_MANUAL
手动触发
Definition voice.h:65
@ TBOX_ECALL_AUTOMATIC
自动触发
Definition voice.h:64
@ TBOX_VOICE_EVENT_CALL
通话状态事件
Definition voice.h:188
@ TBOX_VOICE_EVENT_ECALL
eCall 状态事件
Definition voice.h:189
@ TBOX_VOICE_EMBEDDED
嵌入式卡
Definition voice.h:94
@ TBOX_VOICE_REMOTE
远程卡
Definition voice.h:95
@ TBOX_VOICE_SLOT_1
卡槽 1
Definition voice.h:92
@ TBOX_VOICE_SLOT_2
卡槽 2
Definition voice.h:93
@ TBOX_CALL_INCOMING
来电
Definition voice.h:43
@ TBOX_CALL_ALERTING
对端振铃
Definition voice.h:42
@ TBOX_CALL_ENDED
已结束
Definition voice.h:46
@ TBOX_CALL_ACTIVE
通话中
Definition voice.h:44
@ TBOX_CALL_WAITING
呼叫等待
Definition voice.h:47
@ TBOX_CALL_DIALING
正在拨号
Definition voice.h:41
@ TBOX_CALL_UNKNOWN
未知
Definition voice.h:40
@ TBOX_CALL_HELD
保持
Definition voice.h:45
通话状态事件。
Definition voice.h:157
char number[TBOX_RIL_PHONE_NUMBER_MAX]
NUL 结尾的对端号码
Definition voice.h:160
tbox_call_status_t status
call 状态
Definition voice.h:159
uint32_t id
通话标识
Definition voice.h:158
eCall 状态事件。
Definition voice.h:178
tbox_ecall_status_t status
eCall 状态
Definition voice.h:180
uint32_t call_id
通话标识
Definition voice.h:179
eCall 启动请求。
Definition voice.h:167
tbox_ecall_variant_t variant
呼叫类型
Definition voice.h:169
tbox_ecall_trigger_t trigger
触发方式
Definition voice.h:168
size_t msd_length
MSD 字节数
Definition voice.h:171
const uint8_t * msd
MSD,仅在调用期间借用
Definition voice.h:170
拨号请求。
Definition voice.h:147
char number[TBOX_RIL_PHONE_NUMBER_MAX]
NUL 结尾的号码
Definition voice.h:150
tbox_voice_slot_t slot
使用卡槽
Definition voice.h:149
tbox_call_type_t type
通话类别
Definition voice.h:148
语音事件。
Definition voice.h:196
tbox_ecall_event_t ecall
eCall 状态
Definition voice.h:201
tbox_voice_event_type_t type
事件类别
Definition voice.h:197
tbox_call_event_t call
通话状态
Definition voice.h:200