<div dir="ltr"><div dir="ltr">On Wed, Jun 10, 2020 at 10:27 AM John Hughes <<a href="mailto:john@calva.com">john@calva.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Asterisk can know that one of the attached phones is both
"ringing" and "on the phone".</p>
<p>However the sip NOTIFY it sends out to interested parties can
only communicate one state, for example with pidf+xml it can
either send "Ringing" or "On the phone" and so it sends "Ringing".</p>
<p>This makes the "busy lights" less than useful, if a call makes
multiple phones ring you can't tell, looking at the busy lights,
which ones are busy, and so less likely to answer.</p>
<p>In the chan_sip configuration there is an option "notifyringing":</p>
<blockquote>
<h2 id="gmail-m_2117603681435499439chan_sipStateandPresenceOptions-notifyringing">notifyringing</h2>
<p><strong>notifyringing</strong> enables or disables
notifications for the RINGING state when an extension is already
INUSE. Only affects subscriptions using the <strong>dialog-info</strong>
event package. Option can be configured in the general section
only. It cannot be set per-peer.</p>
</blockquote>
<p>As the doc says this only applies to dialog-info style NOTIFY,
not the pidf+xml format my phones use.</p>
<p>Here is a patch that makes notifyringing work for pidf+xml.</p>
<p>Generalising it for other formats is left as an exercise for the
reader.</p>
<p>Of course chan_sip is obsolete. How might this be done for
chan_pjsip? Parts of the code are similar, but the layering is
vastly different. How could the
ast_sip_presence_exten_state_to_str function in
res/res_pjsip/presence_xml.c get at the pjsip configuration?<br>
</p>
</div></blockquote></div><div><br></div><div>You wouldn't be able to access such information from ast_sip_presence_exten_state_to_str, that function is strictly for taking in instructions/data and producing the output. The user of it would need to pass in a value to turn on this new behavior. >From that level the ast_sip_exten_state_data structure can optionally have a subscription, which itself has the endpoint that was used to establish the subscription.</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="font-family:tahoma,sans-serif"><font color="#073763">Joshua C. Colp</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Asterisk Technical Lead</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Sangoma Technologies</font></div><div style="font-family:tahoma,sans-serif"><font color="#073763">Check us out at <a href="http://www.sangoma.com" target="_blank">www.sangoma.com</a> and <a href="http://www.asterisk.org" target="_blank">www.asterisk.org</a></font><br></div></div></div></div></div></div></div></div></div></div></div>