[HELP] RTPEngine Recording: Metadata Pattern Substitution Not Working

14 views
Skip to first unread message

Nambisdp

unread,
Feb 9, 2026, 3:10:30 AMFeb 9
to Sipwise rtpengine
Hello RTPEngine Team,

I'm having an issue with rtpengine-recording metadata pattern substitution in version 13.5.1.3.

ENVIRONMENT:
- rtpengine-recording version: 13.5.1.3+0~mr13.5.1.3
- OpenSIPS version: 3.x
- Configuration: Recording with custom metadata for filename patterns

ISSUE:
Metadata IS being successfully received by rtpengine-recording from OpenSIPS via the NG protocol, but the output-pattern is not substituting metadata values into the filename.

CONFIGURATION:

rtpengine-recording.conf:
```ini
[rtpengine-recording]
output-pattern = %{custid}%c-%r-%t
output-format = mp3
output-mixed = true
```

OpenSIPS config (rtpengine_offer call):
```opensips
rtpengine_answer("replace-origin replace-session-connection media-address=43.205.96.30 record-call=yes  metadata={callid:$ci,custid:10}");
```

OBSERVED BEHAVIOR:

Metadata is being written to the metafile correctly i tried it in two ways mentioned below:
```
{callid:MzEzZTEx...,custid:10}
```

```
custid-MzEzZTEx...-f9619f19bebcfaaf-mix.mp3
```

Instead of expected:
```
10-MzEzZTEx...-f9619f19bebcfaaf-mix.mp3
```

ERROR MESSAGE FROM LOGS:
```
Feb 09 12:54:03 ip-10-0-4-44 rtpengine-recording[32553]: WARNING: [core] Key '{custid}' used in file name pattern not present in metadata
```

This indicates rtpengine-recording is looking for a metadata key literally named `{custid}` (with braces) instead of `custid` (without braces).

WHAT WORKS:
✅ Basic pattern substitution: %c, %r, %t all work correctly
✅ Metadata transmission from OpenSIPS to rtpengine-recording (confirmed in logs)
✅ Metafile creation with metadata content

WHAT DOESN'T WORK:
❌ Metadata key substitution: %{custid} is not being replaced with the value "10"

QUESTIONS:

1. What is the correct syntax for accessing metadata keys in the output-pattern?
   - Is it `%{key}`, `%(key)`, `${key}`, or something else?

2. Does the metadata key naming matter? Should it be:
   - `metadata=custid:10` or
   - `metadata={custid:10}` (with braces as part of the key)?

3. Is there specific documentation for the output-pattern metadata substitution syntax?

4. Should I be passing metadata differently in the NG protocol from OpenSIPS?

TESTED PATTERNS:
- `output-pattern = %{custid}%c-%r-%t` → Error: Key '{custid}' not found
- `output-pattern = custid-%c-%r-%t` → File: `custid-MzEzZTEx...-mix.mp3`

I can provide full logs, configuration files, and a test call recording if needed.

Thank you for your help!

Best regards
Nambi

Richard Fuchs

unread,
Feb 9, 2026, 7:03:04 AM (14 days ago) Feb 9
to rtpe...@googlegroups.com
On 09/02/2026 04.10, Nambisdp wrote:
> 1. What is the correct syntax for accessing metadata keys in the
> output-pattern?
>    - Is it `%{key}`, `%(key)`, `${key}`, or something else?
As per the documentation, it's %{key}
> 2. Does the metadata key naming matter? Should it be:
>    - `metadata=custid:10` or
>    - `metadata={custid:10}` (with braces as part of the key)?

Of course it matters, and as per the documentation, the format is
key1:val1|key2:val2

There are no braces here, and the separator is the pipe character, not a
comma.

> 3. Is there specific documentation for the output-pattern metadata
> substitution syntax?

You can find it under "output pattern" here:
https://rtpengine.readthedocs.io/en/latest/rtpengine-recording.html

And under "metadata" here:
https://rtpengine.readthedocs.io/en/latest/ng_control_protocol.html

> 4. Should I be passing metadata differently in the NG protocol from
> OpenSIPS?

Probably not, but you can confirm in the debug log that it's been
correctly received from OpenSIPS.

Cheers

Reply all
Reply to author
Forward
0 new messages