app_confbridge: Make explicitly stop MOH if a user is kicked or hangs up while MOH...
authorRichard Mudgett <rmudgett@digium.com>
Wed, 12 Mar 2014 18:47:10 +0000 (18:47 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 12 Mar 2014 18:47:10 +0000 (18:47 +0000)
When MOH is playing to a user in a conference and the user is kicked or
hangs up from the conference then the AMI MusicOnHoldStop events didn't
happen.  (Asterisk v11 AMI event: MusicOnHold, state:Stop)

(closes issue ASTERISK-23311)
Reported by: Benjamin Keith Ford

Review: https://reviewboard.asterisk.org/r/3306/
........

Merged revisions 410490 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 410491 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410492 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/confbridge/conf_state.c
apps/confbridge/conf_state_inactive.c
apps/confbridge/conf_state_single.c
apps/confbridge/conf_state_single_marked.c

index 03dd7d9..305732f 100644 (file)
@@ -74,6 +74,9 @@ void conf_default_join_waitmarked(struct confbridge_user *user)
 void conf_default_leave_waitmarked(struct confbridge_user *user)
 {
        conf_remove_user_waiting(user->conference, user);
+       if (user->playing_moh) {
+               conf_moh_stop(user);
+       }
 }
 
 void conf_change_state(struct confbridge_user *user, struct confbridge_state *newstate)
index 24631e2..bc41e61 100644 (file)
@@ -66,7 +66,7 @@ static void join_marked(struct confbridge_user *user)
 
 static void leave_waitmarked(struct confbridge_user *user)
 {
-       conf_remove_user_waiting(user->conference, user);
+       conf_default_leave_waitmarked(user);
        if (user->conference->waitingusers == 0) {
                conf_change_state(user, CONF_STATE_EMPTY);
        }
index e3e0ca1..b3881fa 100644 (file)
@@ -72,6 +72,9 @@ static void join_marked(struct confbridge_user *user)
 static void leave_unmarked(struct confbridge_user *user)
 {
        conf_remove_user_active(user->conference, user);
+       if (user->playing_moh) {
+               conf_moh_stop(user);
+       }
 
        if (user->conference->waitingusers) {
                conf_change_state(user, CONF_STATE_INACTIVE);
index f72ef5e..c13ef16 100644 (file)
@@ -71,6 +71,9 @@ static void join_marked(struct confbridge_user *user)
 static void leave_marked(struct confbridge_user *user)
 {
        conf_remove_user_marked(user->conference, user);
+       if (user->playing_moh) {
+               conf_moh_stop(user);
+       }
 
        conf_change_state(user, CONF_STATE_EMPTY);
 }