[OpenSIPS-Users] Need help Nathelper + rtpproxy
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Tue Dec 29 15:42:10 CET 2009
Hi Ha,
You need to call unforce_rtp_proxy() when BYE is received.
Regards,
Bogdan
ha do wrote:
> Hi all
>
> i set up rtpproxy run in same machine with opensips
>
> my network topology:
> ip phone1 (192.168.1.6)
> --------(192.168.1.248)opensips(172.26.0.2)-------(172.26.0.100)ip phone 2
>
> media :
> ip phone1 (192.168.1.6)
> --------(192.168.1.248)rtpproxy(172.26.0.2)-------(172.26.0.100)ip phone 2
>
> i start rtpproxy :
> rtpproxy -l 172.26.0.2/192.168.1.248 -f -F -s udp:127.0.0.1:22222 -d
> DBUG:LOG_LOCAL7
>
> the IP Phone 2 call IP Phone 1 and i did successfull on signaling + media
> when i disconnect the call i didnt see the command tear down the media
> session on rtpproxy
>
> it is normal or i mis-config the opensips.cfg, please help
>
>
> Thank you
> Ha
>
> here is my opensips.cfg:
> # ----------- global configuration parameters ------------------------
> debug=9 # debug level (cmd line: -dddddddddd)
> fork=yes
> log_facility=LOG_LOCAL7
> log_stderror=no # (cmd line: -E)
> children=4
> port=5060
>
> # ------------------ module loading ----------------------------------
> #set module path
> mpath="/usr/local/lib/opensips/modules/"
> loadmodule "db_mysql.so"
> loadmodule "signaling.so"
> loadmodule "sl.so"
> loadmodule "tm.so"
> loadmodule "rr.so"
> loadmodule "maxfwd.so"
> loadmodule "usrloc.so"
> loadmodule "registrar.so"
> loadmodule "textops.so"
> loadmodule "mi_fifo.so"
> loadmodule "uri.so"
> loadmodule "xlog.so"
> loadmodule "nathelper.so"
> #loadmodule "snmpstats.so"
>
> # ----------------- setting module-specific parameters ---------------
> # -- mi_fifo params --
> modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")
> # -- usrloc params --
> #modparam("usrloc", "db_mode", 0)
> # Uncomment this if you want to use SQL database
> # for persistent storage and comment the previous line
> modparam("usrloc", "db_url",
> "mysql://opensips:opensipsrw@localhost/opensips")
> modparam("usrloc", "db_mode", 2)
>
> # -- rr params --
> # add value to ;lr param to make some broken UAs happy
> modparam("rr", "enable_full_lr", 1)
> modparam("nathelper", "rtpproxy_sock", "udp:127.0.0.1:22222")
> modparam("nathelper", "nortpproxy_str", "")
> # ------------------------- request routing logic -------------------
>
> # main routing logic
> route{
> # initial sanity checks -- messages with
> # max_forwards==0, or excessively long requests
> if (!mf_process_maxfwd_header("10")) {
> sl_send_reply("483","Too Many Hops");
> exit;
> };
>
> if (msg:len >= 2048 ) {
> sl_send_reply("513", "Message too big");
> exit;
> };
>
> # we record-route all messages -- to make sure that
> # subsequent messages will go through our proxy; that's
> # particularly good if upstream and downstream entities
> # use different transport protocol
> if (!method=="REGISTER")
> record_route();
> # subsequent messages withing a dialog should take the
> # path determined by record-routing
> if (loose_route()) {
> # mark routing logic in request
> append_hf("P-hint: rr-enforced\r\n");
> route(1);
> };
>
> if (!uri==myself) {
> # mark routing logic in request
> append_hf("P-hint: outbound\r\n");
> route(1);
> };
>
> # if the request is for other domain use UsrLoc
> # (in case, it does not work, use the following command
> # with proper names and addresses in it)
> if (uri==myself) {
> if (method=="REGISTER") {
> save("location");
> exit;
> };
> }
> # native SIP destinations are handled using our USRLOC DB
> if(method=="INVITE"){
> if (dst_ip == 192.168.1.248)
> force_rtp_proxy("oei");
> if (dst_ip == 172.26.0.2)
> force_rtp_proxy("oie");
> t_on_reply("1");
> };
> if (is_method("BYE"))
> unforce_rtp_proxy();
>
> if (!lookup("location","m")) {
> switch ($retcode) {
> case -1:
> case -3:
> t_newtran();
> t_on_failure("1");
> t_reply("404", "Not Found");
> exit;
> case -2:
> sl_send_reply("405", "Method Not Allowed");
> exit;
> }
> }
> route(1);
> }
> route[1] {
> # send it out now; use stateful forwarding as it works
> # reliably even for UDP2TCP
> failure_route[1];
> if (!t_relay()) {
> sl_reply_error();
> };
> exit;
> }
> onreply_route[1]{
> if (status=="200"){
> if(dst_ip == 172.26.0.2)
> force_rtp_proxy("oie");
> if(dst_ip == 192.168.1.248)
> force_rtp_proxy("oei");
> }
> }
>
> failure_route[1]{
> unforce_rtp_proxy();
> }
>
>
>
> when i make call and check on rtpproxy debug and see the rtpproxy debug :
>
> DBUG:handle_command: received command "18781_4
> UIEc0,18,4,97,9,2,15,8,101 09d614a45c92f2b0 at 172.26.0.100 172.26.0.100
> 2908 824bcd8bb5ba14fa;1"
> INFO:handle_command: new session 09d614a45c92f2b0 at 172.26.0.100, tag
> 824bcd8bb5ba14fa;1 requested, type strong
> INFO:handle_command: new session on a port 48190 created, tag
> 824bcd8bb5ba14fa;1
> INFO:handle_command: pre-filling caller's address with 172.26.0.100:2908
> DBUG:doreply: sending reply "18781_4 48190 192.168.1.248
> "
> DBUG:handle_command: received command "18780_4 LEIc0,101
> 09d614a45c92f2b0 at 172.26.0.100 192.168.1.6 17206 824bcd8bb5ba14fa;1
> 49ee0e488eccead5;1"
> INFO:handle_command: lookup on ports 48190/42508, session timer restarted
> INFO:handle_command: pre-filling callee's address with 192.168.1.6:17206
> DBUG:doreply: sending reply "18780_4 42508 172.26.0.2
> "
> INFO:process_rtp: session timeout
> INFO:remove_session: RTP stats: 238 in from callee, 323 in from
> caller, 561 relayed, 0 dropped
> INFO:remove_session: RTCP stats: 1 in from callee, 0 in from caller, 1
> relayed, 0 dropped
> INFO:remove_session: session on ports 48190/42508 is cleaned up
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
--
Bogdan-Andrei Iancu
www.voice-system.ro
More information about the Users
mailing list