Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
bc067ebc
提交
bc067ebc
authored
10月 28, 2010
作者:
Giovanni Maruzzelli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
skypopen: cosmetics
上级
f4a6a07e
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
16 行增加
和
190 行删除
+16
-190
mod_skypopen.c
src/mod/endpoints/mod_skypopen/mod_skypopen.c
+13
-159
skypopen.h
src/mod/endpoints/mod_skypopen/skypopen.h
+0
-2
skypopen_protocol.c
src/mod/endpoints/mod_skypopen/skypopen_protocol.c
+3
-29
没有找到文件。
src/mod/endpoints/mod_skypopen/mod_skypopen.c
浏览文件 @
bc067ebc
差异被折叠。
点击展开。
src/mod/endpoints/mod_skypopen/skypopen.h
浏览文件 @
bc067ebc
...
...
@@ -387,9 +387,7 @@ int skypopen_close_socket(unsigned int fd);
private_t
*
find_available_skypopen_interface_rr
(
private_t
*
tech_pvt_calling
);
int
remote_party_is_ringing
(
private_t
*
tech_pvt
);
int
remote_party_is_early_media
(
private_t
*
tech_pvt
);
//int skypopen_answer(private_t * tech_pvt, char *id, char *value);
int
skypopen_answer
(
private_t
*
tech_pvt
);
//int skypopen_transfer(private_t * tech_pvt, char *id, char *value);
int
skypopen_transfer
(
private_t
*
tech_pvt
);
#ifndef WIN32
int
skypopen_socket_create_and_bind
(
private_t
*
tech_pvt
,
int
*
which_port
);
...
...
src/mod/endpoints/mod_skypopen/skypopen_protocol.c
浏览文件 @
bc067ebc
...
...
@@ -97,10 +97,6 @@ int skypopen_socket_create_and_bind(private_t *tech_pvt, unsigned short *which_p
/* for virtual machines, eg: Linux domU-12-31-39-02-68-28 2.6.18-xenU-ec2-v1.0 #2 SMP Tue Feb 19 10:51:53 EST 2008 i686 athlon i386 GNU/Linux
* use:
* sockbufsize=SAMPLES_PER_FRAME * 8;
*/
#ifdef WIN32
sockbufsize
=
SAMPLES_PER_FRAME
*
8
;
#else
...
...
@@ -116,10 +112,6 @@ int skypopen_socket_create_and_bind(private_t *tech_pvt, unsigned short *which_p
getsockopt
(
s
,
SOL_SOCKET
,
SO_RCVBUF
,
(
char
*
)
&
sockbufsize
,
&
size
);
DEBUGA_SKYPE
(
"2 SO_RCVBUF is %d, size is %d
\n
"
,
SKYPOPEN_P_LOG
,
sockbufsize
,
size
);
/* for virtual machines, eg: Linux domU-12-31-39-02-68-28 2.6.18-xenU-ec2-v1.0 #2 SMP Tue Feb 19 10:51:53 EST 2008 i686 athlon i386 GNU/Linux
* use:
* sockbufsize=SAMPLES_PER_FRAME * 8;
*/
#ifdef WIN32
sockbufsize
=
SAMPLES_PER_FRAME
*
8
;
#else
...
...
@@ -175,11 +167,9 @@ int skypopen_signaling_read(private_t *tech_pvt)
a
++
;
if
(
read_from_pipe
[
i
]
==
'\0'
)
{
//if (!strstr(message, "DURATION")) {
DEBUGA_SKYPE
(
"READING: |||%s|||
\n
"
,
SKYPOPEN_P_LOG
,
message
);
strncpy
(
tech_pvt
->
message
,
message
,
sizeof
(
tech_pvt
->
message
));
//}
if
(
!
strcasecmp
(
message
,
"SILENT_MODE OFF"
))
{
if
(
tech_pvt
->
silent_mode
)
{
...
...
@@ -304,7 +294,6 @@ int skypopen_signaling_read(private_t *tech_pvt)
if
(
!
strcasecmp
(
prop
,
"RECEIVEDAUTHREQUEST"
))
{
char
msg_to_skype
[
256
];
DEBUGA_SKYPE
(
"Skype MSG: message: %s, obj: %s, id: %s, prop: %s!
\n
"
,
SKYPOPEN_P_LOG
,
message
,
obj
,
id
,
prop
);
//TODO: allow authorization based on config param
sprintf
(
msg_to_skype
,
"SET USER %s ISAUTHORIZED TRUE"
,
id
);
skypopen_signaling_write
(
tech_pvt
,
msg_to_skype
);
}
...
...
@@ -508,7 +497,6 @@ int skypopen_signaling_read(private_t *tech_pvt)
//SKYPOPEN_P_LOG, message, obj, id, prop, value, where ? where : "NULL");
if
(
!
strcasecmp
(
prop
,
"PARTNER_HANDLE"
))
{
//if (tech_pvt->interface_state != SKYPOPEN_STATE_SELECTED && (!strlen(tech_pvt->skype_call_id) || !strlen(tech_pvt->session_uuid_str))) {}
if
(
tech_pvt
->
interface_state
==
SKYPOPEN_STATE_IDLE
){
/* we are NOT inside an active call */
DEBUGA_SKYPE
(
"Call %s go to skypopen_partner_handle_ring
\n
"
,
SKYPOPEN_P_LOG
,
id
);
...
...
@@ -528,7 +516,6 @@ int skypopen_signaling_read(private_t *tech_pvt)
skypopen_strncpy
(
tech_pvt
->
ring_value
,
value
,
sizeof
(
tech_pvt
->
ring_value
));
skypopen_strncpy
(
tech_pvt
->
answer_id
,
id
,
sizeof
(
tech_pvt
->
answer_id
));
skypopen_strncpy
(
tech_pvt
->
answer_value
,
value
,
sizeof
(
tech_pvt
->
answer_value
));
//skypopen_transfer(tech_pvt, id, value);
skypopen_transfer
(
tech_pvt
);
}
}
...
...
@@ -592,8 +579,6 @@ int skypopen_signaling_read(private_t *tech_pvt)
if
(
!
strcasecmp
(
value
,
"RINGING"
))
{
char
msg_to_skype
[
1024
];
//if ((tech_pvt->interface_state != SKYPOPEN_STATE_SELECTED && tech_pvt->interface_state != SKYPOPEN_STATE_DIALING)
//&& (!strlen(tech_pvt->skype_call_id) || !strlen(tech_pvt->session_uuid_str))) {}
if
(
tech_pvt
->
interface_state
==
SKYPOPEN_STATE_IDLE
){
// CLOUDTREE (Thomas Hazel)
skypopen_strncpy
(
tech_pvt
->
skype_call_id
,
id
,
sizeof
(
tech_pvt
->
skype_call_id
)
-
1
);
...
...
@@ -632,7 +617,6 @@ int skypopen_signaling_read(private_t *tech_pvt)
tech_pvt
->
interface_state
=
SKYPOPEN_STATE_DOWN
;
DEBUGA_SKYPE
(
"we're now DOWN
\n
"
,
SKYPOPEN_P_LOG
);
return
CALLFLOW_INCOMING_HANGUP
;
//skypopen_sleep(10000);
}
}
else
{
...
...
@@ -664,11 +648,6 @@ int skypopen_signaling_read(private_t *tech_pvt)
skypopen_signaling_write
(
tech_pvt
,
msg_to_skype
);
remote_party_is_early_media
(
tech_pvt
);
/* CLOUDTREE (Thomas Hazel)
} else if (!strcasecmp(value, "MISSED")) {
DEBUGA_SKYPE("We missed skype_call %s\n", SKYPOPEN_P_LOG, id);
*/
// CLOUDTREE (Thomas Hazel)
}
else
if
(
!
strcasecmp
(
value
,
"MISSED"
)
||
!
strcasecmp
(
value
,
"FINISHED"
))
{
if
(
!
strcasecmp
(
tech_pvt
->
skype_call_id
,
id
))
{
DEBUGA_SKYPE
(
"skype_call %s is MY call, now I'm going DOWN
\n
"
,
SKYPOPEN_P_LOG
,
id
);
...
...
@@ -933,7 +912,6 @@ void *skypopen_do_tcp_srv_thread_func(void *obj)
if
(
switch_buffer_freespace
(
tech_pvt
->
read_buffer
)
<
len
)
{
switch_buffer_zero
(
tech_pvt
->
read_buffer
);
nospace
=
1
;
//switch_buffer_toss(tech_pvt->read_buffer, len);
}
switch_buffer_write
(
tech_pvt
->
read_buffer
,
srv_in
,
len
);
}
...
...
@@ -1022,7 +1000,7 @@ void *skypopen_do_tcp_cli_thread_func(void *obj)
if
(
!
(
running
&&
tech_pvt
->
running
))
break
;
FD_ZERO
(
&
fsgio
);
togio
.
tv_usec
=
60000
;
//
2
0msec
togio
.
tv_usec
=
60000
;
//
6
0msec
togio
.
tv_sec
=
0
;
fdselectgio
=
s
;
FD_SET
(
fdselectgio
,
&
fsgio
);
...
...
@@ -1558,8 +1536,8 @@ int skypopen_send_message(private_t *tech_pvt, const char *message_P)
unsigned
int
len
=
strlen
(
message_P
);
XEvent
e
;
skypopen_sleep
(
1000
);
//giovanni
XFlush
(
disp
);
//giovanni
skypopen_sleep
(
1000
);
XFlush
(
disp
);
memset
(
&
e
,
0
,
sizeof
(
e
));
e
.
xclient
.
type
=
ClientMessage
;
...
...
@@ -1581,7 +1559,6 @@ int skypopen_send_message(private_t *tech_pvt, const char *message_P)
pos
+=
i
;
}
while
(
pos
<=
len
);
//giovanni XSync(disp, False);
XFlush
(
disp
);
// CLOUDTREE (Thomas Hazel)
...
...
@@ -1923,7 +1900,6 @@ void *skypopen_do_skypeapi_thread_func(void *obj)
#endif
tech_pvt
->
skypopen_api_thread
=
NULL
;
//XCloseDisplay(disp);
return
NULL
;
}
...
...
@@ -1962,8 +1938,6 @@ int skypopen_answered(private_t *tech_pvt)
switch_core_session_t
*
session
=
NULL
;
switch_channel_t
*
channel
=
NULL
;
//WARNINGA("ANSWERED tech_pvt->skype_call_id=%s, tech_pvt->skype_callflow=%d, tech_pvt->interface_state=%d, tech_pvt->skype_user=%s, tech_pvt->callid_number=%s, tech_pvt->ring_value=%s, tech_pvt->ring_id=%s, tech_pvt->answer_value=%s, tech_pvt->answer_id=%s\n", SKYPOPEN_P_LOG, tech_pvt->skype_call_id, tech_pvt->skype_callflow, tech_pvt->interface_state, tech_pvt->skype_user, tech_pvt->callid_number, tech_pvt->ring_value, tech_pvt->ring_id, tech_pvt->answer_value, tech_pvt->answer_id);
if
(
strlen
(
tech_pvt
->
session_uuid_str
)){
session
=
switch_core_session_locate
(
tech_pvt
->
session_uuid_str
);
if
(
session
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论