00001 /* 00002 * Asterisk -- An open source telephony toolkit. 00003 * 00004 * Copyright (C) 1999 - 2012, Digium, Inc. 00005 * 00006 * See http://www.asterisk.org for more information about 00007 * the Asterisk project. Please do not directly contact 00008 * any of the maintainers of this project for assistance; 00009 * the project provides a web site, mailing lists and IRC 00010 * channels for your use. 00011 * 00012 * This program is free software, distributed under the terms of 00013 * the GNU General Public License Version 2. See the LICENSE file 00014 * at the top of the source tree. 00015 */ 00016 00017 /*! 00018 * \file 00019 * \brief Utility functions for chan_sip 00020 * 00021 * \author Terry Wilson <twilson@digium.com> 00022 */ 00023 00024 /*** MODULEINFO 00025 <support_level>core</support_level> 00026 ***/ 00027 00028 #include "asterisk.h" 00029 00030 #include "asterisk/utils.h" 00031 #include "asterisk/cli.h" 00032 #include "include/sip.h" 00033 #include "include/sip_utils.h" 00034 00035 const char *force_rport_string(struct ast_flags *flags) 00036 { 00037 if (ast_test_flag(&flags[2], SIP_PAGE3_NAT_AUTO_RPORT)) { 00038 return ast_test_flag(&flags[0], SIP_NAT_FORCE_RPORT) ? "Auto (Yes)" : "Auto (No)"; 00039 } 00040 return AST_CLI_YESNO(ast_test_flag(&flags[0], SIP_NAT_FORCE_RPORT)); 00041 } 00042 00043 const char *comedia_string(struct ast_flags *flags) 00044 { 00045 if (ast_test_flag(&flags[2], SIP_PAGE3_NAT_AUTO_COMEDIA)) { 00046 return ast_test_flag(&flags[1], SIP_PAGE2_SYMMETRICRTP) ? "Auto (Yes)" : "Auto (No)"; 00047 } 00048 return AST_CLI_YESNO(ast_test_flag(&flags[1], SIP_PAGE2_SYMMETRICRTP)); 00049 }