Table of Contents
presence_publish
{type:'presence_publish', basic:…, activity:…, note:…, expires:…, sipmsg:…}
Publish your own SIP presence status.
arguments:
- basic - online status:
- "open" - client is online
- "closed" - client is offline
- activity - activity description according to RFC4480 section 3.2
- note - free text description
According to RFC4480 basic describes if the phone is online or not, not the person's availability. Thus even if activity is "away" basic is still true as the phone is still online and working and may eg receive text messages for later display when user has returned.
optional arguments:
- expires - seconds before status needs to be refreshed
- sipmsg - raw SIP message header and body (overrules all other arguments)
error
S → C {type:'presence_publish', from:…, error:'404', msg:'Not found'}
If you attempted to publish your presence but are not registered to a SIP account error 404 is returned.
example
raw message
{type:"presence_publish", basic:"open", activity:"", note:"", expires:0, sipmsg:"Expires: 3600\r\n
Content-Type: application/pidf+xml\r\nEvent:presence\r\nContent-Length: 535\r\n\r\n
<?xml version='1.0' encoding='UTF-8'?><presence
xmlns='urn:ietf:params:xml:ns:pidf' xmlns:dm='urn:ietf:params:xml:ns:pidf:data-model'
xmlns:rpid='urn:ietf:params:xml:ns:pidf:rpid' xmlns:c='urn:ietf:params:xml:ns:pidf:cipid'
xmlns:lt='urn:ietf:params:xml:ns:location-type' xmlns:caps='urn:ietf:params:xml:ns:pidf:caps'
entity='sip:foo@bar.com'><tuple id='t1'><status><basic>open</basic></status></tuple>
<dm:person id='p1'><rpid:activities><rpid:on-the-phone/></rpid:activities><dm:note>On the
phone</dm:note></dm:person></presence>"}