]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix for MODENDP-31, send stop-talking events after CNG packets as well as silent...
authorMichael Jerris <mike@jerris.com>
Thu, 22 Nov 2007 06:56:02 +0000 (06:56 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 22 Nov 2007 06:56:02 +0000 (06:56 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6374 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_conference/mod_conference.c

index 596bcdcbf5f21472de842d5e28f625fe8b4fe8a9..7249b70874c9e591aa5ea80facae4812a22a85d9 100644 (file)
@@ -1356,6 +1356,22 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t * thread,
                }
 
                if (switch_test_flag(read_frame, SFF_CNG)) {
+                       if (hangunder_hits) {
+                               hangunder_hits--;
+                       }
+                       if (talking) {
+                               switch_event_t *event;
+                               if (++hangover_hits >= hangover) {
+                                       hangover_hits = hangunder_hits = 0;
+                                       talking = 0;
+
+                                       if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
+                                               conference_add_event_member_data(member, event);
+                                               switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "stop-talking");
+                                               switch_event_fire(&event);
+                                       }
+                               }
+                       }
                        continue;
                }