Hi Daniel and other TM experts<br><br>We have been working on a prototype for being able to use the t_suspend() and t_continue() methods for SIP responses.  The version in branch /tmp/tm_async_reply_support is working, though still needs to be 100% tested and only works for 1 branch (i.e. no forking)<b></b><br>
<br>Would it be possible for you to have a look at this branch code and see if we are on the right track.  The code is working but TM (as mentioned in the documentation ;)) can be tricky to program and we want to make sure we are not breaking anything, as the goal is to get this into the master branch.<br>
<br>The changes we have done:<br><ol><li>parser/msg_parser.h:  added new message state FL_RPL_SUSPENDED</li><li>tm/h_table.h: added int suspended_request to ua_server and int suspended_reply to ua_client</li><li>tm/t_suspend.c:t_suspend</li>
<ol><li>Changed suspend method to check if the message is a request or response and set the suspended_request/suspended_reply variable accordingly</li><li>If its a request we do as the existing code<br></li><li>If its a response we get the correct uac branch, clone the msg into t-&gt;uac[branch].reply and set the msg state to FL_RPL_SUSPENDED</li>
</ol><li>tm/t_reply.c: if msg is in state FL_RPL_SUSPENDED then we skip sending the reply on<br></li><li>tm/t_suspend.c:t_continue</li><ol><li>Check if this uas was suspended - if so this is a continue for a request so continue with existing code<br>
</li><li>If not then we search for the branch that was suspended</li><li>Once branch is found unsuspend the message state</li><li>do pre-script, run_top_route and post scripts</li><li>Relay the reply using basically the same code we skipped in step 4</li>
</ol></ol><p>First next step after we confirm we are on the right track is to add forking support - this will require a new t_continue method where the calling application passes in the branch of the suspended reply when wanting to continue.</p>
<p></p><p>Any comments/feedback would be appreciated.  <br></p><p></p><p>Regards</p><p>Richard.<br></p><p><br></p><p><br></p><br><br><br><br><div class="gmail_quote">On 11 March 2013 14:34, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hello,<br>
    <br>
    t_suspend() and t_continue() are only for requests at this moment.<br>
    <br>
    Cheers,<br>
    Daniel<div><div class="h5"><br>
    <br>
    <div>On 3/6/13 2:49 PM, Richard Good wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">Hi<br>
      <br>
      We are using the t_suspend and t_continue functionality to
      asynchronously send Diameter messages.  <br>
      <br>
      This works nicely when we suspend and resume on a SIP request. 
      However in some circumstances we want to send a Diameter message
      on a SIP response.<br>
      <br>
      I have found that the SIP responses continue to be relayed despite
      being suspended and returning 0 to the cfg file.<br>
      <br>
      I am investigating the cause but before I get any deeper does
      anyone know if the t_suspend and t_continue functionality in the
      tm module can be used on a SIP response?<br>
      <br>
      Regards<br>
      Richard.
      <table style="width:450.0pt" border="0" cellpadding="0" cellspacing="0" width="600">
        <tbody>
          <tr style="min-height:10.5pt">
            <td rowspan="3" style="width:173.25pt;padding:0cm 0cm 0cm 0cm;min-height:10.5pt" valign="top" width="231">
              <br>
            </td>
            <td style="padding:0cm 0cm 0cm 0cm;min-height:10.5pt" valign="top"><br>
            </td>
          </tr>
          <tr style="min-height:42.75pt">
            <td style="padding:0cm 0cm 0cm 0cm;min-height:42.75pt" valign="top"><br>
            </td>
          </tr>
        </tbody>
      </table>
      <span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"></span>
      </div></div><pre>This email is subject to the disclaimer of Smile Communications (PTY) Ltd. at <a href="http://www.smilecoms.com/disclaimer" target="_blank">http://www.smilecoms.com/disclaimer</a>


<fieldset></fieldset>
<pre>_______________________________________________
sr-dev mailing list
<a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>

</pre><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, April 16-17, 2013, Berlin
 - <a href="http://conference.kamailio.com" target="_blank">http://conference.kamailio.com</a> -</pre>
  </font></span></div>

<br>_______________________________________________<br>
sr-dev mailing list<br>
<a href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
<br></blockquote></div><table style="width:450.0pt" border="0" cellpadding="0" cellspacing="0" width="600"><tbody><tr style="min-height:10.5pt"><td rowspan="3" style="width:173.25pt;padding:0cm 0cm 0cm 0cm;min-height:10.5pt" valign="top" width="231">
<br></td><td style="padding:0cm 0cm 0cm 0cm;min-height:10.5pt" valign="top"><br></td></tr><tr style="min-height:42.75pt"><td style="padding:0cm 0cm 0cm 0cm;min-height:42.75pt" valign="top"><br></td></tr></tbody></table><span style="border-collapse:collapse;font-family:arial,sans-serif;font-size:13px"></span>

<pre>This email is subject to the disclaimer of Smile Communications (PTY) Ltd. at http://www.smilecoms.com/disclaimer