[Home]

Summary:ASTERISK-26659: res_pjsip: PJSIP presence - missing braces around the status element in XML
Reporter:Abraham Liebsch (aliebsch)Labels:patch pjsip
Date Opened:2016-12-12 16:18:33.000-0600Date Closed:2017-08-16 06:45:35
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_pjsip_pidf_eyebeam_body_supplement
Versions:13.11.2 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Linux version 2.6.32-504.8.1.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) ) #1 SMP Wed Jan 28 21:11:36 UTC 2015Attachments:( 0) ASTERISK-26659.diff
Description:It appears that the XML for setting presence in Eyebeam/X-Lite per RFC is missing braces around the status element.  The result is that presence is not properly communicated to the client.  Idle properly reads as "Available" but any other status is received as "Offline".

Example of current output from the client log which should set extension 71 presence to "on the phone" but results in it showing as offline:
{code:xml}
NOTIFY sip:335@10.255.4.178:60424;rinstance=8e8e55168a09d83d SIP/2.0
Via: SIP/2.0/UDP 10.255.1.18:5060;rport=5060;branch=z9hG4bKPj2.lz1iVzKL4AQLjI4tg97nxztTUfX3up
Max-Forwards: 70
Contact: <sip:10.255.1.18:5060>
To: <sip:335@pbx.example.com>;tag=4a390f4c
From: <sip:71@pbx.example.com>;tag=aQ0ijmdmPLUEQ5hi73BKM4hAE9KSFutx
Call-ID: 82158Yzk2MmNlMDlkMDMzYjk3MzdjNmQyYzQ2ZDkwYmE5NzY
CSeq: 23753 NOTIFY
Content-Type: application/pidf+xml
User-Agent: FPBX-13.0.190.7(13.11.2)
Subscription-State: active;expires=3561
Event: presence
Allow-Events: presence, dialog, message-summary, refer
Content-Length: 558
<?xml version="1.0" encoding="UTF-8"?>  

<presence entity="sip:71@10.255.1.18:5060" xmlns="urn:ietf:params:xml:ns:pidf" xmlns:pp="urn:ietf:params:xml:ns:pidf:person" xmlns:es="urn:ietf:params:xml:ns:pidf:rpid:status:rpid-status" xmlns:ep="urn:ietf:params:xml:ns:pidf:rpid:rpid-person">  
<note>On the phone</note>  
<tuple id="71">  
 <status>  
  <basic>closed</basic>  
 </status>  
 <contact priority="1"><sip:335@pbx.example.com></contact>  
</tuple>  
<pp:person>  
 <status>  
  <ep:activities>ep:busy</ep:activities>  
 </status>  
</pp:person>  
</presence>
{code}

It seems per https://tools.ietf.org/html/rfc4480#section-3.2 that the line
{code:xml}
  <ep:activities>ep:busy</ep:activities>  
{code}
should actually be
{code:xml}
  <ep:activities><ep:busy/></ep:activities>  
{code}
Comments:By: Asterisk Team (asteriskteam) 2016-12-12 16:18:33.621-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: snuffy (snuffy) 2016-12-13 18:30:25.030-0600

Hello,

Please test this patch, it should apply to 13.

Altered the res/res_pjsip_pidf_eyebeam_body_supplement.c that handles the creation of the xml.


By: Abraham Liebsch (aliebsch) 2016-12-14 11:30:23.963-0600

Thanks.  I'm having difficulty testing since I am using a binary distribution of Asterisk.  I'll try to find time to compile to a test environment.

By: Andrea Sannucci (voztovoice) 2017-01-28 09:31:56.746-0600

I'm testing on Asterisk 13.13.1 without success.
Maybe the problem is the space:

<ep:activities>
<ep:busy />
</ep:activities>

between busy and the /

Regards