error_route not triggering

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

error_route not triggering

Ben Newlin

Hi,

 

I recently noticed some parsing errors in our logs and after digging further I’ve realized that our error route is not triggering when this occurs. Is there some sort of subscribe or attach operation needed to get calls to the error route? The documentation states it will be called automatically. I’ve been able to reproduce the issue in our testbed. We are running OpenSIPS 2.4.4.

 

My error route is defined like this:

 

error_route

{

  xlog("L_ALERT", "Error route called!\n");

}

 

This is what I get from OpenSIPS logs:

 

Jan 24 21:59:30 [329] ERROR:core:receive_msg: Unable to parse msg received from [203.0.113.4:48096]

Jan 24 21:59:30 [336] ERROR:core:parse_first_line: bad request first line

Jan 24 21:59:30 [336] ERROR:core:parse_first_line: at line 0 char 17:

Jan 24 21:59:30 [336] ERROR:core:parse_first_line: parsed so far: INVITE sip:bad to

Jan 24 21:59:30 [336] INFO:core:parse_first_line: bad message

Jan 24 21:59:30 [336] ERROR:core:parse_msg: message=<INVITE sip:bad to syntax\r\n@203.0.113.2:5060;transport=UDP;user=phone SIP/2.0

 

My log from the error route is not called.

 

Any help would be appreciated. I’m probably missing something simple.

 

Ben Newlin


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: error_route not triggering

Bogdan-Andrei Iancu-2
Hi Ben,

There is nothing extra for you to do. The error route should be triggered.

You get this error - https://github.com/OpenSIPS/opensips/blob/master/receive.c#L147 and if a request, the error route should be triggered (see line 151).

Try to log in debug level, maybe you will get more relevant data.

Regards,
Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 2019
  https://www.opensips.org/events/Summit-2019Amsterdam/
On 01/25/2019 12:14 AM, Ben Newlin wrote:

Hi,

 

I recently noticed some parsing errors in our logs and after digging further I’ve realized that our error route is not triggering when this occurs. Is there some sort of subscribe or attach operation needed to get calls to the error route? The documentation states it will be called automatically. I’ve been able to reproduce the issue in our testbed. We are running OpenSIPS 2.4.4.

 

My error route is defined like this:

 

error_route

{

  xlog("L_ALERT", "Error route called!\n");

}

 

This is what I get from OpenSIPS logs:

 

Jan 24 21:59:30 [329] ERROR:core:receive_msg: Unable to parse msg received from [203.0.113.4:48096]

Jan 24 21:59:30 [336] ERROR:core:parse_first_line: bad request first line

Jan 24 21:59:30 [336] ERROR:core:parse_first_line: at line 0 char 17:

Jan 24 21:59:30 [336] ERROR:core:parse_first_line: parsed so far: INVITE <a class="moz-txt-link-freetext" href="sip:bad">sip:bad to

Jan 24 21:59:30 [336] <a class="moz-txt-link-freetext" href="INFO:core:parse_first_line">INFO:core:parse_first_line: bad message

Jan 24 21:59:30 [336] ERROR:core:parse_msg: message=<INVITE <a class="moz-txt-link-freetext" href="sip:bad">sip:bad to syntax\r\[hidden email] SIP/2.0

 

My log from the error route is not called.

 

Any help would be appreciated. I’m probably missing something simple.

 

Ben Newlin



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: error_route not triggering

Ben Newlin

Bogdan,

 

I have increased the logging level to 6, but unfortunately there is only one new log line that is not helpful.

 

Feb  8 13:37:53 [333] ERROR:core:parse_first_line: bad request first line

Feb  8 13:37:53 [333] ERROR:core:parse_first_line: at line 0 char 17:

Feb  8 13:37:53 [333] ERROR:core:parse_first_line: parsed so far: INVITE sip:bad to

Feb  8 13:37:53 [333] INFO:core:parse_first_line: bad message

Feb  8 13:37:53 [333] DBG:core:parse_msg: invalid message

Feb  8 13:37:53 [333] ERROR:core:parse_msg: message=<INVITE sip:bad to syntax\r\n@203.0.113.2:5060;transport=UDP;user=phone SIP/2.0

 

Have you been able to successfully trigger an error route in this manner on 2.4.4? Are there any restrictions on where the error route must be defined in the script, e.g. before or after the modules section? I’m just trying to isolate whether it is specific to our implementation and if so, what possible causes exist.

 

Ben Newlin

 

From: Bogdan-Andrei Iancu <[hidden email]>
Date: Monday, February 4, 2019 at 3:55 AM
To: OpenSIPS users mailling list <[hidden email]>, Ben Newlin <[hidden email]>
Subject: Re: [OpenSIPS-Users] error_route not triggering

 

Hi Ben,

There is nothing extra for you to do. The error route should be triggered.

You get this error - https://github.com/OpenSIPS/opensips/blob/master/receive.c#L147 and if a request, the error route should be triggered (see line 151).

Try to log in debug level, maybe you will get more relevant data.

Regards,

Bogdan-Andrei Iancu
 
OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 2019
  https://www.opensips.org/events/Summit-2019Amsterdam/

On 01/25/2019 12:14 AM, Ben Newlin wrote:

Hi,

 

I recently noticed some parsing errors in our logs and after digging further I’ve realized that our error route is not triggering when this occurs. Is there some sort of subscribe or attach operation needed to get calls to the error route? The documentation states it will be called automatically. I’ve been able to reproduce the issue in our testbed. We are running OpenSIPS 2.4.4.

 

My error route is defined like this:

 

error_route

{

  xlog("L_ALERT", "Error route called!\n");

}

 

This is what I get from OpenSIPS logs:

 

Jan 24 21:59:30 [329] ERROR:core:receive_msg: Unable to parse msg received from [203.0.113.4:48096]

Jan 24 21:59:30 [336] ERROR:core:parse_first_line: bad request first line

Jan 24 21:59:30 [336] ERROR:core:parse_first_line: at line 0 char 17:

Jan 24 21:59:30 [336] ERROR:core:parse_first_line: parsed so far: INVITE <a href="sip:bad">sip:bad to

Jan 24 21:59:30 [336] <a href="INFO:core:parse_first_line">INFO:core:parse_first_line: bad message

Jan 24 21:59:30 [336] ERROR:core:parse_msg: message=<INVITE <a href="sip:bad">sip:bad to syntax\r\[hidden email] SIP/2.0

 

My log from the error route is not called.

 

Any help would be appreciated. I’m probably missing something simple.

 

Ben Newlin




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: error_route not triggering

Ben Newlin

Bogdan,

 

Immediately after sending the below message I noticed this comment in the code you linked:

 

/* if a REQUEST msg was detected (first line was successfully parsed)

                  we should trigger the error route */

 

In my test I am creating a malformed first line. What is the reason to not trigger the error_route in this case? Would it be possible to make this configurable (or documented)?

 

I have verified that when the parsing error is elsewhere in the message the error route is being triggered. Thanks for pointing me to that code!

 

Ben Newlin

 

From: Users <[hidden email]> on behalf of Ben Newlin <[hidden email]>
Reply-To: OpenSIPS users mailling list <[hidden email]>
Date: Friday, February 8, 2019 at 8:55 AM
To: Bogdan-Andrei Iancu <[hidden email]>, OpenSIPS users mailling list <[hidden email]>
Subject: Re: [OpenSIPS-Users] error_route not triggering

 

Bogdan,

 

I have increased the logging level to 6, but unfortunately there is only one new log line that is not helpful.

 

Feb  8 13:37:53 [333] ERROR:core:parse_first_line: bad request first line

Feb  8 13:37:53 [333] ERROR:core:parse_first_line: at line 0 char 17:

Feb  8 13:37:53 [333] ERROR:core:parse_first_line: parsed so far: INVITE sip:bad to

Feb  8 13:37:53 [333] INFO:core:parse_first_line: bad message

Feb  8 13:37:53 [333] DBG:core:parse_msg: invalid message

Feb  8 13:37:53 [333] ERROR:core:parse_msg: message=<INVITE sip:bad to syntax\r\n@203.0.113.2:5060;transport=UDP;user=phone SIP/2.0

 

Have you been able to successfully trigger an error route in this manner on 2.4.4? Are there any restrictions on where the error route must be defined in the script, e.g. before or after the modules section? I’m just trying to isolate whether it is specific to our implementation and if so, what possible causes exist.

 

Ben Newlin

 

From: Bogdan-Andrei Iancu <[hidden email]>
Date: Monday, February 4, 2019 at 3:55 AM
To: OpenSIPS users mailling list <[hidden email]>, Ben Newlin <[hidden email]>
Subject: Re: [OpenSIPS-Users] error_route not triggering

 

Hi Ben,

There is nothing extra for you to do. The error route should be triggered.

You get this error - https://github.com/OpenSIPS/opensips/blob/master/receive.c#L147 and if a request, the error route should be triggered (see line 151).

Try to log in debug level, maybe you will get more relevant data.

Regards,


Bogdan-Andrei Iancu
 
OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 2019
  https://www.opensips.org/events/Summit-2019Amsterdam/

On 01/25/2019 12:14 AM, Ben Newlin wrote:

Hi,

 

I recently noticed some parsing errors in our logs and after digging further I’ve realized that our error route is not triggering when this occurs. Is there some sort of subscribe or attach operation needed to get calls to the error route? The documentation states it will be called automatically. I’ve been able to reproduce the issue in our testbed. We are running OpenSIPS 2.4.4.

 

My error route is defined like this:

 

error_route

{

  xlog("L_ALERT", "Error route called!\n");

}

 

This is what I get from OpenSIPS logs:

 

Jan 24 21:59:30 [329] ERROR:core:receive_msg: Unable to parse msg received from [203.0.113.4:48096]

Jan 24 21:59:30 [336] ERROR:core:parse_first_line: bad request first line

Jan 24 21:59:30 [336] ERROR:core:parse_first_line: at line 0 char 17:

Jan 24 21:59:30 [336] ERROR:core:parse_first_line: parsed so far: INVITE <a href="sip:bad">sip:bad to

Jan 24 21:59:30 [336] <a href="INFO:core:parse_first_line">INFO:core:parse_first_line: bad message

Jan 24 21:59:30 [336] ERROR:core:parse_msg: message=<INVITE <a href="sip:bad">sip:bad to syntax\r\[hidden email] SIP/2.0

 

My log from the error route is not called.

 

Any help would be appreciated. I’m probably missing something simple.

 

Ben Newlin





_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users





_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users