summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorzuul <zuul@gerrit.asterisk.org>2017-02-21 21:17:24 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-02-21 21:17:24 -0600
commita3584c68343f61e4f58c6db8456edd331065318a (patch)
tree8a2b40e5c6f4cdb7e7751576ef660bc6db284c5c /res
parent51c9dd3d165fa99a05274eb2a14a4b767341af28 (diff)
parenteb9ae4f7cba333c4cd188c741a71c1f244071929 (diff)
Merge "res_pjsip: Record the serializer earlier on the tdata." into 13
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip.c2
-rw-r--r--res/res_pjsip/pjsip_distributor.c14
-rw-r--r--res/res_pjsip_outbound_publish.c3
-rw-r--r--res/res_pjsip_outbound_registration.c1
4 files changed, 8 insertions, 12 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 2390bc041..9970d84f4 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -3642,6 +3642,8 @@ static pj_status_t endpt_send_request(struct ast_sip_endpoint *endpoint,
}
}
+ ast_sip_record_request_serializer(tdata);
+
/* We need to insure that the wrapper and tdata are available when the
* transaction callback is executed.
*/
diff --git a/res/res_pjsip/pjsip_distributor.c b/res/res_pjsip/pjsip_distributor.c
index a1689e207..7bea6b735 100644
--- a/res/res_pjsip/pjsip_distributor.c
+++ b/res/res_pjsip/pjsip_distributor.c
@@ -29,12 +29,11 @@
static int distribute(void *data);
static pj_bool_t distributor(pjsip_rx_data *rdata);
-static pj_status_t record_serializer(pjsip_tx_data *tdata);
static pjsip_module distributor_mod = {
.name = {"Request Distributor", 19},
.priority = PJSIP_MOD_PRIORITY_TSX_LAYER - 6,
- .on_tx_request = record_serializer,
+ .on_tx_request = ast_sip_record_request_serializer,
.on_rx_request = distributor,
.on_rx_response = distributor,
};
@@ -64,16 +63,7 @@ struct unidentified_request{
/*! Pool of serializers to use if not supplied. */
static struct ast_taskprocessor *distributor_pool[DISTRIBUTOR_POOL_SIZE];
-/*!
- * \internal
- * \brief Record the task's serializer name on the tdata structure.
- * \since 14.0.0
- *
- * \param tdata The outgoing message.
- *
- * \retval PJ_SUCCESS.
- */
-static pj_status_t record_serializer(pjsip_tx_data *tdata)
+pj_status_t ast_sip_record_request_serializer(pjsip_tx_data *tdata)
{
struct ast_taskprocessor *serializer;
diff --git a/res/res_pjsip_outbound_publish.c b/res/res_pjsip_outbound_publish.c
index 3afa41307..37f64481e 100644
--- a/res/res_pjsip_outbound_publish.c
+++ b/res/res_pjsip_outbound_publish.c
@@ -360,6 +360,7 @@ static int send_unpublish_task(void *data)
pjsip_tx_data_set_transport(tdata, &selector);
}
+ ast_sip_record_request_serializer(tdata);
pjsip_publishc_send(client->client, tdata);
}
@@ -609,6 +610,7 @@ static int sip_publish_client_service_queue(void *data)
pjsip_tx_data_set_transport(tdata, &selector);
}
+ ast_sip_record_request_serializer(tdata);
status = pjsip_publishc_send(client->client, tdata);
if (status == PJ_EBUSY) {
/* We attempted to send the message but something else got there first */
@@ -921,6 +923,7 @@ static void sip_outbound_publish_callback(struct pjsip_publishc_cbparam *param)
pjsip_tx_data_set_transport(tdata, &selector);
}
+ ast_sip_record_request_serializer(tdata);
pjsip_publishc_send(client->client, tdata);
}
client->auth_attempts++;
diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c
index bfb327c75..122d5bb69 100644
--- a/res/res_pjsip_outbound_registration.c
+++ b/res/res_pjsip_outbound_registration.c
@@ -539,6 +539,7 @@ static pj_status_t registration_client_send(struct sip_outbound_registration_cli
*/
ast_sip_set_tpselector_from_transport_name(client_state->transport_name, &selector);
pjsip_regc_set_transport(client_state->client, &selector);
+ ast_sip_record_request_serializer(tdata);
status = pjsip_regc_send(client_state->client, tdata);
/* If the attempt to send the message failed and the callback was not invoked we need to