Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
8c58074c
提交
8c58074c
authored
7月 07, 2010
作者:
root
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
initial t.38 support.
remake logical channel opening. add missing param name in example config.
上级
7cb11360
全部展开
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
542 行增加
和
156 行删除
+542
-156
changes.txt
src/mod/endpoints/mod_h323/changes.txt
+3
-0
h323.conf.xml
src/mod/endpoints/mod_h323/h323.conf.xml
+1
-0
mod_h323.cpp
src/mod/endpoints/mod_h323/mod_h323.cpp
+402
-108
mod_h323.h
src/mod/endpoints/mod_h323/mod_h323.h
+136
-48
没有找到文件。
src/mod/endpoints/mod_h323/changes.txt
浏览文件 @
8c58074c
initial t.38 support.
remake logical channel opening.
add missing param name in example config.
add dtmfinband conf parameter.
add dtmfinband conf parameter.
add endpoint-name conf parameter represents endpoint name.
add endpoint-name conf parameter represents endpoint name.
fix GK registration retrying in case of registration reject.
fix GK registration retrying in case of registration reject.
...
...
src/mod/endpoints/mod_h323/h323.conf.xml
浏览文件 @
8c58074c
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
<param
name=
"jitter-size"
value=
"60"
/>
<!-- optional -->
<param
name=
"jitter-size"
value=
"60"
/>
<!-- optional -->
<param
name=
"progress-indication"
value=
"8"
/>
<!-- optional - PI value in progress message-->
<param
name=
"progress-indication"
value=
"8"
/>
<!-- optional - PI value in progress message-->
<param
name=
"alerting-indication"
value=
"8"
/>
<!-- optional - PI value in alerting message-->
<param
name=
"alerting-indication"
value=
"8"
/>
<!-- optional - PI value in alerting message-->
<param
name=
"endpoint-name"
value=
"fs"
/>
</settings>
</settings>
<listeners>
<listeners>
<listener
name=
"default"
>
<listener
name=
"default"
>
...
...
src/mod/endpoints/mod_h323/mod_h323.cpp
浏览文件 @
8c58074c
差异被折叠。
点击展开。
src/mod/endpoints/mod_h323/mod_h323.h
浏览文件 @
8c58074c
...
@@ -10,7 +10,10 @@
...
@@ -10,7 +10,10 @@
#include <h323pdu.h>
#include <h323pdu.h>
#include <h323caps.h>
#include <h323caps.h>
#include <ptclib/delaychan.h>
#include <ptclib/delaychan.h>
#include <h323t38.h>
#include "t38proto.h"
#include "t38.h"
#include <mediafmt.h>
#include <list>
#include <list>
...
@@ -25,7 +28,16 @@
...
@@ -25,7 +28,16 @@
#include <switch.h>
#include <switch.h>
#include <switch_version.h>
#include <switch_version.h>
#define MODNAME "mod_h323"
#define MODNAME "mod_h323"
#define OpalT38_IFP_COR GetOpalT38_IFP_COR()
#define OpalT38_IFP_PRE GetOpalT38_IFP_PRE()
extern
void
SetT38_IFP_PRE
();
class
OpalMediaFormat
;
class
H245_T38FaxProfile
;
class
OpalT38Protocol
;
extern
const
OpalMediaFormat
&
GetOpalT38_IFP_COR
();
extern
const
OpalMediaFormat
&
GetOpalT38_IFP_PRE
();
typedef
enum
{
typedef
enum
{
TFLAG_IO
=
(
1
<<
0
),
TFLAG_IO
=
(
1
<<
0
),
...
@@ -78,6 +90,7 @@ typedef struct {
...
@@ -78,6 +90,7 @@ typedef struct {
switch_rtp_t
*
rtp_session
;
switch_rtp_t
*
rtp_session
;
switch_mutex_t
*
flag_mutex
;
switch_mutex_t
*
flag_mutex
;
switch_mutex_t
*
h323_mutex
;
switch_mutex_t
*
h323_mutex
;
switch_mutex_t
*
h323_io_mutex
;
FSH323Connection
*
me
;
FSH323Connection
*
me
;
}
h323_private_t
;
}
h323_private_t
;
...
@@ -125,6 +138,7 @@ struct FSListener {
...
@@ -125,6 +138,7 @@ struct FSListener {
};
};
class
FSGkRegThread
;
class
FSGkRegThread
;
class
OpalMediaFormat
;
class
FSH323EndPoint
:
public
H323EndPoint
{
class
FSH323EndPoint
:
public
H323EndPoint
{
PCLASSINFO
(
FSH323EndPoint
,
H323EndPoint
);
PCLASSINFO
(
FSH323EndPoint
,
H323EndPoint
);
...
@@ -191,8 +205,8 @@ class FSH323Connection:public H323Connection {
...
@@ -191,8 +205,8 @@ class FSH323Connection:public H323Connection {
public
:
public
:
FSH323Connection
(
FSH323EndPoint
&
endpoint
,
FSH323Connection
(
FSH323EndPoint
&
endpoint
,
H323Transport
*
transport
,
H323Transport
*
transport
,
unsigned
callReference
,
switch_caller_profile_t
*
outbound_profile
,
switch_core_session_t
*
fsSession
,
switch_channel_t
*
fsChannel
);
unsigned
callReference
,
switch_caller_profile_t
*
outbound_profile
,
switch_core_session_t
*
fsSession
,
switch_channel_t
*
fsChannel
);
~
FSH323Connection
();
~
FSH323Connection
();
virtual
H323Channel
*
CreateRealTimeLogicalChannel
(
const
H323Capability
&
capability
,
virtual
H323Channel
*
CreateRealTimeLogicalChannel
(
const
H323Capability
&
capability
,
...
@@ -212,6 +226,11 @@ class FSH323Connection:public H323Connection {
...
@@ -212,6 +226,11 @@ class FSH323Connection:public H323Connection {
virtual
bool
OnAlerting
(
const
H323SignalPDU
&
alertingPDU
,
const
PString
&
user
);
virtual
bool
OnAlerting
(
const
H323SignalPDU
&
alertingPDU
,
const
PString
&
user
);
virtual
void
AnsweringCall
(
AnswerCallResponse
response
);
virtual
void
AnsweringCall
(
AnswerCallResponse
response
);
virtual
void
OnEstablished
();
virtual
void
OnEstablished
();
virtual
void
OnModeChanged
(
const
H245_ModeDescription
&
newMode
);
virtual
bool
OnRequestModeChange
(
const
H245_RequestMode
&
pdu
,
H245_RequestModeAck
&
ack
,
H245_RequestModeReject
&
reject
,
PINDEX
&
selectedMode
);
bool
SetLocalCapabilities
();
bool
SetLocalCapabilities
();
static
bool
decodeCapability
(
const
H323Capability
&
capability
,
const
char
**
dataFormat
,
int
*
payload
=
0
,
PString
*
capabName
=
0
);
static
bool
decodeCapability
(
const
H323Capability
&
capability
,
const
char
**
dataFormat
,
int
*
payload
=
0
,
PString
*
capabName
=
0
);
virtual
H323Connection
::
AnswerCallResponse
OnAnswerCall
(
const
PString
&
caller
,
const
H323SignalPDU
&
signalPDU
,
H323SignalPDU
&
connectPDU
);
virtual
H323Connection
::
AnswerCallResponse
OnAnswerCall
(
const
PString
&
caller
,
const
H323SignalPDU
&
signalPDU
,
H323SignalPDU
&
connectPDU
);
...
@@ -219,16 +238,17 @@ class FSH323Connection:public H323Connection {
...
@@ -219,16 +238,17 @@ class FSH323Connection:public H323Connection {
const
H245_MultiplexCapability
*
muxCap
,
H245_TerminalCapabilitySetReject
&
reject
);
const
H245_MultiplexCapability
*
muxCap
,
H245_TerminalCapabilitySetReject
&
reject
);
switch_core_session_t
*
GetSession
()
const
{
switch_core_session_t
*
GetSession
()
const
{
return
m_fsSession
;
return
m_fsSession
;
}
virtual
void
SendUserInputTone
(
char
tone
,
unsigned
duration
=
0
,
unsigned
logicalChannel
=
0
,
unsigned
rtpTimestamp
=
0
);
}
virtual
void
SendUserInputTone
(
char
tone
,
unsigned
duration
=
0
,
unsigned
logicalChannel
=
0
,
unsigned
rtpTimestamp
=
0
);
virtual
void
OnUserInputTone
(
char
,
unsigned
,
unsigned
,
unsigned
);
virtual
void
OnUserInputTone
(
char
,
unsigned
,
unsigned
,
unsigned
);
virtual
void
OnUserInputString
(
const
PString
&
value
);
virtual
void
OnUserInputString
(
const
PString
&
value
);
void
CleanUpOnCall
();
DECLARE_CALLBACK0
(
on_init
);
DECLARE_CALLBACK0
(
on_init
);
DECLARE_CALLBACK0
(
on_routing
);
DECLARE_CALLBACK0
(
on_routing
);
DECLARE_CALLBACK0
(
on_execute
);
DECLARE_CALLBACK0
(
on_execute
);
DECLARE_CALLBACK0
(
on_exchange_media
);
DECLARE_CALLBACK0
(
on_exchange_media
);
DECLARE_CALLBACK0
(
on_soft_execute
);
DECLARE_CALLBACK0
(
on_soft_execute
);
DECLARE_CALLBACK1
(
kill_channel
,
int
,
sig
);
DECLARE_CALLBACK1
(
kill_channel
,
int
,
sig
);
DECLARE_CALLBACK1
(
send_dtmf
,
const
switch_dtmf_t
*
,
dtmf
);
DECLARE_CALLBACK1
(
send_dtmf
,
const
switch_dtmf_t
*
,
dtmf
);
DECLARE_CALLBACK1
(
receive_message
,
switch_core_session_message_t
*
,
msg
);
DECLARE_CALLBACK1
(
receive_message
,
switch_core_session_message_t
*
,
msg
);
...
@@ -249,6 +269,10 @@ class FSH323Connection:public H323Connection {
...
@@ -249,6 +269,10 @@ class FSH323Connection:public H323Connection {
unsigned
char
m_select_dtmf
;
unsigned
char
m_select_dtmf
;
PSyncPoint
m_rxAudioOpened
;
PSyncPoint
m_rxAudioOpened
;
PSyncPoint
m_txAudioOpened
;
PSyncPoint
m_txAudioOpened
;
unsigned
m_active_sessionID
;
bool
m_active_chennel_fax
;
int
m_rtp_resetting
;
bool
m_isRequst_fax
;
protected
:
protected
:
FSH323EndPoint
*
m_endpoint
;
FSH323EndPoint
*
m_endpoint
;
PString
m_remoteAddr
;
PString
m_remoteAddr
;
...
@@ -291,7 +315,7 @@ class FSH323_ExternalRTPChannel:public H323_ExternalRTPChannel {
...
@@ -291,7 +315,7 @@ class FSH323_ExternalRTPChannel:public H323_ExternalRTPChannel {
PString
m_RTPlocalIP
;
PString
m_RTPlocalIP
;
WORD
m_RTPlocalPort
;
WORD
m_RTPlocalPort
;
BYTE
payloadCode
;
BYTE
payloadCode
;
unsigned
m_sessionID
;
};
};
class
BaseG7231Capab
:
public
H323AudioCapability
{
class
BaseG7231Capab
:
public
H323AudioCapability
{
...
@@ -342,17 +366,21 @@ class BaseG729Capab:public H323AudioCapability {
...
@@ -342,17 +366,21 @@ class BaseG729Capab:public H323AudioCapability {
public
:
public
:
BaseG729Capab
(
const
char
*
fname
,
unsigned
type
=
H245_AudioCapability
::
e_g729
)
BaseG729Capab
(
const
char
*
fname
,
unsigned
type
=
H245_AudioCapability
::
e_g729
)
:
H323AudioCapability
(
24
,
6
),
m_name
(
fname
),
m_type
(
type
)
{
:
H323AudioCapability
(
24
,
6
),
m_name
(
fname
),
m_type
(
type
)
{
}
virtual
PObject
*
Clone
()
const
}
// default copy constructor - take care!
virtual
PObject
*
Clone
()
const
{
{
return
new
BaseG729Capab
(
*
this
);
return
new
BaseG729Capab
(
*
this
);
}
virtual
unsigned
GetSubType
()
const
{
}
virtual
unsigned
GetSubType
()
const
{
return
m_type
;
return
m_type
;
}
virtual
PString
GetFormatName
()
const
{
}
virtual
PString
GetFormatName
()
const
{
return
m_name
;
return
m_name
;
}
virtual
H323Codec
*
CreateCodec
(
H323Codec
::
Direction
direction
)
const
{
}
virtual
H323Codec
*
CreateCodec
(
H323Codec
::
Direction
direction
)
const
{
return
0
;
return
0
;
}
protected
:
}
protected
:
const
char
*
m_name
;
const
char
*
m_name
;
unsigned
m_type
;
unsigned
m_type
;
};
};
...
@@ -398,6 +426,58 @@ class BaseGSM0610Cap:public H323AudioCapability {
...
@@ -398,6 +426,58 @@ class BaseGSM0610Cap:public H323AudioCapability {
};
};
class
FSH323_T38Capability
:
public
H323_T38Capability
{
PCLASSINFO
(
FSH323_T38Capability
,
H323_T38Capability
);
public
:
FSH323_T38Capability
(
const
OpalMediaFormat
&
_mediaFormat
)
:
H323_T38Capability
(
e_UDP
),
mediaFormat
(
_mediaFormat
)
{
}
virtual
PObject
*
Clone
()
const
{
return
new
FSH323_T38Capability
(
*
this
);
}
virtual
PString
GetFormatName
()
const
{
return
mediaFormat
;
}
virtual
H323Channel
*
CreateChannel
(
H323Connection
&
connection
,
H323Channel
::
Directions
dir
,
unsigned
sessionID
,
const
H245_H2250LogicalChannelParameters
*
param
)
const
;
protected
:
const
OpalMediaFormat
&
mediaFormat
;
};
class
FSH323_T38CapabilityCor
:
public
FSH323_T38Capability
{
public
:
FSH323_T38CapabilityCor
()
:
FSH323_T38Capability
(
OpalT38_IFP_COR
)
{}
};
class
FSH323_T38CapabilityPre
:
public
FSH323_T38Capability
{
public
:
FSH323_T38CapabilityPre
()
:
FSH323_T38Capability
(
OpalT38_IFP_PRE
)
{}
};
//H323_REGISTER_CAPABILITY(FSH323_T38CapabilityCor, OpalT38_IFP_COR)
//H323_REGISTER_CAPABILITY(FSH323_T38CapabilityPre, OpalT38_IFP_PRE)
H323Channel
*
FSH323_T38Capability
::
CreateChannel
(
H323Connection
&
connection
,
H323Channel
::
Directions
direction
,
unsigned
int
sessionID
,
const
H245_H2250LogicalChannelParameters
*
params
)
const
{
PTRACE
(
1
,
"FSH323_T38Capability::CreateChannel "
<<
connection
<<
" sessionID="
<<
sessionID
<<
" direction="
<<
direction
);
return
connection
.
CreateRealTimeLogicalChannel
(
*
this
,
direction
,
sessionID
,
params
);
}
#define DEFINE_H323_CAPAB(cls,base,param,name) \
#define DEFINE_H323_CAPAB(cls,base,param,name) \
class cls : public base { \
class cls : public base { \
public: \
public: \
...
@@ -406,17 +486,25 @@ class cls : public base { \
...
@@ -406,17 +486,25 @@ class cls : public base { \
H323_REGISTER_CAPABILITY(cls,name) \
H323_REGISTER_CAPABILITY(cls,name) \
#define DEFINE_H323_CAPAB_m(cls,base,name) \
class cls : public base { \
public: \
cls() : base(name) { } \
}; \
H323_REGISTER_CAPABILITY(cls,name) \
DEFINE_H323_CAPAB
(
FS_G7231_5
,
BaseG7231Capab
,
false
,
OPAL_G7231_5k3
"{sw}"
)
//DEFINE_H323_CAPAB_m(FS_T38_COR,FSH323_T38Capability,OpalT38_IFP_COR)
DEFINE_H323_CAPAB
(
FS_G7231_6
,
BaseG7231Capab
,
false
,
OPAL_G7231_6k3
"{sw}"
)
//DEFINE_H323_CAPAB_m(FS_T38_RPE,FSH323_T38Capability,OpalT38_IFP_PRE)
DEFINE_H323_CAPAB
(
FS_G7231A_5
,
BaseG7231Capab
,
true
,
OPAL_G7231A_5k3
"{sw}"
)
DEFINE_H323_CAPAB
(
FS_G7231A_6
,
BaseG7231Capab
,
true
,
OPAL_G7231A_6k3
"{sw}"
)
DEFINE_H323_CAPAB
(
FS_G729
,
BaseG729Capab
,
H245_AudioCapability
::
e_g729
,
OPAL_G729
"{sw}"
)
DEFINE_H323_CAPAB
(
FS_G729A
,
BaseG729Capab
,
H245_AudioCapability
::
e_g729AnnexA
,
OPAL_G729A
"{sw}"
)
DEFINE_H323_CAPAB
(
FS_G729B
,
BaseG729Capab
,
H245_AudioCapability
::
e_g729wAnnexB
,
OPAL_G729B
"{sw}"
)
DEFINE_H323_CAPAB
(
FS_G729AB
,
BaseG729Capab
,
H245_AudioCapability
::
e_g729AnnexAwAnnexB
,
OPAL_G729AB
"{sw}"
)
DEFINE_H323_CAPAB
(
FS_GSM
,
BaseGSM0610Cap
,
H245_AudioCapability
::
e_gsmFullRate
,
OPAL_GSM0610
"{sw}"
)
static
FSProcess
*
h323_process
=
NULL
;
DEFINE_H323_CAPAB
(
FS_G7231_5
,
BaseG7231Capab
,
false
,
OPAL_G7231_5k3
"{sw}"
)
DEFINE_H323_CAPAB
(
FS_G7231_6
,
BaseG7231Capab
,
false
,
OPAL_G7231_6k3
"{sw}"
)
DEFINE_H323_CAPAB
(
FS_G7231A_5
,
BaseG7231Capab
,
true
,
OPAL_G7231A_5k3
"{sw}"
)
DEFINE_H323_CAPAB
(
FS_G7231A_6
,
BaseG7231Capab
,
true
,
OPAL_G7231A_6k3
"{sw}"
)
DEFINE_H323_CAPAB
(
FS_G729
,
BaseG729Capab
,
H245_AudioCapability
::
e_g729
,
OPAL_G729
"{sw}"
)
DEFINE_H323_CAPAB
(
FS_G729A
,
BaseG729Capab
,
H245_AudioCapability
::
e_g729AnnexA
,
OPAL_G729A
"{sw}"
)
DEFINE_H323_CAPAB
(
FS_G729B
,
BaseG729Capab
,
H245_AudioCapability
::
e_g729wAnnexB
,
OPAL_G729B
"{sw}"
)
DEFINE_H323_CAPAB
(
FS_G729AB
,
BaseG729Capab
,
H245_AudioCapability
::
e_g729AnnexAwAnnexB
,
OPAL_G729AB
"{sw}"
)
DEFINE_H323_CAPAB
(
FS_GSM
,
BaseGSM0610Cap
,
H245_AudioCapability
::
e_gsmFullRate
,
OPAL_GSM0610
"{sw}"
)
static
FSProcess
*
h323_process
=
NULL
;
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论