<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    On 08/08/2019 16:23, Sean Devoy wrote:<br>
    ><br>
    > How can to stop the default handling of an inbound SMS message?<br>
    <p>></p>
    <p><br>
    </p>
    <p>Hi Sean, after some long time trying to do that, then giving up,
      and coming back to it, various times, I finally went for the
      source code with a comb and it seems I finally found a way to do
      it:</p>
    <p>Please see.
      <a class="moz-txt-link-freetext"
href="https://github.com/Rhizomatica/rccn/commit/db08b977711da1e09e3326db1723f6774a2b4e6c"
        moz-do-not-send="true">https://github.com/Rhizomatica/rccn/commit/db08b977711da1e09e3326db1723f6774a2b4e6c</a></p>
    <p>Hmm, when making that commit, I referenced:
      <a class="moz-txt-link-freetext"
href="https://docs.freeswitch.org/switch__loadable__module_8c.html#a6389148319476a6f9858ccf4b889f8a4"
        moz-do-not-send="true">https://docs.freeswitch.org/switch__loadable__module_8c.html#a6389148319476a6f9858ccf4b889f8a4</a><br>
    </p>
    <p>Which is where I found in this comment:<br>
    </p>
    <p> <span class="comment">/* The event was handled by an extension
        in the chatplan, </span> </p>
    <div class="line"><span class="lineno"></span><span class="comment">
        * so the event will be duplicated, modified and queued again, </span></div>
    <div class="line"><span class="lineno"></span> <span class="comment">
        * but it won't be processed by the chatplan again.</span></div>
    <div class="line"><span class="lineno"></span> <span class="comment">
        * So this copy of the event can be destroyed by the caller.</span></div>
    <div class="line"><span class="lineno"></span> <span class="comment">
        */</span></div>
    <div class="line"><span class="comment"><br>
      </span></div>
    <div class="line"><span class="comment">This is the condition for
        skipping the default handling:</span></div>
    <div class="line"><br>
      <span class="comment"><span class="keywordflow">if</span> (<a
          class="code"
href="https://docs.freeswitch.org/switch__utils_8h.html#a890e4243bd6e31e6c68a83832da023a7"
          moz-do-not-send="true">switch_true</a>(<a class="code"
href="https://docs.freeswitch.org/group__events.html#ga5c3108ab2e8d73d8ef8e6c41224059aa"
          moz-do-not-send="true">switch_event_get_header</a>(message_event,
        <span class="stringliteral">"final_delivery"</span>))) {</span></div>
    <div class="line"><span class="comment">    do_skip = 1;<br>
      </span></div>
    <div class="line"><span class="comment">}<br>
      </span> </div>
    <p><br>
    </p>
    <p>so you need the final_delivery event header. Not sure how you add
      that in an XML dialplan, or in your implementation.</p>
    <p>Maybe the python in github can give you some clues.<br>
    </p>
    <p>and no, stop and all that does not work - It only prevents the
      chatplan from execing applications. (IIUC)</p>
    <p><br>
    </p>
    <p>Cheers</p>
    <p>Keith.</p>
    <p><br>
    </p>
    <p><br>
    </p>
  </body>
</html>