Asterisk - The Open Source Telephony Project  18.5.0
channels/sip/utils.c
Go to the documentation of this file.
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 1999 - 2012, Digium, Inc.
5  *
6  * See http://www.asterisk.org for more information about
7  * the Asterisk project. Please do not directly contact
8  * any of the maintainers of this project for assistance;
9  * the project provides a web site, mailing lists and IRC
10  * channels for your use.
11  *
12  * This program is free software, distributed under the terms of
13  * the GNU General Public License Version 2. See the LICENSE file
14  * at the top of the source tree.
15  */
16 
17 /*!
18  * \file
19  * \brief Utility functions for chan_sip
20  *
21  * \author Terry Wilson <[email protected]>
22  */
23 
24 /*** MODULEINFO
25  <support_level>deprecated</support_level>
26  ***/
27 
28 #include "asterisk.h"
29 
30 #include "asterisk/utils.h"
31 #include "asterisk/cli.h"
32 #include "include/sip.h"
33 #include "include/sip_utils.h"
34 
35 const char *force_rport_string(struct ast_flags *flags)
36 {
37  if (ast_test_flag(&flags[2], SIP_PAGE3_NAT_AUTO_RPORT)) {
38  return ast_test_flag(&flags[0], SIP_NAT_FORCE_RPORT) ? "Auto (Yes)" : "Auto (No)";
39  }
41 }
42 
43 const char *comedia_string(struct ast_flags *flags)
44 {
45  if (ast_test_flag(&flags[2], SIP_PAGE3_NAT_AUTO_COMEDIA)) {
46  return ast_test_flag(&flags[1], SIP_PAGE2_SYMMETRICRTP) ? "Auto (Yes)" : "Auto (No)";
47  }
49 }
const char * comedia_string(struct ast_flags *flags)
Return a string describing the comedia value for the given flags.
chan_sip header file
Asterisk main include file. File version handling, generic pbx functions.
#define ast_test_flag(p, flag)
Definition: utils.h:63
#define SIP_NAT_FORCE_RPORT
Definition: sip.h:283
Utility functions.
#define SIP_PAGE2_SYMMETRICRTP
Definition: sip.h:327
#define SIP_PAGE3_NAT_AUTO_RPORT
Definition: sip.h:386
Structure used to handle boolean flags.
Definition: utils.h:199
const char * force_rport_string(struct ast_flags *flags)
Return a string describing the force_rport value for the given flags.
#define SIP_PAGE3_NAT_AUTO_COMEDIA
Definition: sip.h:387
Standard Command Line Interface.
#define AST_CLI_YESNO(x)
Return Yes or No depending on the argument.
Definition: cli.h:71
sip utils header file