[asterisk-commits] kmoore: branch kmoore/pjsip_path_support r405001 - in /team/kmoore/pjsip_path...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 6 15:30:29 CST 2014


Author: kmoore
Date: Mon Jan  6 15:30:27 2014
New Revision: 405001

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=405001
Log:
Simplify the API and wrap other response creation

Modified:
    team/kmoore/pjsip_path_support/include/asterisk/res_pjsip.h
    team/kmoore/pjsip_path_support/res/res_pjsip.c
    team/kmoore/pjsip_path_support/res/res_pjsip/pjsip_options.c
    team/kmoore/pjsip_path_support/res/res_pjsip_messaging.c
    team/kmoore/pjsip_path_support/res/res_pjsip_registrar.c

Modified: team/kmoore/pjsip_path_support/include/asterisk/res_pjsip.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/include/asterisk/res_pjsip.h?view=diff&rev=405001&r1=405000&r2=405001
==============================================================================
--- team/kmoore/pjsip_path_support/include/asterisk/res_pjsip.h (original)
+++ team/kmoore/pjsip_path_support/include/asterisk/res_pjsip.h Mon Jan  6 15:30:27 2014
@@ -1269,7 +1269,6 @@
 /*!
  * \brief Send a response to an out of dialog request
  *
- * \param endpt The pjsip_endpoint with which this response is associated
  * \param res_addr The response address for this response
  * \param tdata The response to send
  * \param endpoint The ast_sip_endpoint associated with this response
@@ -1277,7 +1276,7 @@
  * \retval 0 Success
  * \retval -1 Failure
  */
-int ast_sip_send_response(pjsip_endpoint *endpt, pjsip_response_addr *res_addr, pjsip_tx_data *tdata, struct ast_sip_endpoint *sip_endpoint);
+int ast_sip_send_response(pjsip_response_addr *res_addr, pjsip_tx_data *tdata, struct ast_sip_endpoint *sip_endpoint);
 
 /*!
  * \brief Determine if an incoming request requires authentication

Modified: team/kmoore/pjsip_path_support/res/res_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/res/res_pjsip.c?view=diff&rev=405001&r1=405000&r2=405001
==============================================================================
--- team/kmoore/pjsip_path_support/res/res_pjsip.c (original)
+++ team/kmoore/pjsip_path_support/res/res_pjsip.c Mon Jan  6 15:30:27 2014
@@ -2171,7 +2171,7 @@
 	return PJ_FALSE;
 }
 
-int ast_sip_send_response(pjsip_endpoint *endpt, pjsip_response_addr *res_addr, pjsip_tx_data *tdata, struct ast_sip_endpoint *sip_endpoint)
+int ast_sip_send_response(pjsip_response_addr *res_addr, pjsip_tx_data *tdata, struct ast_sip_endpoint *sip_endpoint)
 {
 	struct ast_sip_supplement *supplement;
 	pjsip_cseq_hdr *cseq = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL);
@@ -2188,7 +2188,7 @@
 	ast_sip_mod_data_set(tdata->pool, tdata->mod_data, supplement_module.id, MOD_DATA_CONTACT, NULL);
 	ao2_cleanup(contact);
 
-	return pjsip_endpt_send_response(endpt, res_addr, tdata, NULL, NULL);
+	return pjsip_endpt_send_response(ast_sip_get_pjsip_endpoint(), res_addr, tdata, NULL, NULL);
 }
 
 int ast_sip_create_response(const pjsip_rx_data *rdata, int st_code,

Modified: team/kmoore/pjsip_path_support/res/res_pjsip/pjsip_options.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/res/res_pjsip/pjsip_options.c?view=diff&rev=405001&r1=405000&r2=405001
==============================================================================
--- team/kmoore/pjsip_path_support/res/res_pjsip/pjsip_options.c (original)
+++ team/kmoore/pjsip_path_support/res/res_pjsip/pjsip_options.c Mon Jan  6 15:30:27 2014
@@ -475,8 +475,7 @@
 	pj_status_t status;
 
 	/* Make the response object */
-	if ((status = pjsip_endpt_create_response(
-		     endpt, rdata, code, NULL, &tdata) != PJ_SUCCESS)) {
+	if ((status = ast_sip_create_response(rdata, code, NULL, &tdata) != PJ_SUCCESS)) {
 		ast_log(LOG_ERROR, "Unable to create response (%d)\n", status);
 		return status;
 	}
@@ -513,7 +512,7 @@
 			pjsip_tx_data_dec_ref(tdata);
 			return status;
 		}
-		status = ast_sip_send_response(endpt, &res_addr, tdata,
+		status = ast_sip_send_response(&res_addr, tdata,
 						   ast_pjsip_rdata_get_endpoint(rdata));
 	}
 

Modified: team/kmoore/pjsip_path_support/res/res_pjsip_messaging.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/res/res_pjsip_messaging.c?view=diff&rev=405001&r1=405000&r2=405001
==============================================================================
--- team/kmoore/pjsip_path_support/res/res_pjsip_messaging.c (original)
+++ team/kmoore/pjsip_path_support/res/res_pjsip_messaging.c Mon Jan  6 15:30:27 2014
@@ -601,9 +601,7 @@
 	pj_status_t status;
 	pjsip_response_addr res_addr;
 
-	pjsip_endpoint *endpt = ast_sip_get_pjsip_endpoint();
-
-	status = pjsip_endpt_create_response(endpt, rdata, code, NULL, &tdata);
+	status = ast_sip_create_response(rdata, code, NULL, &tdata);
 	if (status != PJ_SUCCESS) {
 		ast_log(LOG_ERROR, "Unable to create response (%d)\n", status);
 		return status;
@@ -618,7 +616,7 @@
 			ast_log(LOG_ERROR, "Unable to get response address (%d)\n", status);
 			return status;
 		}
-		status = ast_sip_send_response(endpt, &res_addr, tdata, ast_pjsip_rdata_get_endpoint(rdata));
+		status = ast_sip_send_response(&res_addr, tdata, ast_pjsip_rdata_get_endpoint(rdata));
 	}
 
 	if (status != PJ_SUCCESS) {

Modified: team/kmoore/pjsip_path_support/res/res_pjsip_registrar.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pjsip_path_support/res/res_pjsip_registrar.c?view=diff&rev=405001&r1=405000&r2=405001
==============================================================================
--- team/kmoore/pjsip_path_support/res/res_pjsip_registrar.c (original)
+++ team/kmoore/pjsip_path_support/res/res_pjsip_registrar.c Mon Jan  6 15:30:27 2014
@@ -554,7 +554,7 @@
 	ao2_callback(contacts, 0, registrar_add_contact, tdata);
 
 	if (pjsip_get_response_addr(tdata->pool, task_data->rdata, &addr) == PJ_SUCCESS) {
-		ast_sip_send_response(ast_sip_get_pjsip_endpoint(), &addr, tdata, task_data->endpoint);
+		ast_sip_send_response(&addr, tdata, task_data->endpoint);
 	} else {
 		pjsip_tx_data_dec_ref(tdata);
 	}




More information about the asterisk-commits mailing list