Data-Over-Voice
[lcr.git] / port.cpp
index 16fcd72..32184a8 100644 (file)
--- a/port.cpp
+++ b/port.cpp
@@ -192,6 +192,8 @@ Port::Port(int type, const char *portname, struct port_settings *settings, struc
 #ifdef WITH_VOOTP
        p_vootp = NULL;
 #endif
+       /* D-O-V */
+       dov_init();
 
        /* append port to chain */
        next = NULL;
@@ -234,6 +236,8 @@ Port::~Port(void)
        if (p_record)
                close_record(0, 0);
 
+       dov_exit();
+
        classuse--;
 
        /* disconnect port from endpoint */
@@ -660,6 +664,16 @@ int Port::message_epoint(unsigned int epoint_id, int message_id, union parameter
                set_vootp(&param->vootp);
                return 1;
 #endif
+
+       case MESSAGE_DOV_REQUEST: /* Data-Over-Voice message */
+               PDEBUG(DEBUG_PORT, "PORT(%s) sending data over voice message (len=%d)\n", p_name, param->dov.length);
+               dov_sendmsg(param->dov.data, param->dov.length, (enum dov_type)param->dov.type, param->dov.level);
+               return 1;
+
+       case MESSAGE_DOV_LISTEN: /* Data-Over-Voice listen order */
+               PDEBUG(DEBUG_PORT, "PORT(%s) sending data over voice listen order\n", p_name);
+               dov_listen((enum dov_type)param->dov.type);
+               return 1;
        }
 
        return 0;