Add conference mixing to LCR's internal bridge
[lcr.git] / gsm_bs.cpp
index 3a9ab7d..ee4bf04 100644 (file)
@@ -179,15 +179,24 @@ void Pgsm_bs::start_dtmf_ind(unsigned int msg_type, unsigned int callref, struct
        send_and_free_mncc(p_g_lcr_gsm, resp->msg_type, resp);
 
        if (p_g_rtp_bridge) {
-               class Port *remote = bridge_remote();
-
-               if (remote) {
-                       struct lcr_msg *message;
-
-                       /* send dtmf information, because we bridge RTP directly */
-                       message = message_create(0, remote->p_serial, EPOINT_TO_PORT, MESSAGE_DTMF);
-                       message->param.dtmf = mncc->keypad;
-                       message_put(message);
+               /* if two members are bridged */
+               if (p_bridge && p_bridge->first && p_bridge->first->next && !p_bridge->first->next->next) {
+                       class Port *remote = NULL;
+
+                       /* select other member */
+                       if (p_bridge->first->port == this)
+                               remote = p_bridge->first->next->port;
+                       if (p_bridge->first->next->port == this)
+                               remote = p_bridge->first->port;
+
+                       if (remote) {
+                               struct lcr_msg *message;
+
+                               /* send dtmf information, because we bridge RTP directly */
+                               message = message_create(0, remote->p_serial, EPOINT_TO_PORT, MESSAGE_DTMF);
+                               message->param.dtmf = mncc->keypad;
+                               message_put(message);
+                       }
                }
        } else {
                /* generate DTMF tones, since we do audio forwarding inside LCR */