res_pjsip: Add support for returning only reachable contacts and use it.

This introduces the ability for PJSIP code to specify filtering flags
when retrieving PJSIP contacts. The first flag for use causes the
query code to only retrieve contacts that are not unreachable. This
change has been leveraged by both the Dial() process and the
PJSIP_DIAL_CONTACTS dialplan function so they will now only attempt
calls to contacts which are not unreachable.

ASTERISK-26281

Change-Id: I8233b4faa21ba3db114f5a42e946e4b191446f6c
This commit is contained in:
Joshua Colp
2017-05-31 15:41:45 +00:00
parent dc05183f4b
commit 746c2c5745
6 changed files with 128 additions and 6 deletions

View File

@@ -1717,7 +1717,8 @@ struct ast_sip_session *ast_sip_session_create_outgoing(struct ast_sip_endpoint
if (location || !contact) {
location = S_OR(location, endpoint->aors);
ast_sip_location_retrieve_contact_and_aor_from_list(location, &found_aor, &found_contact);
ast_sip_location_retrieve_contact_and_aor_from_list_filtered(location, AST_SIP_CONTACT_FILTER_REACHABLE,
&found_aor, &found_contact);
if (!found_contact || ast_strlen_zero(found_contact->uri)) {
uri = location;
} else {