summaryrefslogtreecommitdiffstats
path: root/main/asterisk/ASTERISK-19109.patch
blob: 09491bd8b637299569ff6ddd3771df0ad1e0a0e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
diff -ru asterisk-12.2.0.orig/CHANGES asterisk-12.2.0/CHANGES
--- asterisk-12.2.0.orig/CHANGES	2014-04-22 00:02:00.000000000 -0300
+++ asterisk-12.2.0/CHANGES	2014-05-03 11:54:02.079108226 -0300
@@ -10,6 +10,10 @@
 
 
 
+
+ * Added support for deaf participants with CLI commands, manager actions
+   and ConfBridge DTMF actions to toggle the deaf state.
+
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 12.1.0 to Asterisk 12.2.0 ------------
 ------------------------------------------------------------------------------
diff -ru asterisk-12.2.0.orig/apps/app_confbridge.c asterisk-12.2.0/apps/app_confbridge.c
--- asterisk-12.2.0.orig/apps/app_confbridge.c	2014-03-21 00:54:59.000000000 -0200
+++ asterisk-12.2.0/apps/app_confbridge.c	2014-05-03 11:53:14.806030993 -0300
@@ -215,6 +215,30 @@
 		<description>
 		</description>
 	</manager>
+	<manager name="ConfbridgeDeafen" language="en_US">
+		<synopsis>
+			Deafen a Confbridge user.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Conference" required="true" />
+			<parameter name="Channel" required="true" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
+	<manager name="ConfbridgeUndeafen" language="en_US">
+		<synopsis>
+			Undeafen a Confbridge user.
+		</synopsis>
+		<syntax>
+			<xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
+			<parameter name="Conference" required="true" />
+			<parameter name="Channel" required="true" />
+		</syntax>
+		<description>
+		</description>
+	</manager>
 	<manager name="ConfbridgeKick" language="en_US">
 		<synopsis>
 			Kick a Confbridge user.
@@ -311,6 +335,13 @@
 	CONF_RECORD_STOP,
 };
 
+enum confbridge_feature_action {
+	CONFBRIDGE_FEATURE_MUTE,
+	CONFBRIDGE_FEATURE_UNMUTE,
+	CONFBRIDGE_FEATURE_DEAFEN,
+	CONFBRIDGE_FEATURE_UNDEAFEN
+};
+
 /*! \brief Container to hold all conference bridges in progress */
 struct ao2_container *conference_bridges;
 
@@ -382,6 +413,10 @@
 		return S_OR(custom_sounds->muted, "conf-muted");
 	case CONF_SOUND_UNMUTED:
 		return S_OR(custom_sounds->unmuted, "conf-unmuted");
+	case CONF_SOUND_DEAFENED:
+		return S_OR(custom_sounds->deafened, "conf-deafened");
+	case CONF_SOUND_UNDEAFENED:
+		return S_OR(custom_sounds->undeafened, "conf-undeafened");
 	case CONF_SOUND_ONLY_ONE:
 		return S_OR(custom_sounds->onlyone, "conf-onlyone");
 	case CONF_SOUND_THERE_ARE:
@@ -495,6 +530,16 @@
 	send_conf_stasis(conference, chan, confbridge_unmute_type(), NULL, 1);
 }
 
+static void send_deafen_event(struct ast_channel *chan, struct confbridge_conference *conference)
+{
+	send_conf_stasis(conference, chan, confbridge_deafen_type(), NULL, 1);
+}
+
+static void send_undeafen_event(struct ast_channel *chan, struct confbridge_conference *conference)
+{
+	send_conf_stasis(conference, chan, confbridge_undeafen_type(), NULL, 1);
+}
+
 static void set_rec_filename(struct confbridge_conference *conference, struct ast_str **filename, int is_new)
 {
 	char *rec_file = conference->b_profile.rec_file;
@@ -1657,6 +1702,11 @@
 		/* Set user level mute request. */
 		user.muted = 1;
 	}
+	/* If the caller should be joined already deafened, set the flag before we join. */
+	if (ast_test_flag(&user.u_profile, USER_OPT_STARTDEAF)) {
+		/* Set user level deaf request */
+		user.features.deaf = 1;
+	}
 
 	/* Look for a conference bridge matching the provided name */
 	if (!(conference = join_conference_bridge(args.conf_name, &user))) {
@@ -1846,6 +1896,30 @@
 	return 0;
 }
 
+static int action_toggle_deaf(struct confbridge_conference *conference,
+	struct confbridge_user *user, struct ast_channel *chan)
+{
+	/* Deafen or undeafen yourself */
+	user->features.deaf = !user->features.deaf;
+	ast_test_suite_event_notify("CONF_DEAF",
+		"Message: participant %s %s\r\n"
+		"Conference: %s\r\n"
+		"Channel: %s",
+		ast_channel_name(chan),
+		user->features.deaf ? "deafened" : "undeafened",
+		user->b_profile.name,
+		ast_channel_name(chan));
+	if (user->features.deaf) {
+		send_deafen_event(chan, conference);
+	} else {
+		send_undeafen_event(chan, conference);
+	}
+	return ast_stream_and_wait(chan, (user->features.deaf ?
+		conf_get_sound(CONF_SOUND_DEAFENED, user->b_profile.sounds) :
+		conf_get_sound(CONF_SOUND_UNDEAFENED, user->b_profile.sounds)),
+		"");
+}
+
 static int action_playback(struct ast_bridge_channel *bridge_channel, const char *playback_file)
 {
 	char *file_copy = ast_strdupa(playback_file);
@@ -2034,6 +2108,11 @@
 		case MENU_ACTION_PARTICIPANT_COUNT:
 			announce_user_count(conference, user);
 			break;
+		case MENU_ACTION_TOGGLE_DEAF:
+			res |= action_toggle_deaf(conference,
+				user,
+				bridge_channel->chan);
+			break;
 		case MENU_ACTION_PLAYBACK:
 			if (!stop_prompts) {
 				res |= action_playback(bridge_channel, menu_action->data.playback_file);
@@ -2380,14 +2459,29 @@
 	return res;
 }
 
+static void test_suite_feature_action_event_notify(
+	struct confbridge_conference *conference,
+	struct confbridge_user *user,
+	const char *state, const char *verb)
+{
+	ast_test_suite_event_notify(state,
+		"Message: participant %s %s\r\n"
+		"Conference: %s\r\n"
+		"Channel: %s",
+		ast_channel_name(user->chan),
+		verb,
+		conference->b_profile.name,
+		ast_channel_name(user->chan));
+}
+
 /* \internal
- * \brief finds a conference user by channel name and mutes/unmutes them.
+ * \brief finds a conference user by channel name and changes feature bits on it.
  *
  * \retval 0 success
  * \retval -1 conference not found
  * \retval -2 user not found
  */
-static int generic_mute_unmute_helper(int mute, const char *conference_name, const char *chan_name)
+static int generic_feature_action_helper(enum confbridge_feature_action action, const char *conference_name, const char *chan_name)
 {
 	struct confbridge_conference *conference;
 	struct confbridge_user *user;
@@ -2404,25 +2498,33 @@
 		}
 	}
 	if (user) {
-		/* Set user level mute request. */
-		user->muted = mute ? 1 : 0;
-
-		conf_update_user_mute(user);
-		ast_test_suite_event_notify("CONF_MUTE",
-			"Message: participant %s %s\r\n"
-			"Conference: %s\r\n"
-			"Channel: %s",
-			ast_channel_name(user->chan),
-			mute ? "muted" : "unmuted",
-			conference->b_profile.name,
-			ast_channel_name(user->chan));
-		if (mute) {
+		switch (action) {
+		case CONFBRIDGE_FEATURE_DEAFEN:
+			user->features.deaf = 1;
+			test_suite_feature_action_event_notify(conference, user, "CONF_DEAF", "deafened");
+			send_deafen_event(user->chan, conference);
+			break;
+		case CONFBRIDGE_FEATURE_UNDEAFEN:
+			user->features.deaf = 0;
+			test_suite_feature_action_event_notify(conference, user, "CONF_DEAF", "undeafened");
+			send_undeafen_event(user->chan, conference);
+			break;
+		case CONFBRIDGE_FEATURE_MUTE:
+			user->muted = 1;
+			conf_update_user_mute(user);
+			test_suite_feature_action_event_notify(conference, user, "CONF_MUTE", "muted");
 			send_mute_event(user->chan, conference);
-		} else {
+			break;
+		case CONFBRIDGE_FEATURE_UNMUTE:
+		default:
+			user->muted = 0;
+			conf_update_user_mute(user);
+			test_suite_feature_action_event_notify(conference, user, "CONF_MUTE", "unmuted");
 			send_unmute_event(user->chan, conference);
+			break;
 		}
 	} else {
-		res = -2;;
+		res = -2;
 	}
 	ao2_unlock(conference);
 	ao2_ref(conference, -1);
@@ -2430,9 +2532,10 @@
 	return res;
 }
 
-static int cli_mute_unmute_helper(int mute, struct ast_cli_args *a)
+static int cli_feature_action_helper(enum confbridge_feature_action action, struct ast_cli_args *a)
 {
-	int res = generic_mute_unmute_helper(mute, a->argv[2], a->argv[3]);
+	const char *verb;
+	int res = generic_feature_action_helper(action, a->argv[2], a->argv[3]);
 
 	if (res == -1) {
 		ast_cli(a->fd, "No conference bridge named '%s' found!\n", a->argv[2]);
@@ -2441,7 +2544,24 @@
 		ast_cli(a->fd, "No channel named '%s' found in conference %s\n", a->argv[3], a->argv[2]);
 		return -1;
 	}
-	ast_cli(a->fd, "%s %s from confbridge %s\n", mute ? "Muting" : "Unmuting", a->argv[3], a->argv[2]);
+
+	switch (action) {
+	case CONFBRIDGE_FEATURE_DEAFEN:
+		verb = "Deafening";
+		break;
+	case CONFBRIDGE_FEATURE_UNDEAFEN:
+		verb = "Undeafening";
+		break;
+	case CONFBRIDGE_FEATURE_MUTE:
+		verb = "Muting";
+		break;
+	case CONFBRIDGE_FEATURE_UNMUTE:
+	default:
+		verb = "Unmuting";
+		break;
+	}
+
+	ast_cli(a->fd, "%s %s from confbridge %s\n", verb, a->argv[3], a->argv[2]);
 	return 0;
 }
 
@@ -2470,7 +2590,7 @@
 		return CLI_SHOWUSAGE;
 	}
 
-	cli_mute_unmute_helper(1, a);
+	cli_feature_action_helper(CONFBRIDGE_FEATURE_MUTE, a);
 
 	return CLI_SUCCESS;
 }
@@ -2500,7 +2620,53 @@
 		return CLI_SHOWUSAGE;
 	}
 
-	cli_mute_unmute_helper(0, a);
+	cli_feature_action_helper(CONFBRIDGE_FEATURE_UNMUTE, a);
+
+	return CLI_SUCCESS;
+}
+
+static char *handle_cli_confbridge_deafen(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	switch (cmd) {
+	case CLI_INIT:
+		e->command = "confbridge deafen";
+		e->usage =
+			"Usage: confbridge deafen <conference> <channel>\n";
+		return NULL;
+	case CLI_GENERATE:
+		if (a->pos == 2) {
+			return complete_confbridge_name(a->line, a->word, a->pos, a->n);
+		}
+		return NULL;
+	}
+	if (a->argc != 4) {
+		return CLI_SHOWUSAGE;
+	}
+
+	cli_feature_action_helper(CONFBRIDGE_FEATURE_DEAFEN, a);
+
+	return CLI_SUCCESS;
+}
+
+static char *handle_cli_confbridge_undeafen(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	switch (cmd) {
+	case CLI_INIT:
+		e->command = "confbridge undeafen";
+		e->usage =
+			"Usage: confbridge undeafen <conference> <channel>\n";
+		return NULL;
+	case CLI_GENERATE:
+		if (a->pos == 2) {
+			return complete_confbridge_name(a->line, a->word, a->pos, a->n);
+		}
+		return NULL;
+	}
+	if (a->argc != 4) {
+		return CLI_SHOWUSAGE;
+	}
+
+	cli_feature_action_helper(CONFBRIDGE_FEATURE_UNDEAFEN, a);
 
 	return CLI_SUCCESS;
 }
@@ -2655,6 +2821,8 @@
 	AST_CLI_DEFINE(handle_cli_confbridge_kick, "Kick participants out of conference bridges."),
 	AST_CLI_DEFINE(handle_cli_confbridge_mute, "Mute a participant."),
 	AST_CLI_DEFINE(handle_cli_confbridge_unmute, "Unmute a participant."),
+	AST_CLI_DEFINE(handle_cli_confbridge_deafen, "Deafen a participant."),
+	AST_CLI_DEFINE(handle_cli_confbridge_undeafen, "Undeafen a participant."),
 	AST_CLI_DEFINE(handle_cli_confbridge_lock, "Lock a conference."),
 	AST_CLI_DEFINE(handle_cli_confbridge_unlock, "Unlock a conference."),
 	AST_CLI_DEFINE(handle_cli_confbridge_start_record, "Start recording a conference"),
@@ -2805,10 +2973,11 @@
 	return 0;
 }
 
-static int action_mute_unmute_helper(struct mansession *s, const struct message *m, int mute)
+static int action_feature_action_helper(struct mansession *s, const struct message *m, enum confbridge_feature_action action)
 {
 	const char *conference_name = astman_get_header(m, "Conference");
 	const char *channel_name = astman_get_header(m, "Channel");
+	char *verb;
 	int res = 0;
 
 	if (ast_strlen_zero(conference_name)) {
@@ -2824,7 +2993,7 @@
 		return 0;
 	}
 
-	res = generic_mute_unmute_helper(mute, conference_name, channel_name);
+	res = generic_feature_action_helper(action, conference_name, channel_name);
 
 	if (res == -1) {
 		astman_send_error(s, m, "No Conference by that name found.");
@@ -2834,17 +3003,41 @@
 		return 0;
 	}
 
-	astman_send_ack(s, m, mute ? "User muted" : "User unmuted");
+	switch (action) {
+	case CONFBRIDGE_FEATURE_DEAFEN:
+		verb = "User deafened";
+		break;
+	case CONFBRIDGE_FEATURE_UNDEAFEN:
+		verb = "User undeafened";
+		break;
+	case CONFBRIDGE_FEATURE_MUTE:
+		verb = "User muted";
+		break;
+	case CONFBRIDGE_FEATURE_UNMUTE:
+	default:
+		verb = "User unmuted";
+		break;
+	}
+
+	astman_send_ack(s, m, verb);
 	return 0;
 }
 
 static int action_confbridgeunmute(struct mansession *s, const struct message *m)
 {
-	return action_mute_unmute_helper(s, m, 0);
+	return action_feature_action_helper(s, m, CONFBRIDGE_FEATURE_UNMUTE);
 }
 static int action_confbridgemute(struct mansession *s, const struct message *m)
 {
-	return action_mute_unmute_helper(s, m, 1);
+	return action_feature_action_helper(s, m, CONFBRIDGE_FEATURE_MUTE);
+}
+static int action_confbridgeundeafen(struct mansession *s, const struct message *m)
+{
+	return action_feature_action_helper(s, m, CONFBRIDGE_FEATURE_UNDEAFEN);
+}
+static int action_confbridgedeafen(struct mansession *s, const struct message *m)
+{
+	return action_feature_action_helper(s, m, CONFBRIDGE_FEATURE_DEAFEN);
 }
 
 static int action_lock_unlock_helper(struct mansession *s, const struct message *m, int lock)
@@ -3197,6 +3390,8 @@
 	ast_manager_unregister("ConfbridgeListRooms");
 	ast_manager_unregister("ConfbridgeMute");
 	ast_manager_unregister("ConfbridgeUnmute");
+	ast_manager_unregister("ConfbridgeDeafen");
+	ast_manager_unregister("ConfbridgeUndeafen");
 	ast_manager_unregister("ConfbridgeKick");
 	ast_manager_unregister("ConfbridgeUnlock");
 	ast_manager_unregister("ConfbridgeLock");
@@ -3266,6 +3461,8 @@
 	res |= ast_manager_register_xml("ConfbridgeListRooms", EVENT_FLAG_REPORTING, action_confbridgelistrooms);
 	res |= ast_manager_register_xml("ConfbridgeMute", EVENT_FLAG_CALL, action_confbridgemute);
 	res |= ast_manager_register_xml("ConfbridgeUnmute", EVENT_FLAG_CALL, action_confbridgeunmute);
+	res |= ast_manager_register_xml("ConfbridgeDeafen", EVENT_FLAG_CALL, action_confbridgedeafen);
+	res |= ast_manager_register_xml("ConfbridgeUndeafen", EVENT_FLAG_CALL, action_confbridgeundeafen);
 	res |= ast_manager_register_xml("ConfbridgeKick", EVENT_FLAG_CALL, action_confbridgekick);
 	res |= ast_manager_register_xml("ConfbridgeUnlock", EVENT_FLAG_CALL, action_confbridgeunlock);
 	res |= ast_manager_register_xml("ConfbridgeLock", EVENT_FLAG_CALL, action_confbridgelock);
diff -ru asterisk-12.2.0.orig/apps/confbridge/conf_config_parser.c asterisk-12.2.0/apps/confbridge/conf_config_parser.c
--- asterisk-12.2.0.orig/apps/confbridge/conf_config_parser.c	2014-03-27 21:15:35.000000000 -0200
+++ asterisk-12.2.0/apps/confbridge/conf_config_parser.c	2014-05-03 11:51:44.939851173 -0300
@@ -862,6 +862,10 @@
 		ast_string_field_set(sounds, muted, sound_file);
 	} else if (!strcasecmp(sound_name, "sound_unmuted")) {
 		ast_string_field_set(sounds, unmuted, sound_file);
+	} else if (!strcasecmp(sound_name, "sound_deafened")) {
+		ast_string_field_set(sounds, deafened, sound_file);
+	} else if (!strcasecmp(sound_name, "sound_undeafened")) {
+		ast_string_field_set(sounds, undeafened, sound_file);
 	} else if (!strcasecmp(sound_name, "sound_there_are")) {
 		ast_string_field_set(sounds, thereare, sound_file);
 	} else if (!strcasecmp(sound_name, "sound_other_in_party")) {
@@ -1014,6 +1018,7 @@
 	switch (id) {
 	case MENU_ACTION_NOOP:
 	case MENU_ACTION_TOGGLE_MUTE:
+	case MENU_ACTION_TOGGLE_DEAF:
 	case MENU_ACTION_INCREASE_LISTENING:
 	case MENU_ACTION_DECREASE_LISTENING:
 	case MENU_ACTION_INCREASE_TALKING:
@@ -1304,6 +1309,9 @@
 	ast_cli(a->fd,"Start Muted:             %s\n",
 		u_profile.flags & USER_OPT_STARTMUTED?
 		"true" : "false");
+	ast_cli(a->fd,"Start Deaf:              %s\n",
+		u_profile.flags & USER_OPT_STARTDEAF?
+		"true" : "false");
 	ast_cli(a->fd,"MOH When Empty:          %s\n",
 		u_profile.flags & USER_OPT_MUSICONHOLD ?
 		"enabled" : "disabled");
@@ -1507,6 +1515,8 @@
 	ast_cli(a->fd,"sound_kicked:         %s\n", conf_get_sound(CONF_SOUND_KICKED, b_profile.sounds));
 	ast_cli(a->fd,"sound_muted:          %s\n", conf_get_sound(CONF_SOUND_MUTED, b_profile.sounds));
 	ast_cli(a->fd,"sound_unmuted:        %s\n", conf_get_sound(CONF_SOUND_UNMUTED, b_profile.sounds));
+	ast_cli(a->fd,"sound_deafened:       %s\n", conf_get_sound(CONF_SOUND_DEAFENED, b_profile.sounds));
+	ast_cli(a->fd,"sound_undeafened:     %s\n", conf_get_sound(CONF_SOUND_UNDEAFENED, b_profile.sounds));
 	ast_cli(a->fd,"sound_there_are:      %s\n", conf_get_sound(CONF_SOUND_THERE_ARE, b_profile.sounds));
 	ast_cli(a->fd,"sound_other_in_party: %s\n", conf_get_sound(CONF_SOUND_OTHER_IN_PARTY, b_profile.sounds));
 	ast_cli(a->fd,"sound_place_into_conference: %s\n", conf_get_sound(CONF_SOUND_PLACE_IN_CONF, b_profile.sounds));
@@ -1635,6 +1645,9 @@
 			case MENU_ACTION_TOGGLE_MUTE:
 				ast_cli(a->fd, "toggle_mute");
 				break;
+			case MENU_ACTION_TOGGLE_DEAF:
+				ast_cli(a->fd, "toggle_deaf");
+				break;
 			case MENU_ACTION_NOOP:
 				ast_cli(a->fd, "no_op");
 				break;
@@ -1932,6 +1945,7 @@
 	aco_option_register(&cfg_info, "admin", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_ADMIN);
 	aco_option_register(&cfg_info, "marked", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_MARKEDUSER);
 	aco_option_register(&cfg_info, "startmuted", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_STARTMUTED);
+	aco_option_register(&cfg_info, "startdeaf", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_STARTDEAF);
 	aco_option_register(&cfg_info, "music_on_hold_when_empty", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_MUSICONHOLD);
 	aco_option_register(&cfg_info, "quiet", ACO_EXACT, user_types, "no", OPT_BOOLFLAG_T, 1, FLDSET(struct user_profile, flags), USER_OPT_QUIET);
 	aco_option_register_custom(&cfg_info, "announce_user_count_all", ACO_EXACT, user_types, "no", announce_user_count_all_handler, 0);
diff -ru asterisk-12.2.0.orig/apps/confbridge/confbridge_manager.c asterisk-12.2.0/apps/confbridge/confbridge_manager.c
--- asterisk-12.2.0.orig/apps/confbridge/confbridge_manager.c	2013-09-30 21:48:57.000000000 -0300
+++ asterisk-12.2.0/apps/confbridge/confbridge_manager.c	2014-05-03 11:51:44.939851173 -0300
@@ -161,6 +161,38 @@
 			</see-also>
 		</managerEventInstance>
 	</managerEvent>
+	<managerEvent language="en_US" name="ConfbridgeDeafen">
+		<managerEventInstance class="EVENT_FLAG_CALL">
+			<synopsis>Raised when a Confbridge participant deafens.</synopsis>
+			<syntax>
+				<parameter name="Conference">
+					<para>The name of the Confbridge conference.</para>
+				</parameter>
+				<bridge_snapshot/>
+				<channel_snapshot/>
+			</syntax>
+			<see-also>
+				<ref type="managerEvent">ConfbridgeUndeafen</ref>
+				<ref type="application">ConfBridge</ref>
+			</see-also>
+		</managerEventInstance>
+	</managerEvent>
+	<managerEvent language="en_US" name="ConfbridgeUndeafen">
+		<managerEventInstance class="EVENT_FLAG_CALL">
+			<synopsis>Raised when a confbridge participant undeafens.</synopsis>
+			<syntax>
+				<parameter name="Conference">
+					<para>The name of the Confbridge conference.</para>
+				</parameter>
+				<bridge_snapshot/>
+				<channel_snapshot/>
+			</syntax>
+			<see-also>
+				<ref type="managerEvent">ConfbridgeMute</ref>
+				<ref type="application">ConfBridge</ref>
+			</see-also>
+		</managerEventInstance>
+	</managerEvent>
 	<managerEvent language="en_US" name="ConfbridgeTalking">
 		<managerEventInstance class="EVENT_FLAG_CALL">
 			<synopsis>Raised when a confbridge participant unmutes.</synopsis>
@@ -271,6 +303,18 @@
 	confbridge_publish_manager_event(message, "ConfbridgeUnmute", NULL);
 }
 
+static void confbridge_deafen_cb(void *data, struct stasis_subscription *sub,
+	struct stasis_message *message)
+{
+	confbridge_publish_manager_event(message, "ConfbridgeDeafen", NULL);
+}
+
+static void confbridge_undeafen_cb(void *data, struct stasis_subscription *sub,
+	struct stasis_message *message)
+{
+	confbridge_publish_manager_event(message, "ConfbridgeUndeafen", NULL);
+}
+
 static void confbridge_talking_cb(void *data, struct stasis_subscription *sub,
 	struct stasis_message *message)
 {
@@ -297,6 +341,8 @@
 STASIS_MESSAGE_TYPE_DEFN(confbridge_stop_record_type);
 STASIS_MESSAGE_TYPE_DEFN(confbridge_mute_type);
 STASIS_MESSAGE_TYPE_DEFN(confbridge_unmute_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_deafen_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_undeafen_type);
 STASIS_MESSAGE_TYPE_DEFN(confbridge_talking_type);
 
 void manager_confbridge_shutdown(void) {
@@ -308,6 +354,8 @@
 	STASIS_MESSAGE_TYPE_CLEANUP(confbridge_stop_record_type);
 	STASIS_MESSAGE_TYPE_CLEANUP(confbridge_mute_type);
 	STASIS_MESSAGE_TYPE_CLEANUP(confbridge_unmute_type);
+	STASIS_MESSAGE_TYPE_CLEANUP(confbridge_deafen_type);
+	STASIS_MESSAGE_TYPE_CLEANUP(confbridge_undeafen_type);
 	STASIS_MESSAGE_TYPE_CLEANUP(confbridge_talking_type);
 
 	if (bridge_state_router) {
@@ -331,6 +379,8 @@
 	STASIS_MESSAGE_TYPE_INIT(confbridge_stop_record_type);
 	STASIS_MESSAGE_TYPE_INIT(confbridge_mute_type);
 	STASIS_MESSAGE_TYPE_INIT(confbridge_unmute_type);
+	STASIS_MESSAGE_TYPE_INIT(confbridge_deafen_type);
+	STASIS_MESSAGE_TYPE_INIT(confbridge_undeafen_type);
 	STASIS_MESSAGE_TYPE_INIT(confbridge_talking_type);
 
 	bridge_state_router = stasis_message_router_create(
@@ -397,6 +447,20 @@
 		return -1;
 	}
 	if (stasis_message_router_add(bridge_state_router,
+			confbridge_deafen_type(),
+			confbridge_deafen_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(bridge_state_router,
+			confbridge_undeafen_type(),
+			confbridge_undeafen_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(bridge_state_router,
 			confbridge_talking_type(),
 			confbridge_talking_cb,
 			NULL)) {
@@ -467,6 +531,20 @@
 			NULL)) {
 		manager_confbridge_shutdown();
 		return -1;
+	}
+	if (stasis_message_router_add(channel_state_router,
+			confbridge_deafen_type(),
+			confbridge_deafen_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(channel_state_router,
+			confbridge_undeafen_type(),
+			confbridge_undeafen_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
 	}
 	if (stasis_message_router_add(channel_state_router,
 			confbridge_talking_type(),
diff -ru asterisk-12.2.0.orig/apps/confbridge/include/confbridge.h asterisk-12.2.0/apps/confbridge/include/confbridge.h
--- asterisk-12.2.0.orig/apps/confbridge/include/confbridge.h	2014-02-10 17:54:45.000000000 -0200
+++ asterisk-12.2.0/apps/confbridge/include/confbridge.h	2014-05-03 11:51:44.939851173 -0300
@@ -58,6 +58,7 @@
 	USER_OPT_DTMF_PASS    =  (1 << 13), /*!< Sets if dtmf should be passed into the conference or not */
 	USER_OPT_ANNOUNCEUSERCOUNTALL = (1 << 14), /*!< Sets if the number of users should be announced to everyone. */
 	USER_OPT_JITTERBUFFER =  (1 << 15), /*!< Places a jitterbuffer on the user. */
+	USER_OPT_STARTDEAF =     (1 << 16), /*!< Set if the caller should be initially set deaf */
 };
 
 enum bridge_profile_flags {
@@ -70,6 +71,7 @@
 
 enum conf_menu_action_id {
 	MENU_ACTION_TOGGLE_MUTE = 1,
+	MENU_ACTION_TOGGLE_DEAF,
 	MENU_ACTION_PLAYBACK,
 	MENU_ACTION_PLAYBACK_AND_CONTINUE,
 	MENU_ACTION_INCREASE_LISTENING,
@@ -144,6 +146,8 @@
 	CONF_SOUND_KICKED,
 	CONF_SOUND_MUTED,
 	CONF_SOUND_UNMUTED,
+	CONF_SOUND_DEAFENED,
+	CONF_SOUND_UNDEAFENED,
 	CONF_SOUND_ONLY_ONE,
 	CONF_SOUND_THERE_ARE,
 	CONF_SOUND_OTHER_IN_PARTY,
@@ -171,6 +175,8 @@
 		AST_STRING_FIELD(kicked);
 		AST_STRING_FIELD(muted);
 		AST_STRING_FIELD(unmuted);
+		AST_STRING_FIELD(deafened);
+		AST_STRING_FIELD(undeafened);
 		AST_STRING_FIELD(onlyone);
 		AST_STRING_FIELD(thereare);
 		AST_STRING_FIELD(otherinparty);
@@ -346,6 +352,8 @@
 	struct conf_menu_entry *menu_entry,
 	struct conf_menu *menu);
 
+struct stasis_message_type *confbridge_deafen_type(void);
+struct stasis_message_type *confbridge_undeafen_type(void);
 
 /*! \brief Looks to see if sound file is stored in bridge profile sounds, if not
  *  default sound is provided.*/
diff -ru asterisk-12.2.0.orig/bridges/bridge_softmix.c asterisk-12.2.0/bridges/bridge_softmix.c
--- asterisk-12.2.0.orig/bridges/bridge_softmix.c	2014-03-17 18:52:12.000000000 -0200
+++ asterisk-12.2.0/bridges/bridge_softmix.c	2014-05-03 11:51:44.943184488 -0300
@@ -926,16 +926,23 @@
 
 			ast_mutex_lock(&sc->lock);
 
-			/* Make SLINEAR write frame from local buffer */
-			if (sc->write_frame.subclass.format.id != cur_slin_id) {
-				ast_format_set(&sc->write_frame.subclass.format, cur_slin_id, 0);
-			}
-			sc->write_frame.datalen = softmix_datalen;
-			sc->write_frame.samples = softmix_samples;
-			memcpy(sc->final_buf, buf, softmix_datalen);
+			if (bridge_channel->features && bridge_channel->features->deaf) {
+				/* For deaf channels post a null frame */
+				sc->write_frame.frametype = AST_FRAME_NULL;
+			} else {
+				/* Make SLINEAR write frame from local buffer */
+				sc->write_frame.frametype = AST_FRAME_VOICE;
+				if (sc->write_frame.subclass.format.id != cur_slin_id) {
+					ast_format_set(&sc->write_frame.subclass.format, cur_slin_id, 0);
+				}
+				sc->write_frame.datalen = softmix_datalen;
+				sc->write_frame.samples = softmix_samples;
+				memcpy(sc->final_buf, buf, softmix_datalen);
 
-			/* process the softmix channel's new write audio */
-			softmix_process_write_audio(&trans_helper, ast_channel_rawwriteformat(bridge_channel->chan), sc);
+				/* process the softmix channel's new write audio */
+				softmix_process_write_audio(&trans_helper,
+					ast_channel_rawwriteformat(bridge_channel->chan), sc);
+			}
 
 			ast_mutex_unlock(&sc->lock);
 
diff -ru asterisk-12.2.0.orig/configs/confbridge.conf.sample asterisk-12.2.0/configs/confbridge.conf.sample
--- asterisk-12.2.0.orig/configs/confbridge.conf.sample	2014-02-10 17:54:45.000000000 -0200
+++ asterisk-12.2.0/configs/confbridge.conf.sample	2014-05-03 11:51:44.943184488 -0300
@@ -20,6 +20,7 @@
 ;admin=yes     ; Sets if the user is an admin or not. Off by default.
 ;marked=yes    ; Sets if this is a marked user or not. Off by default.
 ;startmuted=yes; Sets if all users should start out muted. Off by default
+;startdeaf=yes ; Sets if all users should start out deaf. Off by default.
 ;music_on_hold_when_empty=yes  ; Sets whether MOH should be played when only
                                ; one person is in the conference or when the
                                ; the user is waiting on a marked user to enter
@@ -217,6 +218,8 @@
 ;sound_kicked ; The sound played to a user who has been kicked from the conference.
 ;sound_muted  ; The sound played when the mute option it toggled on.
 ;sound_unmuted  ; The sound played when the mute option it toggled off.
+;sound_deafened  ; The sound played when the deaf option is toggled on.
+;sound_undeafened  ; The sound played when the deaf option is toggled off.
 ;sound_only_person ; The sound played when the user is the only person in the conference.
 ;sound_only_one ; The sound played to a user when there is only one other
                 ; person is in the conference.
@@ -278,6 +281,8 @@
                                        ; using the '&' character as a delimiter.
 ; toggle_mute      ; Toggle turning on and off mute.  Mute will make the user silent
                    ; to everyone else, but the user will still be able to listen in.
+; toggle_deaf      ; Toggle turning on and off deaf.  Deaf will make the user to hear
+                   ; only silence, but the user will still be able to talk.
 
 ; no_op ; This action does nothing (No Operation). Its only real purpose exists for
         ; being able to reserve a sequence in the config as a menu exit sequence.
diff -ru asterisk-12.2.0.orig/include/asterisk/bridge_features.h asterisk-12.2.0/include/asterisk/bridge_features.h
--- asterisk-12.2.0.orig/include/asterisk/bridge_features.h	2013-08-21 18:51:19.000000000 -0300
+++ asterisk-12.2.0/include/asterisk/bridge_features.h	2014-05-03 11:51:44.943184488 -0300
@@ -253,6 +253,8 @@
 	unsigned int usable:1;
 	/*! TRUE if the channel/bridge is muted. */
 	unsigned int mute:1;
+	/*! TRUE if the channel/bridge is deaf. */
+	unsigned int deaf:1;
 	/*! TRUE if DTMF should be passed into the bridge tech.  */
 	unsigned int dtmf_passthrough:1;
 };
diff -ru asterisk-12.2.0.orig/main/bridge_channel.c asterisk-12.2.0/main/bridge_channel.c
--- asterisk-12.2.0.orig/main/bridge_channel.c	2014-03-17 18:52:12.000000000 -0200
+++ asterisk-12.2.0/main/bridge_channel.c	2014-05-03 11:51:44.943184488 -0300
@@ -756,7 +756,21 @@
 		return 0;
 	}
 
-	dup = ast_frdup(fr);
+	if (fr->frametype == AST_FRAME_VOICE &&
+	    (bridge_channel->features && bridge_channel->features->deaf)) {
+		short buf[fr->samples];
+		struct ast_frame sframe = {
+			.frametype = AST_FRAME_VOICE,
+			.data.ptr = buf,
+			.samples = fr->samples,
+			.datalen = sizeof(buf),
+		};
+		ast_format_set(&sframe.subclass.format, AST_FORMAT_SLINEAR, 0);
+		memset(buf, 0, sizeof(buf));
+		dup = ast_frdup(&sframe);
+	} else {
+		dup = ast_frdup(fr);
+	}
 	if (!dup) {
 		return -1;
 	}