Hi all, Another attempt,
After doing some tests, I saw that one of the problems was that was
necessary to comment the following lines within the deffinition of the
RELAY route:
# enable additional event routes for forwarded requests
# - serial forking, RTP relaying handling, a.s.o.
#if (is_method(INVITE|BYE|SUBSCRIBE|UPDATE)) {
#if(!t_is_set(branch_route)) t_on_branch(MANAGE_BRANCH);
#}
At this time, all the features of my old configuration are working
fine, and I can make good calls beetween standard SIP UA's and JSSIP UA's,
originationg the call from both sides. I'm Using Cisco SPA3000 GW, and
Twinkle and SJ Phone softphones.
But now, problems are still present with calls between JS SIP UA's.
When the B side accepts the calls, Kamailio sends OK to A side, but
Offering RTP/AVP instead of RTP/SAVFP, and the call is been rejected
because of BAD Media Description.
Can anybody help me with this issue, please?. Here you are a snippet of my
config, wich is based in the standard one, mixed with the example of Carlos
Ruiz Diaz:
### Routing Logic
# Main SIP request routing logic
# - processing of any incoming SIP request starts with this route
# - note: this is the same as route { ... }
request_route {
#!ifdef WITH_WEBSOCKETS
if ((($Rp == MY_WS_PORT || $Rp == MY_WSS_PORT)
!(proto == WS || proto == WSS)) || $Rp == MY_MSRP_PORT) {
xlog(L_WARN, SIP request received on $Rp\n);
sl_send_reply(403, Forbidden);
exit;
}
#!endif
# per request initial checks
route(REQINIT);
#!ifdef WITH_WEBSOCKETS
if (nat_uac_test(64)) {
# Do NAT traversal stuff for requests from a WebSocket
# connection - even if it is not behind a NAT!
# This won't be needed in the future if Kamailio and the
# WebSocket client support Outbound and Path.
force_rport();
if (is_method(REGISTER)) {
fix_nated_register();
} else {
if (!add_contact_alias()) {
xlog(L_ERR, Error aliasing contact $ct\n);
sl_send_reply(400, Bad Request);
exit;
}
}
}
#!endif
# NAT detection
route(NATDETECT);
# CANCEL processing
if (is_method(CANCEL))
{
if (t_check_trans()) {
route(RELAY);
}
exit;
}
# handle requests within SIP dialogs
route(WITHINDLG);
### only initial requests (no To tag)
t_check_trans();
# authentication
route(AUTH);
# record routing for dialog forming requests (in case they are routed)
# - remove preloaded route headers
remove_hf(Route);
if (is_method(INVITE|SUBSCRIBE))
record_route();
# account only INVITEs
if (is_method(INVITE))
{
setflag(FLT_ACC); # do accounting
#!ifdef WITH_CPL
if(!cpl_run_script(incoming,is_stateful))
{
# script execution failed
t_reply(500,CPL script execution failed);
};
#!endif
}
# dispatch requests to foreign domains
route(SIPOUT);
### requests for my local domains
# handle presence related requests
route(PRESENCE);
# handle registrations
route(REGISTRAR);
if ($rU==$null)
{
# request with no Username in RURI
sl_send_reply(484,Address Incomplete);
exit;
}
#if (!is_method(INVITE)) {
#route(RELAY);
#exit;
#}
if (!is_method(INVITE)) {
route(RELAY);
exit;
}
# user location service
route(LOCATION);
}
#!ifdef WITH_WEBRTCGW
route[SETUP_BY_TRANSPORT] {
if ($ru =~ transport=ws) {
xlog(L_INFO, Request going to WS);
rtpproxy_manage(froc+SP);
t_on_reply(REPLY_FROM_WS);
}
else if ($proto =~ ws) {
xlog(L_INFO, Request coming from WS);
rtpproxy_manage(froc-sp);
t_on_reply(REPLY_TO_WS);
}
else {
xlog(L_INFO, This is a classic phone call);
rtpproxy_manage(co);
t_on_reply(MANAGE_CLASSIC_REPLY);
}
}
#!endif
route[RELAY] {
#!ifdef WITH_WEBRTCGW
route(SETUP_BY_TRANSPORT);
#!endif
# enable additional event routes for forwarded requests
# - serial forking, RTP relaying handling, a.s.o.
#if (is_method(INVITE|BYE|SUBSCRIBE|UPDATE)) {
#if(!t_is_set(branch_route)) t_on_branch(MANAGE_BRANCH);
#}
if (is_method(INVITE|SUBSCRIBE|UPDATE)) {
if(!t_is_set(onreply_route)) t_on_reply(MANAGE_REPLY);
}
if (is_method(INVITE)) {
if(!t_is_set(failure_route)) t_on_failure(MANAGE_FAILURE);
}
if (!t_relay()) {
sl_reply_error();
}
exit;
}
# Per SIP request initial checks
route[REQINIT] {
#!ifdef WITH_ANTIFLOOD
# flood dection from same IP and traffic ban for a while
# be sure you exclude checking trusted peers, such as pstn gateways
# - local host excluded (e.g., loop to self)
if(src_ip!=myself)
{
if($sht(ipban=$si)!=$null)
{
# ip is already blocked
xdbg(request from blocked IP - $rm from $fu