Asterisk - The Open Source Telephony Project  18.5.0
Functions
channels/sip/utils.c File Reference

Utility functions for chan_sip. More...

#include "asterisk.h"
#include "asterisk/utils.h"
#include "asterisk/cli.h"
#include "include/sip.h"
#include "include/sip_utils.h"
Include dependency graph for channels/sip/utils.c:

Go to the source code of this file.

Functions

const char * comedia_string (struct ast_flags *flags)
 Return a string describing the comedia value for the given flags. More...
 
const char * force_rport_string (struct ast_flags *flags)
 Return a string describing the force_rport value for the given flags. More...
 

Detailed Description

Utility functions for chan_sip.

Author
Terry Wilson twils[email protected][email protected][email protected]igium[email protected].com

Definition in file channels/sip/utils.c.

Function Documentation

◆ comedia_string()

const char* comedia_string ( struct ast_flags flags)

Return a string describing the comedia value for the given flags.

Definition at line 43 of file channels/sip/utils.c.

References AST_CLI_YESNO, ast_test_flag, SIP_PAGE2_SYMMETRICRTP, and SIP_PAGE3_NAT_AUTO_COMEDIA.

Referenced by _sip_show_peer(), _sip_show_peers_one(), and sip_show_settings().

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 }
#define ast_test_flag(p, flag)
Definition: utils.h:63
#define SIP_PAGE2_SYMMETRICRTP
Definition: sip.h:327
#define SIP_PAGE3_NAT_AUTO_COMEDIA
Definition: sip.h:387
#define AST_CLI_YESNO(x)
Return Yes or No depending on the argument.
Definition: cli.h:71

◆ force_rport_string()

const char* force_rport_string ( struct ast_flags flags)

Return a string describing the force_rport value for the given flags.

Definition at line 35 of file channels/sip/utils.c.

References AST_CLI_YESNO, ast_test_flag, SIP_NAT_FORCE_RPORT, and SIP_PAGE3_NAT_AUTO_RPORT.

Referenced by _sip_show_peer(), _sip_show_peers_one(), sip_show_channel(), and sip_show_settings().

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 }
#define ast_test_flag(p, flag)
Definition: utils.h:63
#define SIP_NAT_FORCE_RPORT
Definition: sip.h:283
#define SIP_PAGE3_NAT_AUTO_RPORT
Definition: sip.h:386
#define AST_CLI_YESNO(x)
Return Yes or No depending on the argument.
Definition: cli.h:71