Don't do SIP contact/route DNS if we're not using the result.
[asterisk/asterisk.git] / apps / confbridge / conf_state.c
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 2012, Terry Wilson
5  *
6  * Terry Wilson <twilson@digium.com>
7  *
8  * See http://www.asterisk.org for more information about
9  * the Asterisk project. Please do not directly contact
10  * any of the maintainers of this project for assistance;
11  * the project provides a web site, mailing lists and IRC
12  * channels for your use.
13  *
14  * This program is free software, distributed under the terms of
15  * the GNU General Public License Version 2. See the LICENSE file
16  * at the top of the source tree.
17  *
18  * Please follow coding guidelines
19  * http://svn.digium.com/view/asterisk/trunk/doc/CODING-GUIDELINES
20  */
21
22 /*! \file
23  *
24  * \brief Confbridge state handling
25  *
26  * \author\verbatim Terry Wilson <twilson@digium.com> \endverbatim
27  *
28  * This file contains functions that are used from multiple conf_state
29  * files for handling stage change behavior.
30  *
31  * \ingroup applications
32  */
33
34 /*** MODULEINFO
35         <support_level>core</support_level>
36  ***/
37
38 #include "asterisk.h"
39
40 #include "asterisk/logger.h"
41 #include "include/conf_state.h"
42 #include "include/confbridge.h"
43
44 void conf_invalid_event_fn(struct conference_bridge_user *cbu)
45 {
46         ast_log(LOG_ERROR, "Invalid event for confbridge user '%s'\n", cbu->u_profile.name);
47 }
48
49 void conf_default_join_waitmarked(struct conference_bridge_user *cbu)
50 {
51         conf_add_user_waiting(cbu->conference_bridge, cbu);
52         conf_add_post_join_action(cbu, conf_handle_inactive_waitmarked);
53 }
54
55 void conf_default_leave_waitmarked(struct conference_bridge_user *cbu)
56 {
57         conf_remove_user_waiting(cbu->conference_bridge, cbu);
58 }
59
60 void conf_change_state(struct conference_bridge_user *cbu, struct conference_state *newstate)
61 {
62         ast_debug(1, "Changing conference '%s' state from %s to %s\n", cbu->conference_bridge->name, cbu->conference_bridge->state->name, newstate->name);
63         if (cbu->conference_bridge->state->exit) {
64                 cbu->conference_bridge->state->exit(cbu);
65         }
66         cbu->conference_bridge->state = newstate;
67         if (cbu->conference_bridge->state->entry) {
68                 cbu->conference_bridge->state->entry(cbu);
69         }
70 }