[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    Re: [asterisk-dev] [Code Review] 4301: res_pjsip_outbound_registration: Add 'pjsip send register' co
From:       "George Joseph" <reviewboard () asterisk ! org>
Date:       2014-12-30 22:09:49
Message-ID: 20141230220949.25563.90472 () sonic ! digium ! api
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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

(Updated Dec. 30, 2014, 3:09 p.m.)


Review request for Asterisk Developers, opticron and Scott Griepentrog.


Changes
-------

Updated help language.


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 (updated)
-----

  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


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/4301/">https://reviewboard.asterisk.org/r/4301/</a>
  </td>
    </tr>
   </table>
   <br />




<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for Asterisk Developers, opticron and Scott Griepentrog.</div>
<div>By George Joseph.</div>


<p style="color: grey;"><i>Updated Dec. 30, 2014, 3:09 p.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Updated help language.</pre>  </td>
 </tr>
</table>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">The current behavior of &#39;pjsip send unregister&#39; is to send the \
unregister (REGISTER with 0 exp) but let the next scheduled register proceed \
normally.  I don&#39;t think that&#39;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&#39;ve added a \
&#39;pjsip send register&#39; 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&#39;s a new PJSIPRegister command.

There&#39;s no harm in calling either command repeatedly.  They don&#39;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&#39;ll look at this separately.</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">The current tests/channels/pjsip/registration/outbound/unregister tests \
run fine.  I&#39;m working on additional tests to exercise the register command.


</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> \
(updated)</h1> <ul style="margin-left: 3em; padding-left: 0;">

 <li>branches/13/res/res_pjsip_outbound_registration.c <span style="color: \
grey">(430163)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/4301/diff/" style="margin-left: \
3em;">View Diff</a></p>







  </td>
 </tr>
</table>




  </div>
 </body>
</html>



-- 
_____________________________________________________________________
-- 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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic