Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b9a8ce56
提交
b9a8ce56
authored
1月 22, 2013
作者:
Giovanni Maruzzelli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-4916 fixed
上级
d1ecaa53
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
50 行增加
和
16 行删除
+50
-16
mod_skypopen.c
src/mod/endpoints/mod_skypopen/mod_skypopen.c
+11
-3
skypopen.h
src/mod/endpoints/mod_skypopen/skypopen.h
+1
-0
skypopen_protocol.c
src/mod/endpoints/mod_skypopen/skypopen_protocol.c
+38
-13
没有找到文件。
src/mod/endpoints/mod_skypopen/mod_skypopen.c
浏览文件 @
b9a8ce56
...
@@ -621,6 +621,11 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session)
...
@@ -621,6 +621,11 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session)
if
(
strlen
(
tech_pvt
->
skype_call_id
))
{
if
(
strlen
(
tech_pvt
->
skype_call_id
))
{
DEBUGA_SKYPE
(
"hanging up skype call: %s
\n
"
,
SKYPOPEN_P_LOG
,
tech_pvt
->
skype_call_id
);
DEBUGA_SKYPE
(
"hanging up skype call: %s
\n
"
,
SKYPOPEN_P_LOG
,
tech_pvt
->
skype_call_id
);
if
(
strlen
(
tech_pvt
->
skype_voicemail_id
)){
sprintf
(
msg_to_skype
,
"ALTER VOICEMAIL %s STOPRECORDING"
,
tech_pvt
->
skype_voicemail_id
);
skypopen_signaling_write
(
tech_pvt
,
msg_to_skype
);
switch_sleep
(
MS_SKYPOPEN
*
1000
*
3
);
//XXX FIXME ??
}
sprintf
(
msg_to_skype
,
"ALTER CALL %s END HANGUP"
,
tech_pvt
->
skype_call_id
);
sprintf
(
msg_to_skype
,
"ALTER CALL %s END HANGUP"
,
tech_pvt
->
skype_call_id
);
skypopen_signaling_write
(
tech_pvt
,
msg_to_skype
);
skypopen_signaling_write
(
tech_pvt
,
msg_to_skype
);
sprintf
(
msg_to_skype
,
"ALTER CALL %s HANGUP"
,
tech_pvt
->
skype_call_id
);
sprintf
(
msg_to_skype
,
"ALTER CALL %s HANGUP"
,
tech_pvt
->
skype_call_id
);
...
@@ -882,7 +887,10 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
...
@@ -882,7 +887,10 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
//DEBUGA_SKYPE("skypopen_audio_read going back to read\n", SKYPOPEN_P_LOG);
//DEBUGA_SKYPE("skypopen_audio_read going back to read\n", SKYPOPEN_P_LOG);
goto
read
;
goto
read
;
}
}
DEBUGA_SKYPE
(
"READ BUFFER EMPTY, skypopen_audio_read Silence
\n
"
,
SKYPOPEN_P_LOG
);
if
(
!
strlen
(
tech_pvt
->
skype_voicemail_id
))
{
DEBUGA_SKYPE
(
"READ BUFFER EMPTY, skypopen_audio_read Silence
\n
"
,
SKYPOPEN_P_LOG
);
}
memset
(
tech_pvt
->
read_frame
.
data
,
255
,
BYTES_PER_FRAME
);
memset
(
tech_pvt
->
read_frame
.
data
,
255
,
BYTES_PER_FRAME
);
tech_pvt
->
read_frame
.
datalen
=
BYTES_PER_FRAME
;
tech_pvt
->
read_frame
.
datalen
=
BYTES_PER_FRAME
;
...
@@ -1030,7 +1038,7 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
...
@@ -1030,7 +1038,7 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
}
}
switch_buffer_write
(
tech_pvt
->
write_buffer
,
frame
->
data
,
frame
->
datalen
);
switch_buffer_write
(
tech_pvt
->
write_buffer
,
frame
->
data
,
frame
->
datalen
);
switch_mutex_unlock
(
tech_pvt
->
mutex_audio_cli
);
switch_mutex_unlock
(
tech_pvt
->
mutex_audio_cli
);
if
(
no_space
)
{
if
(
no_space
&&
!
strlen
(
tech_pvt
->
skype_voicemail_id
)
)
{
//switch_sleep(MS_SKYPOPEN * 1000);
//switch_sleep(MS_SKYPOPEN * 1000);
DEBUGA_SKYPE
(
"NO SPACE in WRITE BUFFER: there was no space for %d
\n
"
,
SKYPOPEN_P_LOG
,
frame
->
datalen
);
DEBUGA_SKYPE
(
"NO SPACE in WRITE BUFFER: there was no space for %d
\n
"
,
SKYPOPEN_P_LOG
,
frame
->
datalen
);
}
}
...
@@ -1797,7 +1805,7 @@ static switch_status_t load_config(int reload_type)
...
@@ -1797,7 +1805,7 @@ static switch_status_t load_config(int reload_type)
(
"Interface_id=%d is now STARTED, the Skype client to which we are connected gave us the correct CURRENTUSERHANDLE (%s)
\n
"
,
(
"Interface_id=%d is now STARTED, the Skype client to which we are connected gave us the correct CURRENTUSERHANDLE (%s)
\n
"
,
SKYPOPEN_P_LOG
,
interface_id
,
globals
.
SKYPOPEN_INTERFACES
[
interface_id
].
skype_user
);
SKYPOPEN_P_LOG
,
interface_id
,
globals
.
SKYPOPEN_INTERFACES
[
interface_id
].
skype_user
);
skypopen_signaling_write
(
&
globals
.
SKYPOPEN_INTERFACES
[
interface_id
],
"PROTOCOL
7
"
);
skypopen_signaling_write
(
&
globals
.
SKYPOPEN_INTERFACES
[
interface_id
],
"PROTOCOL
999
"
);
switch_sleep
(
20000
);
switch_sleep
(
20000
);
skypopen_signaling_write
(
&
globals
.
SKYPOPEN_INTERFACES
[
interface_id
],
"SET AUTOAWAY OFF"
);
skypopen_signaling_write
(
&
globals
.
SKYPOPEN_INTERFACES
[
interface_id
],
"SET AUTOAWAY OFF"
);
switch_sleep
(
20000
);
switch_sleep
(
20000
);
...
...
src/mod/endpoints/mod_skypopen/skypopen.h
浏览文件 @
b9a8ce56
...
@@ -357,6 +357,7 @@ struct private_object {
...
@@ -357,6 +357,7 @@ struct private_object {
char
ring_value
[
256
];
char
ring_value
[
256
];
char
message
[
4096
];
char
message
[
4096
];
char
skype_voicemail_id
[
512
];
};
};
typedef
struct
private_object
private_t
;
typedef
struct
private_object
private_t
;
...
...
src/mod/endpoints/mod_skypopen/skypopen_protocol.c
浏览文件 @
b9a8ce56
...
@@ -219,7 +219,7 @@ int skypopen_signaling_read(private_t *tech_pvt)
...
@@ -219,7 +219,7 @@ int skypopen_signaling_read(private_t *tech_pvt)
(
"If I don't connect immediately, please give the Skype client authorization to be connected by Skypopen (and to not ask you again)
\n
"
,
(
"If I don't connect immediately, please give the Skype client authorization to be connected by Skypopen (and to not ask you again)
\n
"
,
SKYPOPEN_P_LOG
);
SKYPOPEN_P_LOG
);
skypopen_sleep
(
1000000
);
skypopen_sleep
(
1000000
);
skypopen_signaling_write
(
tech_pvt
,
"PROTOCOL
7
"
);
skypopen_signaling_write
(
tech_pvt
,
"PROTOCOL
999
"
);
skypopen_sleep
(
20000
);
skypopen_sleep
(
20000
);
return
0
;
return
0
;
}
}
...
@@ -539,6 +539,37 @@ int skypopen_signaling_read(private_t *tech_pvt)
...
@@ -539,6 +539,37 @@ int skypopen_signaling_read(private_t *tech_pvt)
}
}
if
(
!
strcasecmp
(
message
,
"VOICEMAIL"
))
{
char
msg_to_skype
[
1024
];
skypopen_strncpy
(
obj
,
where
,
sizeof
(
obj
)
-
1
);
where
=
strsep
(
stringp
,
" "
);
skypopen_strncpy
(
id
,
where
,
sizeof
(
id
)
-
1
);
where
=
strsep
(
stringp
,
" "
);
skypopen_strncpy
(
prop
,
where
,
sizeof
(
prop
)
-
1
);
where
=
strsep
(
stringp
,
" "
);
skypopen_strncpy
(
value
,
where
,
sizeof
(
value
)
-
1
);
where
=
strsep
(
stringp
,
" "
);
//DEBUGA_SKYPE
//("Skype MSG: message: %s, obj: %s, id: %s, prop: %s, value: %s,where: %s!\n",
//SKYPOPEN_P_LOG, message, obj, id, prop, value, where ? where : "NULL");
if
(
!
strcasecmp
(
prop
,
"STATUS"
)
&&
!
strcasecmp
(
value
,
"RECORDING"
)
)
{
DEBUGA_SKYPE
(
"VOICEMAIL %s INPUT
\n
"
,
SKYPOPEN_P_LOG
,
id
);
sprintf
(
msg_to_skype
,
"ALTER VOICEMAIL %s SET_INPUT PORT=
\"
%d
\"
"
,
id
,
tech_pvt
->
tcp_cli_port
);
skypopen_signaling_write
(
tech_pvt
,
msg_to_skype
);
}
else
if
(
!
strcasecmp
(
prop
,
"STATUS"
)
&&
!
strcasecmp
(
value
,
"PLAYING"
)
)
{
DEBUGA_SKYPE
(
"VOICEMAIL %s OUTPUT
\n
"
,
SKYPOPEN_P_LOG
,
id
);
sprintf
(
msg_to_skype
,
"ALTER VOICEMAIL %s SET_OUTPUT PORT=
\"
%d
\"
"
,
id
,
tech_pvt
->
tcp_srv_port
);
skypopen_signaling_write
(
tech_pvt
,
msg_to_skype
);
}
else
if
(
!
strcasecmp
(
prop
,
"TYPE"
)
&&
!
strcasecmp
(
value
,
"OUTGOING"
)
)
{
DEBUGA_SKYPE
(
"VOICEMAIL OUTGOING id is %s
\n
"
,
SKYPOPEN_P_LOG
,
id
);
sprintf
(
tech_pvt
->
skype_voicemail_id
,
"%s"
,
id
);
}
}
if
(
!
strcasecmp
(
message
,
"CALL"
))
{
if
(
!
strcasecmp
(
message
,
"CALL"
))
{
skypopen_strncpy
(
obj
,
where
,
sizeof
(
obj
)
-
1
);
skypopen_strncpy
(
obj
,
where
,
sizeof
(
obj
)
-
1
);
where
=
strsep
(
stringp
,
" "
);
where
=
strsep
(
stringp
,
" "
);
...
@@ -665,12 +696,6 @@ int skypopen_signaling_read(private_t *tech_pvt)
...
@@ -665,12 +696,6 @@ int skypopen_signaling_read(private_t *tech_pvt)
return
CALLFLOW_INCOMING_HANGUP
;
return
CALLFLOW_INCOMING_HANGUP
;
}
}
}
}
//skypopen_sleep(1000);
sprintf
(
msg_to_skype
,
"ALTER CALL %s SET_INPUT PORT=
\"
%d
\"
"
,
id
,
tech_pvt
->
tcp_cli_port
);
skypopen_signaling_write
(
tech_pvt
,
msg_to_skype
);
//skypopen_sleep(1000);
sprintf
(
msg_to_skype
,
"#output ALTER CALL %s SET_OUTPUT PORT=
\"
%d
\"
"
,
id
,
tech_pvt
->
tcp_srv_port
);
skypopen_signaling_write
(
tech_pvt
,
msg_to_skype
);
}
}
tech_pvt
->
skype_callflow
=
CALLFLOW_STATUS_INPROGRESS
;
tech_pvt
->
skype_callflow
=
CALLFLOW_STATUS_INPROGRESS
;
if
(
skypopen_answered
(
tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
skypopen_answered
(
tech_pvt
)
!=
SWITCH_STATUS_SUCCESS
)
{
...
@@ -986,15 +1011,15 @@ void *skypopen_do_tcp_srv_thread_func(void *obj)
...
@@ -986,15 +1011,15 @@ void *skypopen_do_tcp_srv_thread_func(void *obj)
||
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_EARLYMEDIA
||
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_EARLYMEDIA
||
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_REMOTEHOLD
||
tech_pvt
->
skype_callflow
==
SKYPOPEN_STATE_UP
))
{
||
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_REMOTEHOLD
||
tech_pvt
->
skype_callflow
==
SKYPOPEN_STATE_UP
))
{
//
unsigned int fdselect;
unsigned
int
fdselect
;
int
rt
=
1
;
int
rt
=
1
;
//
fd_set fs;
fd_set
fs
;
//
struct timeval to;
struct
timeval
to
;
int
nospace
;
int
nospace
;
if
(
!
(
running
&&
tech_pvt
->
running
))
if
(
!
(
running
&&
tech_pvt
->
running
))
break
;
break
;
#if
0
#if
1
fdselect
=
fd
;
fdselect
=
fd
;
FD_ZERO
(
&
fs
);
FD_ZERO
(
&
fs
);
FD_SET
(
fdselect
,
&
fs
);
FD_SET
(
fdselect
,
&
fs
);
...
@@ -1008,7 +1033,7 @@ void *skypopen_do_tcp_srv_thread_func(void *obj)
...
@@ -1008,7 +1033,7 @@ void *skypopen_do_tcp_srv_thread_func(void *obj)
skypopen_sleep
(
20000
);
skypopen_sleep
(
20000
);
}
}
//
rt = select(fdselect + 1, &fs, NULL, NULL, &to);
rt
=
select
(
fdselect
+
1
,
&
fs
,
NULL
,
NULL
,
&
to
);
if
(
rt
>
0
)
{
if
(
rt
>
0
)
{
if
(
tech_pvt
->
skype_callflow
!=
CALLFLOW_STATUS_REMOTEHOLD
)
{
if
(
tech_pvt
->
skype_callflow
!=
CALLFLOW_STATUS_REMOTEHOLD
)
{
...
@@ -1945,7 +1970,7 @@ void *skypopen_do_skypeapi_thread_func(void *obj)
...
@@ -1945,7 +1970,7 @@ void *skypopen_do_skypeapi_thread_func(void *obj)
return
NULL
;
return
NULL
;
}
}
snprintf
(
buf
,
512
,
"PROTOCOL
7
"
);
snprintf
(
buf
,
512
,
"PROTOCOL
999
"
);
if
(
!
skypopen_send_message
(
tech_pvt
,
buf
))
{
if
(
!
skypopen_send_message
(
tech_pvt
,
buf
))
{
ERRORA
(
"Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch Skypopen again
\n
"
,
SKYPOPEN_P_LOG
);
ERRORA
(
"Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch Skypopen again
\n
"
,
SKYPOPEN_P_LOG
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论