[asterisk-dev] [Code Review] 4572: RFC: Refactor Qualify and res_pjsip/endpt_send_request

George Joseph reviewboard at asterisk.org
Tue Mar 31 00:57:30 CDT 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4572/
-----------------------------------------------------------

Review request for Asterisk Developers.


Bugs: ASTERISK-24863
    https://issues.asterisk.org/jira/browse/ASTERISK-24863


Repository: Asterisk


Description
-------

This review is based on the discussion here
http://lists.digium.com/pipermail/asterisk-dev/2015-March/073921.html

-------------------------------------
Right now when a contact is qualified, it's immediately marked as
UNAVAILABLE.  If a response to the OPTIONS message comes back, it's
marked as AVAILABLE again and the round trip time calculated.   The
status flapping even in normal operation makes generating events
tricky because the subscriber will see up/down events even if the
contact is really AVAILABLE.   Now the pjsip transaction will
eventually time out at an unconfigurable 32 seconds and call the
callback but 32 seconds is a long time.  This is also an issue if the
qualify_frequency is less than 32 seconds since they'll be multiple
pjsip transactions in progress for the same contact.

<snip>

So, I'm proposing pulling libpjsip/pjsip_endpt_send_request up into
res_pjsip.   It's 2 short function and a pjsip_module structure with
no access to any private pjsip stuff.   Now we'll have the ability to
terminate the transaction AND it seems that there's a timeout member
of pjsip_transaction which I'm hoping (but haven't tested) will
eliminate the need to add timeout processing in pjsip_options.

The result of all of this is that we'll be able to generate events for
contact status (ASTERISK-24863) which in turn will help is provide
functionality like marking an endpoint unavailable when all of its
contacts are unavailable.
-------------------------------------

Both Josh and Mark had comments in the thread so this is an RFC ONLY review.
It covers the pull up of libpjsip/pjsip_endpt_send_request but I've also added the
use case which is creating and processing a new aor/contact option called 
'qualify_timeout'.  I'll split the final submission into 2 pieces.


Diffs
-----

  branches/13/res/res_pjsip/pjsip_options.c 433794 
  branches/13/res/res_pjsip/location.c 433794 
  branches/13/res/res_pjsip.c 433794 
  branches/13/include/asterisk/res_pjsip.h 433794 

Diff: https://reviewboard.asterisk.org/r/4572/diff/


Testing
-------

All existing pjsip related tests complete.  I'll also have to add event generation on contact status change and the tests based on it.


Thanks,

George Joseph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150331/00ac53eb/attachment.html>


More information about the asterisk-dev mailing list