Can anyone help me configure presence in Asterisk?

Hello Asterisk Community,

I’m stuck with configuring presence in Asterisk using PJSIP. Despite encountering multiple sources claiming that presence isn’t supported by Asterisk, I’ve found various pages in the Asterisk documentation that suggest.
I’ve gone through the Asterisk wiki and other documentation, but I’m still unclear about the correct setup process.
i already know this will not affect call flow but i need to know how to handle below request in asterisk
[2024-06-06 04:40:06] WARNING[1124259]: res_pjsip_pubsub.c:3396 pubsub_on_rx_publish_request: No registered publish handler for event presence from 2001

thank you!

Presence, as you are trying to use it, is not supported. Only a Sangoma-specific version is currently supported, as noone else has done any work to add further support.

Hi. i’m not expert in Asterisk. bus as far i understand, best choice is disabling presence at your softphone

hello hsargolzaei,
this is not the solution i need to know how it can be handled.
like if my softphone is not in use but its presence state is away than our dialplan should not call him. when it set away we received logs so why we cant use it. and how to configure subscriptions and notify.

<?xml version="1.0" encoding="UTF-8"?>
<presence xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" entity="sip:2001@ip:5868" xmlns="urn:ietf:params:xml:ns:pidf">
 <tuple id="fyhb4x">
  <contact priority="0.8">sip:2001@ip:5868</contact>
 <dm:person id="uu1mh7">

because noone has written support for doing so, and until that changes then it won’t work

hello jcolp

you mean as of now below lines not make any sense and i have to wait.

sip.conf: This is the main configuration file for SIP in Asterisk. Here, you can define peers (devices), and their capabilities, and set up event subscriptions.

Presence Subscription:
A SIP phone subscribes to another phone’s presence status using the SUBSCRIBE method.
Asterisk processes the subscription request and keeps track of the subscriber.
When the status of the subscribed phone changes (e.g., it goes from available to busy), Asterisk sends a NOTIFY request to the subscriber with the updated status information.

Devices CAN subscribe, but the events are internally produced based on dialplan hints and device state. For Sangoma phones there is the ability to have some control over a Sangoma specific presence status in the dialplan which is also included in NOTIFY requests.

There is NO ability for a phone to publish its state and Asterisk to use it.

thanks jcolp
i will not try to apply it. i understand

Also, support for this will never happen with chan_sip, as that has been removed from the latest version of Asterisk.