Asterisk - The Open Source Telephony Project
18.5.0
|
sip.conf parser header file More...
#include "sip.h"
Go to the source code of this file.
Functions | |
void | sip_config_parser_register_tests (void) |
register config parsing tests More... | |
void | sip_config_parser_unregister_tests (void) |
unregister config parsing tests More... | |
int | sip_parse_host (char *line, int lineno, char **hostname, int *portnum, enum ast_transport *transport) |
parses a config line for a host with a transport More... | |
void | sip_parse_nat_option (const char *value, struct ast_flags *mask, struct ast_flags *flags) |
Parse the comma-separated nat= option values. More... | |
int | sip_parse_register_line (struct sip_registry *reg, int default_expiry, const char *value, int lineno) |
Parse register=> line in sip.conf. More... | |
sip.conf parser header file
Definition in file config_parser.h.
void sip_config_parser_register_tests | ( | void | ) |
register config parsing tests
register config parsing tests
Definition at line 913 of file config_parser.c.
References AST_TEST_REGISTER.
Referenced by sip_register_tests().
void sip_config_parser_unregister_tests | ( | void | ) |
unregister config parsing tests
unregister config parsing tests
Definition at line 921 of file config_parser.c.
References AST_TEST_UNREGISTER.
Referenced by sip_unregister_tests().
int sip_parse_host | ( | char * | line, |
int | lineno, | ||
char ** | hostname, | ||
int * | portnum, | ||
enum ast_transport * | transport | ||
) |
parses a config line for a host with a transport
An example input would be: tls://www.google.com:8056
0 | on success |
-1 | on failure |
Definition at line 647 of file config_parser.c.
References ast_log, ast_sockaddr_split_hostport(), ast_strlen_zero, AST_TRANSPORT_TCP, AST_TRANSPORT_TLS, AST_TRANSPORT_UDP, hostname, LOG_NOTICE, LOG_WARNING, NULL, STANDARD_SIP_PORT, and STANDARD_TLS_PORT.
Referenced by AST_TEST_DEFINE(), and proxy_from_config().
Parse the comma-separated nat= option values.
value | The comma-separated value |
mask | An array of ast_flags that will be set by this function and used as a mask for copying the flags later |
flags | An array of ast_flags that will be set by this function |
Definition at line 794 of file config_parser.c.
References ast_clear_flag, ast_false(), ast_log, ast_set_flag, ast_strdupa, ast_test_flag, LOG_WARNING, parse(), SIP_NAT_FORCE_RPORT, SIP_PAGE2_SYMMETRICRTP, SIP_PAGE3_NAT_AUTO_COMEDIA, SIP_PAGE3_NAT_AUTO_RPORT, and strsep().
Referenced by AST_TEST_DEFINE(), and handle_common_options().
int sip_parse_register_line | ( | struct sip_registry * | reg, |
int | default_expiry, | ||
const char * | value, | ||
int | lineno | ||
) |
Parse register=> line in sip.conf.
0 | on success |
-1 | on failure |
register => [peer?][transport://]user[][:secret[:authuser]][:port][/extension][~expiry] becomes userpart => [peer?][transport://]user[][:secret[:authuser]] hostpart => host[:port][/extension][~expiry]
pre1.peer => peer pre1.userpart => [transport://]user[][:secret[:authuser]] hostpart => host[:port][/extension][~expiry]
pre1.peer => peer pre2.transport = transport pre2.userpart => user[][:secret[:authuser]] hostpart => host[:port][/extension][~expiry]
pre1.peer => peer pre2.transport = transport user1.userpart => user[] user1.secret => secret user1.authuser => authuser hostpart => host[:port][/extension][~expiry]
pre1.peer => peer pre2.transport = transport user1.userpart => user[] user1.secret => secret user1.authuser => authuser host1.hostpart => host[:port][/extension] host1.expiry => [expiry]
pre1.peer => peer pre2.transport = transport user1.userpart => user[] user1.secret => secret user1.authuser => authuser host2.hostpart => host[:port] host2.extension => [extension] host1.expiry => [expiry]
pre1.peer => peer pre2.transport = transport user1.userpart => user[] user1.secret => secret user1.authuser => authuser host3.host => host host3.port => port host2.extension => extension host1.expiry => expiry
pre1.peer => peer pre2.transport = transport user2.user => user user2.domain => domain user1.secret => secret user1.authuser => authuser host3.host => host host3.port => port host2.extension => extension host1.expiry => expiry
pre1.peer => peer pre2.transport = transport user2.user => user user2.domain => domain user1.secret => secret user3.authuser => authuser user3.domainport => domainport host3.host => host host3.port => port host2.extension => extension host1.expiry => expiry
Definition at line 37 of file config_parser.c.
References AST_APP_ARG, ast_copy_string(), AST_DECLARE_APP_ARGS, ast_log, AST_NONSTANDARD_RAW_ARGS, ast_string_field_set, ast_strip_quoted(), ast_strlen_zero, AST_TRANSPORT_TCP, AST_TRANSPORT_TLS, AST_TRANSPORT_UDP, buf, sip_registry::callid_valid, sip_registry::configured_expiry, default_expiry, sip_registry::expire, sip_registry::expiry, FALSE, host, hostname, INITIAL_CSEQ, LOG_NOTICE, LOG_WARNING, NULL, sip_registry::ocseq, port_str2int(), sip_registry::portno, sip_registry::refresh, sip_registry::regdomainport, S_OR, STANDARD_SIP_PORT, STANDARD_TLS_PORT, sip_registry::timeout, and sip_registry::transport.
Referenced by AST_TEST_DEFINE(), and sip_register().