[Home]

Summary:ASTERISK-28061: Creating new realtime pjsip endpoint not updating state
Reporter:Remi Quezada (remiq)Labels:pjsip
Date Opened:2018-09-19 09:18:06Date Closed:2018-09-19 10:51:53
Priority:MajorRegression?Yes
Status:Closed/CompleteComponents:Resources/res_pjsip
Versions:13.24.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:( 0) db_entires.txt
( 1) debug_log_28061
( 2) extconfig.conf
( 3) pjsip_endpoint_state.txt
( 4) sorcery.conf
Description:When I create a new realtime pjsip endpoint the state is not updating upon registering.  The work around to fix this is to reload res_pjsip.so module or restart asterisk.  

The attached logs show the endpoint registers but when you do a pjsip show endpoint the state is listed as Unavailable.  Once I do a reload res_pjsip.so you can see that endpoint immediately is reachable and when I do a pjsip show endpoint you now see the state as Not in use.  
Comments:By: Asterisk Team (asteriskteam) 2018-09-19 09:18:07.851-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Joshua C. Colp (jcolp) 2018-09-19 09:28:57.435-0500

Thank you for taking the time to report this bug and helping to make Asterisk better. Unfortunately, we cannot work on this bug because your description did not include enough information. Please read over the Asterisk Issue Guidelines [1] which discusses the information necessary for your issue to be resolved and the format that information needs to be in. We would be grateful if you would then provide a more complete description of the problem. At a minimum, we need:

1. The specific steps or actions you took that caused you to encounter the problem.
2. The behavior you expected and the location of documentation that led you to that expectation.
3. The behavior you actually encountered.

To demonstrate the issue in detail, please include Asterisk log files generated per the instructions on the wiki [2]. If applicable, please ensure that protocol-level trace debugging is enabled, e.g., 'sip set debug on' if the issue involves chan_sip, and configuration information such as dialplan and channel configuration.

Thanks!

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines

[2] https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information

The full log also needs to include debug level log messages (debug in logger.conf, and core set debug 9) to show what is going on.

By: Remi Quezada (remiq) 2018-09-19 10:41:14.544-0500

I've attached the debug logs.  In debug_log_28061 log file you will see the endpoint registered at Sep 19 11:24:19.  Registration completed and endpoint state was listed as Unavailable.  At Sep 19 11:25:20 I performed a reload res_pjsip.so.  After a second you can see the 176-eng5 endpoint was reachable:

[Sep 19 11:25:21] VERBOSE[3639] res_pjsip/pjsip_configuration.c: Endpoint 176-eng5 is now Reachable

The state changed to Not in use which should be the correct state.  

I've also attached my pjsip endpoint database entries and realtime configuration files.  

By: Joshua C. Colp (jcolp) 2018-09-19 10:51:53.685-0500

After looking over things your use case is not supported. In order to be performant for most use cases the code had to be optimized and one of the results was that in realtime adding an endpoint has to do a reload. This is because OPTIONS, by its very nature, has to maintain state about things. The previous implementation was CONSTANTLY querying everything to rebuild this and it suffered from HUGE performance problems as a result. This was not scaleable.

If someone would like to work on OPTIONS support which improves it for realtime so it may not be needed with an approach that does NOT cause problems for non-realtime users this is certainly something that would be reviewed.