Asterisk can know that one of the attached phones is both "ringing" and
"on the phone".
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".
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.
In the chan_sip configuration there is an option "notifyringing":
notifyringing
*notifyringing* enables or disables notifications for the RINGING
state when an extension is already INUSE. Only affects subscriptions
using the *dialog-info* event package. Option can be configured in
the general section only. It cannot be set per-peer.
As the doc says this only applies to dialog-info style NOTIFY, not the
pidf+xml format my phones use.
Here is a patch that makes notifyringing work for pidf+xml.
Generalising it for other formats is left as an exercise for the reader.
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?
Description: make "notifyringing" work with pidf+xml
If sip config specifies notifyringing=no and an extension is in a call
then we send out "On a call" instead of "Ringing" so people can see
who is not going to pick the call up.
Author: John Hughes <[email protected]>
Last-Update: 2020-06-09
--- asterisk-13.14.1~dfsg.orig/channels/chan_sip.c
+++ asterisk-13.14.1~dfsg/channels/chan_sip.c
@@ -14966,7 +14966,10 @@ static void state_notify_build_xml(struc
statestring = (sip_cfg.notifyringing) ? "early" : "confirmed";
local_state = NOTIFY_INUSE;
pidfstate = "busy";
- pidfnote = "Ringing";
+ if (subscribed == PIDF_XML && !sip_cfg.notifyringing)
+ pidfnote = "On the phone";
+ else
+ pidfnote = "Ringing";
break;
case AST_EXTENSION_RINGING:
statestring = "early";
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
Check out the new Asterisk community forum at: https://community.asterisk.org/
New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users