From 01899b1dfde8fe752dd39d76444414984876001d Mon Sep 17 00:00:00 2001 From: Jacob MacElroy Date: Tue, 5 Jun 2018 12:12:38 +0000 Subject: [PATCH 1/2] feat(call-flows): Removing cancel hook for ringing status. --- resources/prosody-plugins/mod_muc_call.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/resources/prosody-plugins/mod_muc_call.lua b/resources/prosody-plugins/mod_muc_call.lua index b5f8ea7a0..dc52371cc 100644 --- a/resources/prosody-plugins/mod_muc_call.lua +++ b/resources/prosody-plugins/mod_muc_call.lua @@ -17,7 +17,6 @@ end -- Status strings that trigger call events. local calling_status = "calling" -local ringing_status = "ringing" local busy_status = "busy" local rejected_status = "rejected" local connected_status = "connected" @@ -53,7 +52,6 @@ end -- Status | Event Type -- _________________________ -- "calling" | INVITE --- "ringing" | CANCEL -- "busy" | CANCEL -- "rejected" | CANCEL -- "connected" | CANCEL @@ -93,7 +91,6 @@ module:hook("muc-broadcast-presence", function (event) local switch = function(status) case = { [calling_status] = function() invite() end, - [ringing_status] = function() cancel() end, [busy_status] = function() cancel() end, [rejected_status] = function() cancel() end, [connected_status] = function() cancel() end From 83720a4ed5b221bc877a933516319c0ba1023d4b Mon Sep 17 00:00:00 2001 From: Jacob MacElroy Date: Tue, 5 Jun 2018 13:03:47 +0000 Subject: [PATCH 2/2] fix(call-flows): Maintain presence tags and call id in poltergeist presence stanza. --- resources/prosody-plugins/mod_muc_poltergeist.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/prosody-plugins/mod_muc_poltergeist.lua b/resources/prosody-plugins/mod_muc_poltergeist.lua index 464bb9b60..6eec8aac1 100644 --- a/resources/prosody-plugins/mod_muc_poltergeist.lua +++ b/resources/prosody-plugins/mod_muc_poltergeist.lua @@ -241,8 +241,14 @@ function create_poltergeist_occupant(room, nick, name, avatar, status, context) join:tag("password", { xmlns = MUC_NS }):text(room_password); end + -- Update the nil call id to the initial call id for call flows. local call_id = get_username(room, context.user.id); - join_presence:tag("call_id"):text(get_username(room, context.user.id)):up(); + join_presence:maptags(function (tag) + if tag.name == "call_id" then + return st.stanza("call_id"):text(call_id); + end + return tag; + end); update_presence_identity( join_presence, @@ -356,6 +362,7 @@ function update_presence_tags(presence_stanza, status, call_details) return st.stanza("call_cancel"):text("false"); end end + return tag; end); return presence_stanza