]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add dtmf method to mod_opal
authorAnthony Minessale <anthony.minessale@gmail.com>
Sat, 11 Apr 2009 16:29:36 +0000 (16:29 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sat, 11 Apr 2009 16:29:36 +0000 (16:29 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13002 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_opal/mod_opal.cpp
src/mod/endpoints/mod_opal/mod_opal.h

index ac3a9fd74b0cffecc1e615279bd1f5833aefd521..6e3b428682ee0f71d4a23f6ff097e0d7d3b130db 100644 (file)
@@ -49,6 +49,7 @@ static const char ModuleName[] = "opal";
 \r
 \r
 static switch_status_t on_hangup(switch_core_session_t *session);\r
+static switch_status_t on_destroy(switch_core_session_t *session);\r
 \r
 \r
 static switch_io_routines_t opalfs_io_routines = {\r
@@ -69,9 +70,8 @@ static switch_state_handler_table_t opalfs_event_handlers = {
     /*.on_routing */ FSConnection::on_routing,\r
     /*.on_execute */ FSConnection::on_execute,\r
     /*.on_hangup */ on_hangup,\r
-    /*.on_loopback */ FSConnection::on_loopback,\r
-    /*.on_transmit */ FSConnection::on_transmit,\r
-       /*.on_soft_execute */ NULL,\r
+    /*.on_exchange_media */ FSConnection::on_exchange_media,\r
+    /*.on_soft_execute */ FSConnection::on_soft_execute,\r
        /*.on_consume_media*/ NULL,\r
        /*.on_hibernate*/ NULL,\r
        /*.on_reset*/ NULL,\r
@@ -676,6 +676,12 @@ void FSConnection::OnEstablished()
     OpalLocalConnection::OnEstablished();\r
 }\r
 \r
+PBoolean FSConnection::SendUserInputTone(char tone, unsigned duration)\r
+{\r
+    switch_dtmf_t dtmf = { tone, duration };\r
+\r
+    return (switch_channel_queue_dtmf(m_fsChannel, &dtmf) == SWITCH_STATUS_SUCCESS) ? true : false;\r
+}\r
 \r
 OpalMediaFormatList FSConnection::GetMediaFormats() const\r
 {\r
@@ -887,14 +893,14 @@ static switch_status_t on_hangup(switch_core_session_t *session)
 }\r
 \r
 \r
-switch_status_t FSConnection::on_loopback()\r
+switch_status_t FSConnection::on_exchange_media()\r
 {\r
     PTRACE(3, "mod_opal\tLoopback on connection " << *this);\r
     return SWITCH_STATUS_SUCCESS;\r
 }\r
 \r
 \r
-switch_status_t FSConnection::on_transmit()\r
+switch_status_t FSConnection::on_soft_execute()\r
 {\r
     PTRACE(3, "mod_opal\tTransmit on connection " << *this);\r
     return SWITCH_STATUS_SUCCESS;\r
index c2cf2c630ca7bf6dab1f596452e4c89ed3be838a..0b32c054855353f69347910ecf11d3fe2912f4d8 100644 (file)
@@ -187,6 +187,7 @@ class FSConnection:public OpalLocalConnection {
     virtual OpalMediaStream *CreateMediaStream(const OpalMediaFormat &, unsigned, PBoolean);
     virtual PBoolean OnOpenMediaStream(OpalMediaStream & stream);
     virtual OpalMediaFormatList GetMediaFormats() const;
+    virtual PBoolean SendUserInputTone(char tone, unsigned duration);
 
     void SetCodecs();
 
@@ -195,8 +196,8 @@ class FSConnection:public OpalLocalConnection {
     DECLARE_CALLBACK0(on_execute);
     //DECLARE_CALLBACK0(on_hangup);
 
-    DECLARE_CALLBACK0(on_loopback);
-    DECLARE_CALLBACK0(on_transmit);
+    DECLARE_CALLBACK0(on_exchange_media);
+    DECLARE_CALLBACK0(on_soft_execute);
 
     DECLARE_CALLBACK1(kill_channel, int, sig);
     DECLARE_CALLBACK1(send_dtmf, const switch_dtmf_t *, dtmf);