From: Richard Mudgett Date: Fri, 6 Apr 2012 19:16:56 +0000 (+0000) Subject: Update Func MESSAGE() and AMI MessageSend documentation. X-Git-Tag: 10.4.0-digiumphones-rc1~3^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=636586e0b55c13d8d654a9e62e210a6c65e9f7d4;p=thirdparty%2Fasterisk.git Update Func MESSAGE() and AMI MessageSend documentation. * Document MESSAGE(custom_data) * Update AMI MessageSend documentation * Eliminate a shadowed variable name in msg_func_write() for custom_data. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10-digiumphones@361503 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/message.c b/main/message.c index ad78606c5a..a57dff6b50 100644 --- a/main/message.c +++ b/main/message.c @@ -57,6 +57,18 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Read-only. The source of the message. When processing an incoming message, this will be set to the source of the message. + + Write-only. Mark or unmark all message headers for an outgoing + message. The following values can be set: + + + Mark all headers for an outgoing message. + + + Unmark all headers for an outgoing message. + + + Read/Write. The message body. When processing an incoming message, this includes the body of the message that Asterisk @@ -150,7 +162,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") The URI the message is to be sent to. - The URI the message is from. Not required. + A From URI for the message if needed for the + message technology being used to send this message. + + For SIP the from parameter can be a configured peer name + or in the form of "display-name" <URI>. + The message body text. This must not contain any newlines as that @@ -158,10 +175,13 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") Text bodies requiring the use of newlines have to be base64 encoded - in this field. The Base64Body will be decoded before being sent out. + in this field. Base64Body will be decoded before being sent out. + Base64Body takes precedence over Body. - Message variable to set, multiple Variable: headers are allowed. + Message variable to set, multiple Variable: headers are + allowed. The header value is a comma separated list of + name=value pairs. @@ -890,12 +910,12 @@ static int msg_func_write(struct ast_channel *chan, const char *function, } if (outbound != -1) { - struct msg_data *data; + struct msg_data *hdr_data; struct ao2_iterator iter = ao2_iterator_init(msg->vars, 0); - while ((data= ao2_iterator_next(&iter))) { - data->send = outbound; - ao2_ref(data, -1); + while ((hdr_data = ao2_iterator_next(&iter))) { + hdr_data->send = outbound; + ao2_ref(hdr_data, -1); } ao2_iterator_destroy(&iter); }