pjsip retransmit detection

AG
Andreas Granig
Mon, Feb 8, 2016 1:49 PM

Hi,

First time posting, so, hi all! :)

The question I'm having is whether it's possible in the tx_request
callback set in pjsip_module struct to determine on application level
from the pjsip_tx_data passed to this callback if the request being
transmitted is a retransmission? I'm using the pjsua abstraction layer,
jfyi.

The function pjsip_rdata_get_tsx() provides a way to get the transaction
for received data, and having the transaction structure, it could be
possible to inspect retransmit_count. I'm looking for a similar approach
based on pjsip_tx_data instead of pjsip_rx_data. Is this possible somehow?

Alternatively I'm thinking of patching pjsip/src/pjsip/sip_transaction.c
function tsx_retransmit() for setting a custom callback in case of
retransmission of a request.

Any ideas whether it's possible to get the transaction using
pjsip_tx_data and checking retransmit_count there (is this the right
approach in general anyways?) or if patching pjsip to hook up a custom
callback is more feasible?

Thanks,
Andreas

Hi, First time posting, so, hi all! :) The question I'm having is whether it's possible in the tx_request callback set in pjsip_module struct to determine on application level from the pjsip_tx_data passed to this callback if the request being transmitted is a retransmission? I'm using the pjsua abstraction layer, jfyi. The function pjsip_rdata_get_tsx() provides a way to get the transaction for received data, and having the transaction structure, it could be possible to inspect retransmit_count. I'm looking for a similar approach based on pjsip_tx_data instead of pjsip_rx_data. Is this possible somehow? Alternatively I'm thinking of patching pjsip/src/pjsip/sip_transaction.c function tsx_retransmit() for setting a custom callback in case of retransmission of a request. Any ideas whether it's possible to get the transaction using pjsip_tx_data and checking retransmit_count there (is this the right approach in general anyways?) or if patching pjsip to hook up a custom callback is more feasible? Thanks, Andreas
AG
Andreas Granig
Mon, Feb 8, 2016 10:47 PM

Hi,

On 02/08/2016 02:49 PM, Andreas Granig wrote:

Any ideas whether it's possible to get the transaction using
pjsip_tx_data and checking retransmit_count there (is this the right
approach in general anyways?) or if patching pjsip to hook up a custom
callback is more feasible?

After checking the transaction implementation briefly and experimenting
a bit, it seems that at least for REGISTER something like this could be
used in the on_tx_msg() callbacks to check for retransmissions:

pjsip_module tsx_mod = pjsip_tsx_layer_instance();
if(tsx_mod && !tdata->mod_data[tsx_mod->id]) {
/

looks like a retransmission due to missing tsx,
since in normal requests, this always contains
the transaction struct!?
*/
}

Will test further with INVITES and others whether this holds true in all
cases.

Andreas

Hi, On 02/08/2016 02:49 PM, Andreas Granig wrote: > Any ideas whether it's possible to get the transaction using > pjsip_tx_data and checking retransmit_count there (is this the right > approach in general anyways?) or if patching pjsip to hook up a custom > callback is more feasible? After checking the transaction implementation briefly and experimenting a bit, it seems that at least for REGISTER something like this could be used in the on_tx_msg() callbacks to check for retransmissions: pjsip_module *tsx_mod = pjsip_tsx_layer_instance(); if(tsx_mod && !tdata->mod_data[tsx_mod->id]) { /* looks like a retransmission due to missing tsx, since in normal requests, this always contains the transaction struct!? */ } Will test further with INVITES and others whether this holds true in all cases. Andreas