thomasderooij2 created an issue (kamailio/kamailio#4564)

### Description

Hi all,
I have been working on a SIPREC implementation recently.
Currently developing against 6.1.0~pre0+bpo12.20260120024225.107 from the 
nightly Debian builds.
The documentation and example for rtpengine_subscribe_request seems rather 
straightforward, but I’m having some trouble and think this could be a bug.
When calling
rtpengine_subscribe_request("all siprec", "$avp(siprec_offer)", 
"$avp(siprec_to_tag)", "”);
the function does not return. Nothing afterwards is logged and the script 
execution does not continue.
The debug logging does mention the returned sendonly SDP, but nothing after 
that.
Same thing happens when setting the stream_xavp to some new xavp.
When following the source code, I’m failing to see how the function can get 
stuck or cause the script execution to stop entirely.

When setting stream_xavp to $null, the populating of the xavp should not happen 
according to the source code (contrary to what the docs say).
However, I’m seeing an error (can't get Via branch/extra ID) and the function 
returns -1 before sending any subscribe request to the rtpengine node.

### Troubleshooting

#### Reproduction
When calling `rtpengine_subscribe_request("all siprec", "$avp(siprec_offer)", 
"$avp(siprec_to_tag)", "”);` from the onreply_route the function does not 
return to executing the rest of the script.

When calling `rtpengine_subscribe_request("all siprec", "$avp(siprec_offer)", 
"$avp(siprec_to_tag)", $null);`  from the onreply_route the function gives an 
error:
`can't get Via branch/extra ID`
before sending out the subscribe request to the rtpengine 
(https://github.com/kamailio/kamailio/blob/master/src/modules/rtpengine/rtpengine.c#L3781C13-L3781C42)

#### Debugging Data
n/a

#### Log Messages

```
/usr/sbin/kamailio[1490207]: DEBUG: 
[B2B.504.1282309.1768998376.1835511209:INVITE:200] :: rtpengine 
[rtpengine.c:3561]: parse_flags(): Setting flag all
/usr/sbin/kamailio[1490207]: DEBUG: 
[B2B.504.1282309.1768998376.1835511209:INVITE:200] :: rtpengine 
[rtpengine.c:3561]: parse_flags(): Setting flag siprec
/usr/sbin/kamailio[1490207]: DEBUG: 
[B2B.504.1282309.1768998376.1835511209:INVITE:200] :: rtpengine 
[rtpengine.c:2805]: build_rtpp_socks(): same rtpengines list version: 1 
(1768998308)
/usr/sbin/kamailio[1490207]: DEBUG: 
[B2B.504.1282309.1768998376.1835511209:INVITE:200] :: rtpengine 
[rtpengine.c:4626]: select_rtpp_node_old(): rtpengine hash table lookup find 
node=udp:10.1.1.1:2000 for calllen=37 
callid=B2B.504.1282309.1768998376.1835511209 viabranch=
/usr/sbin/kamailio[1490207]: DEBUG: 
[B2B.504.1282309.1768998376.1835511209:INVITE:200] :: rtpengine 
[rtpengine.c:3850]: rtpp_function_call(): proxy reply: 
d3:sdp483:[sdp]]10:tag-mediasld3:tag13:tDmN36XyKUrFm6:mediasld5:indexi1e4:type5:audio5:label1:04:mode8:sendrecveeed3:tag37:418d850d2adaf92686a86bceaadc8689-bdcc6:mediasld5:indexi1e4:type5:audio5:label1:14:mode8:sendrecveeee12:media-labelsd1:0d3:tag13:tDmN36XyKUrFm5:indexi1e4:type5:audio4:mode8:sendrecve1:1d3:tag37:418d850d2adaf92686a86bceaadc8689-bdcc5:indexi1e4:type5:audio4:mode8:sendrecvee9:from-tagsl13:tDmN36XyKUrFm37:418d850d2adaf92686a86bceaadc8689-bdcce6:to-tag64:5eda3b3f52919128e5ab08fbfdb687576b4fb97ad18a46b15c1032dd76ba40006:result2:oke
/usr/sbin/kamailio[1490207]: DEBUG: 
[B2B.504.1282309.1768998376.1835511209:INVITE:200] :: <core> 
[core/pvapi.c:412]: pv_cache_lookup(): pvar [$avp(siprec_offer)] found in cache
/usr/sbin/kamailio[1490207]: DEBUG: 
[B2B.504.1282309.1768998376.1835511209:INVITE:200] :: rtpengine 
[rtpengine.c:5466]: rtpengine_subscribe_request_wrap(): Set sdp 
$avp(siprec_offer) AVP to [sdp]
/usr/sbin/kamailio[1490207]: DEBUG: 
[B2B.504.1282309.1768998376.1835511209:INVITE:200] :: <core> 
[core/pvapi.c:412]: pv_cache_lookup(): pvar [$avp(siprec_to_tag)] found in cache
/usr/sbin/kamailio[1490207]: DEBUG: 
[B2B.504.1282309.1768998376.1835511209:INVITE:200] :: rtpengine 
[rtpengine.c:5483]: rtpengine_subscribe_request_wrap(): Set to_tag 
$avp(siprec_to_tag) AVP to 
5eda3b3f52919128e5ab08fbfdb687576b4fb97ad18a46b15c1032dd76ba4000
/usr/sbin/kamailio[1490207]: DEBUG: 
[B2B.504.1282309.1768998376.1835511209:INVITE:200] :: rtpengine 
[rtpengine.c:7029]: rtpengine_copy_streams_to_xavp(): stream_xavp is not set, 
nothing to do
/usr/sbin/kamailio[1490207]: DEBUG: 
[B2B.504.1282309.1768998376.1835511209:INVITE:200] :: tm [t_reply.c:1387]: 
t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=200
/usr/sbin/kamailio[1490207]: DEBUG: 
[B2B.504.1282309.1768998376.1835511209:INVITE:200] :: tm [t_reply.c:1653]: 
t_should_relay_response(): rps completed - uas status: 0
/usr/sbin/kamailio[1490207]: DEBUG: 
[B2B.504.1282309.1768998376.1835511209:INVITE:200] :: tm [t_reply.c:1965]: 
relay_reply(): reply status=4 branch=0, save=0, relay=0 icode=0 msg status=200
/usr/sbin/kamailio[1490207]: DEBUG: 
[B2B.504.1282309.1768998376.1835511209:INVITE:200] :: tm [h_table.c:537]: 
tm_xdata_swap(): copy X/AVPs from msg context to txdata
/usr/sbin/kamailio[1490207]: DEBUG: 
[B2B.504.1282309.1768998376.1835511209:INVITE:200] :: tm [t_hooks.c:235]: 
run_trans_callbacks_internal(): DBG: trans=0x7f56577f39f0, callback type 32, id 
0 entered
.. continues finishing processing the reply, however script execution should 
continue ..
```

#### SIP Traffic
n/a

### Possible Solutions
Still looking for one.

### Additional Information
```
version: kamailio 6.1.0-pre0 (x86_64/Linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, 
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, 
F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, DBG_QM_MALLOC, DBG_F_MALLOC, 
DBG_TLSF_MALLOC, USE_FUTEX, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, 
USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, 
BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll.
id: unknown
compiled with gcc 12.2.0
```

* **Operating System**:

```
Linux 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) 
x86_64 GNU/Linux
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4564
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/issues/[email protected]>
_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to