res_pjsip: Apply outbound proxy to all SIP requests.

Objects which are involved in SIP request creation and sending
now allow an outbound proxy to be specified. For cases where
an endpoint is used the outbound proxy specified there will
be applied.

(closes issue ASTERISK-22673)
Reported by: Antti Yrjola

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@403811 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2013-12-14 17:25:51 +00:00
parent 6e7d64c79d
commit db930057fd
4 changed files with 69 additions and 0 deletions

View File

@@ -144,6 +144,8 @@ struct ast_sip_contact {
AST_DECLARE_STRING_FIELDS(
/*! Full URI of the contact */
AST_STRING_FIELD(uri);
/*! Outbound proxy to use for qualify */
AST_STRING_FIELD(outbound_proxy);
);
/*! Absolute time that this contact is no longer valid after */
struct timeval expiration_time;
@@ -188,6 +190,8 @@ struct ast_sip_aor {
AST_DECLARE_STRING_FIELDS(
/*! Voicemail boxes for this AOR */
AST_STRING_FIELD(mailboxes);
/*! Outbound proxy for OPTIONS requests */
AST_STRING_FIELD(outbound_proxy);
);
/*! Minimum expiration time */
unsigned int minimum_expiration;
@@ -1280,6 +1284,16 @@ int ast_sip_create_request_with_auth(const struct ast_sip_auth_array *auths, pjs
*/
struct ast_sip_endpoint *ast_sip_identify_endpoint(pjsip_rx_data *rdata);
/*!
* \brief Set the outbound proxy for an outbound SIP message
*
* \param tdata The message to set the outbound proxy on
* \param proxy SIP uri of the proxy
* \retval 0 Success
* \retval -1 Failure
*/
int ast_sip_set_outbound_proxy(pjsip_tx_data *tdata, const char *proxy);
/*!
* \brief Add a header to an outbound SIP message
*