Kamailio Deployment in AWS

Guilherme via sr-users <[email protected]>
Newsgroups gmane.comp.voip.ser
Message-ID <[email protected]>
Hi community,

I'm not sure if anyone has ever tried that before, but I'm trying to run Kamailio in AWS with RTPengine. I successfully installed both Kamailio and RTPengine on my EC2 instance and I'm able to make my devices register to it. However, when I make a call from one of my devices, the call is muted. As I analyze my kamailio.cfg file, I see that the "route[NATMANAGE]" is likely the cause of the mute call.

I think that none of the conditions below are met, therefore, the flags are not set. Because of that, the last condition is met, thus triggering the "return" and exiting from the route[NATMANAGE] prematurely without even reaching the section where I define the RTPengine modifications. Not only that, but if I remove/comment out the "return", then the RTPengine is triggered, but there call doesn't connect. I wonder why this is happening and if there's any known workaround.

# RTP relaying management and signaling updates for NAT traversal
route[NATMANAGE] {
xlog("L_INFO", "NATMANAGE path was followed\n");
#!ifdef WITH_NAT
    xlog("L_INFO", "WITH_NAT Triggered\n");
    if (is_request())
    {
    	xlog("L_INFO", "is_request path was followed\n");
        if (has_totag())
    	{
    		xlog("L_INFO", "has_totag path was followed\n");
            if (check_route_param("nat=yes"))
    		{
                		xlog("L_INFO", "nat=yes param detected, setting FLB_NATB\n");
                		setbflag(FLB_NATB);
            		}
        	}
    
    	if (nat_uac_test("3"))
    	{
    		xlog("L_INFO", "nat_uac_test(3) matched, setting FLT_NATS + FLB_NATB\n");
    		setflag(FLT_NATS);
           		setbflag(FLB_NATB);
        	}
    	}

if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))
    {
        	xlog("L_INFO", "No NAT flags set, skipping NAT handling\n");
    	return;
    }

#!ifdef WITH_RTPENGINE
xlog("L_INFO", "WITH_RTPENGINE Path followed\n");
if (has_body("application/sdp"))
{       
    if (is_method("INVITE"))
    {
        	xlog("L_INFO", "IS_METHOD_INVITE Path Followed\n");
        	rtpengine_manage("replace-origin replace-session-connection trust-address direction=internal");
        } 
    else if (is_reply())
    {
        	xlog("L_INFO", "IS_Reply Path Followed\n");
        	rtpengine_manage("replace-origin replace-session-connection trust-address direction=internal");
        }
}
#!else
    if(nat_uac_test("8")) {
    	rtpproxy_manage("co");
    } else {
    	rtpproxy_manage("cor");
    }
#!endif

if (is_request()) {
    	if (!has_totag()) {
    		if(t_is_branch_route()) {
    			add_rr_param(";nat=yes");
    		}
    	}
    }
    if (is_reply()) {
    	if(isbflagset(FLB_NATB)) {
    		if(is_first_hop())
    			set_contact_alias();
    	}
    }

if(isbflagset(FLB_NATB)) {
    	# no connect message in a dialog involving NAT traversal
    	if (is_request()) {
    		if(has_totag()) {
    			set_forward_no_connect();
    		}
    	}
    }
#!endif
    return;
}
__________________________________________________________
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!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.