36 #define sip_route_traverse(route,elem) AST_LIST_TRAVERSE(&(route)->list, elem, list) 37 #define sip_route_first(route) AST_LIST_FIRST(&(route)->list) 51 if (!uri || len < 1 || uri[0] ==
'\0') {
92 header = strchr(header,
',');
93 if (header >= uri && header <= (uri + len)) {
95 const char *next_br = strchr(header,
'<');
96 if (next_br && next_br <= (uri + len)) {
103 ast_debug(2,
"sip_route_process_header: <%s>\n", hop);
105 header = strchr(uri + len + 1,
',');
106 if (header ==
NULL) {
125 ast_debug(2,
"sip_route_copy: copied hop: <%s>\n", uri);
167 comma = formatcli ?
", " :
",";
176 if (formatcli && i <= 0) {
191 int ret = hop && (strstr(hop->
uri,
";lr") ==
NULL);
Asterisk main include file. File version handling, generic pbx functions.
Structure to store route information.
const char * sip_route_first_uri(const struct sip_route *route)
Get the URI of the route's first hop.
#define sip_route_traverse(route, elem)
Traverse route hops.
int ast_str_append(struct ast_str **buf, ssize_t max_len, const char *fmt,...)
Append to a thread local dynamic string.
const char * sip_route_add(struct sip_route *route, const char *uri, size_t len, int inserthead)
Add a new hop to the route.
void ast_verbose(const char *fmt,...)
#define sip_route_first(route)
int get_in_brackets_const(const char *src, const char **start, int *length)
Get text in brackets on a const without copy.
#define ast_debug(level,...)
Log a DEBUG message.
#define sip_route_empty(route)
Check if route has no URI's.
#define ast_malloc(len)
A wrapper for malloc()
#define AST_LIST_REMOVE_HEAD(head, field)
Removes and returns the head entry from a list.
void sip_route_clear(struct sip_route *route)
Free all routes in the list.
int sip_route_is_strict(struct sip_route *route)
Check if the route is strict.
Structure to save a route hop.
sip request response parser header file
#define AST_LIST_INSERT_TAIL(head, elm, field)
Appends a list entry to the tail of a list.
void sip_route_dump(const struct sip_route *route)
Verbose dump of all hops for debugging.
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
void sip_route_process_header(struct sip_route *route, const char *header, int inserthead)
Add routes from header.
#define AST_LIST_ENTRY(type)
Declare a forward link structure inside a list entry.
#define AST_LIST_INSERT_HEAD(head, elm, field)
Inserts a list entry at the head of a list.
void DO_CRASH_NORETURN ast_do_crash(void)
Force a crash if DO_CRASH is defined.
struct ast_str * sip_route_list(const struct sip_route *route, int formatcli, int skip)
Make the comma separated list of route hops.
void ast_copy_string(char *dst, const char *src, size_t size)
Size-limited null-terminating string copy.
struct sip_route_hop::@180 list
void sip_route_copy(struct sip_route *dst, const struct sip_route *src)
copy route-set
struct sip_route_hop * next
struct sip_route::@165 list
#define ast_str_create(init_len)
Create a malloc'ed dynamic length string.