Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
48ec0c28
提交
48ec0c28
authored
4月 08, 2010
作者:
unknown
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of git.freeswitch.org:freeswitch
上级
61c563af
089e7f65
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
321 行增加
和
220 行删除
+321
-220
call.cpp
fscomm/call.cpp
+22
-2
call.h
fscomm/call.h
+5
-4
channel.cpp
fscomm/channel.cpp
+1
-0
channel.h
fscomm/channel.h
+3
-0
statedebugdialog.cpp
fscomm/debugtools/statedebugdialog.cpp
+1
-0
fshost.cpp
fscomm/fshost.cpp
+15
-8
mainwindow.cpp
fscomm/mainwindow.cpp
+45
-6
mainwindow.h
fscomm/mainwindow.h
+1
-0
mainwindow.ui
fscomm/mainwindow.ui
+227
-199
zap_threadmutex.c
libs/openzap/src/zap_threadmutex.c
+1
-1
没有找到文件。
fscomm/call.cpp
浏览文件 @
48ec0c28
...
...
@@ -36,6 +36,27 @@ Call::Call()
_answeredEpoch
=
0
;
}
switch_status_t
Call
::
toggleHold
(
bool
holdPressed
)
{
if
(
_state
!=
FSCOMM_CALL_STATE_ANSWERED
)
return
SWITCH_STATUS_FALSE
;
switch_stream_handle_t
stream
=
{
0
};
SWITCH_STANDARD_STREAM
(
stream
);
QString
holdStr
;
if
(
holdPressed
)
{
holdStr
=
_channel
.
data
()
->
getUuid
();
}
else
{
holdStr
=
"off "
+
_channel
.
data
()
->
getUuid
();
}
switch_status_t
st
=
switch_api_execute
(
"uuid_hold"
,
holdStr
.
toAscii
().
data
(),
NULL
,
&
stream
);
switch_safe_free
(
stream
.
data
);
return
st
;
}
switch_status_t
Call
::
toggleRecord
(
bool
startRecord
)
{
QDir
conf_dir
=
QDir
::
home
();
...
...
@@ -82,8 +103,7 @@ QTime Call::getCurrentStateTime()
{
if
(
_direction
==
FSCOMM_CALL_DIRECTION_INBOUND
)
{
/* TODO: DOESNT WORK - How do I get what time it started to ring? */
_channel
.
data
()
->
getProgressEpoch
()
==
0
?
time
=
_channel
.
data
()
->
getProgressMediaEpoch
()
:
time
=
_channel
.
data
()
->
getProgressEpoch
();
time
=
_channel
.
data
()
->
getCreatedEpoch
();
}
else
_otherLegChannel
.
data
()
->
getProgressEpoch
()
==
0
?
time
=
_otherLegChannel
.
data
()
->
getProgressMediaEpoch
()
:
time
=
_otherLegChannel
.
data
()
->
getProgressEpoch
();
...
...
fscomm/call.h
浏览文件 @
48ec0c28
...
...
@@ -50,8 +50,8 @@ class Call {
public
:
Call
();
/* Needs rework */
QString
getCidName
(
void
)
{
return
_channel
.
data
()
->
getCidName
();
}
QString
getCidNumber
(
void
)
{
return
_channel
.
data
()
->
getCidNumber
();
}
QString
getCidName
(
void
)
{
return
(
_direction
==
FSCOMM_CALL_DIRECTION_INBOUND
)
?
_otherLegChannel
.
data
()
->
getCidName
()
:
_channel
.
data
()
->
getCidName
();
}
QString
getCidNumber
(
void
)
{
return
(
_direction
==
FSCOMM_CALL_DIRECTION_INBOUND
)
?
_otherLegChannel
.
data
()
->
getCidNumber
()
:
_channel
.
data
()
->
getCidNumber
();
}
QString
getDestinationNumber
(
void
)
{
return
_otherLegChannel
.
data
()
->
getDestinationNumber
();
}
void
setChannel
(
QSharedPointer
<
Channel
>
channel
)
{
_channel
=
channel
;
}
...
...
@@ -66,11 +66,12 @@ public:
fscomm_call_direction_t
getDirection
()
{
return
_direction
;
}
fscomm_call_state_t
getState
()
{
return
_state
;
}
void
setState
(
fscomm_call_state_t
state
)
{
_state
=
state
;
}
void
setCause
(
QString
cause
)
{
_cause
=
cause
;
}
QString
getCause
()
{
return
_cause
;
}
void
setCause
(
QString
cause
)
{
_cause
=
cause
;
qDebug
()
<<
cause
;
}
QString
getCause
()
{
return
_cause
;
qDebug
()
<<
_cause
;
}
void
setActive
(
bool
isActive
)
{
_isActive
=
isActive
;
}
bool
isActive
()
{
return
_isActive
==
true
;
}
switch_status_t
toggleRecord
(
bool
);
switch_status_t
toggleHold
(
bool
);
void
sendDTMF
(
QString
digit
);
void
setAnsweredEpoch
(
qulonglong
time
)
{
_answeredEpoch
=
time
/
1000000
;
}
QTime
getCurrentStateTime
();
...
...
fscomm/channel.cpp
浏览文件 @
48ec0c28
...
...
@@ -5,4 +5,5 @@ Channel::Channel(QString uuid):
{
_progressEpoch
=
0
;
_progressMediaEpoch
=
0
;
_createdEpoch
=
0
;
}
fscomm/channel.h
浏览文件 @
48ec0c28
...
...
@@ -23,6 +23,8 @@ public:
qulonglong
getProgressEpoch
()
{
return
_progressEpoch
;
}
void
setProgressMediaEpoch
(
qulonglong
time
)
{
_progressMediaEpoch
=
time
/
1000000
;
}
qulonglong
getProgressMediaEpoch
()
{
return
_progressMediaEpoch
;
}
void
setCreatedEpoch
(
qulonglong
time
)
{
_createdEpoch
=
time
/
1000000
;
}
qulonglong
getCreatedEpoch
()
{
return
_createdEpoch
;
}
private
:
QString
_uuid
;
...
...
@@ -32,6 +34,7 @@ private:
int
_paCallId
;
qulonglong
_progressEpoch
;
qulonglong
_progressMediaEpoch
;
qulonglong
_createdEpoch
;
};
Q_DECLARE_METATYPE
(
Channel
)
...
...
fscomm/debugtools/statedebugdialog.cpp
浏览文件 @
48ec0c28
...
...
@@ -66,6 +66,7 @@ void StateDebugDialog::currentEventsChanged()
{
ui
->
listDetails
->
clear
();
int
r
=
ui
->
listEvents
->
currentRow
();
if
(
r
==
-
1
)
return
;
QString
uuid
=
ui
->
listUUID
->
currentItem
()
->
text
();
QList
<
QSharedPointer
<
switch_event_t
>
>
tmpListEvents
=
_events
.
value
(
uuid
);
QSharedPointer
<
switch_event_t
>
e
=
tmpListEvents
.
at
(
r
);
...
...
fscomm/fshost.cpp
浏览文件 @
48ec0c28
...
...
@@ -394,13 +394,13 @@ void FSHost::eventChannelOutgoing(QSharedPointer<switch_event_t>event, QString u
else
{
Call
*
callPtr
=
new
Call
();
callPtr
->
setCallDirection
(
FSCOMM_CALL_DIRECTION_INBOUND
);
callPtr
->
setChannel
(
_channels
.
value
(
switch_event_get_header_nil
(
event
.
data
(),
"Other-Leg-Unique-ID"
)
));
callPtr
->
setOtherLegChannel
(
_channels
.
value
(
uuid
));
callPtr
->
setChannel
(
_channels
.
value
(
uuid
));
callPtr
->
setOtherLegChannel
(
_channels
.
value
(
switch_event_get_header_nil
(
event
.
data
(),
"Other-Leg-Unique-ID"
)
));
QSharedPointer
<
Call
>
call
(
callPtr
);
_active_calls
.
insert
(
switch_event_get_header_nil
(
event
.
data
(),
"Other-Leg-Unique-ID"
)
,
call
);
_active_calls
.
insert
(
uuid
,
call
);
call
.
data
()
->
setState
(
FSCOMM_CALL_STATE_RINGING
);
_channels
.
value
(
uuid
).
data
()
->
setCreatedEpoch
(
QString
(
switch_event_get_header_nil
(
event
.
data
(),
"Caller-Channel-Created-Time"
)).
toULongLong
());
emit
ringing
(
call
);
}
}
...
...
@@ -426,16 +426,23 @@ void FSHost::eventChannelBridge(QSharedPointer<switch_event_t>event, QString uui
if
(
time
.
toULongLong
()
>
0
)
_channels
.
value
(
uuid
).
data
()
->
setProgressMediaEpoch
(
time
.
toULongLong
());
}
void
FSHost
::
eventChannelHangup
(
QSharedPointer
<
switch_event_t
>
event
,
QString
uuid
)
{}
void
FSHost
::
eventChannelUnbridge
(
QSharedPointer
<
switch_event_t
>
event
,
QString
uuid
)
{}
void
FSHost
::
eventChannelHangupComplete
(
QSharedPointer
<
switch_event_t
>
event
,
QString
uuid
)
{
if
(
_active_calls
.
contains
(
uuid
))
{
if
(
_active_calls
.
value
(
uuid
).
data
()
->
getState
()
!=
FSCOMM_CALL_STATE_ANSWERED
)
{
_active_calls
.
value
(
uuid
).
data
()
->
setState
(
FSCOMM_CALL_STATE_FAILED
);
_active_calls
.
value
(
uuid
).
data
()
->
setCause
(
switch_event_get_header_nil
(
event
.
data
(),
"variable_originate_disposition"
));
emit
callFailed
(
_active_calls
.
value
(
uuid
));
return
;
}
emit
hungup
(
_active_calls
.
take
(
uuid
));
}
}
void
FSHost
::
eventChannelUnbridge
(
QSharedPointer
<
switch_event_t
>
event
,
QString
uuid
)
{}
void
FSHost
::
eventChannelHangupComplete
(
QSharedPointer
<
switch_event_t
>
event
,
QString
uuid
)
{}
void
FSHost
::
eventChannelDestroy
(
QSharedPointer
<
switch_event_t
>
event
,
QString
uuid
)
{
_channels
.
take
(
uuid
);
...
...
fscomm/mainwindow.cpp
浏览文件 @
48ec0c28
...
...
@@ -100,6 +100,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect
(
ui
->
answerBtn
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
paAnswer
()));
connect
(
ui
->
hangupBtn
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
paHangup
()));
connect
(
ui
->
recoredCallBtn
,
SIGNAL
(
toggled
(
bool
)),
SLOT
(
recordCall
(
bool
)));
connect
(
ui
->
btnHold
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
holdCall
(
bool
)));
connect
(
ui
->
tableCalls
,
SIGNAL
(
itemDoubleClicked
(
QTableWidgetItem
*
)),
this
,
SLOT
(
callTableDoubleClick
(
QTableWidgetItem
*
)));
connect
(
ui
->
action_Preferences
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
prefTriggered
()));
connect
(
ui
->
action_Exit
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
close
()));
...
...
@@ -363,16 +364,35 @@ void MainWindow::paHangup()
ui
->
hangupBtn
->
setEnabled
(
false
);
}
void
MainWindow
::
recor
dCall
(
bool
pressed
)
void
MainWindow
::
hol
dCall
(
bool
pressed
)
{
QSharedPointer
<
Call
>
call
=
g_FSHost
.
getCurrentActiveCall
();
if
(
call
.
isNull
())
{
QMessageBox
::
warning
(
this
,
tr
(
"Record call"
),
tr
(
"<p>FSComm reports that there are no active calls to be recorded."
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Could not hold call because there is not current active call!.
\n
"
);
return
;
}
if
(
call
.
data
()
->
toggleHold
(
pressed
)
!=
SWITCH_STATUS_SUCCESS
)
{
QMessageBox
::
warning
(
this
,
tr
(
"Hold call"
),
tr
(
"<p>Could not get active call to hold/unhold."
"<p>Please report this bug."
),
QMessageBox
::
Ok
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Could not hold/unhold call [%s].
\n
"
,
call
.
data
()
->
getUuid
().
toAscii
().
data
());
return
;
}
}
void
MainWindow
::
recordCall
(
bool
pressed
)
{
QSharedPointer
<
Call
>
call
=
g_FSHost
.
getCurrentActiveCall
();
if
(
call
.
isNull
())
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Could not record call because there is not current active call!.
\n
"
);
return
;
}
...
...
@@ -472,6 +492,9 @@ void MainWindow::answered(QSharedPointer<Call> call)
}
ui
->
recoredCallBtn
->
setEnabled
(
true
);
ui
->
recoredCallBtn
->
setChecked
(
false
);
ui
->
btnHold
->
setEnabled
(
true
);
ui
->
btnHold
->
setChecked
(
false
);
ui
->
btnTransfer
->
setEnabled
(
true
);
ui
->
dtmf0Btn
->
setEnabled
(
true
);
ui
->
dtmf1Btn
->
setEnabled
(
true
);
ui
->
dtmf2Btn
->
setEnabled
(
true
);
...
...
@@ -504,13 +527,26 @@ void MainWindow::callFailed(QSharedPointer<Call> call)
break
;
}
}
ui
->
textEdit
->
setText
(
tr
(
"Call with %1 (%2) failed with reason %3."
).
arg
(
call
.
data
()
->
getCidName
(),
call
.
data
()
->
getCidNumber
(),
call
.
data
()
->
getCause
()));
if
(
call
.
data
()
->
getDirection
()
==
FSCOMM_CALL_DIRECTION_INBOUND
)
{
ui
->
textEdit
->
setText
(
tr
(
"Call from %1 (%2) failed with reason %3."
).
arg
(
call
.
data
()
->
getCidName
(),
call
.
data
()
->
getCidNumber
(),
call
.
data
()
->
getCause
()));
}
else
{
ui
->
textEdit
->
setText
(
tr
(
"Call to %1 failed with reason %3."
).
arg
(
call
.
data
()
->
getCidName
(),
call
.
data
()
->
getCidNumber
(),
call
.
data
()
->
getCause
()));
}
call
.
data
()
->
setActive
(
false
);
/* TODO: Will cause problems if 2 calls are received at the same time */
ui
->
recoredCallBtn
->
setEnabled
(
false
);
ui
->
recoredCallBtn
->
setChecked
(
false
);
ui
->
btnHold
->
setEnabled
(
false
);
ui
->
btnHold
->
setChecked
(
false
);
ui
->
btnTransfer
->
setEnabled
(
false
);
ui
->
answerBtn
->
setEnabled
(
false
);
ui
->
hangupBtn
->
setEnabled
(
false
);
ui
->
dtmf0Btn
->
setEnabled
(
false
);
...
...
@@ -558,6 +594,9 @@ void MainWindow::hungup(QSharedPointer<Call> call)
/* TODO: Will cause problems if 2 calls are received at the same time */
ui
->
recoredCallBtn
->
setEnabled
(
false
);
ui
->
recoredCallBtn
->
setChecked
(
false
);
ui
->
btnHold
->
setEnabled
(
false
);
ui
->
btnHold
->
setChecked
(
false
);
ui
->
btnTransfer
->
setEnabled
(
false
);
ui
->
answerBtn
->
setEnabled
(
false
);
ui
->
hangupBtn
->
setEnabled
(
false
);
ui
->
dtmf0Btn
->
setEnabled
(
false
);
...
...
fscomm/mainwindow.h
浏览文件 @
48ec0c28
...
...
@@ -76,6 +76,7 @@ private slots:
void
hungup
(
QSharedPointer
<
Call
>
);
void
callFailed
(
QSharedPointer
<
Call
>
);
void
recordCall
(
bool
);
void
holdCall
(
bool
);
void
setDefaultAccount
();
void
accountAdd
(
QSharedPointer
<
Account
>
);
void
accountDel
(
QSharedPointer
<
Account
>
);
...
...
fscomm/mainwindow.ui
浏览文件 @
48ec0c28
差异被折叠。
点击展开。
libs/openzap/src/zap_threadmutex.c
浏览文件 @
48ec0c28
...
...
@@ -425,7 +425,7 @@ OZ_DECLARE(zap_status_t) zap_interrupt_multiple_wait(zap_interrupt_t *interrupts
return
ZAP_TIMEOUT
;
}
for
(
i
=
size
;
i
<
zap_array_len
(
ints
)
;
i
++
)
{
for
(
i
=
0
;
i
<
size
;
i
++
)
{
if
(
ints
[
i
].
revents
&
POLLIN
)
{
res
=
read
(
ints
[
0
].
fd
,
pipebuf
,
sizeof
(
pipebuf
));
if
(
res
==
-
1
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论