[OpenSIPS-Users] Opensips 1.6 as a Proxy and Presence Server

maatohewetbi trance_maniak at o2.pl
Tue Jan 3 08:00:15 EST 2017


It doesn't work. If I call number B, it rings, and BLF LED is blinking, but
after picking up the phone, call is without audio and LED is still blinking
event I disconnect call. Then If I try to call again, call freezes like if
it's routing in loop, and B side doesn't ring at all. I heve to restart
Opensips. Here is my config:

.................
Modules, general config
..................


# -------------------------  request routing logic -------------------
route{
    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;
    };

    if (nat_uac_test("3")) {
	if (is_method("REGISTER") || !is_present_hf("Record-Route")) {
	    log("LOG:Someone trying to register from private IP, rewriting\n");
	    fix_nated_contact();
	    if ( is_method("INVITE") ) {
		fix_nated_sdp("1");
	    	    };
	    force_rport();
	    setbflag(6);
	    setbflag(8);
	};
    };

    if (loose_route()) {
	append_hf("P-hint: rr-enforced\r\n"); 
	
	    if(src_ip == 'YYY.YYY.YYY.YYY'){
	    route(1);
	    }else{
	    route(2);
	    }
	
	exit;
    };

    if (!is_method("REGISTER"))
	record_route();

    if (!uri==myself) {
	append_hf("P-hint: outbound\r\n"); 
	
	if(src_ip == 'YYY.YYY.YYY.YYY'){
	route(1);
	}else{
	route(2);
	}
	
	exit;
    };

    if (uri==myself) {

	if (is_method("REGISTER")) {
	    if (!www_authorize("", "subscriber")) {
		www_challenge("", "0");
		return;
	    };
	    save("location");
	    exit;
	};

	lookup("aliases");
	if (!uri==myself) {
	    append_hf("P-hint: outbound alias\r\n"); 
	    
	    if(src_ip == 'YYY.YYY.YYY.YYY'){
	    route(1);
	    }else{
	    route(2);
	    }	
	    
	    exit;
	};
	alias_db_lookup("dbaliases","d");
	if (!lookup("location")) {
	    route(2);
	    exit;
	};
    };

	
	if (is_method("INVITE")) {
	    create_dialog();
	    dialoginfo_set();
    }
	if (is_method("PUBLISH|SUBSCRIBE")) {
	route(handle_presence);
	exit;
    }

	

    append_hf("P-hint: usrloc applied\r\n"); 
    if(src_ip == 'YYY.YYY.YYY.YYY'){
    route(1);
    }else{
    route(2);
    }
    
    
}

	
route[handle_presence]
{
    if(!t_newtran()){
	sl_reply_error();
	exit;
    }

    if (is_method("PUBLISH")) {
	handle_publish();
    } else

    if (is_method("SUBSCRIBE")) {
	handle_subscribe();
    }

    exit;
}

	

route[1] 
{
    if (uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" &&
!search("^Route:")){
	sl_send_reply("479", "We don't forward to private IP addresses");
	exit;
    };

    if (isbflagset(6)) {
	force_rtp_proxy();
    };

    t_on_reply("1");

    if (!t_relay()) {
	sl_reply_error();
    };
}

route[2] {
    force_rtp_proxy();
    rewritehostport ("YYY.YYY.YYY.YYY:xx");
    t_relay();
}

onreply_route[1] {
    if (isbflagset(6) && status =~ "(183)|2[0-9][0-9]") {
	fix_nated_contact();
	force_rtp_proxy();
    } else if (nat_uac_test("1")) {
	fix_nated_contact();
    };
}




--
View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Opensips-1-6-as-a-Proxy-and-Presence-Server-tp7605411p7605416.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.



More information about the Users mailing list