Did you load the module?
On Thursday, January 3, 2019 5:27:12 PM EST Andrew Chen wrote:
Hey it's me again.
So I'm following the instructions in the Kamailio 5.1.x wiki module page for websocket configuration and it specifically mention to set this block:
onreply_route[WS_REPLY] {
xlog("L_INFO", "[CSeq $cs] Is in WS_REPLY.");
xlog("L_INFO", "[CSeq $cs] Sending $rs $rr to $sel(via[2].host) via $sel(via[2].transport) len: $ml");
xlog("L_INFO", "[CSeq $cs] \n$mb \n");
if(nat_uac_test("64")) {
# Do NAT traversal stuff for replies to 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.
add_contact_alias();
}
}
When I did this and started up Kamailio, it gave me an error:
Jan 3 22:19:43 sjomainkama55 kamailio: ERROR: <core> [core/cfg.y:3309]: yyparse(): cfg. parser: failed to find command nat_uac_test (params 1)
I moved that if statement to a route block and I was able to start it up.
The wiki page for nathelper module specify this function can be run in onreply_route as well:
5.5. nat_uac_test(flags)
Tries to guess if client's request originated behind a nat. The parameter determines what heuristics is used.
Meaning of the flags is as follows:
All flags can be bitwise combined, the test returns true if any of the tests identified a NAT.
This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, FAILURE_ROUTE, BRANCH_ROUTE.
is this some known bug in 5.1.x?
Thanks
--
Andy Chen
*Confidentiality Notice: The information contained in this e-mail and any
attachments may be confidential. If you are not an intended recipient, you
are hereby notified that any dissemination, distribution or copying of this
e-mail is strictly prohibited. If you have received this e-mail in error,
please notify the sender and permanently delete the e-mail and any
attachments immediately. You should not retain, copy or use this e-mail or
any attachment for any purpose, nor disclose all or any part of the
contents to any other person. Thank you.*