[Asterisk-code-review] Change in asterisk[13]: res_pjsip: Refactor endpt_send_request to include transactio...

George Joseph (Code Review) asteriskteam at digium.com
Wed Apr 15 20:46:57 CDT 2015


Hello Joshua Colp,

I'd like you to reexamine a change.  Please visit

    https://gerrit.asterisk.org/43

to look at the new patch set (#6).

Change subject: res_pjsip: Refactor endpt_send_request to include transaction timeout
......................................................................

res_pjsip: Refactor endpt_send_request to include transaction timeout

This is the first follow-on to https://reviewboard.asterisk.org/r/4572/ and the
discussion at
http://lists.digium.com/pipermail/asterisk-dev/2015-March/073921.html

Since we currently have no control over pjproject transaction timeout, this
patch pulls the pjsip_endpt_send_request function out of pjproject and into
res_pjsip/endpt_send_transaction in order to implement that capability.

Now when the transaction is initiated, we also schedule our own pj_timer with
our own desired timeout.

If the transaction completes before either timeout, pjproject cancels its timer,
and calls our tsx callback where we cancel our timer and run the app callback.

If the pjproject timer times out first, pjproject calls our tsx callback where
we cancel our timer and run the app callback.

If our timer times out first, we terminate the transaction which causes
pjproject to cancel its timer and call our tsx callback where we run the app
callback.

Regardless of the scenario, pjproject is calling the tsx callback inside the
group_lock and there are checks in the callback to make sure it doesn't run
twice.

As part of this patch ast_sip_send_out_of_dialog_request was created to replace
its similarly named private function.  It takes a new timeout argument in
milliseconds (<= 0 to disable the timeout).

Change-Id: I0778dc730d9689c5147a444a04aee3c1026bf747
Tested-by: George Joseph <george.joseph at fairview5.com>
---
M include/asterisk/res_pjsip.h
M res/res_pjsip.c
2 files changed, 177 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/43/43/6
-- 
To view, visit https://gerrit.asterisk.org/43
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0778dc730d9689c5147a444a04aee3c1026bf747
Gerrit-PatchSet: 6
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list