[asterisk-dev] [Code Review] 4301: res_pjsip_outbound_registration: Add 'pjsip send register' command and update behavior of 'send unregister'
Joshua Colp
reviewboard at asterisk.org
Tue Dec 30 09:39:01 CST 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4301/#review14053
-----------------------------------------------------------
branches/13/res/res_pjsip_outbound_registration.c
<https://reviewboard.asterisk.org/r/4301/#comment24572>
I'd make this more friendly for reading:
"Call PJSIPRegister to start registration and schedule re-registrations according to configuration."
branches/13/res/res_pjsip_outbound_registration.c
<https://reviewboard.asterisk.org/r/4301/#comment24569>
Register.
branches/13/res/res_pjsip_outbound_registration.c
<https://reviewboard.asterisk.org/r/4301/#comment24570>
I'm in a pedantic mood. "Re-register" usually means to refresh an existing registration. Since you are doing an unregister this is just a plain ol' register.
branches/13/res/res_pjsip_outbound_registration.c
<https://reviewboard.asterisk.org/r/4301/#comment24571>
I'm concerned that the behavior that used to happen was explicitly documented, it wasn't overlooked. We're now changing it - why was it the previous way in the first place?
- Joshua Colp
On Dec. 30, 2014, 5:35 a.m., George Joseph wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4301/
> -----------------------------------------------------------
>
> (Updated Dec. 30, 2014, 5:35 a.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> The current behavior of 'pjsip send unregister' is to send the unregister (REGISTER with 0 exp) but let the next scheduled register proceed normally. I don't think that's a good idea. If you unregister, it should stay unregistered until you decide to start registrations again. So this patch just adds a cancel_registration call to the current unregister_task to cancel the timer.
>
> Of course, now you need a way to start registration again so I've added a 'pjsip send register' command that unregisters and cancels any existing registration (the same as send unregister), then sends an immediate registration and starts the timer back up again.
>
> Both changes also ripple to AMI. There's a new PJSIPRegister command.
>
> There's no harm in calling either command repeatedly. They don't care about the actual state.
>
> I did discover a previously existing ref count leak for state though. Every time asterisk sends a register, the count gets incremented but never decremented. I'll look at this separately.
>
>
> Diffs
> -----
>
> branches/13/res/res_pjsip_outbound_registration.c 430163
>
> Diff: https://reviewboard.asterisk.org/r/4301/diff/
>
>
> Testing
> -------
>
> The current tests/channels/pjsip/registration/outbound/unregister tests run fine. I'm working on additional tests to exercise the register command.
>
>
> Thanks,
>
> George Joseph
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20141230/f908f8dc/attachment-0001.html>
More information about the asterisk-dev
mailing list