Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
568013bc
提交
568013bc
authored
12月 23, 2010
作者:
Moises Silva
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
freetdm: initial changes to make FreeTDM APIs non-blocking
上级
656ecc1b
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
220 行增加
和
61 行删除
+220
-61
ftdm_io.c
libs/freetdm/src/ftdm_io.c
+149
-44
ftmod_r2.c
libs/freetdm/src/ftmod/ftmod_r2/ftmod_r2.c
+3
-0
freetdm.h
libs/freetdm/src/include/freetdm.h
+49
-16
ftdm_declare.h
libs/freetdm/src/include/ftdm_declare.h
+9
-1
ftdm_core.h
libs/freetdm/src/include/private/ftdm_core.h
+1
-0
ftdm_types.h
libs/freetdm/src/include/private/ftdm_types.h
+9
-0
没有找到文件。
libs/freetdm/src/ftdm_io.c
浏览文件 @
568013bc
差异被折叠。
点击展开。
libs/freetdm/src/ftmod/ftmod_r2/ftmod_r2.c
浏览文件 @
568013bc
...
...
@@ -1595,6 +1595,9 @@ static FIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(ftdm_r2_configure_span_signaling)
/* use signals queue */
ftdm_set_flag
(
span
,
FTDM_SPAN_USE_SIGNALS_QUEUE
);
/* we can skip states (going straight from RING to UP) */
ftdm_set_flag
(
span
,
FTDM_SPAN_USE_SKIP_STATES
);
/* setup the scheduler */
snprintf
(
schedname
,
sizeof
(
schedname
),
"ftmod_r2_%s"
,
span
->
name
);
ftdm_assert
(
ftdm_sched_create
(
&
r2data
->
sched
,
schedname
)
==
FTDM_SUCCESS
,
"Failed to create schedule!
\n
"
);
...
...
libs/freetdm/src/include/freetdm.h
浏览文件 @
568013bc
...
...
@@ -349,11 +349,13 @@ typedef enum {
FTDM_SIGEVENT_FACILITY
,
/*!< In call facility event */
FTDM_SIGEVENT_TRACE
,
/*!<Interpreted trace event */
FTDM_SIGEVENT_TRACE_RAW
,
/*!<Raw trace event */
FTDM_SIGEVENT_INDICATION_COMPLETED
,
/*!< Last requested indication was completed */
FTDM_SIGEVENT_INVALID
,
/*!<Invalid */
}
ftdm_signal_event_t
;
#define SIGNAL_STRINGS "START", "STOP", "RELEASED", "UP", "FLASH", "PROCEED", "RINGING", "PROGRESS", \
"PROGRESS_MEDIA", "ALARM_TRAP", "ALARM_CLEAR", \
"COLLECTED_DIGIT", "ADD_CALL", "RESTART", "SIGSTATUS_CHANGED", "COLLISION", "FACILITY", "TRACE", "TRACE_RAW", "INVALID"
"COLLECTED_DIGIT", "ADD_CALL", "RESTART", "SIGSTATUS_CHANGED", "COLLISION", "FACILITY", \
"TRACE", "TRACE_RAW", "INDICATION_COMPLETED", "INVALID"
/*! \brief Move from string to ftdm_signal_event_t and viceversa */
FTDM_STR2ENUM_P
(
ftdm_str2ftdm_signal_event
,
ftdm_signal_event2str
,
ftdm_signal_event_t
)
...
...
@@ -434,6 +436,31 @@ typedef struct {
char
digits
[
FTDM_DIGITS_LIMIT
];
}
ftdm_event_collected_t
;
/*! \brief FreeTDM supported indications.
* This is used during incoming calls when you want to request the signaling stack
* to notify about indications occurring locally. See ftdm_channel_call_indicate for more info */
typedef
enum
{
FTDM_CHANNEL_INDICATE_RINGING
,
FTDM_CHANNEL_INDICATE_PROCEED
,
FTDM_CHANNEL_INDICATE_PROGRESS
,
FTDM_CHANNEL_INDICATE_PROGRESS_MEDIA
,
FTDM_CHANNEL_INDICATE_BUSY
,
/* Using this indication is equivalent to call ftdm_channel_call_answer API */
FTDM_CHANNEL_INDICATE_ANSWER
,
FTDM_CHANNEL_INDICATE_INVALID
,
}
ftdm_channel_indication_t
;
#define INDICATION_STRINGS "RINGING", "PROCEED", "PROGRESS", "PROGRESS_MEDIA", "BUSY", "ANSWER", "INVALID"
/*! \brief Move from string to ftdm_channel_indication_t and viceversa */
FTDM_STR2ENUM_P
(
ftdm_str2channel_indication
,
ftdm_channel_indication2str
,
ftdm_channel_indication_t
)
typedef
struct
{
/* The indication that was completed */
ftdm_channel_indication_t
indication
;
/* Completion status of the indication */
ftdm_status_t
status
;
}
ftdm_event_indication_completed_t
;
/*! \brief Generic signaling message */
struct
ftdm_sigmsg
{
ftdm_signal_event_t
event_id
;
/*!< The type of message */
...
...
@@ -444,7 +471,8 @@ struct ftdm_sigmsg {
union
{
ftdm_event_sigstatus_t
sigstatus
;
/*!< valid if event_id is FTDM_SIGEVENT_SIGSTATUS_CHANGED */
ftdm_event_trace_t
logevent
;
/*!< valid if event_id is FTDM_SIGEVENT_TRACE or FTDM_SIGEVENT_TRACE_RAW */
ftdm_event_collected_t
collected
;
/*!< valif if event_id is FTDM_SIGEVENT_COLLECTED_DIGIT */
ftdm_event_collected_t
collected
;
/*!< valid if event_id is FTDM_SIGEVENT_COLLECTED_DIGIT */
ftdm_event_indication_completed_t
indication_completed
;
/*!< valid if the event_id is FTDM_SIGEVENT_INDICATION_COMPLETED */
}
ev_data
;
struct
{
uint8_t
autofree
;
/*!< Whether the freetdm core will free it after message delivery */
...
...
@@ -708,17 +736,6 @@ typedef enum {
FTDM_CODEC_NONE
=
(
1
<<
30
)
}
ftdm_codec_t
;
/*! \brief FreeTDM supported indications.
* This is used during incoming calls when you want to request the signaling stack
* to notify about indications occurring locally */
typedef
enum
{
FTDM_CHANNEL_INDICATE_RINGING
,
FTDM_CHANNEL_INDICATE_PROCEED
,
FTDM_CHANNEL_INDICATE_PROGRESS
,
FTDM_CHANNEL_INDICATE_PROGRESS_MEDIA
,
FTDM_CHANNEL_INDICATE_BUSY
,
}
ftdm_channel_indication_t
;
/*! \brief FreeTDM supported hardware alarms. */
typedef
enum
{
FTDM_ALARM_NONE
=
0
,
...
...
@@ -741,7 +758,12 @@ FT_DECLARE(ftdm_status_t) ftdm_global_set_queue_handler(ftdm_queue_handler_t *ha
*/
FT_DECLARE
(
int
)
ftdm_channel_get_availability
(
ftdm_channel_t
*
ftdmchan
);
/*! \brief Answer call */
/*! \brief Answer call. This can also be accomplished by ftdm_channel_call_indicate with FTDM_CHANNEL_INDICATE_ANSWER, in both
* cases you will get a FTDM_SIGEVENT_INDICATION_COMPLETED when the indication is sent (or an error occurs)
* \note Although this API will result in FTDM_SIGEVENT_INDICATION_COMPLETED event being delivered,
* there is no guarantee of whether the event will arrive after or before your execution thread returns
* from ftdm_channel_call_answer
*/
#define ftdm_channel_call_answer(ftdmchan) _ftdm_channel_call_answer(__FILE__, __FUNCTION__, __LINE__, (ftdmchan))
/*! \brief Answer call recording the source code point where the it was called (see ftdm_channel_call_answer for an easy to use macro) */
...
...
@@ -753,7 +775,13 @@ FT_DECLARE(ftdm_status_t) _ftdm_channel_call_answer(const char *file, const char
/*! \brief Place an outgoing call recording the source code point where it was called (see ftdm_channel_call_place for an easy to use macro) */
FT_DECLARE
(
ftdm_status_t
)
_ftdm_channel_call_place
(
const
char
*
file
,
const
char
*
func
,
int
line
,
ftdm_channel_t
*
ftdmchan
);
/*! \brief Indicate a new condition in an incoming call */
/*! \brief Indicate a new condition in an incoming call
* \note Every indication request will result in FTDM_SIGEVENT_INDICATION_COMPLETED event being delivered with
* the proper status that will inform you if the request was successful or not.
* Be aware there is no guarantee of whether the event will arrive after or before your execution thread returns
* from ftdm_channel_call_indicate. This means you could get FTDM_SIGEVENT_INDICATION_COMPLETED even before
* your execution thread returns from the ftdm_channel_call_indicate() API
*/
#define ftdm_channel_call_indicate(ftdmchan, indication) _ftdm_channel_call_indicate(__FILE__, __FUNCTION__, __LINE__, (ftdmchan), (indication))
/*! \brief Indicate a new condition in an incoming call recording the source code point where it was called (see ftdm_channel_call_indicate for an easy to use macro) */
...
...
@@ -1494,9 +1522,14 @@ FT_DECLARE(const char *) ftdm_channel_get_last_state_str(const ftdm_channel_t *c
*/
FT_DECLARE
(
char
*
)
ftdm_channel_get_history_str
(
const
ftdm_channel_t
*
channel
);
/*! \brief Initialize channel state for an outgoing call */
/*! \brief Initialize channel state for an outgoing call
* \note This API will eventually be deprecated, is only needed if you use boost signaling
*/
FT_DECLARE
(
ftdm_status_t
)
ftdm_channel_init
(
ftdm_channel_t
*
ftdmchan
);
/*! \brief Enable/disable blocking mode in the channels for this span */
FT_DECLARE
(
ftdm_status_t
)
ftdm_span_set_blocking_mode
(
const
ftdm_span_t
*
span
,
ftdm_bool_t
enabled
);
/*! \brief Initialize the library */
FT_DECLARE
(
ftdm_status_t
)
ftdm_global_init
(
void
);
...
...
libs/freetdm/src/include/ftdm_declare.h
浏览文件 @
568013bc
...
...
@@ -183,7 +183,15 @@ typedef enum {
FTDM_TIMEOUT
,
/*!< Operation timed out (ie: polling on a device)*/
FTDM_NOTIMPL
,
/*!< Operation not implemented */
FTDM_BREAK
,
/*!< Request the caller to perform a break (context-dependant, ie: stop getting DNIS/ANI) */
FTDM_EINVAL
/*!< Invalid argument */
/*!< Any new return codes should try to mimc unix style error codes, no need to reinvent */
/* Remapping some of the codes that were before */
FTDM_ENOMEM
=
FTDM_MEMERR
,
/*!< Memory error */
FTDM_ETIMEDOUT
=
FTDM_TIMEOUT
,
/*!< Operation timedout */
FTDM_ENOSYS
=
FTDM_NOTIMPL
,
/*!< The function is not implemented */
FTDM_EINVAL
,
/*!< Invalid argument */
FTDM_ECANCELED
,
/*!< Operation cancelled */
}
ftdm_status_t
;
/*! \brief FreeTDM bool type. */
...
...
libs/freetdm/src/include/private/ftdm_core.h
浏览文件 @
568013bc
...
...
@@ -606,6 +606,7 @@ FT_DECLARE(int) ftdm_vasprintf(char **ret, const char *fmt, va_list ap);
FT_DECLARE
(
ftdm_status_t
)
ftdm_span_close_all
(
void
);
FT_DECLARE
(
ftdm_status_t
)
ftdm_channel_open_chan
(
ftdm_channel_t
*
ftdmchan
);
FT_DECLARE
(
void
)
ftdm_ack_indication
(
const
ftdm_channel_t
*
ftdmchan
,
ftdm_channel_indication_t
indication
,
ftdm_status_t
status
);
/*!
* \brief Retrieves an event from the span
...
...
libs/freetdm/src/include/private/ftdm_types.h
浏览文件 @
568013bc
...
...
@@ -260,9 +260,16 @@ FTDM_STR2ENUM_P(ftdm_str2ftdm_channel_state, ftdm_channel_state2str, ftdm_channe
#define FTDM_CHANNEL_OUTBOUND (1ULL << 18)
#define FTDM_CHANNEL_SUSPENDED (1ULL << 19)
#define FTDM_CHANNEL_3WAY (1ULL << 20)
/* this 3 flags are really nonsense used by boost module only, as soon
* as we deprecate/delete boost module we can get rid of them
* ==================
* */
#define FTDM_CHANNEL_PROGRESS (1ULL << 21)
#define FTDM_CHANNEL_MEDIA (1ULL << 22)
#define FTDM_CHANNEL_ANSWERED (1ULL << 23)
/* ================== */
#define FTDM_CHANNEL_MUTE (1ULL << 24)
#define FTDM_CHANNEL_USE_RX_GAIN (1ULL << 25)
#define FTDM_CHANNEL_USE_TX_GAIN (1ULL << 26)
...
...
@@ -273,6 +280,8 @@ FTDM_STR2ENUM_P(ftdm_str2ftdm_channel_state, ftdm_channel_state2str, ftdm_channe
#define FTDM_CHANNEL_TX_DISABLED (1ULL << 31)
/*!< The user knows about a call in this channel */
#define FTDM_CHANNEL_CALL_STARTED (1ULL << 32)
/*!< The user wants non-blocking operations in the channel */
#define FTDM_CHANNEL_NONBLOCK (1ULL << 33)
typedef
enum
{
ZSM_NONE
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论