The README of websocket suggests to modify
kamailio.cfg as below
# Handle requests within SIP dialogs
route[WITHINDLG] {
if (has_totag()) {
# sequential request withing a
dialog should
# take the path determined by
record-routing
if (loose_route()) {
if ($du == "") {
if
(!handle_ruri_alias()) {
xlog("L_ERR", "Bad alias <$ru>\n");
sl_send_reply("400", "Bad Request");
exit;
}
}
route(RELAY);
} else {
if ( is_method("ACK") ) {
...
But the original script was
# Handle requests within SIP dialogs
route[WITHINDLG] {
if (!has_totag()) return;
# sequential request withing a dialog should
# take the path determined by record-routing
if (loose_route()) {
route(DLGURI);
if (is_method("BYE")) {
setflag(FLT_ACC); # do
accounting ...
setflag(FLT_ACCFAILED); #
... even if the transaction fails
}
else if ( is_method("ACK") ) {
# ACK is forwarded
statelessy
route(NATMANAGE);
}
else if ( is_method("NOTIFY") ) {
# Add Record-Route for
in-dialog NOTIFY as per RFC 6665.
record_route();
}
route(RELAY);
exit;
}
if (is_method("SUBSCRIBE") && uri ==
myself) {
# in-dialog subscribe requests
route(PRESENCE);
exit;
}
if ( is_method("ACK") ) {
if ( t_check_trans() ) {
# no loose-route, but
stateful ACK;
# must be an ACK after a 487
# or e.g. 404 from upstream
server
route(RELAY);
exit;
} else {
# ACK without matching
transaction ... ignore and discard
exit;
}
}
sl_send_reply("404","Not here");
exit;
}
Now I have to include the websocket README suggested
script in original script. I am not finding logical way
where shall I include websocket part.