Re: [SR-Users] Webrtc: Don't catch 488 between JSSIP and SIP UA's

2014-06-06 Thread LAA
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 

[SR-Users] Webrtc: Don't catch 488 between JSSIP and SIP UA's

2014-06-02 Thread LAA
Apologize. Previous message was too long.
L.


El 02/06/2014 20:25, LAA ornitorrinco7...@gmail.com escribió:

 Hi all,

 Another guy strugling his mind trying to get a configuration to enable
 calls between WebRTC UA (JSSIP) to standard SIP UA (Twinkle or SjPhone)
 I've been working with the examples that were shared by Carlos Ruiz Diaz
 and Peter Dunkley (thanks to both).

 http://www.slideshare.net/crocodilertc/webrtc-websockets
 http://caruizdiaz.com/2014/02/26/webrtc-kamailio/

 Kamailio is not running behind NAT. I'm using rtpproxy-ng module with
 Kamailio 4.1.3, and Rtpengine.

 I share a link with my current configuration, wich is based in Peters
 example, with websocket support from websocket.cfg example.

 -  Calls between SIP standard UA's are working OK. I have some endpoint
 behind nat.
 -  Calls between JSIP UA's are working OK. So, websocket support is
 running.
 -  Calls from JSIP and Twinkle are NOT WORKING OK. sip UA send's back a
 488 response, and Kamailio send it back to JSSIP (Incompatible SDP).
 -  Calls from Twinkle to Jsip are NOT WORKING OK: Kamailio sends an INVITE
 to JSIP, and it returns an error. And Kamailio sends 488 to Twinkle.


 It seems as if Kamailio is not catching 488. I share a snippet of my
 config, and links to tcpdump captures:

 https://www.dropbox.com/s/i7c9ty57oauujc4/fromws0.pcap
 https://www.dropbox.com/s/q3q30pgzvdoswts/kamailio.cfg
 https://www.dropbox.com/s/rqtjwcbgg1foaoq/tows0.pcap

 What am I missing?


 Best regards.

 Luis.








___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users