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



/branches/13/res/res_pjsip_outbound_publish.c
<https://reviewboard.asterisk.org/r/4325/#comment24628>

    explicit_publish_destroy?


- Joshua Colp


On Jan. 9, 2015, 12:07 a.m., Mark Michelson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4325/
> -----------------------------------------------------------
> 
> (Updated Jan. 9, 2015, 12:07 a.m.)
> 
> 
> Review request for Asterisk Developers and Kevin Harwell.
> 
> 
> Bugs: ASTERISK-24655
>     https://issues.asterisk.org/jira/browse/ASTERISK-24655
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> If an outbound publish is configured, and that publication never published 
> any data, then a graceful shutdown would result in Asterisk hanging for a 
> while before finally shutting down.
> 
> The reason is that the code did not take into account the case where we never 
> started publishing anything. The code would attempt to send a PUBLISH to stop 
> publication, relying on the PUBLISH callback to be called so we could then 
> destroy the PJSIP publishc structure, destroy our publication client, and 
> signal to the unloading code that we were done. The problem is that the 
> PUBLISH callback was never being called, presumably since 
> pjsip_publishc_send() was failing.
> 
> I modified the code to outright destroy the PJSIP publishc structure and drop 
> its reference to our publication client if we never actually started 
> publishing anything. This way, shutting down gracefully doesn't wait for a 
> callback that will never occur.
> 
> Also, feel free to give a better suggestion for a function name than 
> "kill_it". There are already so many variations on destroying clients in that 
> file, I was a bit bankrupt for ideas.
> 
> 
> Diffs
> -----
> 
>   /branches/13/res/res_pjsip_outbound_publish.c 430372 
> 
> Diff: https://reviewboard.asterisk.org/r/4325/diff/
> 
> 
> Testing
> -------
> 
> Reproduced the issue originally as described in ASTERISK-24655. With the 
> patch here, I have confirmed that the issue no longer occurs.
> 
> I won't be writing a testsuite test for this, since the testsuite is not 
> really well suited to this sort of thing.
> 
> 
> Thanks,
> 
> Mark Michelson
> 
>

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to