<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">Hello again,</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">answering to myself, the solution is
      not really intuitive - instead of using <code>rtpengine_answer()</code>
      directly, one has to use <code>rtpengine_offer()</code> with a <code>force-answer</code> flag.
      Doing so makes the <code>rtpengine</code> module set the <code>command</code> value
      to <code>answer</code> when sending the request via the control
      interface:</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix"><code>rtpengine_offer("force-answer
        to-tag=$sig_local_totag", , $var(new_sdp_answer),
        $var(orig_sdp_answer));</code></div>
    <div class="moz-cite-prefix"><code>append_to_reply("Contact:
        $var(contact)\r\n");<br>
        append_to_reply("Content-Type: application/sdp\r\n");<br>
        t_reply_with_body(200,"OK",$var(</code><code>new_sdp_answer</code><code>));<br>
        exit;</code></div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Pavel</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Dne 08.03.2026 v 14:01 Pavel Sindelka
      napsal(a):<br>
    </div>
    <blockquote type="cite"
      cite="mid:e671830b-85d5-4bb5-b2bc-cbd9bdf07e2e@gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <p>Hello,</p>
      <p><a class="moz-txt-link-freetext"
href="https://opensips.org/docs/modules/3.6.x/rtpengine.html#func_rtpengine_answer"
          moz-do-not-send="true">https://opensips.org/docs/modules/3.6.x/rtpengine.html#func_rtpengine_answer</a>
        doesn't mention any restrictions on use of this function, but in
        reality opensips does not send anything to rtpengine if <code>rtpengine_answer()</code> is
        called on a request route handling the INVITE. Nothing in the
        log, no UDP exchange on the rtpengine control port, regardless
        whether <code>rtpengine_offer()</code> is called earlier on that
        route or not. If it is, the information exchange with rtpengine
        related to <code>rtpengine_offer()</code> can be seen both in
        the log and on the rtpengine control port.</p>
      <p>The intended overall workflow is to call <code>rtpengine_offer()</code>,
        handle the mangled SDP offer internally and generate the SDP
        answer, and get it "mangled back" using <code>rtpengine_answer()</code>
        before using it as the body of a locally generated 200 response
        to the INVITE. Could it be that as of now, <code>rtpengine_manage()</code>
        not only "combines the functionality ... based on message type
        and method ..." but the three individual methods have actually
        become just aliases of <code>rtpengine_manage()</code> for
        backward compatibility? Or is the actual execution of <code>rtpengine_answer()</code> suppressed
        thanks to some undocumented plausibility check?</p>
      <p>Is there any way to enforce execution of <code>rtpengine_answer()</code>
        on a request route handling the INVITE?</p>
      <p>Thank you for advice.</p>
      <p>Pavel</p>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>