Hi,
you need to put different config for webrtc -> sip and from sip -> webrtc
e.g.
```
if ($proto =~ "ws") { # web --> SIP
$xavp(r=>$T_branch_idx) = $xavp(r=>$T_branch_idx) + " rtcp-mux=demux
DTLS=off ICE=remove RTP/AVPF";
} else { # SIP --> web
$xavp(r=>$T_branch_idx) = $xavp(r=>$T_branch_idx) + " rtcp-mux-offer
generate-mid DTLS-reverse SDES-off ICE=force RTP/SAVPF";
}
```
Regards
Rajneesh
On Fri, Sep 19, 2025 at 12:52 AM Yuriy G via sr-users <
[email protected]> wrote:
> You have to deal with rtp profiles:
>
>
> *> RTP/AVP, RTP/SAVP, UDP/TLS/RTP/SAVP, RTP/AVPF, RTP/SAVPF,
> UDP/TLS/RTP/SAVPF*
> Take a look closer to documentation:
> https://kamailio.org/docs/modules/6.0.x/modules/rtpengine.html#rtpengine.f.rtpengine_offer
>
> чт, 18 сент. 2025 г. в 20:35, Fernando Lopes via sr-users <
> [email protected]>:
>
>> Hello everyone,
>>
>> I'm currently trying to make WebRTC-to-SIP calls. My setup is: WebRTC →
>> WSS → Kamailio → UDP → Asterisk, using rtpengine. I have a route named
>> GET_ICE that is called in onreply_route.
>> Everything else works: SIP-to-SIP calls and WebRTC messaging are fine.
>> Only WebRTC-to-SIP calls have audio issues. I've tested many different ICE
>> flags, but without success. In my testing I think I've managed to get audio
>> to kamailio but not to webrtc, but decided to rollback to start to get help.
>>
>> In my PJSIP configuration, I allow these codecs:
>> allow=g722,ulaw,vp9,vp8,h264
>>
>> My Kamailio code:
>> route[GET_ICE] {
>> if ( $proto == "wss" ) {
>> if (is_ip_rfc1918("$si")) {
>> $dlg_var(ice) = " ";
>> } else {
>> $dlg_var(ice) = " ICE=remove RTP ";
>>
>> }
>> } else {
>> $dlg_var(ice) = "ICE=FORCE";
>> }
>> }
>>
>> route[BUILD_RTPENGINE_PARAMETER] {
>> route(SET_RTP_DIRECTION); # returns $dlg_var(rtp_direction)
>> if ( is_method("INVITE") ) {
>> route(GET_ICE); # returns $dlg_var(ice)
>> }
>>
>> xlog("L_WARN", "[BUILD_RTPENGINE_PARAMETER] >
>> $dlg_var(rtp_direction)\n");
>> $var(rtp_param) = "replace-origin replace-session-connection " +
>> $dlg_var(ice) + " " + $dlg_var(rtp_direction);
>> xlog("L_WARN", "[RTPENGINE]: Method $rm status $rs protocol:
>> $dlg_var(call_type) -> $dlg_var(rtp_direction) -> [$dlg_var(ice)]\n");
>> xlog("L_WARN", "[RTPENGINE]: Param: [$var(rtp_param)]\n");
>> rtpengine_manage($var(rtp_param));
>> }
>>
>> My logs:
>>
>> 3(47) WARNING: <script>: [REPLY] 1xx or 2xx received
>> 3(47) WARNING: <script>: [SET_RTP_DIRECTION] -> reply from internal =
>> direction=internal direction=external
>> 3(47) WARNING: <script>: [BUILD_RTPENGINE_PARAMETER] >
>> direction=internal direction=external
>> 3(47) WARNING: <script>: [RTPENGINE]: Method INVITE status 200 protocol:
>> <null> -> direction=internal direction=external -> []
>> 3(47) WARNING: <script>: [RTPENGINE]: Param: [replace-origin
>> replace-session-connection direction=internal direction=external]
>> [1758217893.108564] INFO: [ID="m7e648isjm9n96ti62k9"]: [control] Received
>> command 'answer' from 10.5.0.8:42938
>> [1758217893.108583] INFO: [ID="m7e648isjm9n96ti62k9"]: [core]
>> replace-session-connection flag encountered, but not supported anymore.
>> [1758217893.108998] WARNING: [ID="m7e648isjm9n96ti62k9"
>> tag="f03487ad-0be2-49d5-9452-289c407db828" index="1"]: [core] ICE restart
>> detected, but reset not allowed at this point
>> [1758217893.109379] INFO: [ID="m7e648isjm9n96ti62k9"]: [control] Replying
>> to 'answer' from 10.5.0.8:42938 (elapsed time 0.000804 sec)
>> [1758217893.109411] INFO: [ID="m7e648isjm9n96ti62k9"
>> tag="f03487ad-0be2-49d5-9452-289c407db828" index="1" port="14656"]: [ice]
>> ICE negotiated: peer for component 1 is 10.5.0.2:28384
>> [1758217893.109418] INFO: [ID="m7e648isjm9n96ti62k9"
>> tag="f03487ad-0be2-49d5-9452-289c407db828" index="1" port="14656"]: [ice]
>> ICE negotiated: local interface 10.5.0.8
>>
>> [1758217893.208990] INFO: [ID="m7e648isjm9n96ti62k9"
>> tag="f03487ad-0be2-49d5-9452-289c407db828" index="1" port="14656"]: [ice]
>> ICE negotiated: peer for component 1 is 10.5.0.2:28384
>> [1758217893.209036] INFO: [ID="m7e648isjm9n96ti62k9"
>> tag="f03487ad-0be2-49d5-9452-289c407db828" index="1" port="14656"]: [ice]
>> ICE negotiated: local interface 10.5.0.8
>> [1758217894.111112] INFO: [ID="m7e648isjm9n96ti62k9"
>> tag="f03487ad-0be2-49d5-9452-289c407db828" index="1" port="14656"]:
>> [crypto] DTLS: Peer certificate accepted
>> [1758217894.112292] INFO: [ID="m7e648isjm9n96ti62k9"
>> tag="f03487ad-0be2-49d5-9452-289c407db828" index="1" port="14656"]:
>> [crypto] DTLS-SRTP successfully negotiated using AES_CM_128_HMAC_SHA1_80
>> [1758217894.112341] INFO: [ID="m7e648isjm9n96ti62k9"
>> tag="f03487ad-0be2-49d5-9452-289c407db828" index="1" port="14656"]:
>> [crypto] DTLS-SRTP successfully negotiated using AES_CM_128_HMAC_SHA1_80
>> [1758217896.299109] INFO: [ID="m7e648isjm9n96ti62k9"
>> tag="f03487ad-0be2-49d5-9452-289c407db828" index="1" port="14656"]: [core]
>> Confirmed peer address as 10.5.0.2:28384
>> [1758217896.299174] ERR: [ID="m7e648isjm9n96ti62k9"
>> tag="f03487ad-0be2-49d5-9452-289c407db828" index="1" port="14656"]: [srtp]
>> SRTP output wanted, but no crypto suite was negotiated
>> [1758217901.298677] ERR: [ID="m7e648isjm9n96ti62k9"
>> tag="f03487ad-0be2-49d5-9452-289c407db828" index="1" port="14656"]: [rtcp]
>> SRTCP output wanted, but no crypto suite was negotiated
>>
>> [1758217930.743494] INFO: [ID="483961fa065a4df9b5f76059c8a1a3e3"]: [core]
>> Closing call due to timeout
>> [1758217930.743636] INFO: [ID="483961fa065a4df9b5f76059c8a1a3e3"]: [core]
>> Final packet stats:
>> [1758217930.743651] INFO: [ID="483961fa065a4df9b5f76059c8a1a3e3"]: [core]
>> --- Tag '2bad2cacef0945b1a506a198aeb4ae01', created 1:00 ago for branch ''
>> [1758217930.743659] INFO: [ID="483961fa065a4df9b5f76059c8a1a3e3"]: [core]
>> ------ Media #1 (audio over RTP/AVP) using unknown codec
>> [1758217930.743670] INFO: [ID="483961fa065a4df9b5f76059c8a1a3e3"]: [core]
>> --------- Port 10.5.0.8:15028 <> 172.31.208.1:4000 , SSRC 0,
>> in 0 p, 0 b, 0 e, 60 ts, out 0 p, 0 b, 0 e
>> [1758217930.743677] INFO: [ID="483961fa065a4df9b5f76059c8a1a3e3"]: [core]
>> --------- Port 10.5.0.8:15029 <> 172.31.208.1:4001 (RTCP),
>> SSRC 0, in 0 p, 0 b, 0 e, 60 ts, out 0 p, 0 b, 0 e
>> [1758217930.743683] INFO: [ID="483961fa065a4df9b5f76059c8a1a3e3"]: [core]
>> --- Tag '88cf8c49-cdfc-475e-8075-a3ce0a36ecca', created 1:00 ago for branch
>> ''
>> [1758217930.743687] INFO: [ID="483961fa065a4df9b5f76059c8a1a3e3"]: [core]
>> ------ Media #1 (audio over RTP/AVP) using unknown codec
>> [1758217930.743693] INFO: [ID="483961fa065a4df9b5f76059c8a1a3e3"]: [core]
>> --------- Port 10.5.0.8:17956 <> 10.5.0.2:64570, SSRC 0,
>> in 0 p, 0 b, 0 e, 60 ts, out 0 p, 0 b, 0 e
>> [1758217930.743699] INFO: [ID="483961fa065a4df9b5f76059c8a1a3e3"]: [core]
>> --------- Port 10.5.0.8:17957 <> 10.5.0.2:64571 (RTCP),
>> SSRC 0, in 0 p, 0 b, 0 e, 60 ts, out 0 p, 0 b, 0 e
>>
>> Thank you.
>> __________________________________________________________
>> Kamailio - Users Mailing List - Non Commercial Discussions --
>> [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!
>>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions --
> [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!
>
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions --
[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!