[Home]

Summary:ASTERISK-28969: res_pjsip: AMI command for show endpoint does not reflect active channels
Reporter:PeppeP (Peppe)Labels:
Date Opened:2020-06-29 08:11:19Date Closed:2020-07-20 12:00:01
Priority:MinorRegression?
Status:Closed/CompleteComponents:Resources/res_pjsip
Versions:16.11.1 17.5.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:naAttachments:
Description:pjsipshowendpoint and pjsipshowendpoint ami commands return always empty activechannels field.
Comments:By: Asterisk Team (asteriskteam) 2020-06-29 08:11:20.606-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].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: Joshua C. Colp (jcolp) 2020-06-29 08:20:49.864-0500

Please attach a log of the AMI interaction showing the AMI action executed, the complete response, as well as the output of "core show channels" and "pjsip show endpoints".

By: PeppeP (Peppe) 2020-06-29 08:42:38.677-0500

query: https://127.0.0.1:8089/amxml?action=pjsipshowendpoints
answer: <ajax-response><response type="object" id="unknown"><generic response="Success" eventlist="start" message="A listing of Endpoints follows, presented as EndpointList events"/></response><response type="object" id="unknown"><generic event="EndpointList" objecttype="endpoint" objectname="106" transport="udp" aor="106" auths="106-iauth" outboundauths="" contacts="106/sip:106@192.168.2.241:5062," devicestate="In use" activechannels=""/></response><response type="object" id="unknown"><generic event="EndpointList" objecttype="endpoint" objectname="102" transport="udp" aor="102" auths="102-iauth" outboundauths="" contacts="102/sip:102@192.168.2.180:40681;transport=udp," devicestate="In use" activechannels=""/></response><response type="object" id="unknown"><generic event="EndpointListComplete" eventlist="Complete" listitems="2"/></response></ajax-response>

core show channels
Channel              Location             State   Application(Data)            
PJSIP/102-00000000   106@first:119        Up      Dial(PJSIP/106,,)            
PJSIP/106-00000001   (None)               Up      AppDial((Outgoing Line))      
2 active channels
1 active call
1 call processed

pjsip show endpoints

Endpoint:  <Endpoint/CID.....................................>  <State.....>  <Channels.>
   I/OAuth:  <AuthId/UserName...........................................................>
       Aor:  <Aor............................................>  <MaxContact>
     Contact:  <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
 Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress..................>
  Identify:  <Identify/Endpoint.........................................................>
       Match:  <criteria.........................>
   Channel:  <ChannelId......................................>  <State.....>  <Time.....>
       Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
==========================================================================================

Endpoint:  102                                                  In use        1 of 100
    InAuth:  102-iauth/102
       Aor:  102                                                1
     Contact:  102/sip:102@192.168.2.180:40681;transport= 5df17455e0 NonQual         nan
 Transport:  udp                       udp      0      0  192.168.2.182:5060
   Channel: PJSIP/102-00000000/Dial                             Up            00:02:57  
       Exten: 106                       CLCID: "" <106>

Endpoint:  106                                                  In use        1 of 100
    InAuth:  106-iauth/106
       Aor:  106                                                1
     Contact:  106/sip:106@192.168.2.241:5062             816c80a7a3 NonQual         nan
 Transport:  udp                       udp      0      0  192.168.2.182:5060
   Channel: PJSIP/106-00000001/AppDial                          Up            00:02:57  
       Exten:                           CLCID: "clarabella" <102>


Objects found: 2


By: PeppeP (Peppe) 2020-06-29 08:46:27.414-0500

maybe the problem is in "res/res_pjsip/pjsip_configuration.c" file
in "active_channels_to_str" function
.... from....
if (endpoint_snapshot) {
return;
}
.............
....to .....
if (!endpoint_snapshot) {
return;
}
........


By: Joshua C. Colp (jcolp) 2020-06-29 08:47:01.607-0500

Oh, you're using the XML HTTP Manager interface. That is seldom used. If you use the normal AMI mechanism on port 5038 does it work as described? It may be an issue relating to the XML HTTP functionality.

By: PeppeP (Peppe) 2020-06-29 08:56:39.589-0500

the behavior is the same:

action:pjsipshowendpoints

Response: Success
EventList: start
Message: A listing of Endpoints follows, presented as EndpointList events

Event: EndpointList
ObjectType: endpoint
ObjectName: 106
Transport: udp
Aor: 106
Auths: 106-iauth
OutboundAuths:
Contacts: 106/sip:106@192.168.2.241:5062,
DeviceState: In use
ActiveChannels:

Event: EndpointList
ObjectType: endpoint
ObjectName: 102
Transport: udp
Aor: 102
Auths: 102-iauth
OutboundAuths:
Contacts: 102/sip:102@192.168.2.180:40681;transport=udp,
DeviceState: In use
ActiveChannels:

Event: EndpointListComplete
EventList: Complete
ListItems: 2


By: Joshua C. Colp (jcolp) 2020-06-29 08:58:18.118-0500

Yes, that does seem to be the issue at first glance. Are you able to provide a patch on Gerrit to resolve the issue?

By: PeppeP (Peppe) 2020-06-29 09:27:50.066-0500

I can try, but I see that this problem is present in all asterisk releases from 16.3 to current relase. I don't check older releases but I suppose is not a regression.
So... one patch for each release... no sounds good.


By: Joshua C. Colp (jcolp) 2020-06-29 09:31:58.046-0500

Previous releases are not fixed. The change goes up to the relevant branch - so 16 and 17 for example. The fix will then appear in the next releases.

By: PeppeP (Peppe) 2020-06-29 11:21:08.995-0500

I'm waiting for "Contributor License Agreement" approvement.

By: Joshua C. Colp (jcolp) 2020-06-30 04:00:28.934-0500

Putting back into feedback until license agreement is accepted. Commenting will automatically place this back into triage.

By: PeppeP (Peppe) 2020-07-03 08:01:32.831-0500

Digium has refused my subscription.
I'll make it right.

By: Asterisk Team (asteriskteam) 2020-07-20 12:00:01.242-0500

Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1].

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