asterisk/res/stasis/messaging.h
Matthew Jordan 085d5a2629 Clean up files that do not end with newlines
Trivial patch to add new lines to several files missing them. This fixes
warnings when compiling with gcc 4.1.2 on CentOS 5.

ASTERISK-24245 #close
Reported by: Shaun Ruffell
patches:
  0002-Trivial-addition-of-newlines-at-end-of-three-files.patch uploaded by Shaun Ruffell (License 5417)
........

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

Merged revisions 421678 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@421679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-21 14:52:28 +00:00

84 lines
2.4 KiB
C

/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 2014, Digium, Inc.
*
* Matt Jordan <mjordan@digium.com>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
#ifndef _ASTERISK_RES_STASIS_MESSAGING_H
#define _ASTERISK_RES_STASIS_MESSAGING_H
/*!
* \file
*
* \brief Stasis out-of-call text message support
*
* \author Matt Jordan <mjordan@digium.com>
* \since 12.4.0
*/
/*!
* \brief Callback handler for when a message is received from the core
*
* \param endpoint_id The ID of the endpoint that we received the message from
* \param json_msg JSON representation of the text message
* \param pvt ao2 ref counted pvt passed during registration
*
* \retval 0 the message was handled
* \retval non-zero the message was not handled
*/
typedef int (* message_received_cb)(const char *endpoint_id, struct ast_json *json_msg, void *pvt);
/*!
* \brief Subscribe for messages from a particular endpoint
*
* \param app_name Name of the stasis application to unsubscribe from messaging
* \param endpoint_id The ID of the endpoint we no longer care about
*
* \retval 0 success
* \retval -1 error
*/
void messaging_app_unsubscribe_endpoint(const char *app_name, const char *endpoint_id);
/*!
* \brief Subscribe an application to an endpoint for messages
*
* \param app_name The name of the \ref stasis application to subscribe to \c endpoint
* \param endpoint The endpoint object to subscribe to
* \param message_received_cb The callback to call when a message is received
* \param pvt An ao2 ref counted object that will be passed to the callback.
*
* \retval 0 subscription was successful
* \retval -1 subscription failed
*/
int messaging_app_subscribe_endpoint(const char *app_name, struct ast_endpoint *endpoint, message_received_cb callback, void *pvt);
/*!
* \brief Tidy up the messaging layer
*
* \retval 0 success
* \retval -1 failure
*/
int messaging_cleanup(void);
/*!
* \brief Initialize the messaging layer
*
* \retval 0 success
* \retval -1 failure
*/
int messaging_init(void);
#endif /* #define _ASTERISK_RES_STASIS_MESSAGING_H */