]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_rayo: some fixes for punchblock 2.0 compatibility
authorChris Rienzo <chris.rienzo@grasshopper.com>
Thu, 13 Jun 2013 19:28:53 +0000 (15:28 -0400)
committerChris Rienzo <chris.rienzo@grasshopper.com>
Thu, 13 Jun 2013 19:28:53 +0000 (15:28 -0400)
src/mod/event_handlers/mod_rayo/mod_rayo.h
src/mod/event_handlers/mod_rayo/rayo_input_component.c

index 05b5f23771b97927e609b71e82268ccc3f2aac7d..fb197ef915a72fe08e4079e7dbb649a395c15f40 100644 (file)
 #define RAYO_CALL_NS RAYO_BASE "call:" RAYO_VERSION
 #define RAYO_MIXER_NS RAYO_BASE "mixer:" RAYO_VERSION
 
-/* this is to support punchblock.. undefine once punchblock is fixed */
+
+/* these are support punchblock.. undefine once punchblock is fixed */
 #define RAYO_UUID_IN_REF_URI
+#define RAYO_INPUT_COMPLETE_WITHOUT_CONTENT_TYPE
 
 struct rayo_actor;
 struct rayo_call;
index 8b59029e36649625c12cbec5d527cbd448105347..4bebb35e8cbe8faa2d374efbd527737c34bc3831 100644 (file)
@@ -169,11 +169,15 @@ static int digit_mask_set_from_digits(int digit_mask, const char *digits)
  */
 static void send_match_event(struct rayo_component *component, iks *result)
 {
-       iks *event = rayo_component_create_complete_event_with_metadata(RAYO_COMPONENT(component), INPUT_MATCH, result, 0);
-       /* add content-type to <match>... */
+#ifdef RAYO_INPUT_COMPLETE_WITHOUT_CONTENT_TYPE
+       rayo_component_send_complete_with_metadata(RAYO_COMPONENT(component), INPUT_MATCH, result, 0);
+#else
+       iks *event = rayo_component_create_complete_event(RAYO_COMPONENT(component), INPUT_MATCH);
        iks *match = iks_find(iks_find(event, "complete"), INPUT_MATCH_TAG);
        iks_insert_attrib(match, "content-type", "application/nlsml+xml");
+       iks_insert_cdata(match, iks_string(iks_stack(result), result), 0);
        rayo_component_send_complete_event(component, event);
+#endif
 }
 
 /**