res_pjsip: Fix contact authenticate_qualify endpoint lookup when qualifing a contact.

* Fixed bad use of ao2_find() in on_endpoint().

* Replaced use of find_endpoints() with find_an_endpoint() since only the
first found endpoint is ever needed.

* Fixed qualify_contact_cb() to update the contact with the aor
authenticate_qualify setting.  Otherwise, permanent contacts in the aor
type sections would have a config line order dependancy.

* Fixed off nominal path contact ref leak in qualify_contact().  The
comment saying the unref is not needed was wrong.

* Fixed off nominal path use of the endpoint parameter if it is NULL in
send_out_of_dialog_request().

* Added missing off nominal path unref of pjsip tdata in
send_out_of_dialog_request().

* Fixed off nominal path failing to call the callback in send_request_cb()
when the request is challenged for authentication.

* Eliminated silly RAII_VAR() use in qualify_contact_cb().

* Updated ast_sip_send_request() doxygen to better reflect reality.

(closes issue ASTERISK-23254)
Reported by: rmudgett

Review: https://reviewboard.asterisk.org/r/3381/
........

Merged revisions 411141 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2014-03-25 16:57:41 +00:00
parent a4890eddfb
commit c1c8300e27
3 changed files with 65 additions and 37 deletions

View File

@@ -1262,13 +1262,13 @@ int ast_sip_create_request(const char *method, struct pjsip_dialog *dlg,
* they arrive.
*
* \param tdata The request to send
* \param dlg Optional. If specified, the dialog on which the request should be sent
* \param endpoint Optional. If specified, the request is sent out-of-dialog to the endpoint.
* \param token Data to be passed to the callback upon receipt of response
* \param callback Callback to be called upon receipt of response
* \param dlg Optional. The dialog in which the request is sent. Otherwise it is out-of-dialog.
* \param endpoint Optional. If specified, the out-of-dialog request is sent to the endpoint.
* \param token Data to be passed to the callback upon receipt of out-of-dialog response.
* \param callback Callback to be called upon receipt of out-of-dialog response.
*
* \retval 0 Success
* \retval -1 Failure
* \retval -1 Failure (out-of-dialog callback will not be called.)
*/
int ast_sip_send_request(pjsip_tx_data *tdata, struct pjsip_dialog *dlg,
struct ast_sip_endpoint *endpoint, void *token,