Sat Apr 26 2014 22:01:42

Asterisk developer's documentation


sip_api.h
Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 2012, Digium, Inc.
00005  *
00006  * Mark Michelson <mmichelson@digium.com>
00007  *
00008  * See http://www.asterisk.org for more information about
00009  * the Asterisk project. Please do not directly contact
00010  * any of the maintainers of this project for assistance;
00011  * the project provides a web site, mailing lists and IRC
00012  * channels for your use.
00013  *
00014  * This program is free software, distributed under the terms of
00015  * the GNU General Public License Version 2. See the LICENSE file
00016  * at the top of the source tree.
00017  */
00018 
00019 #ifndef __ASTERISK_SIP_H
00020 #define __ASTERISK_SIP_H
00021 
00022 #if defined(__cplusplus) || defined(c_plusplus)
00023 extern "C" {
00024 #endif
00025 
00026 #include "asterisk/optional_api.h"
00027 #include "asterisk/config.h"
00028 
00029 #define AST_SIP_API_VERSION 1
00030 
00031 struct ast_sip_api_tech {
00032    const int version;
00033    const char *name;
00034    int (*sipinfo_send)(struct ast_channel *chan,
00035          struct ast_variable *headers, const char *content_type,
00036          const char *content, const char *useragent_filter);
00037 };
00038 
00039 /*!
00040  * \brief Send a customized SIP INFO request
00041  *
00042  * \param headers The headers to add to the INFO request
00043  * \param content_type The content type header to add
00044  * \param conten The body of the INFO request
00045  * \param useragent_filter If non-NULL, only send the INFO if the
00046  * recipient's User-Agent contains useragent_filter as a substring
00047  *
00048  * \retval 0 Success
00049  * \retval non-zero Failure
00050  */
00051 int ast_sipinfo_send(struct ast_channel *chan,
00052       struct ast_variable *headers,
00053       const char *content_type,
00054       const char *content,
00055       const char *useragent_filter);
00056 
00057 /*!
00058  * \brief Register a SIP API provider
00059  *
00060  * This will fail if a provider has already registered or if the
00061  * provider is using an incorrect version.
00062  *
00063  * \param provider The provider to register
00064  * \retval 0 Success
00065  * \retval -1 Failure
00066  */
00067 int ast_sip_api_provider_register(const struct ast_sip_api_tech *provider);
00068 
00069 /*!
00070  * \brief Unregister a SIP API provider
00071  */
00072 void ast_sip_api_provider_unregister(void);
00073 
00074 #if defined(__cplusplus) || defined(c_plusplus)
00075 }
00076 #endif
00077 
00078 #endif /* __ASTERISK_SIP_H */