186static const char *
const app =
"SendText";
187static const char *
const app2 =
"ReceiveText";
196 const char *content_type;
205 body =
S_OR(body,
"");
222 .value = (
char *)
S_OR(from,
""),
226 .value = (
char *)
S_OR(to,
""),
230 .value = (
char *)
S_OR(content_type,
""),
234 .value = (
char *)
S_OR(body,
""),
238 msg_type =
"ENHANCED";
282 double timeout = 0, timeout_ms = 0;
294 if (sscanf(
args.timeout,
"%30lg", &timeout) != 1) {
298 timeout_ms = timeout * 1000.0;
static int sendtext_exec(struct ast_channel *chan, const char *data)
static const char *const app
static int recvtext_exec(struct ast_channel *chan, const char *data)
static const char *const app2
static int load_module(void)
static int unload_module(void)
Asterisk main include file. File version handling, generic pbx functions.
#define ast_strdupa(s)
duplicate a string in memory from the stack
static void send_text(unsigned char pos, unsigned char inverse, struct unistimsession *pte, const char *text)
General Asterisk PBX channel definitions.
char * ast_recvtext(struct ast_channel *chan, int timeout)
Receives a text string from a channel Read a string of text from a channel.
int ast_sendtext_data(struct ast_channel *chan, struct ast_msg_data *msg)
Sends text to a channel in an ast_msg_data structure wrapper with ast_sendtext as fallback.
#define ast_channel_lock(chan)
int ast_sendtext(struct ast_channel *chan, const char *text)
Sends text to a channel.
const struct ast_channel_tech * ast_channel_tech(const struct ast_channel *chan)
#define ast_channel_unlock(chan)
Generic File Format Support. Should be included by clients of the file handling routines....
struct ast_msg_data * ast_msg_data_alloc(enum ast_msg_data_source_type source, struct ast_msg_data_attribute attributes[], size_t count)
Allocates an ast_msg_data structure.
@ AST_MSG_DATA_ATTR_CONTENT_TYPE
@ AST_MSG_DATA_SOURCE_TYPE_IN_DIALOG
Application convenience functions, designed to give consistent look and feel to Asterisk apps.
#define AST_APP_ARG(name)
Define an application argument.
int ast_str_get_encoded_str(struct ast_str **str, int maxlen, const char *stream)
Decode a stream of encoded control or extended ASCII characters.
#define AST_DECLARE_APP_ARGS(name, arglist)
Declare a structure to hold an application's arguments.
#define AST_STANDARD_APP_ARGS(args, parse)
Performs the 'standard' argument separation process for an application.
Out-of-call text message support.
Asterisk module definitions.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#define ASTERISK_GPL_KEY
The text the key() function should return.
int ast_unregister_application(const char *app)
Unregister an application.
#define ast_register_application_xml(app, execute)
Register an application using XML documentation.
Core PBX routines and definitions.
const char * pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name)
Return a pointer to the value of the corresponding channel variable.
int pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value)
Add a variable to the channel variable stack, removing the most recently set value for the same name.
static void * cleanup(void *unused)
char * ast_str_buffer(const struct ast_str *buf)
Returns the string buffer within the ast_str buf.
#define S_OR(a, b)
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
static force_inline int attribute_pure ast_strlen_zero(const char *s)
#define ast_str_alloca(init_len)
static int force_inline attribute_pure ast_begins_with(const char *str, const char *prefix)
Checks whether a string begins with another.
Main Channel structure associated with a channel.
enum ast_msg_data_attribute_type type
Structure used to transport a message through the frame core.
Support for dynamic strings.