[Home]

Summary:ASTERISK-26678: chan_sip: AMI Events - PeerStatus does not show time parameter
Reporter:Diego Souza (diego.souza)Labels:
Date Opened:2016-12-27 05:50:42.000-0600Date Closed:
Priority:MinorRegression?
Status:Open/NewComponents:Channels/chan_sip/General
Versions:13.5.0 Frequency of
Occurrence
Frequent
Related
Issues:
Environment:CentOS release 6.8, jansson 2.9Attachments:
Description:When connecting to the manager, the PeerStatus event does not show the paramenter time.

I am connecting to the asterisk manager interface and receiving events. But in a particular event, of my interest, peerStatus (ManagerEvent_PeerStatus - Asterisk Documentation), I wait for the Time argument as described in the Asterisk 13 Documentation, however this argument doesn't come from the event. Looking at the Asterisk code to try to understand the reason, I verified there was an error using the json module in stasis_endpoints file. I made changes and the Time argument was in the PeerStatus event as expected.

The Time field will come only when the status is "Reachable" or "Lagged", and if the sip has the attribute "qualify" equal to "yes". But it's not happening. In channels/chan_sip.c, in handle_response_peerpoke function, on line 23902, pingtime is an integer and in main/stasis_endpoints.c, in the *peerstatus_to_ami function, on line 155 the expected result to the Time value in json is a string, but in fact it's coming as an integer. So the Time value will be always null and it won't come out in the event.
Comments:By: Asterisk Team (asteriskteam) 2016-12-27 05:50:43.693-0600

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) 2017-01-03 06:29:22.986-0600

Can you be more detailed and provide the event itself you are seeing and what you expect to see?

By: Diego Souza (diego.souza) 2017-01-03 10:29:01.025-0600

I am connecting to the asterisk manager interface and receiving events. But in a particular event, of my interest, peerStatus (ManagerEvent_PeerStatus - Asterisk Documentation), I wait for the Time argument  as described in the Asterisk 13 Documentation, however this argument doesn't come from the event. Looking at the Asterisk code to try to understand the reason, I verified  there was an error using the json module in stasis_endpoints file. I made changes and the Time argument was in the PeerStatus event as expected. If necessary, I create a patch so you can analyze it better.

By: Joshua C. Colp (jcolp) 2017-01-04 09:32:27.762-0600

The patch or just more information (with example) would be helpful. As it is the Time field will only go out if the state is of a select few. The documentation should be updated to reflect this.

By: Diego Souza (diego.souza) 2017-01-05 06:12:54.506-0600

The Time field will come only when the status is "Reachable" or "Lagged", and if the sip has the attribute "qualify" equal to "yes". But it's not happening. In channels/chan_sip.c, in handle_response_peerpoke function, on line 23902, pingtime is an integer and in main/stasis_endpoints.c, in the *peerstatus_to_ami function, on line 155 the expected result to the Time value in json is a string, but in fact it's coming as an integer. So the Time value will be always null and it won't come out in the event.

By: Rusty Newton (rnewton) 2017-01-05 21:29:17.508-0600

Thanks for the additional information and the report. I'm opening this issue up.

Note that chan_sip is under extended support in the latest Asterisk versions, so the fastest way to issue resolution is to submit a patch or rally an interested community developer to tackle the issue. The core supported SIP channel driver is now res_pjsip/chan_pjsip, while chan_sip was moved to extended support in Asterisk 12.

https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States
https://wiki.asterisk.org/wiki/display/AST/Gerrit+Usage