[OpenSIPS-Users] siprec with rtpproxy

Martin Nyström martin.nystrom at connectel.se
Tue Jan 23 03:15:26 EST 2018


Hi,

I am having issues with siprec and rtpproxy.
Running the latest 2.4 dev version.

The issue I am having is that when an 200 OK is received, the siprec is sending an incorrect SDP block to the recording provider. As a result of this they are unable to process the recording properly.
For an example the SDP element c= is missing completely and the o= element are sending the incorrect IP. I am thinking there is some issue between rtpproxy and opensips that causes this.

I have attached below some relevant configurations, please note that “my.externalip.com” is a pseudo for my external IP. The server only has an interface with an external address.


------------------ /etc/default/rtpproxy -------------------


USER="opensips"
GROUP="opensips"
PIDFILE="/var/run/rtpproxy.pid"
LISTEN_ADDR= my.externalip.com

# The control socket.
CONTROL_SOCK="unix:/var/run/rtpproxy.sock"
# To listen on an UDP socket, uncomment this line:
#CONTROL_SOCK=udp:127.0.0.1:7722

# Additional options that are passed to the daemon.
EXTRA_OPTS="-s udp:127.0.0.1:7722 -l my.externalip.com -d DBUG:LOG_LOCAL0 -u opensips"

DAEMON_OPTS="-s \$CONTROL_SOCK -u \$USER:\$GROUP -p \$PIDFILE \$EXTRA_OPTS"

------------ end ---------------





------------------ /etc/opensips/opensips.cfg -------------------



####### Global Parameters #########

log_level=3
log_stderror=no
log_facility=LOG_LOCAL0
children=4
debug_mode=no

listen=udp:my.externalip.com:5060
advertised_address="my.externalip.com "
advertised_port=5060
auto_aliases=no
alias=udp:my.externalip.com:5060


####### Modules Section ########
mpath="/usr/local//lib64/opensips/modules/"

loadmodule "signaling.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "sipmsgops.so"
loadmodule "mi_fifo.so"
loadmodule "uri.so"
loadmodule "proto_udp.so"
loadmodule "dispatcher.so"
loadmodule "db_mysql.so"
loadmodule "textops.so"

# SIPREC Begin
loadmodule "acc.so"
loadmodule "dialog.so"
loadmodule "b2b_entities.so"
loadmodule "siprec.so"
loadmodule "rtpproxy.so"

modparam("rtpproxy", "rtpproxy_sock", "udp:localhost:7722")

# SIPREC End

modparam("db_mysql", "exec_query_threshold", 60000)
modparam("db_mysql", "timeout_interval", 2)

modparam("dispatcher", "dst_avp", "$avp(dstdst)")
modparam("dispatcher", "attrs_avp", "$avp(dsattrs)")
modparam("dispatcher", "grp_avp", "$avp(dsgrp)")
modparam("dispatcher", "cnt_avp", "$avp(dscnt)")
modparam("dispatcher", "db_url", "mysql://opensips:dbpassword@localhost/opensips")

modparam("tm", "fr_timeout", 5)
modparam("tm", "fr_inv_timeout", 30)
modparam("tm", "restart_fr_on_each_reply", 0)
modparam("tm", "onreply_avp_mode", 1)

modparam("rr", "append_fromtag", 0)

modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")
modparam("mi_fifo", "fifo_mode", 0666)

modparam("uri", "use_uri_table", 0)


####### Routing Logic ########

# main request routing logic

route{

        if (!mf_process_maxfwd_header("10")) {
                sl_send_reply("483","Too Many Hops");
                exit;
        }

        if (has_totag()) {

                # handle hop-by-hop ACK (no routing required)
                if ( is_method("ACK") && t_check_trans() ) {
                        t_relay();
                        exit;
                }

                # sequential request within a dialog should
                # take the path determined by record-routing
                if ( !loose_route() ) {
                        # we do record-routing for all our traffic, so we should not
                        # receive any sequential requests without Route hdr.
                        sl_send_reply("404","Not here");
                        exit;
                }

                if (is_method("BYE")) {
                        # do accounting even if the transaction fails
                }

                # route it out to whatever destination was set by loose_route()
                # in $du (destination URI).
                route(relay);
                exit;
        }

        xlog("L_INFO","==> Incomming request $rm $ru from $si\n");

        # INVITE processing
        if (is_method("INVITE"))
        {

                        xlog("L_INFO", "Outgoing call from $si");
                        if(ds_is_in_list("$si", "$sp"))
                        {
                                xlog("L_INFO", "Dispatcher $si:$sp found, sending to $ru");
                                xlog("L_INFO", "Dispatcher $si:$sp valid, starting siprec");
                                do_accounting("log");
                                create_dialog();
                                rtpproxy_engage();
                                siprec_start_recording("sip:recordingprovider.com:5060");
                                xlog("L_INFO", "Originator: $fu calling destination: $ru");
                                ds_select_dst("1100", "4");
                                record_route();
                                route(relay);
                                exit;
                        }

                        sl_send_reply("403" ,"Forbidden - Dispatcher not found");
                        exit;

                }

                sl_send_reply("403", "Forbidden - Calls from this originator is not allowed");
                exit;

        }

        # OPTION processing
        if (is_method("OPTIONS"))
        {
                xlog("L_INFO", "Replying 200 for method OPTIONS, I am alive");
                sl_send_reply("200" ,"OK");
                exit;
        }

        # CANCEL processing
        if (is_method("CANCEL"))
        {
                if (t_check_trans())
                        t_relay();
                exit;
        }

        t_check_trans();

        # preloaded route checking
        if (loose_route()) {
                xlog("L_ERR",
                "Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]");
                if (!is_method("ACK"))
                        sl_send_reply("403","Preload Route denied");
                exit;
        }

        sl_send_reply("403", "Forbidden");
        exit;
}


route[relay] {

        if (is_method("INVITE")) {
                if(!t_relay()) {
                        # Transaction failed, send stateless reply
                        xlog("L_INFO", "   --> Transaction failed.  Sending error response. \n");
                        sl_reply_error();
                }
                exit;
        }

                if (is_method("OK")) {
                                xlog("L_INFO", "200 OK Ye");
                }

        if (!t_relay()) {
                send_reply("500","Internal Error");
        };
        exit;

}


branch_route[per_branch_ops] {
        xlog("new branch at $ru\n");
}


------------ end -------------



This is the outgoing siprec INVITE SDP block




--OSS-unique-boundary-42.
Content-Type: application/sdp.
.
v=0.
o=- 1516694269 0 IN IP4 0.0.0.0.
s=-.
m=audio 35001 RTP/AVP 0 8 3 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:3 GSM/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=maxptime:150.
a=label:1.
a=sendonly.
m=audio 35002 RTP/AVP 3 0 8 101.
a=rtpmap:3 GSM/8000.
a=rtpmap:0 PCMU/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=ptime:20.
a=label:2.
a=sendonly.
.
--OSS-unique-boundary-42.
Content-Type: application/rs-metadata+xml.
Content-Disposition: recording-session.
.
<?xml version="1.0" encoding="UTF-8"?>.
<recording xmlns='urn:ietf:params:xml:ns:recording:1'>.
.<datamode>complete</datamode>.
.<session session_id="jwRdMT4vTxSflXrv0ivZLg==">.
..<sipSessionID>731e5c203339d5253be6a44048978cc8 at customerpbx.pbx.com</sipSessionID>.
.</session>.
.<participant participant_id="fJEttOQnROa8czaSnrcoHQ==">.
..<nameID aor="sip:jane.miller at customerpbx.pbx.com"/>.
.</participant>.
.<participant participant_id="FsU9x4pNTs+TV3uMG1wH7w==">.
..<nameID aor="sip:john.doe at sip.provider.com"/>.
.</participant>.
.<stream stream_id="0CxCuLF7RG2tB13mlCV2ng==" session_id="jwRdMT4vTxSflXrv0ivZLg==">.
..<label>1</label>.
.</stream>.
.<stream stream_id="HmSit+HiRly7wAH4D8unAg==" session_id="jwRdMT4vTxSflXrv0ivZLg==">.
..<label>2</label>.
.</stream>.
</recording>.
--OSS-unique-boundary-42--.




------------ end -------------



Thank you


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20180123/436ff5cc/attachment-0001.html>


More information about the Users mailing list