manager.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 1999 - 2005, Digium, Inc.
  5. *
  6. * Mark Spencer <markster@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. #ifndef _ASTERISK_MANAGER_H
  19. #define _ASTERISK_MANAGER_H
  20. #include "asterisk/network.h"
  21. #include "asterisk/lock.h"
  22. #include "asterisk/datastore.h"
  23. #include "asterisk/xmldoc.h"
  24. /*!
  25. \file
  26. \brief The AMI - Asterisk Manager Interface - is a TCP protocol created to
  27. manage Asterisk with third-party software.
  28. Manager protocol packages are text fields of the form a: b. There is
  29. always exactly one space after the colon.
  30. \verbatim
  31. For Actions replies, the first line of the reply is a "Response:" header with
  32. values "success", "error" or "follows". "Follows" implies that the
  33. response is coming as separate events with the same ActionID. If the
  34. Action request has no ActionID, it will be hard matching events
  35. to the Action request in the manager client.
  36. The first header type is the "Event" header. Other headers vary from
  37. event to event. Headers end with standard \\r\\n termination.
  38. The last line of the manager response or event is an empty line.
  39. (\\r\\n)
  40. \endverbatim
  41. \note Please try to \b re-use \b existing \b headers to simplify manager message parsing in clients.
  42. Don't re-use an existing header with a new meaning, please.
  43. You can find a reference of standard headers in doc/manager.txt
  44. - \ref manager.c Main manager code file
  45. */
  46. #define AMI_VERSION "2.10.4"
  47. #define DEFAULT_MANAGER_PORT 5038 /* Default port for Asterisk management via TCP */
  48. #define DEFAULT_MANAGER_TLS_PORT 5039 /* Default port for Asterisk management via TCP */
  49. /*! \name Constant return values
  50. *\note Currently, returning anything other than zero causes the session to terminate.
  51. */
  52. /*@{ */
  53. #define AMI_SUCCESS (0)
  54. #define AMI_DESTROY (-1)
  55. /*@} */
  56. /*! \name Manager event classes */
  57. /*@{ */
  58. #define EVENT_FLAG_SYSTEM (1 << 0) /* System events such as module load/unload */
  59. #define EVENT_FLAG_CALL (1 << 1) /* Call event, such as state change, etc */
  60. #define EVENT_FLAG_LOG (1 << 2) /* Log events */
  61. #define EVENT_FLAG_VERBOSE (1 << 3) /* Verbose messages */
  62. #define EVENT_FLAG_COMMAND (1 << 4) /* Ability to read/set commands */
  63. #define EVENT_FLAG_AGENT (1 << 5) /* Ability to read/set agent info */
  64. #define EVENT_FLAG_USER (1 << 6) /* Ability to read/set user info */
  65. #define EVENT_FLAG_CONFIG (1 << 7) /* Ability to modify configurations */
  66. #define EVENT_FLAG_DTMF (1 << 8) /* Ability to read DTMF events */
  67. #define EVENT_FLAG_REPORTING (1 << 9) /* Reporting events such as rtcp sent */
  68. #define EVENT_FLAG_CDR (1 << 10) /* CDR events */
  69. #define EVENT_FLAG_DIALPLAN (1 << 11) /* Dialplan events (VarSet, NewExten) */
  70. #define EVENT_FLAG_ORIGINATE (1 << 12) /* Originate a call to an extension */
  71. #define EVENT_FLAG_AGI (1 << 13) /* AGI events */
  72. #define EVENT_FLAG_HOOKRESPONSE (1 << 14) /* Hook Response */
  73. #define EVENT_FLAG_CC (1 << 15) /* Call Completion events */
  74. #define EVENT_FLAG_AOC (1 << 16) /* Advice Of Charge events */
  75. #define EVENT_FLAG_TEST (1 << 17) /* Test event used to signal the Asterisk Test Suite */
  76. #define EVENT_FLAG_SECURITY (1 << 18) /* Security Message as AMI Event */
  77. /*XXX Why shifted by 30? XXX */
  78. #define EVENT_FLAG_MESSAGE (1 << 30) /* MESSAGE events. */
  79. /*@} */
  80. /*! \brief Export manager structures */
  81. #define AST_MAX_MANHEADERS 128
  82. /*! \brief Manager Helper Function
  83. *
  84. * \param category The class authorization category of the event
  85. * \param event The name of the event being raised
  86. * \param body The body of the event
  87. *
  88. * \retval 0 Success
  89. * \retval non-zero Error
  90. */
  91. typedef int (*manager_hook_t)(int category, const char *event, char *body);
  92. struct manager_custom_hook {
  93. /*! Identifier */
  94. char *file;
  95. /*! helper function */
  96. manager_hook_t helper;
  97. /*! Linked list information */
  98. AST_RWLIST_ENTRY(manager_custom_hook) list;
  99. };
  100. /*! \brief Check if AMI is enabled */
  101. int check_manager_enabled(void);
  102. /*! \brief Check if AMI/HTTP is enabled */
  103. int check_webmanager_enabled(void);
  104. /*! Add a custom hook to be called when an event is fired
  105. \param hook struct manager_custom_hook object to add
  106. */
  107. void ast_manager_register_hook(struct manager_custom_hook *hook);
  108. /*! Delete a custom hook to be called when an event is fired
  109. \param hook struct manager_custom_hook object to delete
  110. */
  111. void ast_manager_unregister_hook(struct manager_custom_hook *hook);
  112. /*! \brief Registered hooks can call this function to invoke actions and they will receive responses through registered callback
  113. * \param hook the file identifier specified in manager_custom_hook struct when registering a hook
  114. * \param msg ami action mesage string e.g. "Action: SipPeers\r\n"
  115. * \retval 0 on Success
  116. * \retval non-zero on Failure
  117. */
  118. int ast_hook_send_action(struct manager_custom_hook *hook, const char *msg);
  119. struct mansession;
  120. struct message {
  121. unsigned int hdrcount;
  122. const char *headers[AST_MAX_MANHEADERS];
  123. };
  124. struct manager_action {
  125. /*! Name of the action */
  126. const char *action;
  127. AST_DECLARE_STRING_FIELDS(
  128. AST_STRING_FIELD(synopsis); /*!< Synopsis text (short description). */
  129. AST_STRING_FIELD(description); /*!< Description (help text) */
  130. AST_STRING_FIELD(syntax); /*!< Syntax text */
  131. AST_STRING_FIELD(arguments); /*!< Description of each argument. */
  132. AST_STRING_FIELD(seealso); /*!< See also */
  133. );
  134. /*! Possible list element response events. */
  135. struct ast_xml_doc_item *list_responses;
  136. /*! Final response event. */
  137. struct ast_xml_doc_item *final_response;
  138. /*! Permission required for action. EVENT_FLAG_* */
  139. int authority;
  140. /*! Function to be called */
  141. int (*func)(struct mansession *s, const struct message *m);
  142. struct ast_module *module; /*!< Module this action belongs to */
  143. /*! Where the documentation come from. */
  144. enum ast_doc_src docsrc;
  145. /*! For easy linking */
  146. AST_RWLIST_ENTRY(manager_action) list;
  147. /*!
  148. * \brief TRUE if the AMI action is registered and the callback can be called.
  149. *
  150. * \note Needed to prevent a race between calling the callback
  151. * function and unregestring the AMI action object.
  152. */
  153. unsigned int registered:1;
  154. };
  155. /*! \brief External routines may register/unregister manager callbacks this way
  156. * \note Use ast_manager_register2() to register with help text for new manager commands */
  157. #define ast_manager_register(action, authority, func, synopsis) ast_manager_register2(action, authority, func, ast_module_info->self, synopsis, NULL)
  158. /*! \brief Register a manager callback using XML documentation to describe the manager. */
  159. #define ast_manager_register_xml(action, authority, func) ast_manager_register2(action, authority, func, ast_module_info->self, NULL, NULL)
  160. /*!
  161. * \brief Register a manager callback using XML documentation to describe the manager.
  162. *
  163. * \note For Asterisk core modules that are not independently
  164. * loadable.
  165. *
  166. * \warning If you use ast_manager_register_xml() instead when
  167. * you need to use this function, Asterisk will crash on load.
  168. */
  169. #define ast_manager_register_xml_core(action, authority, func) ast_manager_register2(action, authority, func, NULL, NULL, NULL)
  170. /*!
  171. * \brief Register a manager command with the manager interface
  172. * \param action Name of the requested Action:
  173. * \param authority Required authority for this command
  174. * \param func Function to call for this command
  175. * \param module The module containing func. (NULL if module is part of core and not loadable)
  176. * \param synopsis Help text (one line, up to 30 chars) for CLI manager show commands
  177. * \param description Help text, several lines
  178. */
  179. int ast_manager_register2(
  180. const char *action,
  181. int authority,
  182. int (*func)(struct mansession *s, const struct message *m),
  183. struct ast_module *module,
  184. const char *synopsis,
  185. const char *description);
  186. /*!
  187. * \brief Unregister a registered manager command
  188. * \param action Name of registered Action:
  189. */
  190. int ast_manager_unregister(const char *action);
  191. /*!
  192. * \brief Verify a session's read permissions against a permission mask.
  193. * \param ident session identity
  194. * \param perm permission mask to verify
  195. * \retval 1 if the session has the permission mask capabilities
  196. * \retval 0 otherwise
  197. */
  198. int astman_verify_session_readpermissions(uint32_t ident, int perm);
  199. /*!
  200. * \brief Verify a session's write permissions against a permission mask.
  201. * \param ident session identity
  202. * \param perm permission mask to verify
  203. * \retval 1 if the session has the permission mask capabilities, otherwise 0
  204. * \retval 0 otherwise
  205. */
  206. int astman_verify_session_writepermissions(uint32_t ident, int perm);
  207. /*! \brief External routines may send asterisk manager events this way
  208. * \param category Event category, matches manager authorization
  209. \param event Event name
  210. \param contents Contents of event
  211. */
  212. /* XXX the parser in gcc 2.95 gets confused if you don't put a space
  213. * between the last arg before VA_ARGS and the comma */
  214. #define manager_event(category, event, contents , ...) \
  215. __ast_manager_event_multichan(category, event, 0, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, contents , ## __VA_ARGS__)
  216. #define ast_manager_event(chan, category, event, contents , ...) \
  217. do { \
  218. struct ast_channel *_chans[] = { chan, }; \
  219. __ast_manager_event_multichan(category, event, 1, _chans, __FILE__, __LINE__, __PRETTY_FUNCTION__, contents , ## __VA_ARGS__); \
  220. } while (0)
  221. #define ast_manager_event_multichan(category, event, nchans, chans, contents , ...) \
  222. __ast_manager_event_multichan(category, event, nchans, chans, __FILE__, __LINE__, __PRETTY_FUNCTION__, contents , ## __VA_ARGS__);
  223. /*! External routines may send asterisk manager events this way
  224. * \param category Event category, matches manager authorization
  225. * \param event Event name
  226. * \param chancount Number of channels in chans parameter
  227. * \param chans A pointer to an array of channels involved in the event
  228. * \param file, line, func
  229. * \param contents Format string describing event
  230. * \param ...
  231. * \since 1.8
  232. */
  233. int __ast_manager_event_multichan(int category, const char *event, int chancount,
  234. struct ast_channel **chans, const char *file, int line, const char *func,
  235. const char *contents, ...) __attribute__((format(printf, 8, 9)));
  236. /*! \brief Get header from mananger transaction */
  237. const char *astman_get_header(const struct message *m, char *var);
  238. /*! \brief Get a linked list of the Variable: headers
  239. *
  240. * \note Order of variables is reversed from the order they are specified in
  241. * the manager message
  242. */
  243. struct ast_variable *astman_get_variables(const struct message *m);
  244. enum variable_orders {
  245. ORDER_NATURAL,
  246. ORDER_REVERSE
  247. };
  248. /*! \brief Get a linked list of the Variable: headers with order specified */
  249. struct ast_variable *astman_get_variables_order(const struct message *m, enum variable_orders order);
  250. /*! \brief Send error in manager transaction */
  251. void astman_send_error(struct mansession *s, const struct message *m, char *error);
  252. /*! \brief Send error in manager transaction (with va_args support) */
  253. void __attribute__((format(printf, 3, 4))) astman_send_error_va(struct mansession *s, const struct message *m, const char *fmt, ...);
  254. /*! \brief Send response in manager transaction */
  255. void astman_send_response(struct mansession *s, const struct message *m, char *resp, char *msg);
  256. /*! \brief Send ack in manager transaction */
  257. void astman_send_ack(struct mansession *s, const struct message *m, char *msg);
  258. /*!
  259. * \brief Send ack in manager transaction to begin a list.
  260. *
  261. * \param s - AMI session control struct.
  262. * \param m - AMI action request that started the list.
  263. * \param msg - Message contents describing the list to follow.
  264. * \param listflag - Should always be set to "start".
  265. *
  266. * \note You need to call astman_send_list_complete_start() and
  267. * astman_send_list_complete_end() to send the AMI list completion event.
  268. *
  269. * \return Nothing
  270. */
  271. void astman_send_listack(struct mansession *s, const struct message *m, char *msg, char *listflag);
  272. /*!
  273. * \brief Start the list complete event.
  274. * \since 13.2.0
  275. *
  276. * \param s - AMI session control struct.
  277. * \param m - AMI action request that started the list.
  278. * \param event_name - AMI list complete event name.
  279. * \param count - Number of items in the list.
  280. *
  281. * \note You need to call astman_send_list_complete_end() to end
  282. * the AMI list completion event.
  283. *
  284. * \note Between calling astman_send_list_complete_start() and
  285. * astman_send_list_complete_end() you can add additonal headers
  286. * using astman_append().
  287. *
  288. * \return Nothing
  289. */
  290. void astman_send_list_complete_start(struct mansession *s, const struct message *m, const char *event_name, int count);
  291. /*!
  292. * \brief End the list complete event.
  293. * \since 13.2.0
  294. *
  295. * \param s - AMI session control struct.
  296. *
  297. * \note You need to call astman_send_list_complete_start() to start
  298. * the AMI list completion event.
  299. *
  300. * \note Between calling astman_send_list_complete_start() and
  301. * astman_send_list_complete_end() you can add additonal headers
  302. * using astman_append().
  303. *
  304. * \return Nothing
  305. */
  306. void astman_send_list_complete_end(struct mansession *s);
  307. void __attribute__((format(printf, 2, 3))) astman_append(struct mansession *s, const char *fmt, ...);
  308. /*! \brief Determinie if a manager session ident is authenticated */
  309. int astman_is_authed(uint32_t ident);
  310. /*! \brief Called by Asterisk initialization */
  311. int init_manager(void);
  312. /*! \brief Called by Asterisk module functions and the CLI command */
  313. int reload_manager(void);
  314. /*!
  315. * \brief Add a datastore to a session
  316. *
  317. * \retval 0 success
  318. * \retval non-zero failure
  319. * \since 1.6.1
  320. */
  321. int astman_datastore_add(struct mansession *s, struct ast_datastore *datastore);
  322. /*!
  323. * \brief Remove a datastore from a session
  324. *
  325. * \retval 0 success
  326. * \retval non-zero failure
  327. * \since 1.6.1
  328. */
  329. int astman_datastore_remove(struct mansession *s, struct ast_datastore *datastore);
  330. /*!
  331. * \brief Find a datastore on a session
  332. *
  333. * \retval pointer to the datastore if found
  334. * \retval NULL if not found
  335. * \since 1.6.1
  336. */
  337. struct ast_datastore *astman_datastore_find(struct mansession *s, const struct ast_datastore_info *info, const char *uid);
  338. /*!
  339. * \brief append an event header to an ast string
  340. * \since 12
  341. *
  342. * \param fields_string pointer to an ast_string pointer. It may be a pointer to a
  343. * NULL ast_str pointer, in which case the ast_str will be initialized.
  344. * \param header The header being applied
  345. * \param value the value of the header
  346. *
  347. * \retval 0 if successful
  348. * \retval non-zero on failure
  349. */
  350. int ast_str_append_event_header(struct ast_str **fields_string,
  351. const char *header, const char *value);
  352. /*! \brief Struct representing a snapshot of channel state */
  353. struct ast_channel_snapshot;
  354. /*!
  355. * \brief Generate the AMI message body from a channel snapshot
  356. * \since 12
  357. *
  358. * \param snapshot the channel snapshot for which to generate an AMI message
  359. * body
  360. * \param prefix What to prepend to the channel fields
  361. *
  362. * \retval NULL on error
  363. * \retval ast_str* on success (must be ast_freed by caller)
  364. */
  365. struct ast_str *ast_manager_build_channel_state_string_prefix(
  366. const struct ast_channel_snapshot *snapshot,
  367. const char *prefix);
  368. /*!
  369. * \brief Generate the AMI message body from a channel snapshot
  370. * \since 12
  371. *
  372. * \param snapshot the channel snapshot for which to generate an AMI message
  373. * body
  374. *
  375. * \retval NULL on error
  376. * \retval ast_str* on success (must be ast_freed by caller)
  377. */
  378. struct ast_str *ast_manager_build_channel_state_string(
  379. const struct ast_channel_snapshot *snapshot);
  380. /*! \brief Struct representing a snapshot of bridge state */
  381. struct ast_bridge_snapshot;
  382. /*!
  383. * \since 12
  384. * \brief Callback used to determine whether a key should be skipped when converting a
  385. * JSON object to a manager blob
  386. * \param key Key from JSON blob to be evaluated
  387. * \retval non-zero if the key should be excluded
  388. * \retval zero if the key should not be excluded
  389. */
  390. typedef int (*key_exclusion_cb)(const char *key);
  391. struct ast_json;
  392. /*!
  393. * \since 12
  394. * \brief Convert a JSON object into an AMI compatible string
  395. *
  396. * \param blob The JSON blob containing key/value pairs to convert
  397. * \param exclusion_cb A \ref key_exclusion_cb pointer to a function that will exclude
  398. * keys from the final AMI string
  399. *
  400. * \retval A malloc'd \ref ast_str object. Callers of this function should free
  401. * the returned \ref ast_str object
  402. * \retval NULL on error
  403. */
  404. struct ast_str *ast_manager_str_from_json_object(struct ast_json *blob, key_exclusion_cb exclusion_cb);
  405. /*!
  406. * \brief Generate the AMI message body from a bridge snapshot
  407. * \since 12
  408. *
  409. * \param snapshot the bridge snapshot for which to generate an AMI message
  410. * body
  411. * \param prefix What to prepend to the bridge fields
  412. *
  413. * \retval NULL on error
  414. * \retval ast_str* on success (must be ast_freed by caller)
  415. */
  416. struct ast_str *ast_manager_build_bridge_state_string_prefix(
  417. const struct ast_bridge_snapshot *snapshot,
  418. const char *prefix);
  419. /*!
  420. * \brief Generate the AMI message body from a bridge snapshot
  421. * \since 12
  422. *
  423. * \param snapshot the bridge snapshot for which to generate an AMI message
  424. * body
  425. *
  426. * \retval NULL on error
  427. * \retval ast_str* on success (must be ast_freed by caller)
  428. */
  429. struct ast_str *ast_manager_build_bridge_state_string(
  430. const struct ast_bridge_snapshot *snapshot);
  431. /*! \brief Struct containing info for an AMI event to send out. */
  432. struct ast_manager_event_blob {
  433. int event_flags; /*!< Flags the event should be raised with. */
  434. const char *manager_event; /*!< The event to be raised, should be a string literal. */
  435. AST_DECLARE_STRING_FIELDS(
  436. AST_STRING_FIELD(extra_fields); /*!< Extra fields to include in the event. */
  437. );
  438. };
  439. /*!
  440. * \since 12
  441. * \brief Construct a \ref ast_manager_event_blob.
  442. *
  443. * The returned object is AO2 managed, so clean up with ao2_cleanup().
  444. *
  445. * \param event_flags Flags the event should be raised with.
  446. * \param manager_event The event to be raised, should be a string literal.
  447. * \param extra_fields_fmt Format string for extra fields to include.
  448. * Or NO_EXTRA_FIELDS for no extra fields.
  449. *
  450. * \return New \ref ast_manager_snapshot_event object.
  451. * \return \c NULL on error.
  452. */
  453. struct ast_manager_event_blob *
  454. __attribute__((format(printf, 3, 4)))
  455. ast_manager_event_blob_create(
  456. int event_flags,
  457. const char *manager_event,
  458. const char *extra_fields_fmt,
  459. ...);
  460. /*! GCC warns about blank or NULL format strings. So, shenanigans! */
  461. #define NO_EXTRA_FIELDS "%s", ""
  462. /*!
  463. * \since 12
  464. * \brief Initialize support for AMI system events.
  465. * \retval 0 on success
  466. * \retval non-zero on error
  467. */
  468. int manager_system_init(void);
  469. /*!
  470. * \brief Initialize support for AMI channel events.
  471. * \retval 0 on success.
  472. * \retval non-zero on error.
  473. * \since 12
  474. */
  475. int manager_channels_init(void);
  476. /*!
  477. * \since 12
  478. * \brief Initialize support for AMI MWI events.
  479. * \retval 0 on success
  480. * \retval non-zero on error
  481. */
  482. int manager_mwi_init(void);
  483. /*!
  484. * \brief Initialize support for AMI channel events.
  485. * \return 0 on success.
  486. * \return non-zero on error.
  487. * \since 12
  488. */
  489. int manager_bridging_init(void);
  490. /*!
  491. * \brief Initialize support for AMI endpoint events.
  492. * \return 0 on success.
  493. * \return non-zero on error.
  494. * \since 12
  495. */
  496. int manager_endpoints_init(void);
  497. /*!
  498. * \since 12
  499. * \brief Get the \ref stasis_message_type for generic messages
  500. *
  501. * A generic AMI message expects a JSON only payload. The payload must have the following
  502. * structure:
  503. * {type: s, class_type: i, event: [ {s: s}, ...] }
  504. *
  505. * - type is the AMI event type
  506. * - class_type is the class authorization type for the event
  507. * - event is a list of key/value tuples to be sent out in the message
  508. *
  509. * \retval A \ref stasis_message_type for AMI messages
  510. */
  511. struct stasis_message_type *ast_manager_get_generic_type(void);
  512. /*!
  513. * \since 12
  514. * \brief Get the \ref stasis topic for AMI
  515. *
  516. * \retval The \ref stasis topic for AMI
  517. * \retval NULL on error
  518. */
  519. struct stasis_topic *ast_manager_get_topic(void);
  520. /*!
  521. * \since 12
  522. * \brief Publish an event to AMI
  523. *
  524. * \param type The type of AMI event to publish
  525. * \param class_type The class on which to publish the event
  526. * \param obj The event data to be published.
  527. *
  528. * Publishes a message to the \ref stasis message bus solely for the consumption of AMI.
  529. * The message will be of the type provided by \ref ast_manager_get_type, and will be
  530. * published to the topic provided by \ref ast_manager_get_topic. As such, the JSON must
  531. * be constructed as defined by the \ref ast_manager_get_type message.
  532. */
  533. void ast_manager_publish_event(const char *type, int class_type, struct ast_json *obj);
  534. /*!
  535. * \since 12
  536. * \brief Get the \ref stasis_message_router for AMI
  537. *
  538. * \retval The \ref stasis_message_router for AMI
  539. * \retval NULL on error
  540. */
  541. struct stasis_message_router *ast_manager_get_message_router(void);
  542. #endif /* _ASTERISK_MANAGER_H */