Just wanted to report a couple small bugs with the newest 2.5.3 and asterisk-im integration (I think its related to the fixes in SPARK-718 which makes your local Spark change to “on the phone” status when making a call).
There’'s a couple bugs, which might be in Spark or Asterisk-IM (not sure):
When your local spark changes to “on the phone” status, it always switches back to “Available” when switching out of “on the phone” status, regardless of what it was before. So, if I set Do Not Disturb but check a voicemail, when hanging up I’'ll be incorrectly set to “Available” when I hang up.
Spark changes to “on the phone” a bit prematurely on a ring event (before you’'ve answered). If you combine this with #1 above, you can set your status to Do Not Disturb, get a call that you ignore, then when the call is done ringing you are automatically back to “Available”.
Do we need additional messages from Asterisk-IM to the client or is this just a Spark-only issue?
Hi srt, thank you for the reply. Thanks for your awesome work on asterisk-im, too. The newest version has been very stable for us.
I just did a little more testing using clients other than spark (pandion and exodus). I can say that #1 is definitely a Spark-only bug (as of Spark 2.5.3). There’'s probably some code somewhere that says set status = Available when call is finished (when it should revert to the previous state)
#2 is not necessarily even a bug, it just says “on the phone” while ringing (before connected). In some ways that might be a good thing (i.e. maybe so you don’‘t start a chat right as someone is getting a call). For us, we have four phones ring on incoming calls so we see those people as on the phone for a few seconds until someone answers, which isn’'t a big deal at all
For #2 we would have to make a difference between incoming and outgoing calls as for outgoing calls you are “on the phone” even if the remote party did not yet answer. For incoming calls this could be different, i.e. setting the “on the phone” status not until the remote party has answered the call.
I agree its not a big issue. Nevertheless I’‘ve created feature request PHONE-59 to track it. If it’'s important for someone you can voted for it
Wow! I’‘m so proud of myself! I just fixed my first Spark bug. Here’'s a patch which will make spark revert to the previous state when all calls are finished. Its my first patch, so hopefully everything is formatted correctly. I can re-do it if necessary.
Index: C:/Documents and Settings/peted20/My Documents/Eclipse Workspace/spark/src/java/org/jivesoftware/sparkimpl/plugin/phone/PhonePlugin.java
===================================================================
--- C:/Documents and Settings/peted20/My Documents/Eclipse Workspace/spark/src/java/org/jivesoftware/sparkimpl/plugin/phone/PhonePlugin.java (revision 8500)
+++ C:/Documents and Settings/peted20/My Documents/Eclipse Workspace/spark/src/java/org/jivesoftware/sparkimpl/plugin/phone/PhonePlugin.java (working copy)
@@ -238,11 +238,15 @@
} if (offPhonePresence != null) {
- // Set user to available when all phone calls are hung up.
+ // Set user to previous presence state when all phone calls are hung up.
+ SparkManager.getSessionManager().changePresence(offPhonePresence);
+
+ offPhonePresence = null;
+ }else{
+ // If no previous state available, set status to Available
Presence availablePresence = new Presence(Presence.Type.available, "Available", 1, Presence.Mode.available);
-
SparkManager.getSessionManager().changePresence(availablePresence);
-
+ offPhonePresence = null;
}
}