Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
9ef6b410
提交
9ef6b410
authored
1月 05, 2007
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix names
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@3910
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
085b8971
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
52 行增加
和
52 行删除
+52
-52
mod_woomera.c
src/mod/endpoints/mod_woomera/mod_woomera.c
+52
-52
没有找到文件。
src/mod/endpoints/mod_woomera/mod_woomera.c
浏览文件 @
9ef6b410
...
...
@@ -26,7 +26,7 @@
* Anthony Minessale II <anthmct@yahoo.com>
*
*
* mod_woomera
chan
.c -- Woomera Endpoint Module
* mod_woomera.c -- Woomera Endpoint Module
*
*/
#include <switch.h>
...
...
@@ -164,18 +164,18 @@ typedef struct woomera_event_queue woomera_event_queue;
static
woomera_profile
default_profile
;
static
switch_status_t
woomera
chan
_on_init
(
switch_core_session_t
*
session
);
static
switch_status_t
woomera
chan
_on_hangup
(
switch_core_session_t
*
session
);
static
switch_status_t
woomera
chan
_on_ring
(
switch_core_session_t
*
session
);
static
switch_status_t
woomera
chan
_on_loopback
(
switch_core_session_t
*
session
);
static
switch_status_t
woomera
chan
_on_transmit
(
switch_core_session_t
*
session
);
static
switch_status_t
woomera
chan
_outgoing_channel
(
switch_core_session_t
*
session
,
switch_caller_profile_t
*
outbound_profile
,
static
switch_status_t
woomera_on_init
(
switch_core_session_t
*
session
);
static
switch_status_t
woomera_on_hangup
(
switch_core_session_t
*
session
);
static
switch_status_t
woomera_on_ring
(
switch_core_session_t
*
session
);
static
switch_status_t
woomera_on_loopback
(
switch_core_session_t
*
session
);
static
switch_status_t
woomera_on_transmit
(
switch_core_session_t
*
session
);
static
switch_status_t
woomera_outgoing_channel
(
switch_core_session_t
*
session
,
switch_caller_profile_t
*
outbound_profile
,
switch_core_session_t
**
new_session
,
switch_memory_pool_t
*
pool
);
static
switch_status_t
woomera
chan
_read_frame
(
switch_core_session_t
*
session
,
switch_frame_t
**
frame
,
int
timeout
,
static
switch_status_t
woomera_read_frame
(
switch_core_session_t
*
session
,
switch_frame_t
**
frame
,
int
timeout
,
switch_io_flag_t
flags
,
int
stream_id
);
static
switch_status_t
woomera
chan
_write_frame
(
switch_core_session_t
*
session
,
switch_frame_t
*
frame
,
int
timeout
,
static
switch_status_t
woomera_write_frame
(
switch_core_session_t
*
session
,
switch_frame_t
*
frame
,
int
timeout
,
switch_io_flag_t
flags
,
int
stream_id
);
static
switch_status_t
woomera
chan
_kill_channel
(
switch_core_session_t
*
session
,
int
sig
);
static
switch_status_t
woomera_kill_channel
(
switch_core_session_t
*
session
,
int
sig
);
static
void
tech_destroy
(
private_object
*
tech_pvt
);
static
void
woomera_printf
(
woomera_profile
*
profile
,
switch_socket_t
*
socket
,
char
*
fmt
,
...);
static
char
*
woomera_message_header
(
woomera_message
*
wmsg
,
char
*
key
);
...
...
@@ -196,7 +196,7 @@ static int tech_activate(private_object * tech_pvt);
returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next
so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it.
*/
static
switch_status_t
woomera
chan
_on_init
(
switch_core_session_t
*
session
)
static
switch_status_t
woomera_on_init
(
switch_core_session_t
*
session
)
{
switch_channel_t
*
channel
;
struct
private_object
*
tech_pvt
=
NULL
;
...
...
@@ -235,12 +235,12 @@ static switch_status_t woomerachan_on_init(switch_core_session_t *session)
switch_core_session_launch_thread
(
session
,
woomera_channel_thread_run
,
session
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%s WOOMERA
CHAN
INIT
\n
"
,
switch_channel_get_name
(
channel
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%s WOOMERA INIT
\n
"
,
switch_channel_get_name
(
channel
));
return
SWITCH_STATUS_SUCCESS
;
}
static
switch_status_t
woomera
chan
_on_ring
(
switch_core_session_t
*
session
)
static
switch_status_t
woomera_on_ring
(
switch_core_session_t
*
session
)
{
switch_channel_t
*
channel
=
NULL
;
struct
private_object
*
tech_pvt
=
NULL
;
...
...
@@ -251,12 +251,12 @@ static switch_status_t woomerachan_on_ring(switch_core_session_t *session)
tech_pvt
=
switch_core_session_get_private
(
session
);
assert
(
tech_pvt
!=
NULL
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%s WOOMERA
CHAN
RING
\n
"
,
switch_channel_get_name
(
channel
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%s WOOMERA RING
\n
"
,
switch_channel_get_name
(
channel
));
return
SWITCH_STATUS_SUCCESS
;
}
static
switch_status_t
woomera
chan
_on_execute
(
switch_core_session_t
*
session
)
static
switch_status_t
woomera_on_execute
(
switch_core_session_t
*
session
)
{
switch_channel_t
*
channel
=
NULL
;
...
...
@@ -268,13 +268,13 @@ static switch_status_t woomerachan_on_execute(switch_core_session_t *session)
tech_pvt
=
switch_core_session_get_private
(
session
);
assert
(
tech_pvt
!=
NULL
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%s WOOMERA
CHAN
EXECUTE
\n
"
,
switch_channel_get_name
(
channel
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%s WOOMERA EXECUTE
\n
"
,
switch_channel_get_name
(
channel
));
return
SWITCH_STATUS_SUCCESS
;
}
static
switch_status_t
woomera
chan
_on_hangup
(
switch_core_session_t
*
session
)
static
switch_status_t
woomera_on_hangup
(
switch_core_session_t
*
session
)
{
switch_channel_t
*
channel
=
NULL
;
struct
private_object
*
tech_pvt
=
NULL
;
...
...
@@ -288,7 +288,7 @@ static switch_status_t woomerachan_on_hangup(switch_core_session_t *session)
switch_core_codec_destroy
(
&
tech_pvt
->
read_codec
);
switch_core_codec_destroy
(
&
tech_pvt
->
write_codec
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%s WOOMERA
CHAN
HANGUP
\n
"
,
switch_channel_get_name
(
channel
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%s WOOMERA HANGUP
\n
"
,
switch_channel_get_name
(
channel
));
tech_destroy
(
tech_pvt
);
return
SWITCH_STATUS_SUCCESS
;
...
...
@@ -312,7 +312,7 @@ static void udp_socket_close(struct private_object *tech_pvt)
}
static
switch_status_t
woomera
chan
_kill_channel
(
switch_core_session_t
*
session
,
int
sig
)
static
switch_status_t
woomera_kill_channel
(
switch_core_session_t
*
session
,
int
sig
)
{
switch_channel_t
*
channel
=
NULL
;
struct
private_object
*
tech_pvt
=
NULL
;
...
...
@@ -330,7 +330,7 @@ static switch_status_t woomerachan_kill_channel(switch_core_session_t *session,
switch
(
sig
)
{
case
SWITCH_SIG_KILL
:
udp_socket_close
(
tech_pvt
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%s WOOMERA
CHAN
KILL
\n
"
,
switch_channel_get_name
(
channel
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"%s WOOMERA KILL
\n
"
,
switch_channel_get_name
(
channel
));
break
;
case
SWITCH_SIG_BREAK
:
{
...
...
@@ -345,19 +345,19 @@ static switch_status_t woomerachan_kill_channel(switch_core_session_t *session,
return
SWITCH_STATUS_SUCCESS
;
}
static
switch_status_t
woomera
chan
_on_loopback
(
switch_core_session_t
*
session
)
static
switch_status_t
woomera_on_loopback
(
switch_core_session_t
*
session
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"WOOMERA
CHAN
LOOPBACK
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"WOOMERA LOOPBACK
\n
"
);
return
SWITCH_STATUS_SUCCESS
;
}
static
switch_status_t
woomera
chan
_on_transmit
(
switch_core_session_t
*
session
)
static
switch_status_t
woomera_on_transmit
(
switch_core_session_t
*
session
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"WOOMERA
CHAN
TRANSMIT
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"WOOMERA TRANSMIT
\n
"
);
return
SWITCH_STATUS_SUCCESS
;
}
static
switch_status_t
woomera
chan
_waitfor_read
(
switch_core_session_t
*
session
,
int
ms
,
int
stream_id
)
static
switch_status_t
woomera_waitfor_read
(
switch_core_session_t
*
session
,
int
ms
,
int
stream_id
)
{
struct
private_object
*
tech_pvt
=
NULL
;
...
...
@@ -367,7 +367,7 @@ static switch_status_t woomerachan_waitfor_read(switch_core_session_t *session,
return
switch_socket_waitfor
(
&
tech_pvt
->
read_poll
,
ms
)
?
SWITCH_STATUS_FALSE
:
SWITCH_STATUS_SUCCESS
;
}
static
switch_status_t
woomera
chan
_waitfor_write
(
switch_core_session_t
*
session
,
int
ms
,
int
stream_id
)
static
switch_status_t
woomera_waitfor_write
(
switch_core_session_t
*
session
,
int
ms
,
int
stream_id
)
{
struct
private_object
*
tech_pvt
=
NULL
;
...
...
@@ -378,7 +378,7 @@ static switch_status_t woomerachan_waitfor_write(switch_core_session_t *session,
// return switch_socket_waitfor(&tech_pvt->write_poll, ms);
}
static
switch_status_t
woomera
chan
_read_frame
(
switch_core_session_t
*
session
,
switch_frame_t
**
frame
,
int
timeout
,
static
switch_status_t
woomera_read_frame
(
switch_core_session_t
*
session
,
switch_frame_t
**
frame
,
int
timeout
,
switch_io_flag_t
flags
,
int
stream_id
)
{
switch_channel_t
*
channel
=
NULL
;
...
...
@@ -396,7 +396,7 @@ static switch_status_t woomerachan_read_frame(switch_core_session_t *session, sw
return
SWITCH_STATUS_GENERR
;
}
/*
if ((status = woomera
chan
_waitfor_read(session, -1)) != SWITCH_STATUS_SUCCESS) {
if ((status = woomera_waitfor_read(session, -1)) != SWITCH_STATUS_SUCCESS) {
return status;
}1<
*/
...
...
@@ -413,7 +413,7 @@ static switch_status_t woomerachan_read_frame(switch_core_session_t *session, sw
return
SWITCH_STATUS_FALSE
;
}
static
switch_status_t
woomera
chan
_write_frame
(
switch_core_session_t
*
session
,
switch_frame_t
*
frame
,
int
timeout
,
static
switch_status_t
woomera_write_frame
(
switch_core_session_t
*
session
,
switch_frame_t
*
frame
,
int
timeout
,
switch_io_flag_t
flags
,
int
stream_id
)
{
switch_channel_t
*
channel
=
NULL
;
...
...
@@ -441,36 +441,36 @@ static switch_status_t woomerachan_write_frame(switch_core_session_t *session, s
return
SWITCH_STATUS_GENERR
;
}
static
const
switch_state_handler_table_t
woomera
chan
_event_handlers
=
{
/*.on_init */
woomera
chan
_on_init
,
/*.on_ring */
woomera
chan
_on_ring
,
/*.on_execute */
woomera
chan
_on_execute
,
/*.on_hangup */
woomera
chan
_on_hangup
,
/*.on_loopback */
woomera
chan
_on_loopback
,
/*.on_transmit */
woomera
chan
_on_transmit
static
const
switch_state_handler_table_t
woomera_event_handlers
=
{
/*.on_init */
woomera_on_init
,
/*.on_ring */
woomera_on_ring
,
/*.on_execute */
woomera_on_execute
,
/*.on_hangup */
woomera_on_hangup
,
/*.on_loopback */
woomera_on_loopback
,
/*.on_transmit */
woomera_on_transmit
};
static
const
switch_io_routines_t
woomera
chan
_io_routines
=
{
/*.outgoing_channel */
woomera
chan
_outgoing_channel
,
static
const
switch_io_routines_t
woomera_io_routines
=
{
/*.outgoing_channel */
woomera_outgoing_channel
,
/*.answer_channel */
NULL
,
/*.read_frame */
woomera
chan
_read_frame
,
/*.write_frame */
woomera
chan
_write_frame
,
/*.kill_channel */
woomera
chan
_kill_channel
,
/*.waitfor_read */
woomera
chan
_waitfor_read
,
/*.waitfor_write */
woomera
chan
_waitfor_write
/*.read_frame */
woomera_read_frame
,
/*.write_frame */
woomera_write_frame
,
/*.kill_channel */
woomera_kill_channel
,
/*.waitfor_read */
woomera_waitfor_read
,
/*.waitfor_write */
woomera_waitfor_write
};
static
const
switch_endpoint_interface_t
woomera
chan
_endpoint_interface
=
{
static
const
switch_endpoint_interface_t
woomera_endpoint_interface
=
{
/*.interface_name */
"woomera"
,
/*.io_routines */
&
woomera
chan
_io_routines
,
/*.event_handlers */
&
woomera
chan
_event_handlers
,
/*.io_routines */
&
woomera_io_routines
,
/*.event_handlers */
&
woomera_event_handlers
,
/*.private */
NULL
,
/*.next */
NULL
};
static
const
switch_loadable_module_interface_t
woomera
chan
_module_interface
=
{
static
const
switch_loadable_module_interface_t
woomera_module_interface
=
{
/*.module_name */
modname
,
/*.endpoint_interface */
&
woomera
chan
_endpoint_interface
,
/*.endpoint_interface */
&
woomera_endpoint_interface
,
/*.timer_interface */
NULL
,
/*.dialplan_interface */
NULL
,
/*.codec_interface */
NULL
,
...
...
@@ -481,10 +481,10 @@ static const switch_loadable_module_interface_t woomerachan_module_interface = {
/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
*/
static
switch_status_t
woomera
chan
_outgoing_channel
(
switch_core_session_t
*
session
,
switch_caller_profile_t
*
outbound_profile
,
static
switch_status_t
woomera_outgoing_channel
(
switch_core_session_t
*
session
,
switch_caller_profile_t
*
outbound_profile
,
switch_core_session_t
**
new_session
,
switch_memory_pool_t
*
pool
)
{
if
((
*
new_session
=
switch_core_session_request
(
&
woomera
chan
_endpoint_interface
,
pool
))
!=
0
)
{
if
((
*
new_session
=
switch_core_session_request
(
&
woomera_endpoint_interface
,
pool
))
!=
0
)
{
struct
private_object
*
tech_pvt
;
switch_channel_t
*
channel
;
...
...
@@ -1258,7 +1258,7 @@ static void *woomera_thread_run(void *obj)
}
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_NOTICE
,
"New Inbound Channel %s!
\n
"
,
name
);
if
((
session
=
switch_core_session_request
(
&
woomera
chan
_endpoint_interface
,
NULL
))
!=
0
)
{
if
((
session
=
switch_core_session_request
(
&
woomera_endpoint_interface
,
NULL
))
!=
0
)
{
struct
private_object
*
tech_pvt
;
switch_channel_t
*
channel
;
...
...
@@ -1409,7 +1409,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(const switch_loadable_mod
/* connect my internal structure to the blank pointer passed to me */
*
module_interface
=
&
woomera
chan
_module_interface
;
*
module_interface
=
&
woomera_module_interface
;
/* indicate that the module should continue to be loaded */
return
SWITCH_STATUS_SUCCESS
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论