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:
-
*1* - The “Contact” header field is searched for occurrence of RFC1918 or RFC6598 addresses. -
*2* - the "received" test is used: address in the “Via” header is compared against source IP address of signaling -
*4* - The Top Most “Via” is searched for occurrence of RFC1918 or RFC6598 addresses -
*8* - The SDP is searched for occurrence of RFC1918 or RFC6598 addresses -
*16* - Test if the source port is different from the port in the “Via” header -
*32* - Test if the source IP address of signaling is a RFC1918 or RFC6598 address -
*64* - Test if the source connection of signaling is a WebSocket -
*128* - Test if the “Contact” header URI port differs from the source port of the request (Warning: this is might be legal or even intended combination in non NATted scenarios)
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
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: 1 - The “Contact” header field is searched for occurrence of RFC1918 or RFC6598 addresses. 2 - the "received" test is used: address in the “Via” header is compared against source IP address of signaling 4 - The Top Most “Via” is searched for occurrence of RFC1918 or RFC6598 addresses 8 - The SDP is searched for occurrence of RFC1918 or RFC6598 addresses 16 - Test if the source port is different from the port in the “Via” header 32 - Test if the source IP address of signaling is a RFC1918 or RFC6598 address 64 - Test if the source connection of signaling is a WebSocket 128 - Test if the “Contact” header URI port differs from the source port of the request (Warning: this is might be legal or even intended combination in non NATted scenarios) 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
Yup. The default configuaration already have the nathelper.so loaded. Plus, there are other places in the config where nat_uac_test was called but never error out.
On Thu, Jan 3, 2019 at 5:39 PM Sergey Okhapkin sos@sokhapkin.dyndns.org wrote:
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:
- 1 - The “Contact” header field is searched for occurrence of RFC1918
or RFC6598 addresses.
- 2 - the "received" test is used: address in the “Via” header is
compared against source IP address of signaling
- 4 - The Top Most “Via” is searched for occurrence of RFC1918 or
RFC6598 addresses
- 8 - The SDP is searched for occurrence of RFC1918 or RFC6598
addresses
- 16 - Test if the source port is different from the port in
the “Via” header
- 32 - Test if the source IP address of signaling is a RFC1918 or
RFC6598 address
- 64 - Test if the source connection of signaling is a WebSocket
- 128 - Test if the “Contact” header URI port differs from the source
port of the request (Warning: this is might be legal or even intended combination in non NATted scenarios)
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
achen@ achen@thinkingphones.comfuze.com
*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.*
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Am Freitag, 4. Januar 2019, 01:28:23 CET schrieb Andrew Chen:
Yup. The default configuaration already have the nathelper.so loaded. Plus, there are other places in the config where nat_uac_test was called but never error out.
Hi Andrew,
sounds strange. I would suggest to minimize the configuration step by step to find out the issue. Maybe it is some other error nearby that confuses the cfg parser (just guessing).
Best regards,
Henning
On Thu, Jan 3, 2019 at 5:39 PM Sergey Okhapkin sos@sokhapkin.dyndns.org
wrote:
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:
- 1 - The “Contact” header field is searched for occurrence of RFC1918
or RFC6598 addresses.
- 2 - the "received" test is used: address in the “Via” header is
compared against source IP address of signaling
- 4 - The Top Most “Via” is searched for occurrence of RFC1918 or
RFC6598 addresses
- 8 - The SDP is searched for occurrence of RFC1918 or RFC6598
addresses
- 16 - Test if the source port is different from the port in
the “Via” header
- 32 - Test if the source IP address of signaling is a RFC1918 or
RFC6598 address
- 64 - Test if the source connection of signaling is a WebSocket
- 128 - Test if the “Contact” header URI port differs from the source
port of the request (Warning: this is might be legal or even intended combination in non NATted scenarios)
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
achen@ achen@thinkingphones.comfuze.com
That's what I did. I commented out the whole onreply_route[WS_REPLY] and moved the if statement inside the route block. when I restarted, no errors. This onreply_route block is a direct copy and paste from the wiki page.
On Fri, Jan 4, 2019 at 5:05 PM Henning Westerholt hw@kamailio.org wrote:
Am Freitag, 4. Januar 2019, 01:28:23 CET schrieb Andrew Chen:
Yup. The default configuaration already have the nathelper.so loaded. Plus, there are other places in the config where nat_uac_test was called but never error out.
Hi Andrew,
sounds strange. I would suggest to minimize the configuration step by step to find out the issue. Maybe it is some other error nearby that confuses the cfg parser (just guessing).
Best regards,
Henning
On Thu, Jan 3, 2019 at 5:39 PM Sergey Okhapkin <sos@sokhapkin.dyndns.org
wrote:
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:
- 1 - The “Contact” header field is searched for occurrence of
RFC1918
or RFC6598 addresses.
- 2 - the "received" test is used: address in the “Via” header is
compared against source IP address of signaling
- 4 - The Top Most “Via” is searched for occurrence of RFC1918 or
RFC6598 addresses
- 8 - The SDP is searched for occurrence of RFC1918 or RFC6598
addresses
- 16 - Test if the source port is different from the port in
the “Via” header
- 32 - Test if the source IP address of signaling is a RFC1918 or
RFC6598 address
- 64 - Test if the source connection of signaling is a WebSocket
- 128 - Test if the “Contact” header URI port differs from the
source
port of the request (Warning: this is might be legal or even
intended
combination in non NATted scenarios)
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
achen@ achen@thinkingphones.comfuze.com
-- Henning Westerholt - https://skalatan.de/blog/ Kamailio services - https://skalatan.de/services Kamailio security assessment - https://skalatan.de/de/assessment
Hello,
nat_uac_test(...) is allowed in the reply route block. The error is not about using the function in an invalid route block, but that the function is not found by name and 1 parameter.
Were there other error messages before the one you pasted in your message?
Cheers, Daniel
On 04.01.19 01:28, Andrew Chen wrote:
Yup. The default configuaration already have the nathelper.so loaded. Plus, there are other places in the config where nat_uac_test was called but never error out.
On Thu, Jan 3, 2019 at 5:39 PM Sergey Okhapkin <sos@sokhapkin.dyndns.org mailto:sos@sokhapkin.dyndns.org> wrote:
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: * 1 - The “Contact” header field is searched for occurrence of RFC1918 or RFC6598 addresses. * 2 - the "received" test is used: address in the “Via” header is compared against source IP address of signaling * 4 - The Top Most “Via” is searched for occurrence of RFC1918 or RFC6598 addresses * 8 - The SDP is searched for occurrence of RFC1918 or RFC6598 addresses * 16 - Test if the source port is different from the port in the “Via” header * 32 - Test if the source IP address of signaling is a RFC1918 or RFC6598 address * 64 - Test if the source connection of signaling is a WebSocket * 128 - Test if the “Contact” header URI port differs from the source port of the request (Warning: this is might be legal or even intended combination in non NATted scenarios) 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 achen@ <mailto:achen@thinkingphones.com>fuze.com <http://fuze.com> *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.* _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Andy Chen Sr. Telephony Lead Engineer 415 516 5535 (M) achen@ mailto:achen@thinkingphones.comfuze.com http://fuze.com
*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.*
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hi Daniel,
Here is all of it:
Jan 3 18:33:01 sjomainkama55 systemd[1]: Stopped Kamailio (OpenSER) - the Open Source SIP Server. Jan 3 18:33:01 sjomainkama55 systemd[1]: Starting Kamailio (OpenSER) - the Open Source SIP Server... Jan 3 18:33:01 sjomainkama55 kamailio: ERROR: <core> [core/cfg.y:3309]: yyparse(): cfg. parser: failed to find command nat_uac_test (params 1) Jan 3 18:33:01 sjomainkama55 kamailio: CRITICAL: <core> [core/cfg.y:3449]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 1093, column 28: unknown command, missing loadmodule? Jan 3 18:33:01 sjomainkama55 kamailio: ERROR: <core> [core/cfg.y:3309]: yyparse(): cfg. parser: failed to find command add_contact_alias (params 0) Jan 3 18:33:01 sjomainkama55 kamailio: CRITICAL: <core> [core/cfg.y:3449]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 1098, column 35: unknown command, missing loadmodule? Jan 3 18:33:01 sjomainkama55 kamailio[12334]: ERROR: bad config file (2 errors)
I just realized it missed the add_contact_alias as well. This is the config in the Websocket module page which I copy and pasted:
onreply_route[WS_REPLY] { 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(); } }
On Mon, Jan 7, 2019 at 3:42 AM Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
nat_uac_test(...) is allowed in the reply route block. The error is not about using the function in an invalid route block, but that the function is not found by name and 1 parameter.
Were there other error messages before the one you pasted in your message?
Cheers, Daniel On 04.01.19 01:28, Andrew Chen wrote:
Yup. The default configuaration already have the nathelper.so loaded. Plus, there are other places in the config where nat_uac_test was called but never error out.
On Thu, Jan 3, 2019 at 5:39 PM Sergey Okhapkin sos@sokhapkin.dyndns.org wrote:
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:
- 1 - The “Contact” header field is searched for occurrence of
RFC1918 or RFC6598 addresses.
- 2 - the "received" test is used: address in the “Via” header is
compared against source IP address of signaling
- 4 - The Top Most “Via” is searched for occurrence of RFC1918 or
RFC6598 addresses
- 8 - The SDP is searched for occurrence of RFC1918 or RFC6598
addresses
- 16 - Test if the source port is different from the port in
the “Via” header
- 32 - Test if the source IP address of signaling is a RFC1918 or
RFC6598 address
- 64 - Test if the source connection of signaling is a WebSocket
- 128 - Test if the “Contact” header URI port differs from the source
port of the request (Warning: this is might be legal or even intended combination in non NATted scenarios)
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
achen@ achen@thinkingphones.comfuze.com
*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.*
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Andy Chen Sr. Telephony Lead Engineer 415 516 5535 (M) achen@ achen@thinkingphones.comfuze.com
*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.*
Kamailio (SER) - Users Mailing Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio World Conference - May 6-8, 2019 -- www.kamailioworld.com Kamailio Advanced Training - Mar 4-6, 2019 in Berlin; Mar 25-27, 2019, in Washington, DC, USA -- www.asipto.com
Hello,
there seems to be something wrong in your config with loading the nathelper module, can you check if you have proper #!ifdef ... #!endif blocks?
Try to run it with debug=3 and see if you can spot more hints via the DEBUG messages printed in the logs...
Cheers, Daniel
On 07.01.19 14:44, Andrew Chen wrote:
Hi Daniel,
Here is all of it:
Jan 3 18:33:01 sjomainkama55 systemd[1]: Stopped Kamailio (OpenSER) - the Open Source SIP Server. Jan 3 18:33:01 sjomainkama55 systemd[1]: Starting Kamailio (OpenSER)
- the Open Source SIP Server...
Jan 3 18:33:01 sjomainkama55 kamailio: ERROR: <core> [core/cfg.y:3309]: yyparse(): cfg. parser: failed to find command nat_uac_test (params 1) Jan 3 18:33:01 sjomainkama55 kamailio: CRITICAL: <core> [core/cfg.y:3449]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 1093, column 28: unknown command, missing loadmodule? Jan 3 18:33:01 sjomainkama55 kamailio: ERROR: <core> [core/cfg.y:3309]: yyparse(): cfg. parser: failed to find command add_contact_alias (params 0) Jan 3 18:33:01 sjomainkama55 kamailio: CRITICAL: <core> [core/cfg.y:3449]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 1098, column 35: unknown command, missing loadmodule? Jan 3 18:33:01 sjomainkama55 kamailio[12334]: ERROR: bad config file (2 errors)
I just realized it missed the add_contact_alias as well. This is the config in the Websocket module page which I copy and pasted: onreply_route[WS_REPLY] { 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(); } }
On Mon, Jan 7, 2019 at 3:42 AM Daniel-Constantin Mierla <miconda@gmail.com mailto:miconda@gmail.com> wrote:
Hello, nat_uac_test(...) is allowed in the reply route block. The error is not about using the function in an invalid route block, but that the function is not found by name and 1 parameter. Were there other error messages before the one you pasted in your message? Cheers, Daniel On 04.01.19 01:28, Andrew Chen wrote:
Yup. The default configuaration already have the nathelper.so loaded. Plus, there are other places in the config where nat_uac_test was called but never error out. On Thu, Jan 3, 2019 at 5:39 PM Sergey Okhapkin <sos@sokhapkin.dyndns.org <mailto:sos@sokhapkin.dyndns.org>> wrote: 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: * 1 - The “Contact” header field is searched for occurrence of RFC1918 or RFC6598 addresses. * 2 - the "received" test is used: address in the “Via” header is compared against source IP address of signaling * 4 - The Top Most “Via” is searched for occurrence of RFC1918 or RFC6598 addresses * 8 - The SDP is searched for occurrence of RFC1918 or RFC6598 addresses * 16 - Test if the source port is different from the port in the “Via” header * 32 - Test if the source IP address of signaling is a RFC1918 or RFC6598 address * 64 - Test if the source connection of signaling is a WebSocket * 128 - Test if the “Contact” header URI port differs from the source port of the request (Warning: this is might be legal or even intended combination in non NATted scenarios) 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 achen@ <mailto:achen@thinkingphones.com>fuze.com <http://fuze.com> *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.* _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users -- Andy Chen Sr. Telephony Lead Engineer 415 516 5535 (M) achen@ <mailto:achen@thinkingphones.com>fuze.com <http://fuze.com> *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.* _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla -- www.asipto.com <http://www.asipto.com> www.twitter.com/miconda <http://www.twitter.com/miconda> -- www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda> Kamailio World Conference - May 6-8, 2019 -- www.kamailioworld.com <http://www.kamailioworld.com> Kamailio Advanced Training - Mar 4-6, 2019 in Berlin; Mar 25-27, 2019, in Washington, DC, USA -- www.asipto.com <http://www.asipto.com>
-- Andy Chen Sr. Telephony Lead Engineer 415 516 5535 (M) achen@ mailto:achen@thinkingphones.comfuze.com http://fuze.com
*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.*
Ah you are right. I did somehow not define WITH_NAT for some reason. thanks!
On Mon, Jan 7, 2019 at 9:06 AM Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
there seems to be something wrong in your config with loading the nathelper module, can you check if you have proper #!ifdef ... #!endif blocks?
Try to run it with debug=3 and see if you can spot more hints via the DEBUG messages printed in the logs...
Cheers, Daniel On 07.01.19 14:44, Andrew Chen wrote:
Hi Daniel,
Here is all of it:
Jan 3 18:33:01 sjomainkama55 systemd[1]: Stopped Kamailio (OpenSER) - the Open Source SIP Server. Jan 3 18:33:01 sjomainkama55 systemd[1]: Starting Kamailio (OpenSER) - the Open Source SIP Server... Jan 3 18:33:01 sjomainkama55 kamailio: ERROR: <core> [core/cfg.y:3309]: yyparse(): cfg. parser: failed to find command nat_uac_test (params 1) Jan 3 18:33:01 sjomainkama55 kamailio: CRITICAL: <core> [core/cfg.y:3449]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 1093, column 28: unknown command, missing loadmodule? Jan 3 18:33:01 sjomainkama55 kamailio: ERROR: <core> [core/cfg.y:3309]: yyparse(): cfg. parser: failed to find command add_contact_alias (params 0) Jan 3 18:33:01 sjomainkama55 kamailio: CRITICAL: <core> [core/cfg.y:3449]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 1098, column 35: unknown command, missing loadmodule? Jan 3 18:33:01 sjomainkama55 kamailio[12334]: ERROR: bad config file (2 errors)
I just realized it missed the add_contact_alias as well. This is the config in the Websocket module page which I copy and pasted:
onreply_route[WS_REPLY] { 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(); } }
On Mon, Jan 7, 2019 at 3:42 AM Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
nat_uac_test(...) is allowed in the reply route block. The error is not about using the function in an invalid route block, but that the function is not found by name and 1 parameter.
Were there other error messages before the one you pasted in your message?
Cheers, Daniel On 04.01.19 01:28, Andrew Chen wrote:
Yup. The default configuaration already have the nathelper.so loaded. Plus, there are other places in the config where nat_uac_test was called but never error out.
On Thu, Jan 3, 2019 at 5:39 PM Sergey Okhapkin sos@sokhapkin.dyndns.org wrote:
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:
- 1 - The “Contact” header field is searched for occurrence of
RFC1918 or RFC6598 addresses.
- 2 - the "received" test is used: address in the “Via” header is
compared against source IP address of signaling
- 4 - The Top Most “Via” is searched for occurrence of RFC1918 or
RFC6598 addresses
- 8 - The SDP is searched for occurrence of RFC1918 or RFC6598
addresses
- 16 - Test if the source port is different from the port in
the “Via” header
- 32 - Test if the source IP address of signaling is a RFC1918 or
RFC6598 address
- 64 - Test if the source connection of signaling is a WebSocket
- 128 - Test if the “Contact” header URI port differs from the
source port of the request (Warning: this is might be legal or even intended combination in non NATted scenarios)
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
achen@ achen@thinkingphones.comfuze.com
*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.*
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Andy Chen Sr. Telephony Lead Engineer 415 516 5535 (M) achen@ achen@thinkingphones.comfuze.com
*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.*
Kamailio (SER) - Users Mailing Listsr-users@lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio World Conference - May 6-8, 2019 -- www.kamailioworld.com Kamailio Advanced Training - Mar 4-6, 2019 in Berlin; Mar 25-27, 2019, in Washington, DC, USA -- www.asipto.com
-- Andy Chen Sr. Telephony Lead Engineer 415 516 5535 (M) achen@ achen@thinkingphones.comfuze.com
*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.*
-- Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio World Conference - May 6-8, 2019 -- www.kamailioworld.com Kamailio Advanced Training - Mar 4-6, 2019 in Berlin; Mar 25-27, 2019, in Washington, DC, USA -- www.asipto.com
Welcome, good it was figured out!
Daniel
On 07.01.19 15:18, Andrew Chen wrote:
Ah you are right. I did somehow not define WITH_NAT for some reason. thanks!
On Mon, Jan 7, 2019 at 9:06 AM Daniel-Constantin Mierla <miconda@gmail.com mailto:miconda@gmail.com> wrote:
Hello, there seems to be something wrong in your config with loading the nathelper module, can you check if you have proper #!ifdef ... #!endif blocks? Try to run it with debug=3 and see if you can spot more hints via the DEBUG messages printed in the logs... Cheers, Daniel On 07.01.19 14:44, Andrew Chen wrote:
Hi Daniel, Here is all of it: Jan 3 18:33:01 sjomainkama55 systemd[1]: Stopped Kamailio (OpenSER) - the Open Source SIP Server. Jan 3 18:33:01 sjomainkama55 systemd[1]: Starting Kamailio (OpenSER) - the Open Source SIP Server... Jan 3 18:33:01 sjomainkama55 kamailio: ERROR: <core> [core/cfg.y:3309]: yyparse(): cfg. parser: failed to find command nat_uac_test (params 1) Jan 3 18:33:01 sjomainkama55 kamailio: CRITICAL: <core> [core/cfg.y:3449]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 1093, column 28: unknown command, missing loadmodule? Jan 3 18:33:01 sjomainkama55 kamailio: ERROR: <core> [core/cfg.y:3309]: yyparse(): cfg. parser: failed to find command add_contact_alias (params 0) Jan 3 18:33:01 sjomainkama55 kamailio: CRITICAL: <core> [core/cfg.y:3449]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 1098, column 35: unknown command, missing loadmodule? Jan 3 18:33:01 sjomainkama55 kamailio[12334]: ERROR: bad config file (2 errors) I just realized it missed the add_contact_alias as well. This is the config in the Websocket module page which I copy and pasted: onreply_route[WS_REPLY] { 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(); } } On Mon, Jan 7, 2019 at 3:42 AM Daniel-Constantin Mierla <miconda@gmail.com <mailto:miconda@gmail.com>> wrote: Hello, nat_uac_test(...) is allowed in the reply route block. The error is not about using the function in an invalid route block, but that the function is not found by name and 1 parameter. Were there other error messages before the one you pasted in your message? Cheers, Daniel On 04.01.19 01:28, Andrew Chen wrote:
Yup. The default configuaration already have the nathelper.so loaded. Plus, there are other places in the config where nat_uac_test was called but never error out. On Thu, Jan 3, 2019 at 5:39 PM Sergey Okhapkin <sos@sokhapkin.dyndns.org <mailto:sos@sokhapkin.dyndns.org>> wrote: 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: * 1 - The “Contact” header field is searched for occurrence of RFC1918 or RFC6598 addresses. * 2 - the "received" test is used: address in the “Via” header is compared against source IP address of signaling * 4 - The Top Most “Via” is searched for occurrence of RFC1918 or RFC6598 addresses * 8 - The SDP is searched for occurrence of RFC1918 or RFC6598 addresses * 16 - Test if the source port is different from the port in the “Via” header * 32 - Test if the source IP address of signaling is a RFC1918 or RFC6598 address * 64 - Test if the source connection of signaling is a WebSocket * 128 - Test if the “Contact” header URI port differs from the source port of the request (Warning: this is might be legal or even intended combination in non NATted scenarios) 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 achen@ <mailto:achen@thinkingphones.com>fuze.com <http://fuze.com> *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.* _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users -- Andy Chen Sr. Telephony Lead Engineer 415 516 5535 (M) achen@ <mailto:achen@thinkingphones.com>fuze.com <http://fuze.com> *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.* _______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org <mailto:sr-users@lists.kamailio.org> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla -- www.asipto.com <http://www.asipto.com> www.twitter.com/miconda <http://www.twitter.com/miconda> -- www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda> Kamailio World Conference - May 6-8, 2019 -- www.kamailioworld.com <http://www.kamailioworld.com> Kamailio Advanced Training - Mar 4-6, 2019 in Berlin; Mar 25-27, 2019, in Washington, DC, USA -- www.asipto.com <http://www.asipto.com> -- Andy Chen Sr. Telephony Lead Engineer 415 516 5535 (M) achen@ <mailto:achen@thinkingphones.com>fuze.com <http://fuze.com> *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.*
-- Daniel-Constantin Mierla -- www.asipto.com <http://www.asipto.com> www.twitter.com/miconda <http://www.twitter.com/miconda> -- www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda> Kamailio World Conference - May 6-8, 2019 -- www.kamailioworld.com <http://www.kamailioworld.com> Kamailio Advanced Training - Mar 4-6, 2019 in Berlin; Mar 25-27, 2019, in Washington, DC, USA -- www.asipto.com <http://www.asipto.com>
-- Andy Chen Sr. Telephony Lead Engineer 415 516 5535 (M) achen@ mailto:achen@thinkingphones.comfuze.com http://fuze.com
*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.*