Minor fix for GSM HR codec negotiation: Add missing 'break'.
[lcr.git] / port.cpp
index 16fcd72..11b70f3 100644 (file)
--- a/port.cpp
+++ b/port.cpp
@@ -176,6 +176,7 @@ Port::Port(int type, const char *portname, struct port_settings *settings, struc
        memset(&p_capainfo, 0, sizeof(p_capainfo));
        p_echotest = 0;
        p_bridge = 0;
+       p_hold = 0;
 
        /* call recording */
        p_record = NULL;
@@ -192,6 +193,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 +237,8 @@ Port::~Port(void)
        if (p_record)
                close_record(0, 0);
 
+       dov_exit();
+
        classuse--;
 
        /* disconnect port from endpoint */
@@ -660,6 +665,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;