Help understanding if asterisk can handle "publish" requests?

I am working on an html5 softphone based on sipml5. That API supports setting your presence attributes via the “publish” call, and does not support notify directly as the API is now. The specific API call on their end is documented here: https://www.doubango.org/sipml5/docgen/symbols/SIPml.Session.Publish.html

I am using Asterisk 16. I am confused on asterisk’s support for the publish call. According to an Asterisk Technical Lead here it is not supported: https://community.asterisk.org/t/publish-presence-by-softphones/84518

That being said, according to the wiki, Asterisk 16 supports publish through res_pjsip_publish_asterisk: wiki asterisk org/wiki/display/AST/Asterisk+16+Configuration_res_pjsip_publish_asterisk (sorry I can only put 2 links)

I’ve tried this in my testing environment; when I attempt to publish presence, I get the following:

Mar 14 23:21:41] WARNING[3931100]: res_pjsip_pubsub.c:3353 pubsub_on_rx_publish_request: No registered publish handler for event presence from 1000

I’m no asterisk expert (I have a colleague who mostly set up the environment for me to develop the front end against) but if I’m understanding it correctly, I need to add some configuration to pjsip.conf to enable the ability to handle publish requests through the module? I’ve googled but not found concrete examples that get me to a point of understanding. Can someone help understanding Asterisk’s capabilities in handling publish requests, and if it’s possible, what would my configuration need to look like?

Many thanks in advance!

No, Asterisk can’t handle accepting PUBLISH presence like that. No configuration will change that.

Can you help me understand that a bit more? I see that wiki article supports “asterisk-publication”, is that a different form of a publish request custom to asterisk, or is that something else completely?

Is presence notification possible using something different; we theorized it was possible through a “notify” request. We get a presence subscription for various events which come as rpid xml events (so a basic presence event saying “open” or “closed” based on registration status, then an “rpid:activity” for “rpid:on-the-phone” when on a call). Those are clearly getting through to us, so I’m sure somehow asterisk supports indicating presence, what does the api call need to look like? I’ve searched, but I’m not sure I understand how it works.

If it’s possible to communicate a manual presence status using some other request like NOTIFY I’d consider extending the API, but I need to understand the SIP side more.

There isn’t such a thing supported in SIP in Asterisk for normal endpoints.

A PUBLISH is for publishing something to a SIP entity. Within that is a type. Asterisk supports using this to exchange information between two Asterisk instances using an Asterisk specific type.

There is no implementation written to allow receiving PUBLISH from an endpoint. Can’t use NOTIFY either, because that is for notifying an endpoint.

What you see in the NOTIFY is produced by Asterisk itself. You could certainly use something like custom device state in Asterisk to set a value, but you can’t do that over SIP unless you leveraged something else - like a MESSAGE request.

Ok, thanks for the help understanding. Reading this, my takeaway was that right now, there’s something custom to digium/sangoma that can speak through asterisk to handle presence notifications:

https://wiki.asterisk.org/wiki/display/AST/Presence+State

It says only digium devices can handle those requests, but they’re not proprietary or anything, just the only devices are digium devices and someone else making a softphone could theoretically parse or communicate such a request.

I’ve googled (locking onto the term “CustomPresence”) to see if there’s some sort of API documentation, but I’m not seeing it? Am I approaching that the wrong way? Is this some sort of proprietary API that’s not officially part of any asterisk documentation?

Right now we’ve successfully captured the state of registration and on a call (so, we’re reading the results of presence notifications), but we’re hoping to extend it to be able to manually set several of the activities per the SIP RFC’s around Rich Presence.

The core functionality is in Asterisk and open source, and even the module which places information in the NOTIFY[1] for Digium/Sangoma phones is also open source. How the presence state is updated by the phone is proprietary to the DPMA module.

[1] asterisk/res_pjsip_pidf_digium_body_supplement.c at master · asterisk/asterisk · GitHub

The CustomPresence support is also open source[1].

[1] asterisk/func_presencestate.c at master · asterisk/asterisk · GitHub

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.