提交 8694fd32 authored 作者: Anthony Minessale's avatar Anthony Minessale

add dtmf method to mod_opal

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13002 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 d84c68b9
...@@ -49,6 +49,7 @@ static const char ModuleName[] = "opal"; ...@@ -49,6 +49,7 @@ static const char ModuleName[] = "opal";
static switch_status_t on_hangup(switch_core_session_t *session); static switch_status_t on_hangup(switch_core_session_t *session);
static switch_status_t on_destroy(switch_core_session_t *session);
static switch_io_routines_t opalfs_io_routines = { static switch_io_routines_t opalfs_io_routines = {
...@@ -69,9 +70,8 @@ static switch_state_handler_table_t opalfs_event_handlers = { ...@@ -69,9 +70,8 @@ static switch_state_handler_table_t opalfs_event_handlers = {
/*.on_routing */ FSConnection::on_routing, /*.on_routing */ FSConnection::on_routing,
/*.on_execute */ FSConnection::on_execute, /*.on_execute */ FSConnection::on_execute,
/*.on_hangup */ on_hangup, /*.on_hangup */ on_hangup,
/*.on_loopback */ FSConnection::on_loopback, /*.on_exchange_media */ FSConnection::on_exchange_media,
/*.on_transmit */ FSConnection::on_transmit, /*.on_soft_execute */ FSConnection::on_soft_execute,
/*.on_soft_execute */ NULL,
/*.on_consume_media*/ NULL, /*.on_consume_media*/ NULL,
/*.on_hibernate*/ NULL, /*.on_hibernate*/ NULL,
/*.on_reset*/ NULL, /*.on_reset*/ NULL,
...@@ -676,6 +676,12 @@ void FSConnection::OnEstablished() ...@@ -676,6 +676,12 @@ void FSConnection::OnEstablished()
OpalLocalConnection::OnEstablished(); OpalLocalConnection::OnEstablished();
} }
PBoolean FSConnection::SendUserInputTone(char tone, unsigned duration)
{
switch_dtmf_t dtmf = { tone, duration };
return (switch_channel_queue_dtmf(m_fsChannel, &dtmf) == SWITCH_STATUS_SUCCESS) ? true : false;
}
OpalMediaFormatList FSConnection::GetMediaFormats() const OpalMediaFormatList FSConnection::GetMediaFormats() const
{ {
...@@ -887,14 +893,14 @@ static switch_status_t on_hangup(switch_core_session_t *session) ...@@ -887,14 +893,14 @@ static switch_status_t on_hangup(switch_core_session_t *session)
} }
switch_status_t FSConnection::on_loopback() switch_status_t FSConnection::on_exchange_media()
{ {
PTRACE(3, "mod_opal\tLoopback on connection " << *this); PTRACE(3, "mod_opal\tLoopback on connection " << *this);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
switch_status_t FSConnection::on_transmit() switch_status_t FSConnection::on_soft_execute()
{ {
PTRACE(3, "mod_opal\tTransmit on connection " << *this); PTRACE(3, "mod_opal\tTransmit on connection " << *this);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
......
...@@ -187,6 +187,7 @@ class FSConnection:public OpalLocalConnection { ...@@ -187,6 +187,7 @@ class FSConnection:public OpalLocalConnection {
virtual OpalMediaStream *CreateMediaStream(const OpalMediaFormat &, unsigned, PBoolean); virtual OpalMediaStream *CreateMediaStream(const OpalMediaFormat &, unsigned, PBoolean);
virtual PBoolean OnOpenMediaStream(OpalMediaStream & stream); virtual PBoolean OnOpenMediaStream(OpalMediaStream & stream);
virtual OpalMediaFormatList GetMediaFormats() const; virtual OpalMediaFormatList GetMediaFormats() const;
virtual PBoolean SendUserInputTone(char tone, unsigned duration);
void SetCodecs(); void SetCodecs();
...@@ -195,8 +196,8 @@ class FSConnection:public OpalLocalConnection { ...@@ -195,8 +196,8 @@ class FSConnection:public OpalLocalConnection {
DECLARE_CALLBACK0(on_execute); DECLARE_CALLBACK0(on_execute);
//DECLARE_CALLBACK0(on_hangup); //DECLARE_CALLBACK0(on_hangup);
DECLARE_CALLBACK0(on_loopback); DECLARE_CALLBACK0(on_exchange_media);
DECLARE_CALLBACK0(on_transmit); 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);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论