<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 28/04/2021 10.53, [ EXT ] Володимир
Іванець wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAOQgkjbn4G9QrUHrFFDH0WSHHT2ypWxS7VwssivYHwjsfYJZXg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hello!
<div><br>
</div>
<div>I'm testing call recording with Rtpengine. It works fine
when the "record-call=on" flag is added to the <i>rtpengine_offer</i>
or <i>start_recording</i> is used in the <b>request_route</b>.</div>
<div><br>
</div>
<div>But I was wondering if the call recording can be managed by
a separate application. So I add the following lines to the <b>event_route[xhttp:request]</b>
and triggered it with an HTTP request after the call was
established. The call-id value was taken from the Rtpengine
log and sent with the request.</div>
<blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div><i> if ($hu =~ "^/CALL_RECORD_START/") {</i></div>
<div><i> $var(call_id) = </i>"call-id=" + <i>$(hu{s.select,2,/});</i></div>
<div> xlog("L_DBG", "$var(call_id)");<br>
</div>
<div><i> start_recording($var(call_id));</i></div>
<div><i> </i>exit;</div>
<div><i> }</i></div>
</blockquote>
</div>
</blockquote>
<p>If you have to reason to go through Kamailio for this, you can
simply trigger the command from any other external application.
There's a sample script included in the repo that can be used for
this purpose directly (making use of the Perl module that is also
included):
<a class="moz-txt-link-freetext" href="https://github.com/sipwise/rtpengine/blob/master/utils/rtpengine-ng-client">https://github.com/sipwise/rtpengine/blob/master/utils/rtpengine-ng-client</a></p>
<p>There's also a nodejs client that I'm aware of:
<a class="moz-txt-link-freetext" href="https://github.com/davehorton/rtpengine-client">https://github.com/davehorton/rtpengine-client</a></p>
<p>Or you can hand-roll the request and talk to rtpengine via HTTP
or Websocket for example.</p>
<p>Cheers<br>
</p>
</body>
</html>