Selaa lähdekoodia

Merge pull request #3096 from jmacelroy/master

Cleaning up call flow presence stanzas and cancel triggers.
j8
Aaron van Meerten 7 vuotta sitten
vanhempi
commit
ff0d42a95b
No account linked to committer's email address

+ 0
- 2
resources/prosody-plugins/mod_muc_call.lua Näytä tiedosto

17
 
17
 
18
 -- Status strings that trigger call events.
18
 -- Status strings that trigger call events.
19
 local calling_status   = "calling"
19
 local calling_status   = "calling"
20
-local ringing_status   = "ringing"
21
 local busy_status      = "busy"
20
 local busy_status      = "busy"
22
 local rejected_status  = "rejected"
21
 local rejected_status  = "rejected"
23
 local connected_status = "connected"
22
 local connected_status = "connected"
53
 --    Status      | Event Type
52
 --    Status      | Event Type
54
 --    _________________________
53
 --    _________________________
55
 --    "calling"   | INVITE
54
 --    "calling"   | INVITE
56
 --    "busy"      | CANCEL
55
 --    "busy"      | CANCEL
57
 --    "rejected"  | CANCEL
56
 --    "rejected"  | CANCEL
58
 --    "connected" | CANCEL
57
 --    "connected" | CANCEL
93
 	local switch = function(status)
91
 	local switch = function(status)
94
 	   case = {
92
 	   case = {
95
 		  [calling_status]   = function() invite() end,
93
 		  [calling_status]   = function() invite() end,
96
-		  [ringing_status]   = function() cancel() end,
97
 		  [busy_status]      = function() cancel() end,
94
 		  [busy_status]      = function() cancel() end,
98
 		  [rejected_status]  = function() cancel() end,
95
 		  [rejected_status]  = function() cancel() end,
99
 		  [connected_status] = function() cancel() end
96
 		  [connected_status] = function() cancel() end

+ 8
- 1
resources/prosody-plugins/mod_muc_poltergeist.lua Näytä tiedosto

241
         join:tag("password", { xmlns = MUC_NS }):text(room_password);
241
         join:tag("password", { xmlns = MUC_NS }):text(room_password);
242
     end
242
     end
243
 
243
 
244
+    -- Update the nil call id to the initial call id for call flows.
244
 	local call_id = get_username(room, context.user.id);
245
 	local call_id = get_username(room, context.user.id);
245
-	join_presence:tag("call_id"):text(get_username(room, context.user.id)):up();
246
+    join_presence:maptags(function (tag)
247
+        if tag.name == "call_id" then
248
+           return st.stanza("call_id"):text(call_id);
249
+        end
250
+        return tag;
251
+    end);
246
 
252
 
247
     update_presence_identity(
253
     update_presence_identity(
248
         join_presence,
254
         join_presence,
356
                 return st.stanza("call_cancel"):text("false");
362
                 return st.stanza("call_cancel"):text("false");
357
             end
363
             end
358
         end
364
         end
365
+        return tag;
359
     end);
366
     end);
360
 
367
 
361
     return presence_stanza
368
     return presence_stanza

Loading…
Peruuta
Tallenna