提交 d22d045b authored 作者: Chris Rienzo's avatar Chris Rienzo

mod_rayo: add <sendfax> component

上级 02f1853d
......@@ -11,10 +11,10 @@ LOCAL_OBJS= $(IKS_LA) \
nlsml.o \
rayo_components.o \
rayo_elements.o \
rayo_fax_components.o \
rayo_input_component.o \
rayo_output_component.o \
rayo_prompt_component.o \
rayo_receivefax_component.o \
rayo_record_component.o \
sasl.o \
srgs.o \
......@@ -24,11 +24,11 @@ LOCAL_SOURCES= \
nlsml.c \
rayo_components.c \
rayo_elements.c \
rayo_fax_components.c \
rayo_input_component.c \
rayo_output_component.c \
rayo_prompt_component.c \
rayo_record_component.c \
rayo_receivefax_component.c \
sasl.c \
srgs.c \
xmpp_streams.c
......
......@@ -16,11 +16,11 @@
<param name="default-recognizer" value="pocketsphinx"/>
</input>
<!-- receivefax component params -->
<receivefax>
<!-- send/receivefax component params -->
<fax>
<!-- where to store incoming faxes -->
<param name="file-prefix" value="/tmp/"/>
</receivefax>
<param name="receivefax-file-prefix" value="/tmp/"/>
</fax>
<!-- XMPP server domain -->
<domain name="$${rayo_domain_name}" shared-secret="ClueCon">
......
......@@ -952,6 +952,7 @@ static void rayo_call_cleanup(struct rayo_actor *actor)
iks_delete(revent);
switch_event_destroy(&event);
switch_core_hash_destroy(&call->pcps);
}
/**
......@@ -1130,13 +1131,23 @@ static struct rayo_call *_rayo_call_create(const char *uuid, const char *file, i
return rayo_call_init(call, pool, uuid, file, line);
}
/**
* Mixer destructor
*/
static void rayo_mixer_cleanup(struct rayo_actor *actor)
{
struct rayo_mixer *mixer = RAYO_MIXER(actor);
switch_core_hash_destroy(&mixer->members);
switch_core_hash_destroy(&mixer->subscribers);
}
/**
* Initialize mixer
*/
static struct rayo_mixer *rayo_mixer_init(struct rayo_mixer *mixer, switch_memory_pool_t *pool, const char *name, const char *file, int line)
{
char *mixer_jid = switch_mprintf("%s@%s", name, RAYO_JID(globals.server));
rayo_actor_init(RAYO_ACTOR(mixer), pool, RAT_MIXER, "", name, mixer_jid, NULL, rayo_mixer_send, file, line);
rayo_actor_init(RAYO_ACTOR(mixer), pool, RAT_MIXER, "", name, mixer_jid, rayo_mixer_cleanup, rayo_mixer_send, file, line);
switch_core_hash_init(&mixer->members, pool);
switch_core_hash_init(&mixer->subscribers, pool);
switch_safe_free(mixer_jid);
......@@ -1307,6 +1318,7 @@ static void rayo_peer_server_cleanup(struct rayo_actor *actor)
RAYO_UNLOCK(client);
RAYO_DESTROY(client);
}
switch_core_hash_destroy(&rserver->clients);
switch_mutex_unlock(globals.clients_mutex);
}
......
......@@ -227,7 +227,7 @@ switch_status_t rayo_components_load(switch_loadable_module_interface_t **module
rayo_output_component_load(module_interface, pool, config_file) != SWITCH_STATUS_SUCCESS ||
rayo_prompt_component_load(module_interface, pool, config_file) != SWITCH_STATUS_SUCCESS ||
rayo_record_component_load(module_interface, pool, config_file) != SWITCH_STATUS_SUCCESS ||
rayo_receivefax_component_load(module_interface, pool, config_file) != SWITCH_STATUS_SUCCESS) {
rayo_fax_components_load(module_interface, pool, config_file) != SWITCH_STATUS_SUCCESS) {
return SWITCH_STATUS_TERM;
}
return SWITCH_STATUS_SUCCESS;
......@@ -242,7 +242,7 @@ switch_status_t rayo_components_shutdown(void)
rayo_output_component_shutdown();
rayo_prompt_component_shutdown();
rayo_record_component_shutdown();
rayo_receivefax_component_shutdown();
rayo_fax_components_shutdown();
return SWITCH_STATUS_SUCCESS;
}
......
......@@ -61,14 +61,14 @@ extern switch_status_t rayo_input_component_load(switch_loadable_module_interfac
extern switch_status_t rayo_output_component_load(switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool, const char *config_file);
extern switch_status_t rayo_prompt_component_load(switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool, const char *config_file);
extern switch_status_t rayo_record_component_load(switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool, const char *config_file);
extern switch_status_t rayo_receivefax_component_load(switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool, const char *config_file);
extern switch_status_t rayo_fax_components_load(switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool, const char *config_file);
extern switch_status_t rayo_components_shutdown(void);
extern switch_status_t rayo_input_component_shutdown(void);
extern switch_status_t rayo_output_component_shutdown(void);
extern switch_status_t rayo_prompt_component_shutdown(void);
extern switch_status_t rayo_record_component_shutdown(void);
extern switch_status_t rayo_receivefax_component_shutdown(void);
extern switch_status_t rayo_fax_components_shutdown(void);
extern void rayo_component_send_start(struct rayo_component *component, iks *iq);
extern void rayo_component_send_iq_error(struct rayo_component *component, iks *iq, const char *error_name, const char *error_type);
......
......@@ -49,6 +49,17 @@ ELEMENT(RAYO_INPUT)
ATTRIB(start-timers, true, bool)
ELEMENT_END
/**
* <join> command validation
*/
ELEMENT(RAYO_JOIN)
ATTRIB(xmlns,, any)
STRING_ATTRIB(direction, duplex, "send,recv,duplex")
STRING_ATTRIB(media, bridge, "bridge,direct")
ATTRIB(call-uri,, any)
ATTRIB(mixer-name,, any)
ELEMENT_END
/**
* <output> component validation
*/
......@@ -80,6 +91,13 @@ ELEMENT(RAYO_PROMPT)
ATTRIB(barge-in, true, bool)
ELEMENT_END
/**
* <receivefax> command validation
*/
ELEMENT(RAYO_RECEIVEFAX)
ATTRIB(xmlns,, any)
ELEMENT_END
/**
* <record> component validation
*/
......@@ -97,22 +115,12 @@ ELEMENT(RAYO_RECORD)
ELEMENT_END
/**
* <join> command validation
* <sendfax> command validation
*/
ELEMENT(RAYO_JOIN)
ELEMENT(RAYO_SENDFAX)
ATTRIB(xmlns,, any)
STRING_ATTRIB(direction, duplex, "send,recv,duplex")
STRING_ATTRIB(media, bridge, "bridge,direct")
ATTRIB(call-uri,, any)
ATTRIB(mixer-name,, any)
ELEMENT_END
/**
* <receivefax> command validation
*/
ELEMENT(RAYO_RECEIVEFAX)
ATTRIB(xmlns,, any)
ELEMENT_END
/* For Emacs:
* Local Variables:
......
......@@ -32,12 +32,13 @@
#include "iks_helpers.h"
ELEMENT_DECL(RAYO_INPUT)
ELEMENT_DECL(RAYO_JOIN)
ELEMENT_DECL(RAYO_OUTPUT)
ELEMENT_DECL(RAYO_OUTPUT_SEEK)
ELEMENT_DECL(RAYO_PROMPT)
ELEMENT_DECL(RAYO_RECORD)
ELEMENT_DECL(RAYO_JOIN)
ELEMENT_DECL(RAYO_RECEIVEFAX)
ELEMENT_DECL(RAYO_RECORD)
ELEMENT_DECL(RAYO_SENDFAX)
#endif
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论