bridge_builtin_features.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 2009, Digium, Inc.
  5. *
  6. * Joshua Colp <jcolp@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. /*! \file
  19. *
  20. * \brief Built in bridging features
  21. *
  22. * \author Joshua Colp <jcolp@digium.com>
  23. *
  24. * \ingroup bridges
  25. */
  26. /*** MODULEINFO
  27. <support_level>core</support_level>
  28. ***/
  29. #include "asterisk.h"
  30. ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
  31. #include <stdio.h>
  32. #include <stdlib.h>
  33. #include <string.h>
  34. #include <sys/types.h>
  35. #include <sys/stat.h>
  36. #include "asterisk/module.h"
  37. #include "asterisk/channel.h"
  38. #include "asterisk/bridge.h"
  39. #include "asterisk/bridge_technology.h"
  40. #include "asterisk/frame.h"
  41. #include "asterisk/file.h"
  42. #include "asterisk/app.h"
  43. #include "asterisk/astobj2.h"
  44. #include "asterisk/pbx.h"
  45. #include "asterisk/parking.h"
  46. #include "asterisk/features_config.h"
  47. #include "asterisk/monitor.h"
  48. #include "asterisk/mixmonitor.h"
  49. #include "asterisk/audiohook.h"
  50. #include "asterisk/causes.h"
  51. enum set_touch_variables_res {
  52. SET_TOUCH_SUCCESS,
  53. SET_TOUCH_UNSET,
  54. SET_TOUCH_ALLOC_FAILURE,
  55. };
  56. static void set_touch_variable(enum set_touch_variables_res *res, struct ast_channel *chan, const char *var_name, char **touch)
  57. {
  58. const char *c_touch;
  59. if (*res == SET_TOUCH_ALLOC_FAILURE) {
  60. return;
  61. }
  62. c_touch = pbx_builtin_getvar_helper(chan, var_name);
  63. if (!ast_strlen_zero(c_touch)) {
  64. *touch = ast_strdup(c_touch);
  65. if (!*touch) {
  66. *res = SET_TOUCH_ALLOC_FAILURE;
  67. } else {
  68. *res = SET_TOUCH_SUCCESS;
  69. }
  70. }
  71. }
  72. static enum set_touch_variables_res set_touch_variables(struct ast_channel *chan, int is_mixmonitor, char **touch_format, char **touch_monitor, char **touch_monitor_prefix)
  73. {
  74. enum set_touch_variables_res res = SET_TOUCH_UNSET;
  75. const char *var_format;
  76. const char *var_monitor;
  77. const char *var_prefix;
  78. SCOPED_CHANNELLOCK(lock, chan);
  79. if (is_mixmonitor) {
  80. var_format = "TOUCH_MIXMONITOR_FORMAT";
  81. var_monitor = "TOUCH_MIXMONITOR";
  82. var_prefix = "TOUCH_MIXMONITOR_PREFIX";
  83. } else {
  84. var_format = "TOUCH_MONITOR_FORMAT";
  85. var_monitor = "TOUCH_MONITOR";
  86. var_prefix = "TOUCH_MONITOR_PREFIX";
  87. }
  88. set_touch_variable(&res, chan, var_format, touch_format);
  89. set_touch_variable(&res, chan, var_monitor, touch_monitor);
  90. set_touch_variable(&res, chan, var_prefix, touch_monitor_prefix);
  91. return res;
  92. }
  93. static void stop_automonitor(struct ast_bridge_channel *bridge_channel, struct ast_channel *peer_chan, struct ast_features_general_config *features_cfg, const char *stop_message)
  94. {
  95. ast_verb(4, "AutoMonitor used to stop recording call.\n");
  96. ast_channel_lock(peer_chan);
  97. if (ast_channel_monitor(peer_chan)) {
  98. if (ast_channel_monitor(peer_chan)->stop(peer_chan, 1)) {
  99. ast_verb(4, "Cannot stop AutoMonitor for %s\n", ast_channel_name(bridge_channel->chan));
  100. if (features_cfg && !(ast_strlen_zero(features_cfg->recordingfailsound))) {
  101. ast_bridge_channel_queue_playfile(bridge_channel, NULL, features_cfg->recordingfailsound, NULL);
  102. }
  103. ast_channel_unlock(peer_chan);
  104. return;
  105. }
  106. } else {
  107. /* Something else removed the Monitor before we got to it. */
  108. ast_channel_unlock(peer_chan);
  109. return;
  110. }
  111. ast_channel_unlock(peer_chan);
  112. if (features_cfg && !(ast_strlen_zero(features_cfg->courtesytone))) {
  113. ast_bridge_channel_queue_playfile(bridge_channel, NULL, features_cfg->courtesytone, NULL);
  114. ast_bridge_channel_write_playfile(bridge_channel, NULL, features_cfg->courtesytone, NULL);
  115. }
  116. if (!ast_strlen_zero(stop_message)) {
  117. ast_bridge_channel_queue_playfile(bridge_channel, NULL, stop_message, NULL);
  118. ast_bridge_channel_write_playfile(bridge_channel, NULL, stop_message, NULL);
  119. }
  120. }
  121. static void start_automonitor(struct ast_bridge_channel *bridge_channel, struct ast_channel *peer_chan, struct ast_features_general_config *features_cfg, const char *start_message)
  122. {
  123. char *touch_filename;
  124. size_t len;
  125. int x;
  126. enum set_touch_variables_res set_touch_res;
  127. RAII_VAR(char *, touch_format, NULL, ast_free);
  128. RAII_VAR(char *, touch_monitor, NULL, ast_free);
  129. RAII_VAR(char *, touch_monitor_prefix, NULL, ast_free);
  130. set_touch_res = set_touch_variables(bridge_channel->chan, 0, &touch_format,
  131. &touch_monitor, &touch_monitor_prefix);
  132. switch (set_touch_res) {
  133. case SET_TOUCH_SUCCESS:
  134. break;
  135. case SET_TOUCH_UNSET:
  136. set_touch_res = set_touch_variables(peer_chan, 0, &touch_format, &touch_monitor,
  137. &touch_monitor_prefix);
  138. if (set_touch_res == SET_TOUCH_ALLOC_FAILURE) {
  139. return;
  140. }
  141. break;
  142. case SET_TOUCH_ALLOC_FAILURE:
  143. return;
  144. }
  145. if (!ast_strlen_zero(touch_monitor)) {
  146. len = strlen(touch_monitor) + 50;
  147. touch_filename = ast_alloca(len);
  148. snprintf(touch_filename, len, "%s-%ld-%s",
  149. S_OR(touch_monitor_prefix, "auto"),
  150. (long) time(NULL),
  151. touch_monitor);
  152. } else {
  153. char *caller_chan_id;
  154. char *peer_chan_id;
  155. caller_chan_id = ast_strdupa(S_COR(ast_channel_caller(bridge_channel->chan)->id.number.valid,
  156. ast_channel_caller(bridge_channel->chan)->id.number.str, ast_channel_name(bridge_channel->chan)));
  157. peer_chan_id = ast_strdupa(S_COR(ast_channel_caller(peer_chan)->id.number.valid,
  158. ast_channel_caller(peer_chan)->id.number.str, ast_channel_name(peer_chan)));
  159. len = strlen(caller_chan_id) + strlen(peer_chan_id) + 50;
  160. touch_filename = ast_alloca(len);
  161. snprintf(touch_filename, len, "%s-%ld-%s-%s",
  162. S_OR(touch_monitor_prefix, "auto"),
  163. (long) time(NULL),
  164. caller_chan_id,
  165. peer_chan_id);
  166. }
  167. for (x = 0; x < strlen(touch_filename); x++) {
  168. if (touch_filename[x] == '/') {
  169. touch_filename[x] = '-';
  170. }
  171. }
  172. ast_verb(4, "AutoMonitor used to record call. Filename: %s\n", touch_filename);
  173. if (ast_monitor_start(peer_chan, touch_format, touch_filename, 1, X_REC_IN | X_REC_OUT, NULL)) {
  174. ast_verb(4, "AutoMonitor feature was tried by '%s' but monitor failed to start.\n",
  175. ast_channel_name(bridge_channel->chan));
  176. return;
  177. }
  178. if (features_cfg && !ast_strlen_zero(features_cfg->courtesytone)) {
  179. ast_bridge_channel_queue_playfile(bridge_channel, NULL, features_cfg->courtesytone, NULL);
  180. ast_bridge_channel_write_playfile(bridge_channel, NULL, features_cfg->courtesytone, NULL);
  181. }
  182. if (!ast_strlen_zero(start_message)) {
  183. ast_bridge_channel_queue_playfile(bridge_channel, NULL, start_message, NULL);
  184. ast_bridge_channel_write_playfile(bridge_channel, NULL, start_message, NULL);
  185. }
  186. pbx_builtin_setvar_helper(peer_chan, "TOUCH_MONITOR_OUTPUT", touch_filename);
  187. }
  188. static int feature_automonitor(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
  189. {
  190. const char *start_message;
  191. const char *stop_message;
  192. struct ast_bridge_features_automonitor *options = hook_pvt;
  193. enum ast_bridge_features_monitor start_stop = options ? options->start_stop : AUTO_MONITOR_TOGGLE;
  194. int is_monitoring;
  195. RAII_VAR(struct ast_channel *, peer_chan, NULL, ast_channel_cleanup);
  196. RAII_VAR(struct ast_features_general_config *, features_cfg, NULL, ao2_cleanup);
  197. ast_channel_lock(bridge_channel->chan);
  198. features_cfg = ast_get_chan_features_general_config(bridge_channel->chan);
  199. ast_channel_unlock(bridge_channel->chan);
  200. ast_bridge_channel_lock_bridge(bridge_channel);
  201. peer_chan = ast_bridge_peer_nolock(bridge_channel->bridge, bridge_channel->chan);
  202. ast_bridge_unlock(bridge_channel->bridge);
  203. if (!peer_chan) {
  204. ast_verb(4, "Cannot start AutoMonitor for %s - can not determine peer in bridge.\n",
  205. ast_channel_name(bridge_channel->chan));
  206. if (features_cfg && !ast_strlen_zero(features_cfg->recordingfailsound)) {
  207. ast_bridge_channel_queue_playfile(bridge_channel, NULL, features_cfg->recordingfailsound, NULL);
  208. }
  209. return 0;
  210. }
  211. ast_channel_lock(bridge_channel->chan);
  212. start_message = pbx_builtin_getvar_helper(bridge_channel->chan,
  213. "TOUCH_MONITOR_MESSAGE_START");
  214. start_message = ast_strdupa(S_OR(start_message, ""));
  215. stop_message = pbx_builtin_getvar_helper(bridge_channel->chan,
  216. "TOUCH_MONITOR_MESSAGE_STOP");
  217. stop_message = ast_strdupa(S_OR(stop_message, ""));
  218. ast_channel_unlock(bridge_channel->chan);
  219. is_monitoring = ast_channel_monitor(peer_chan) != NULL;
  220. switch (start_stop) {
  221. case AUTO_MONITOR_TOGGLE:
  222. if (is_monitoring) {
  223. stop_automonitor(bridge_channel, peer_chan, features_cfg, stop_message);
  224. } else {
  225. start_automonitor(bridge_channel, peer_chan, features_cfg, start_message);
  226. }
  227. return 0;
  228. case AUTO_MONITOR_START:
  229. if (!is_monitoring) {
  230. start_automonitor(bridge_channel, peer_chan, features_cfg, start_message);
  231. return 0;
  232. }
  233. ast_verb(4, "AutoMonitor already recording call.\n");
  234. break;
  235. case AUTO_MONITOR_STOP:
  236. if (is_monitoring) {
  237. stop_automonitor(bridge_channel, peer_chan, features_cfg, stop_message);
  238. return 0;
  239. }
  240. ast_verb(4, "AutoMonitor already stopped on call.\n");
  241. break;
  242. }
  243. /*
  244. * Fake start/stop to invoker so will think it did something but
  245. * was already in that mode.
  246. */
  247. if (features_cfg && !ast_strlen_zero(features_cfg->courtesytone)) {
  248. ast_bridge_channel_queue_playfile(bridge_channel, NULL, features_cfg->courtesytone, NULL);
  249. }
  250. if (is_monitoring) {
  251. if (!ast_strlen_zero(start_message)) {
  252. ast_bridge_channel_queue_playfile(bridge_channel, NULL, start_message, NULL);
  253. }
  254. } else {
  255. if (!ast_strlen_zero(stop_message)) {
  256. ast_bridge_channel_queue_playfile(bridge_channel, NULL, stop_message, NULL);
  257. }
  258. }
  259. return 0;
  260. }
  261. static void stop_automixmonitor(struct ast_bridge_channel *bridge_channel, struct ast_channel *peer_chan, struct ast_features_general_config *features_cfg, const char *stop_message)
  262. {
  263. ast_verb(4, "AutoMixMonitor used to stop recording call.\n");
  264. if (ast_stop_mixmonitor(peer_chan, NULL)) {
  265. ast_verb(4, "Failed to stop AutoMixMonitor for %s.\n", ast_channel_name(bridge_channel->chan));
  266. if (features_cfg && !(ast_strlen_zero(features_cfg->recordingfailsound))) {
  267. ast_bridge_channel_queue_playfile(bridge_channel, NULL, features_cfg->recordingfailsound, NULL);
  268. }
  269. return;
  270. }
  271. if (features_cfg && !ast_strlen_zero(features_cfg->courtesytone)) {
  272. ast_bridge_channel_queue_playfile(bridge_channel, NULL, features_cfg->courtesytone, NULL);
  273. ast_bridge_channel_write_playfile(bridge_channel, NULL, features_cfg->courtesytone, NULL);
  274. }
  275. if (!ast_strlen_zero(stop_message)) {
  276. ast_bridge_channel_queue_playfile(bridge_channel, NULL, stop_message, NULL);
  277. ast_bridge_channel_write_playfile(bridge_channel, NULL, stop_message, NULL);
  278. }
  279. }
  280. static void start_automixmonitor(struct ast_bridge_channel *bridge_channel, struct ast_channel *peer_chan, struct ast_features_general_config *features_cfg, const char *start_message)
  281. {
  282. char *touch_filename;
  283. size_t len;
  284. int x;
  285. enum set_touch_variables_res set_touch_res;
  286. RAII_VAR(char *, touch_format, NULL, ast_free);
  287. RAII_VAR(char *, touch_monitor, NULL, ast_free);
  288. RAII_VAR(char *, touch_monitor_prefix, NULL, ast_free);
  289. set_touch_res = set_touch_variables(bridge_channel->chan, 1, &touch_format,
  290. &touch_monitor, &touch_monitor_prefix);
  291. switch (set_touch_res) {
  292. case SET_TOUCH_SUCCESS:
  293. break;
  294. case SET_TOUCH_UNSET:
  295. set_touch_res = set_touch_variables(peer_chan, 1, &touch_format, &touch_monitor,
  296. &touch_monitor_prefix);
  297. if (set_touch_res == SET_TOUCH_ALLOC_FAILURE) {
  298. return;
  299. }
  300. break;
  301. case SET_TOUCH_ALLOC_FAILURE:
  302. return;
  303. }
  304. if (!ast_strlen_zero(touch_monitor)) {
  305. len = strlen(touch_monitor) + 50;
  306. touch_filename = ast_alloca(len);
  307. snprintf(touch_filename, len, "%s-%ld-%s.%s",
  308. S_OR(touch_monitor_prefix, "auto"),
  309. (long) time(NULL),
  310. touch_monitor,
  311. S_OR(touch_format, "wav"));
  312. } else {
  313. char *caller_chan_id;
  314. char *peer_chan_id;
  315. caller_chan_id = ast_strdupa(S_COR(ast_channel_caller(bridge_channel->chan)->id.number.valid,
  316. ast_channel_caller(bridge_channel->chan)->id.number.str, ast_channel_name(bridge_channel->chan)));
  317. peer_chan_id = ast_strdupa(S_COR(ast_channel_caller(peer_chan)->id.number.valid,
  318. ast_channel_caller(peer_chan)->id.number.str, ast_channel_name(peer_chan)));
  319. len = strlen(caller_chan_id) + strlen(peer_chan_id) + 50;
  320. touch_filename = ast_alloca(len);
  321. snprintf(touch_filename, len, "%s-%ld-%s-%s.%s",
  322. S_OR(touch_monitor_prefix, "auto"),
  323. (long) time(NULL),
  324. caller_chan_id,
  325. peer_chan_id,
  326. S_OR(touch_format, "wav"));
  327. }
  328. for (x = 0; x < strlen(touch_filename); x++) {
  329. if (touch_filename[x] == '/') {
  330. touch_filename[x] = '-';
  331. }
  332. }
  333. ast_verb(4, "AutoMixMonitor used to record call. Filename: %s\n", touch_filename);
  334. if (ast_start_mixmonitor(peer_chan, touch_filename, "b")) {
  335. ast_verb(4, "AutoMixMonitor feature was tried by '%s' but MixMonitor failed to start.\n",
  336. ast_channel_name(bridge_channel->chan));
  337. if (features_cfg && !ast_strlen_zero(features_cfg->recordingfailsound)) {
  338. ast_bridge_channel_queue_playfile(bridge_channel, NULL, features_cfg->recordingfailsound, NULL);
  339. }
  340. return;
  341. }
  342. if (features_cfg && !ast_strlen_zero(features_cfg->courtesytone)) {
  343. ast_bridge_channel_queue_playfile(bridge_channel, NULL, features_cfg->courtesytone, NULL);
  344. ast_bridge_channel_write_playfile(bridge_channel, NULL, features_cfg->courtesytone, NULL);
  345. }
  346. if (!ast_strlen_zero(start_message)) {
  347. ast_bridge_channel_queue_playfile(bridge_channel, NULL, start_message, NULL);
  348. ast_bridge_channel_write_playfile(bridge_channel, NULL, start_message, NULL);
  349. }
  350. pbx_builtin_setvar_helper(peer_chan, "TOUCH_MIXMONITOR_OUTPUT", touch_filename);
  351. }
  352. static int feature_automixmonitor(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
  353. {
  354. static const char *mixmonitor_spy_type = "MixMonitor";
  355. const char *stop_message;
  356. const char *start_message;
  357. struct ast_bridge_features_automixmonitor *options = hook_pvt;
  358. enum ast_bridge_features_monitor start_stop = options ? options->start_stop : AUTO_MONITOR_TOGGLE;
  359. int is_monitoring;
  360. RAII_VAR(struct ast_channel *, peer_chan, NULL, ast_channel_cleanup);
  361. RAII_VAR(struct ast_features_general_config *, features_cfg, NULL, ao2_cleanup);
  362. ast_channel_lock(bridge_channel->chan);
  363. features_cfg = ast_get_chan_features_general_config(bridge_channel->chan);
  364. ast_channel_unlock(bridge_channel->chan);
  365. ast_bridge_channel_lock_bridge(bridge_channel);
  366. peer_chan = ast_bridge_peer_nolock(bridge_channel->bridge, bridge_channel->chan);
  367. ast_bridge_unlock(bridge_channel->bridge);
  368. if (!peer_chan) {
  369. ast_verb(4, "Cannot start AutoMixMonitor for %s - cannot determine peer in bridge.\n",
  370. ast_channel_name(bridge_channel->chan));
  371. if (features_cfg && !ast_strlen_zero(features_cfg->recordingfailsound)) {
  372. ast_bridge_channel_queue_playfile(bridge_channel, NULL, features_cfg->recordingfailsound, NULL);
  373. }
  374. return 0;
  375. }
  376. ast_channel_lock(bridge_channel->chan);
  377. start_message = pbx_builtin_getvar_helper(bridge_channel->chan,
  378. "TOUCH_MIXMONITOR_MESSAGE_START");
  379. start_message = ast_strdupa(S_OR(start_message, ""));
  380. stop_message = pbx_builtin_getvar_helper(bridge_channel->chan,
  381. "TOUCH_MIXMONITOR_MESSAGE_STOP");
  382. stop_message = ast_strdupa(S_OR(stop_message, ""));
  383. ast_channel_unlock(bridge_channel->chan);
  384. is_monitoring =
  385. 0 < ast_channel_audiohook_count_by_source(peer_chan, mixmonitor_spy_type, AST_AUDIOHOOK_TYPE_SPY);
  386. switch (start_stop) {
  387. case AUTO_MONITOR_TOGGLE:
  388. if (is_monitoring) {
  389. stop_automixmonitor(bridge_channel, peer_chan, features_cfg, stop_message);
  390. } else {
  391. start_automixmonitor(bridge_channel, peer_chan, features_cfg, start_message);
  392. }
  393. return 0;
  394. case AUTO_MONITOR_START:
  395. if (!is_monitoring) {
  396. start_automixmonitor(bridge_channel, peer_chan, features_cfg, start_message);
  397. return 0;
  398. }
  399. ast_verb(4, "AutoMixMonitor already recording call.\n");
  400. break;
  401. case AUTO_MONITOR_STOP:
  402. if (is_monitoring) {
  403. stop_automixmonitor(bridge_channel, peer_chan, features_cfg, stop_message);
  404. return 0;
  405. }
  406. ast_verb(4, "AutoMixMonitor already stopped on call.\n");
  407. break;
  408. }
  409. /*
  410. * Fake start/stop to invoker so will think it did something but
  411. * was already in that mode.
  412. */
  413. if (features_cfg && !ast_strlen_zero(features_cfg->courtesytone)) {
  414. ast_bridge_channel_queue_playfile(bridge_channel, NULL, features_cfg->courtesytone, NULL);
  415. }
  416. if (is_monitoring) {
  417. if (!ast_strlen_zero(start_message)) {
  418. ast_bridge_channel_queue_playfile(bridge_channel, NULL, start_message, NULL);
  419. }
  420. } else {
  421. if (!ast_strlen_zero(stop_message)) {
  422. ast_bridge_channel_queue_playfile(bridge_channel, NULL, stop_message, NULL);
  423. }
  424. }
  425. return 0;
  426. }
  427. /*! \brief Internal built in feature for hangup */
  428. static int feature_hangup(struct ast_bridge_channel *bridge_channel, void *hook_pvt)
  429. {
  430. /*
  431. * This is very simple, we simply change the state on the
  432. * bridge_channel to force the channel out of the bridge and the
  433. * core takes care of the rest.
  434. */
  435. ast_bridge_channel_leave_bridge(bridge_channel, BRIDGE_CHANNEL_STATE_END,
  436. AST_CAUSE_NORMAL_CLEARING);
  437. return 0;
  438. }
  439. static int unload_module(void)
  440. {
  441. ast_bridge_features_unregister(AST_BRIDGE_BUILTIN_HANGUP);
  442. ast_bridge_features_unregister(AST_BRIDGE_BUILTIN_AUTOMON);
  443. ast_bridge_features_unregister(AST_BRIDGE_BUILTIN_AUTOMIXMON);
  444. return 0;
  445. }
  446. static int load_module(void)
  447. {
  448. ast_bridge_features_register(AST_BRIDGE_BUILTIN_HANGUP, feature_hangup, NULL);
  449. ast_bridge_features_register(AST_BRIDGE_BUILTIN_AUTOMON, feature_automonitor, NULL);
  450. ast_bridge_features_register(AST_BRIDGE_BUILTIN_AUTOMIXMON, feature_automixmonitor, NULL);
  451. /* This module cannot be unloaded until shutdown */
  452. ast_module_shutdown_ref(ast_module_info->self);
  453. return AST_MODULE_LOAD_SUCCESS;
  454. }
  455. AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Built in bridging features");