Asterisk - The Open Source Telephony Project  18.5.0
sip_api.h
Go to the documentation of this file.
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 2012, Digium, Inc.
5  *
6  * Mark Michelson <[email protected]>
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 
19 #ifndef __ASTERISK_SIP_H
20 #define __ASTERISK_SIP_H
21 
22 #if defined(__cplusplus) || defined(c_plusplus)
23 extern "C" {
24 #endif
25 
26 #include "asterisk/config.h"
27 
28 #define AST_SIP_API_VERSION 1
29 
31  const int version;
32  const char *name;
33  int (*sipinfo_send)(struct ast_channel *chan,
34  struct ast_variable *headers, const char *content_type,
35  const char *content, const char *useragent_filter);
36 };
37 
38 /*!
39  * \brief Send a customized SIP INFO request
40  *
41  * \param chan Channel
42  * \param headers The headers to add to the INFO request
43  * \param content_type The content type header to add
44  * \param content The body of the INFO request
45  * \param useragent_filter If non-NULL, only send the INFO if the
46  * recipient's User-Agent contains useragent_filter as a substring
47  *
48  * \retval 0 Success
49  * \retval non-zero Failure
50  */
51 int ast_sipinfo_send(struct ast_channel *chan,
52  struct ast_variable *headers,
53  const char *content_type,
54  const char *content,
55  const char *useragent_filter);
56 
57 /*!
58  * \brief Register a SIP API provider
59  *
60  * This will fail if a provider has already registered or if the
61  * provider is using an incorrect version.
62  *
63  * \param provider The provider to register
64  * \retval 0 Success
65  * \retval -1 Failure
66  */
68 
69 /*!
70  * \brief Unregister a SIP API provider
71  */
73 
74 #if defined(__cplusplus) || defined(c_plusplus)
75 }
76 #endif
77 
78 #endif /* __ASTERISK_SIP_H */
void ast_sip_api_provider_unregister(void)
Unregister a SIP API provider.
Definition: sip_api.c:57
Main Channel structure associated with a channel.
int ast_sipinfo_send(struct ast_channel *chan, struct ast_variable *headers, const char *content_type, const char *content, const char *useragent_filter)
Send a customized SIP INFO request.
Definition: sip_api.c:25
int(* sipinfo_send)(struct ast_channel *chan, struct ast_variable *headers, const char *content_type, const char *content, const char *useragent_filter)
Definition: sip_api.h:33
Structure for variables, used for configurations and for channel variables.
const int version
Definition: sip_api.h:31
Configuration File Parser.
int ast_sip_api_provider_register(const struct ast_sip_api_tech *provider)
Register a SIP API provider.
Definition: sip_api.c:39
static struct prometheus_metrics_provider provider
Definition: bridges.c:178
const char * name
Definition: sip_api.h:32