OpenSIPS / opensips

OpenSIPS is a GPL implementation of a multi-functionality SIP Server that targets to deliver a high-level technical solution (performance, security and quality) to be used in professional SIP server platforms.
https://opensips.org
Other
1.23k stars 571 forks source link

rtpengine_manage on 2.4 does not work #1410

Closed telematico closed 6 years ago

telematico commented 6 years ago

I'm trying to implement a rtp engine scenario using the function rtpengine_manage and I think is not working as it should

Reading the docs: http://www.opensips.org/html/docs/modules/2.4.x/rtpengine#func_rtpengine_manage

I understand that the arguments are the same for rtpengine_manage and for rtpengine_offer.

If I try to use 3 arguments with rtpengine_manage opensips pass the syntax check (opensips -c) but does not start with the error:

Jun 25 12:33:03 tls3 SIPproxy[3229]: ERROR:core:fixup_spve_null: invalid parameter number 3 Jun 25 12:33:03 tls3 SIPproxy[3229]: ERROR:core:fix_actions: fixing failed (code=-1) at /etc/opensips/opensips.cfg:380 Jun 25 12:33:03 tls3 SIPproxy[3229]: ERROR:core:main: failed to fix configuration with err code -1 Jun 25 12:33:03 tls3 SIPproxy[3229]: NOTICE:event_datagram:destroy: destroy module ...

my config line is:

rtpengine_manage("replace-origin replace-session-connection loop-protect to-tag recod-call=no ICE=remove",,"$var(respuesta_audio)");

Using rtpngine_manage only with one argument opensips starts, but it seems that Invite SDP is not modified, so the UAC and UAS don't use rtpengine. Besides it, seems that the rtpengine is not correctly attached to the dialog, I don't see any related info in the dialog:

dialog:: ID=10785447804076 state:: 4 user_flags:: 0 timestart:: 1529925326 datestart:: 2018-06-25 13:15:26 timeout:: 1529946926 dateout:: 2018-06-25 19:15:26 callid:: 46f2e9cf5a8852642f29df0f632fa18b@192.168.78.87:5060 from_uri:: sip:XXXXXXXX@192.168.78.87 to_uri:: sip:YYYYYYYY@192.168.78.30 caller_tag:: as52a692ed caller_contact:: sip:XXXXXXXXX@192.168.78.87:5060 callee_cseq:: 0 caller_route_set:: caller_bind_addr:: udp:ZZZ.ZZZ.ZZZ.ZZZ:5060 caller_sdp:: CALLEES:: callee:: callee_tag:: db04660cdef71f8ei0 callee_contact:: sip:YYYYYYY@ppp.ppp.ppp.ppp:9743 caller_cseq:: 102 callee_route_set:: callee_bind_addr:: udp:xxx.xxx.xxx.xxx:5060 callee_sdp:: context:: values:: accX_table:: acc accX_created:: \xcc\xce0[\x00\x00\x00\x00 accX_flags:: \x0b\x00\x0b\x00\x00\x00\x07\x00 accX_extra:: \t\x00\x0e\x00RRRR-TTTTTTT-CO\x00\x00\b\x00XXXXXXXXX\f\x00192.168.78.30\x01\x000\x04\x00RRRR\x00\x00\x01\x003\x05\x00ivr87 accX_ctx:: (\xc4\xc4\x1b\x1c\x7f\x00\x00 accX_core:: \x06\x00INVITE\n\x00as52a692ed\x12\x00db04660cdef71f8ei02\x0046f2e9cf5a8852642f29df0f632fa18b@192.168.78.87:5060\x03\x00200\x02\x00OK\x10\x00\xce\xce0[\x00\x00\x00\x00V7\x02\x00\x00\x00\x00\x00 vsf:: sip:YYYYYYYY@192.168.78.87 739823:: sip:YYYYYYY@mydomain.com dlginfo_flag:: B dlg_peer:: sip:XXXXXXXX@mydomain.com\r\n dlg_entity:: sip:YYYYYYYY@mydomain.com\r\n profiles:: activecalls:: XXXXXXXX callsOut:: 0

and when opensips recives the "BYE" request do not send the "teardown" order to rtpengine, I think because is not attached to dialog.

Could somebody please take a look to rtpengine_manage function? Maybe I'm doing something wrong but using old protocol with rtpproxy module all seems to work.

thanks and regards,

razvancrainea commented 6 years ago

You are right, there seems to be some issues when passing parameters to the rtpengine_manage() function. I will shortly push a fix for that.

Regarding the rtpengine termination, note that rtpengine_manage() is not equivalent to rtpproxy_engage(). The latter one does engage rtpproxy for the entire call, whereas rtpengine_manage() is only detecting which function (offer, answer, delete) should be called. Therefore, for a proper session, you need to call rtpengine_manage() at least three times: once for INVITE, once for 200 OK and once for BYE.