[svn-commits] mmichelson: branch group/issue8824 r186520 - in /team/group/issue8824: ./ app...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Fri Apr 3 17:14:08 CDT 2009
Author: mmichelson
Date: Fri Apr 3 17:13:59 2009
New Revision: 186520
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=186520
Log:
Resolve conflicts and reset automerge.
This also puts the branch in sync with trunk....hmmmmmmmmm
Removed:
team/group/issue8824/include/asterisk/rtp.h
team/group/issue8824/main/rtp.c
Modified:
team/group/issue8824/ (props changed)
team/group/issue8824/UPGRADE.txt
team/group/issue8824/apps/app_dial.c
team/group/issue8824/apps/app_voicemail.c
team/group/issue8824/cdr/cdr_radius.c
team/group/issue8824/channels/chan_agent.c
team/group/issue8824/channels/chan_bridge.c
team/group/issue8824/channels/chan_dahdi.c
team/group/issue8824/channels/chan_gtalk.c
team/group/issue8824/channels/chan_h323.c
team/group/issue8824/channels/chan_iax2.c
team/group/issue8824/channels/chan_jingle.c
team/group/issue8824/channels/chan_local.c
team/group/issue8824/channels/chan_mgcp.c
team/group/issue8824/channels/chan_sip.c
team/group/issue8824/channels/chan_skinny.c
team/group/issue8824/channels/chan_unistim.c
team/group/issue8824/configs/features.conf.sample
team/group/issue8824/configs/sip.conf.sample
team/group/issue8824/configs/voicemail.conf.sample
team/group/issue8824/include/asterisk.h
team/group/issue8824/include/asterisk/_private.h
team/group/issue8824/include/asterisk/astobj2.h
team/group/issue8824/include/asterisk/crypto.h
team/group/issue8824/include/asterisk/frame.h
team/group/issue8824/include/asterisk/pbx.h
team/group/issue8824/include/asterisk/res_odbc.h
team/group/issue8824/include/asterisk/strings.h
team/group/issue8824/main/Makefile
team/group/issue8824/main/ast_expr2f.c
team/group/issue8824/main/asterisk.c
team/group/issue8824/main/audiohook.c
team/group/issue8824/main/channel.c
team/group/issue8824/main/loader.c
team/group/issue8824/main/manager.c
team/group/issue8824/main/stdtime/localtime.c
team/group/issue8824/main/strings.c
team/group/issue8824/main/taskprocessor.c
team/group/issue8824/main/tdd.c
team/group/issue8824/res/res_odbc.c
Propchange: team/group/issue8824/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.
Propchange: team/group/issue8824/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/group/issue8824/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Apr 3 17:13:59 2009
@@ -1,1 +1,1 @@
-/trunk:1-185889
+/trunk:1-186519
Modified: team/group/issue8824/UPGRADE.txt
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/UPGRADE.txt?view=diff&rev=186520&r1=186519&r2=186520
==============================================================================
--- team/group/issue8824/UPGRADE.txt (original)
+++ team/group/issue8824/UPGRADE.txt Fri Apr 3 17:13:59 2009
@@ -20,7 +20,11 @@
From 1.6.2 to 1.6.3:
-* Nothing, yet!
+* The usage of RTP inside of Asterisk has now become modularized. This means
+ the Asterisk RTP stack now exists as a loadable module, res_rtp_asterisk.
+ If you are not using autoload=yes in modules.conf you will need to ensure
+ it is set to load. If not, then any module which uses RTP (such as chan_sip)
+ will not be able to send or receive calls.
From 1.6.1 to 1.6.2:
Modified: team/group/issue8824/apps/app_dial.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/apps/app_dial.c?view=diff&rev=186520&r1=186519&r2=186520
==============================================================================
--- team/group/issue8824/apps/app_dial.c (original)
+++ team/group/issue8824/apps/app_dial.c Fri Apr 3 17:13:59 2009
@@ -54,7 +54,7 @@
#include "asterisk/utils.h"
#include "asterisk/app.h"
#include "asterisk/causes.h"
-#include "asterisk/rtp.h"
+#include "asterisk/rtp_engine.h"
#include "asterisk/cdr.h"
#include "asterisk/manager.h"
#include "asterisk/privacy.h"
@@ -750,7 +750,9 @@
handle_cause(cause, num);
ast_hangup(original);
} else {
- ast_rtp_make_compatible(c, in, single);
+ if (single) {
+ ast_rtp_instance_early_bridge_make_compatible(c, in);
+ }
c->cdrflags = in->cdrflags;
@@ -1833,7 +1835,9 @@
CHANNEL_DEADLOCK_AVOIDANCE(tc);
}
/* Setup outgoing SDP to match incoming one */
- ast_rtp_make_compatible(tc, chan, !outgoing && !rest);
+ if (!outgoing && !rest) {
+ ast_rtp_instance_early_bridge_make_compatible(tc, chan);
+ }
/* Inherit specially named variables from parent channel */
ast_channel_inherit_variables(chan, tc);
Modified: team/group/issue8824/apps/app_voicemail.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/apps/app_voicemail.c?view=diff&rev=186520&r1=186519&r2=186520
==============================================================================
--- team/group/issue8824/apps/app_voicemail.c (original)
+++ team/group/issue8824/apps/app_voicemail.c Fri Apr 3 17:13:59 2009
@@ -325,7 +325,7 @@
static char *get_header_by_tag(char *header, char *tag, char *buf, size_t len);
static void vm_imap_delete(int msgnum, struct ast_vm_user *vmu);
static char *get_user_by_mailbox(char *mailbox, char *buf, size_t len);
-static struct vm_state *get_vm_state_by_imapuser(char *user, int interactive);
+static struct vm_state *get_vm_state_by_imapuser(const char *user, int interactive);
static struct vm_state *get_vm_state_by_mailbox(const char *mailbox, const char *context, int interactive);
static struct vm_state *create_vm_state_from_user(struct ast_vm_user *vmu);
static void vmstate_insert(struct vm_state *vms);
@@ -804,7 +804,7 @@
static int vm_tempgreeting(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, char *fmtc, signed char record_gain);
static int vm_play_folder_name(struct ast_channel *chan, char *mbox);
static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms, int msgnum, long duration, char *fmt, char *cidnum, char *cidname, const char *flag);
-static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, char *attach, char *attach2, char *format, int duration, int attach_user_voicemail, struct ast_channel *chan, const char *category, int imap, const char *flag);
+static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, const char *fromfolder, char *cidnum, char *cidname, char *attach, char *attach2, char *format, int duration, int attach_user_voicemail, struct ast_channel *chan, const char *category, int imap, const char *flag);
static void apply_options(struct ast_vm_user *vmu, const char *options);
static int add_email_attachment(FILE *p, struct ast_vm_user *vmu, char *format, char *attach, char *greeting_attachment, char *mailbox, char *bound, char *filename, int last, int msgnum);
static int is_valid_dtmf(const char *key);
@@ -1911,9 +1911,9 @@
}
imap_delete_old_greeting(fn, vms);
}
-
- make_email_file(p, myserveremail, vmu, msgnum, vmu->context, vmu->mailbox, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL), fn, introfn, fmt, duration, 1, chan, NULL, 1, flag);
- /* read mail file to memory */
+
+ make_email_file(p, myserveremail, vmu, msgnum, vmu->context, vmu->mailbox, "INBOX", S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL), fn, introfn, fmt, duration, 1, chan, NULL, 1, flag);
+ /* read mail file to memory */
len = ftell(p);
rewind(p);
if (!(buf = ast_malloc(len + 1))) {
@@ -2294,22 +2294,14 @@
static void update_messages_by_imapuser(const char *user, unsigned long number)
{
- struct vmstate *vlist = NULL;
-
- AST_LIST_LOCK(&vmstates);
- AST_LIST_TRAVERSE(&vmstates, vlist, list) {
- if (!vlist->vms) {
- ast_debug(3, "error: vms is NULL for %s\n", user);
- continue;
- }
- if (!vlist->vms->imapuser) {
- ast_debug(3, "error: imapuser is NULL for %s\n", user);
- continue;
- }
- ast_debug(3, "saving mailbox message number %lu as message %d. Interactive set to %d\n", number, vlist->vms->vmArrayIndex, vlist->vms->interactive);
- vlist->vms->msgArray[vlist->vms->vmArrayIndex++] = number;
- }
- AST_LIST_UNLOCK(&vmstates);
+ struct vm_state *vms = get_vm_state_by_imapuser(user, 1);
+
+ if (!vms && !(vms = get_vm_state_by_imapuser(user, 0))) {
+ return;
+ }
+
+ ast_debug(3, "saving mailbox message number %lu as message %d. Interactive set to %d\n", number, vms->vmArrayIndex, vms->interactive);
+ vms->msgArray[vms->vmArrayIndex++] = number;
}
void mm_searched(MAILSTREAM *stream, unsigned long number)
@@ -2600,7 +2592,7 @@
return vms_p;
}
-static struct vm_state *get_vm_state_by_imapuser(char *user, int interactive)
+static struct vm_state *get_vm_state_by_imapuser(const char *user, int interactive)
{
struct vmstate *vlist = NULL;
@@ -3851,9 +3843,16 @@
return 1;
}
-static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, char *dur, char *date, char *passdata, size_t passdatasize, const char *category, const char *flag)
+static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, const char *fromfolder, char *cidnum, char *cidname, char *dur, char *date, char *passdata, size_t passdatasize, const char *category, const char *flag)
{
char callerid[256];
+ char fromdir[256], fromfile[256];
+ struct ast_config *msg_cfg;
+ const char *origcallerid, *origtime;
+ char origcidname[80], origcidnum[80], origdate[80];
+ int inttime;
+ struct ast_flags config_flags = { CONFIG_FLAG_NOCACHE };
+
/* Prepare variables for substitution in email body and subject */
pbx_builtin_setvar_helper(ast, "VM_NAME", vmu->fullname);
pbx_builtin_setvar_helper(ast, "VM_DUR", dur);
@@ -3868,6 +3867,35 @@
pbx_builtin_setvar_helper(ast, "VM_DATE", date);
pbx_builtin_setvar_helper(ast, "VM_CATEGORY", category ? ast_strdupa(category) : "no category");
pbx_builtin_setvar_helper(ast, "VM_FLAG", flag);
+
+ /* Retrieve info from VM attribute file */
+ make_dir(fromdir, sizeof(fromdir), vmu->context, vmu->mailbox, fromfolder);
+ make_file(fromfile, sizeof(fromfile), fromdir, msgnum - 1);
+ if (strlen(fromfile) < sizeof(fromfile) - 5) {
+ strcat(fromfile, ".txt");
+ }
+ if (!(msg_cfg = ast_config_load(fromfile, config_flags))) {
+ if (option_debug > 0) {
+ ast_log(LOG_DEBUG, "Config load for message text file '%s' failed\n", fromfile);
+ }
+ return;
+ }
+
+ if ((origcallerid = ast_variable_retrieve(msg_cfg, "message", "callerid"))) {
+ pbx_builtin_setvar_helper(ast, "ORIG_VM_CALLERID", origcallerid);
+ ast_callerid_split(origcallerid, origcidname, sizeof(origcidname), origcidnum, sizeof(origcidnum));
+ pbx_builtin_setvar_helper(ast, "ORIG_VM_CIDNAME", origcidname);
+ pbx_builtin_setvar_helper(ast, "ORIG_VM_CIDNUM", origcidnum);
+ }
+
+ if ((origtime = ast_variable_retrieve(msg_cfg, "message", "origtime")) && sscanf(origtime, "%d", &inttime) == 1) {
+ struct timeval tv = { inttime, };
+ struct ast_tm tm;
+ ast_localtime(&tv, &tm, NULL);
+ ast_strftime(origdate, sizeof(origdate), emaildateformat, &tm);
+ pbx_builtin_setvar_helper(ast, "ORIG_VM_DATE", origdate);
+ }
+ ast_config_destroy(msg_cfg);
}
/*!
@@ -4001,7 +4029,7 @@
*
* The email body, and base 64 encoded attachement (if any) are stored to the file identified by *p. This method does not actually send the email. That is done by invoking the configure 'mailcmd' and piping this generated file into it, or with the sendemail() function.
*/
-static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, char *attach, char *attach2, char *format, int duration, int attach_user_voicemail, struct ast_channel *chan, const char *category, int imap, const char *flag)
+static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, const char *fromfolder, char *cidnum, char *cidname, char *attach, char *attach2, char *format, int duration, int attach_user_voicemail, struct ast_channel *chan, const char *category, int imap, const char *flag)
{
char date[256];
char host[MAXHOSTNAMELEN] = "";
@@ -4061,7 +4089,7 @@
if ((ast = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", "", "", 0, "Substitution/voicemail"))) {
char *ptr;
memset(passdata2, 0, len_passdata2);
- prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, enc_cidnum, enc_cidname, dur, date, passdata2, len_passdata2, category, flag);
+ prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, fromfolder, enc_cidnum, enc_cidname, dur, date, passdata2, len_passdata2, category, flag);
pbx_substitute_variables_helper(ast, fromstring, passdata2, len_passdata2);
len_passdata = strlen(passdata2) * 3 + 300;
passdata = alloca(len_passdata);
@@ -4112,7 +4140,7 @@
}
memset(passdata, 0, len_passdata);
- prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, cidnum, cidname, dur, date, passdata, len_passdata, category, flag);
+ prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, fromfolder, cidnum, cidname, dur, date, passdata, len_passdata, category, flag);
pbx_substitute_variables_helper(ast, e_subj, passdata, len_passdata);
if (check_mime(passdata)) {
int first_line = 1;
@@ -4198,17 +4226,57 @@
int vmlen = strlen(e_body) * 3 + 200;
passdata = alloca(vmlen);
memset(passdata, 0, vmlen);
- prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, cidnum, cidname, dur, date, passdata, vmlen, category, flag);
+ prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, fromfolder, cidnum, cidname, dur, date, passdata, vmlen, category, flag);
pbx_substitute_variables_helper(ast, e_body, passdata, vmlen);
fprintf(p, "%s" ENDL, passdata);
ast_channel_free(ast);
} else
ast_log(AST_LOG_WARNING, "Cannot allocate the channel for variables substitution\n");
- } else if (msgnum > -1){
- fprintf(p, "Dear %s:" ENDL ENDL "\tJust wanted to let you know you were just left a %s long %s message (number %d)" ENDL
- "in mailbox %s from %s, on %s so you might" ENDL
- "want to check it when you get a chance. Thanks!" ENDL ENDL "\t\t\t\t--Asterisk" ENDL ENDL, vmu->fullname,
- dur, flag, msgnum + 1, mailbox, (cidname ? cidname : (cidnum ? cidnum : "an unknown caller")), date);
+ } else if (msgnum > -1) {
+ if (strcmp(vmu->mailbox, mailbox)) {
+ /* Forwarded type */
+ struct ast_config *msg_cfg;
+ const char *v;
+ int inttime;
+ char fromdir[256], fromfile[256], origdate[80] = "", origcallerid[80] = "";
+ struct ast_flags config_flags = { CONFIG_FLAG_NOCACHE };
+ /* Retrieve info from VM attribute file */
+ make_dir(fromdir, sizeof(fromdir), vmu->context, vmu->mailbox, fromfolder);
+ make_file(fromfile, sizeof(fromfile), fromdir, msgnum);
+ if (strlen(fromfile) < sizeof(fromfile) - 5) {
+ strcat(fromfile, ".txt");
+ }
+ if ((msg_cfg = ast_config_load(fromfile, config_flags))) {
+ if ((v = ast_variable_retrieve(msg_cfg, "message", "callerid"))) {
+ ast_copy_string(origcallerid, v, sizeof(origcallerid));
+ }
+
+ /* You might be tempted to do origdate, except that a) it's in the wrong
+ * format, and b) it's missing for IMAP recordings. */
+ if ((v = ast_variable_retrieve(msg_cfg, "message", "origtime")) && sscanf(v, "%d", &inttime) == 1) {
+ struct timeval tv = { inttime, };
+ struct ast_tm tm;
+ ast_localtime(&tv, &tm, NULL);
+ ast_strftime(origdate, sizeof(origdate), emaildateformat, &tm);
+ }
+ fprintf(p, "Dear %s:" ENDL ENDL "\tJust wanted to let you know you were just forwarded"
+ " a %s long message (number %d)" ENDL "in mailbox %s from %s, on %s" ENDL
+ "(originally sent by %s on %s)" ENDL "so you might want to check it when you get a"
+ " chance. Thanks!" ENDL ENDL "\t\t\t\t--Asterisk" ENDL ENDL, vmu->fullname, dur,
+ msgnum + 1, mailbox, (cidname ? cidname : (cidnum ? cidnum : "an unknown caller")),
+ date, origcallerid, origdate);
+ ast_config_destroy(msg_cfg);
+ } else {
+ goto plain_message;
+ }
+ } else {
+plain_message:
+ fprintf(p, "Dear %s:" ENDL ENDL "\tJust wanted to let you know you were just left a "
+ "%s long message (number %d)" ENDL "in mailbox %s from %s, on %s so you might" ENDL
+ "want to check it when you get a chance. Thanks!" ENDL ENDL "\t\t\t\t--Asterisk"
+ ENDL ENDL, vmu->fullname, dur, msgnum + 1, mailbox,
+ (cidname ? cidname : (cidnum ? cidnum : "an unknown caller")), date);
+ }
} else {
fprintf(p, "This message is to let you know that your greeting was changed on %s." ENDL
"Please do not delete this message, lest your greeting vanish with it." ENDL ENDL, date);
@@ -4283,7 +4351,7 @@
}
#undef ENDL
-static int sendmail(char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, char *attach, char *attach2, char *format, int duration, int attach_user_voicemail, struct ast_channel *chan, const char *category, const char *flag)
+static int sendmail(char *srcemail, struct ast_vm_user *vmu, int msgnum, char *context, char *mailbox, const char *fromfolder, char *cidnum, char *cidname, char *attach, char *attach2, char *format, int duration, int attach_user_voicemail, struct ast_channel *chan, const char *category, const char *flag)
{
FILE *p=NULL;
char tmp[80] = "/tmp/astmail-XXXXXX";
@@ -4302,7 +4370,7 @@
ast_log(AST_LOG_WARNING, "Unable to launch '%s' (can't create temporary file)\n", mailcmd);
return -1;
} else {
- make_email_file(p, srcemail, vmu, msgnum, context, mailbox, cidnum, cidname, attach, attach2, format, duration, attach_user_voicemail, chan, category, 0, flag);
+ make_email_file(p, srcemail, vmu, msgnum, context, mailbox, fromfolder, cidnum, cidname, attach, attach2, format, duration, attach_user_voicemail, chan, category, 0, flag);
fclose(p);
snprintf(tmp2, sizeof(tmp2), "( %s < %s ; rm -f %s ) &", mailcmd, tmp, tmp);
ast_safe_system(tmp2);
@@ -4311,7 +4379,7 @@
return 0;
}
-static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char *mailbox, char *cidnum, char *cidname, int duration, struct ast_vm_user *vmu, const char *category, const char *flag)
+static int sendpage(char *srcemail, char *pager, int msgnum, char *context, char *mailbox, const char *fromfolder, char *cidnum, char *cidname, int duration, struct ast_vm_user *vmu, const char *category, const char *flag)
{
char date[256];
char host[MAXHOSTNAMELEN] = "";
@@ -4342,7 +4410,7 @@
int vmlen = strlen(fromstring)*3 + 200;
passdata = alloca(vmlen);
memset(passdata, 0, vmlen);
- prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, cidnum, cidname, dur, date, passdata, vmlen, category, flag);
+ prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, fromfolder, cidnum, cidname, dur, date, passdata, vmlen, category, flag);
pbx_substitute_variables_helper(ast, pagerfromstring, passdata, vmlen);
fprintf(p, "From: %s <%s>\n", passdata, who);
ast_channel_free(ast);
@@ -4358,7 +4426,7 @@
int vmlen = strlen(pagersubject) * 3 + 200;
passdata = alloca(vmlen);
memset(passdata, 0, vmlen);
- prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, cidnum, cidname, dur, date, passdata, vmlen, category, flag);
+ prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, fromfolder, cidnum, cidname, dur, date, passdata, vmlen, category, flag);
pbx_substitute_variables_helper(ast, pagersubject, passdata, vmlen);
fprintf(p, "Subject: %s\n\n", passdata);
ast_channel_free(ast);
@@ -4380,7 +4448,7 @@
int vmlen = strlen(pagerbody) * 3 + 200;
passdata = alloca(vmlen);
memset(passdata, 0, vmlen);
- prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, cidnum, cidname, dur, date, passdata, vmlen, category, flag);
+ prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, fromfolder, cidnum, cidname, dur, date, passdata, vmlen, category, flag);
pbx_substitute_variables_helper(ast, pagerbody, passdata, vmlen);
fprintf(p, "%s\n", passdata);
ast_channel_free(ast);
@@ -6267,14 +6335,15 @@
RETRIEVE(todir, msgnum, vmu->mailbox, vmu->context);
/* XXX possible imap issue, should category be NULL XXX */
- sendmail(myserveremail, vmu, msgnum, vmu->context, vmu->mailbox, cidnum, cidname, fn, NULL, fmt, duration, attach_user_voicemail, chan, category, flag);
+ sendmail(myserveremail, vmu, msgnum, vmu->context, vmu->mailbox, mbox(0), cidnum, cidname, fn, NULL, fmt, duration, attach_user_voicemail, chan, category, flag);
if (attach_user_voicemail)
DISPOSE(todir, msgnum);
}
- if (!ast_strlen_zero(vmu->pager))
- sendpage(myserveremail, vmu->pager, msgnum, vmu->context, vmu->mailbox, cidnum, cidname, duration, vmu, category, flag);
+ if (!ast_strlen_zero(vmu->pager)) {
+ sendpage(myserveremail, vmu->pager, msgnum, vmu->context, vmu->mailbox, mbox(0), cidnum, cidname, duration, vmu, category, flag);
+ }
if (ast_test_flag(vmu, VM_DELETE))
DELETE(todir, msgnum, fn, vmu);
@@ -6454,6 +6523,7 @@
while ((receiver = AST_LIST_REMOVE_HEAD(&extensions, list))) {
free_user(receiver);
}
+ ast_log(LOG_NOTICE, "'%s' is not a valid mailbox\n", s);
valid_extensions = 0;
break;
}
@@ -6527,7 +6597,7 @@
myserveremail = vmtmp->serveremail;
attach_user_voicemail = ast_test_flag(vmtmp, VM_ATTACH);
/* NULL category for IMAP storage */
- sendmail(myserveremail, vmtmp, todircount, vmtmp->context, vmtmp->mailbox, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL), vmstmp.fn, vmstmp.introfn, fmt, duration, attach_user_voicemail, chan, NULL, urgent_str);
+ sendmail(myserveremail, vmtmp, todircount, vmtmp->context, vmtmp->mailbox, dstvms->curbox, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL), vmstmp.fn, vmstmp.introfn, fmt, duration, attach_user_voicemail, chan, NULL, urgent_str);
#else
copy_message(chan, sender, 0, curmsg, duration, vmtmp, fmt, dir, urgent_str);
#endif
Modified: team/group/issue8824/cdr/cdr_radius.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/cdr/cdr_radius.c?view=diff&rev=186520&r1=186519&r2=186520
==============================================================================
--- team/group/issue8824/cdr/cdr_radius.c (original)
+++ team/group/issue8824/cdr/cdr_radius.c Fri Apr 3 17:13:59 2009
@@ -205,12 +205,18 @@
if (build_radius_record(&tosend, cdr)) {
ast_debug(1, "Unable to create RADIUS record. CDR not recorded!\n");
- return result;
+ goto return_cleanup;
}
result = rc_acct(rh, 0, tosend);
- if (result != OK_RC)
+ if (result != OK_RC) {
ast_log(LOG_ERROR, "Failed to record Radius CDR record!\n");
+ }
+
+return_cleanup:
+ if (tosend) {
+ rc_avpair_free(tosend);
+ }
return result;
}
Modified: team/group/issue8824/channels/chan_agent.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/channels/chan_agent.c?view=diff&rev=186520&r1=186519&r2=186520
==============================================================================
--- team/group/issue8824/channels/chan_agent.c (original)
+++ team/group/issue8824/channels/chan_agent.c Fri Apr 3 17:13:59 2009
@@ -52,7 +52,6 @@
#include "asterisk/pbx.h"
#include "asterisk/sched.h"
#include "asterisk/io.h"
-#include "asterisk/rtp.h"
#include "asterisk/acl.h"
#include "asterisk/callerid.h"
#include "asterisk/file.h"
Modified: team/group/issue8824/channels/chan_bridge.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/channels/chan_bridge.c?view=diff&rev=186520&r1=186519&r2=186520
==============================================================================
--- team/group/issue8824/channels/chan_bridge.c (original)
+++ team/group/issue8824/channels/chan_bridge.c Fri Apr 3 17:13:59 2009
@@ -39,7 +39,6 @@
#include "asterisk/pbx.h"
#include "asterisk/sched.h"
#include "asterisk/io.h"
-#include "asterisk/rtp.h"
#include "asterisk/acl.h"
#include "asterisk/callerid.h"
#include "asterisk/file.h"
Modified: team/group/issue8824/channels/chan_dahdi.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/channels/chan_dahdi.c?view=diff&rev=186520&r1=186519&r2=186520
==============================================================================
--- team/group/issue8824/channels/chan_dahdi.c (original)
+++ team/group/issue8824/channels/chan_dahdi.c Fri Apr 3 17:13:59 2009
@@ -2532,9 +2532,6 @@
/* Don't delete if we don't think it's conferenced at all (implied) */
) return 0;
memset(&zi, 0, sizeof(zi));
- zi.chan = 0;
- zi.confno = 0;
- zi.confmode = 0;
if (ioctl(c->dfd, DAHDI_SETCONF, &zi)) {
ast_log(LOG_WARNING, "Failed to drop %d from conference %d/%d: %s\n", c->dfd, c->curconf.confmode, c->curconf.confno, strerror(errno));
return -1;
@@ -2590,11 +2587,12 @@
static int reset_conf(struct dahdi_pvt *p)
{
- struct dahdi_confinfo zi;
- memset(&zi, 0, sizeof(zi));
p->confno = -1;
memset(&p->subs[SUB_REAL].curconf, 0, sizeof(p->subs[SUB_REAL].curconf));
if (p->subs[SUB_REAL].dfd > -1) {
+ struct dahdi_confinfo zi;
+
+ memset(&zi, 0, sizeof(zi));
if (ioctl(p->subs[SUB_REAL].dfd, DAHDI_SETCONF, &zi))
ast_log(LOG_WARNING, "Failed to reset conferencing on channel %d: %s\n", p->channel, strerror(errno));
}
@@ -2908,8 +2906,7 @@
p->saveconf.confmode = 0;
return -1;
}
- c.chan = 0;
- c.confno = 0;
+ memset(&c, 0, sizeof(c));
c.confmode = DAHDI_CONF_NORMAL;
res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_SETCONF, &c);
if (res) {
@@ -4599,6 +4596,7 @@
case SIG_FXOGS:
case SIG_FXOLS:
case SIG_FXOKS:
+ memset(&par, 0, sizeof(par));
res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_GET_PARAMS, &par);
if (!res) {
#if 0
@@ -5576,6 +5574,7 @@
}
/* No alarms on the span. Check for channel alarms. */
+ memset(¶ms, 0, sizeof(params));
if ((res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_GET_PARAMS, ¶ms)) >= 0)
return params.chan_alarms;
@@ -6202,6 +6201,7 @@
{
struct dahdi_params par;
+ memset(&par, 0, sizeof(par));
if (ioctl(p->oprpeer->subs[SUB_REAL].dfd, DAHDI_GET_PARAMS, &par) != -1)
{
if (!par.rxisoffhook)
@@ -6694,6 +6694,7 @@
{
struct dahdi_params ps;
+ memset(&ps, 0, sizeof(ps));
ps.channo = p->channel;
if (ioctl(p->subs[SUB_REAL].dfd, DAHDI_GET_PARAMS, &ps) < 0) {
ast_mutex_unlock(&p->lock);
@@ -7387,6 +7388,7 @@
if (!tmp)
return NULL;
tmp->tech = &dahdi_tech;
+ memset(&ps, 0, sizeof(ps));
ps.channo = i->channel;
res = ioctl(i->subs[SUB_REAL].dfd, DAHDI_GET_PARAMS, &ps);
if (res) {
@@ -7404,7 +7406,7 @@
deflaw = AST_FORMAT_ULAW;
}
ast_channel_set_fd(tmp, 0, i->subs[idx].dfd);
- tmp->nativeformats = AST_FORMAT_SLINEAR | deflaw;
+ tmp->nativeformats = deflaw;
/* Start out assuming ulaw since it's smaller :) */
tmp->rawreadformat = deflaw;
tmp->readformat = deflaw;
@@ -10216,9 +10218,10 @@
#endif
} else {
chan_sig = tmp->sig;
- memset(&p, 0, sizeof(p));
- if (tmp->subs[SUB_REAL].dfd > -1)
+ if (tmp->subs[SUB_REAL].dfd > -1) {
+ memset(&p, 0, sizeof(p));
res = ioctl(tmp->subs[SUB_REAL].dfd, DAHDI_GET_PARAMS, &p);
+ }
}
/* Adjust starttime on loopstart and kewlstart trunks to reasonable values */
switch (chan_sig) {
@@ -10599,9 +10602,10 @@
if (!p->sig || (p->sig == SIG_FXSLS))
return 1;
/* Check hook state */
- if (p->subs[SUB_REAL].dfd > -1)
+ if (p->subs[SUB_REAL].dfd > -1) {
+ memset(&par, 0, sizeof(par));
res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_GET_PARAMS, &par);
- else {
+ } else {
/* Assume not off hook on CVRS */
res = 0;
par.rxisoffhook = 0;
@@ -11937,6 +11941,7 @@
if (!explicit) {
spanfd = pri_active_dchan_fd(pri);
+ memset(¶m, 0, sizeof(param));
if (ioctl(spanfd, DAHDI_GET_PARAMS, ¶m))
return -1;
span = pris[param.spanno - 1].prilogicalspan;
@@ -13402,6 +13407,7 @@
ast_log(LOG_ERROR, "Unable to open D-channel %d (%s)\n", x, strerror(errno));
return -1;
}
+ memset(&p, 0, sizeof(p));
res = ioctl(pri->fds[i], DAHDI_GET_PARAMS, &p);
if (res) {
dahdi_close_pri_fd(pri, i);
@@ -13423,6 +13429,7 @@
pri->dchanavail[i] |= DCHAN_NOTINALARM;
else
pri->dchanavail[i] &= ~DCHAN_NOTINALARM;
+ memset(&bi, 0, sizeof(bi));
bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.numbufs = 32;
@@ -14634,12 +14641,14 @@
memset(&ci, 0, sizeof(ci));
ps.channo = tmp->channel;
if (tmp->subs[SUB_REAL].dfd > -1) {
+ memset(&ci, 0, sizeof(ci));
if (!ioctl(tmp->subs[SUB_REAL].dfd, DAHDI_GETCONF, &ci)) {
ast_cli(a->fd, "Actual Confinfo: Num/%d, Mode/0x%04x\n", ci.confno, ci.confmode);
}
if (!ioctl(tmp->subs[SUB_REAL].dfd, DAHDI_GETCONFMUTE, &x)) {
ast_cli(a->fd, "Actual Confmute: %s\n", x ? "Yes" : "No");
}
+ memset(&ps, 0, sizeof(ps));
if (ioctl(tmp->subs[SUB_REAL].dfd, DAHDI_GET_PARAMS, &ps) < 0) {
ast_log(LOG_WARNING, "Failed to get parameters on channel %d: %s\n", tmp->channel, strerror(errno));
} else {
@@ -15299,6 +15308,7 @@
ast_log(LOG_ERROR, "Unable to open SS7 sigchan %d (%s)\n", sigchan, strerror(errno));
return -1;
}
+ memset(&p, 0, sizeof(p));
res = ioctl(link->fds[curfd], DAHDI_GET_PARAMS, &p);
if (res) {
dahdi_close_ss7_fd(link, curfd);
@@ -15311,6 +15321,7 @@
return -1;
}
+ memset(&bi, 0, sizeof(bi));
bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.numbufs = 32;
Modified: team/group/issue8824/channels/chan_gtalk.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/issue8824/channels/chan_gtalk.c?view=diff&rev=186520&r1=186519&r2=186520
==============================================================================
--- team/group/issue8824/channels/chan_gtalk.c (original)
+++ team/group/issue8824/channels/chan_gtalk.c Fri Apr 3 17:13:59 2009
@@ -52,7 +52,8 @@
#include "asterisk/pbx.h"
#include "asterisk/sched.h"
#include "asterisk/io.h"
-#include "asterisk/rtp.h"
+#include "asterisk/rtp_engine.h"
+#include "asterisk/stun.h"
#include "asterisk/acl.h"
#include "asterisk/callerid.h"
#include "asterisk/file.h"
@@ -112,8 +113,8 @@
char cid_name[80]; /*!< Caller ID name */
char exten[80]; /*!< Called extension */
struct ast_channel *owner; /*!< Master Channel */
- struct ast_rtp *rtp; /*!< RTP audio session */
- struct ast_rtp *vrtp; /*!< RTP video session */
+ struct ast_rtp_instance *rtp; /*!< RTP audio session */
+ struct ast_rtp_instance *vrtp; /*!< RTP video session */
int jointcapability; /*!< Supported capability at both ends (codecs ) */
int peercapability;
struct gtalk_pvt *next; /* Next entity */
@@ -183,11 +184,6 @@
static struct gtalk_pvt *gtalk_alloc(struct gtalk *client, const char *us, const char *them, const char *sid);
static char *gtalk_do_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
static char *gtalk_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
-/*----- RTP interface functions */
-static int gtalk_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp,
- struct ast_rtp *vrtp, struct ast_rtp *trtp, int codecs, int nat_active);
-static enum ast_rtp_get_result gtalk_get_rtp_peer(struct ast_channel *chan, struct ast_rtp **rtp);
-static int gtalk_get_codec(struct ast_channel *chan);
/*! \brief PBX interface structure for channel registration */
static const struct ast_channel_tech gtalk_tech = {
@@ -197,7 +193,7 @@
.requester = gtalk_request,
.send_digit_begin = gtalk_digit_begin,
.send_digit_end = gtalk_digit_end,
- .bridge = ast_rtp_bridge,
+ .bridge = ast_rtp_instance_bridge,
.call = gtalk_call,
.hangup = gtalk_hangup,
.answer = gtalk_answer,
@@ -215,14 +211,6 @@
static struct sched_context *sched; /*!< The scheduling context */
static struct io_context *io; /*!< The IO context */
static struct in_addr __ourip;
-
-/*! \brief RTP driver interface */
-static struct ast_rtp_protocol gtalk_rtp = {
- type: "Gtalk",
- get_rtp_info: gtalk_get_rtp_peer,
- set_rtp_peer: gtalk_set_rtp_peer,
- get_codec: gtalk_get_codec,
-};
static struct ast_cli_entry gtalk_cli[] = {
AST_CLI_DEFINE(gtalk_do_reload, "Reload GoogleTalk configuration"),
@@ -371,7 +359,7 @@
iks_insert_node(dcodecs, payload_gsm);
res++;
}
- ast_rtp_lookup_code(p->rtp, 1, codec);
+
return res;
}
@@ -523,18 +511,19 @@
return res;
}
-static enum ast_rtp_get_result gtalk_get_rtp_peer(struct ast_channel *chan, struct ast_rtp **rtp)
+static enum ast_rtp_glue_result gtalk_get_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance **instance)
{
struct gtalk_pvt *p = chan->tech_pvt;
- enum ast_rtp_get_result res = AST_RTP_GET_FAILED;
+ enum ast_rtp_glue_result res = AST_RTP_GLUE_RESULT_FORBID;
if (!p)
return res;
ast_mutex_lock(&p->lock);
if (p->rtp){
- *rtp = p->rtp;
- res = AST_RTP_TRY_PARTIAL;
+ ao2_ref(p->rtp, +1);
+ *instance = p->rtp;
+ res = AST_RTP_GLUE_RESULT_LOCAL;
}
ast_mutex_unlock(&p->lock);
@@ -547,7 +536,7 @@
return p->peercapability;
}
-static int gtalk_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, struct ast_rtp *trtp, int codecs, int nat_active)
+static int gtalk_set_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance *rtp, struct ast_rtp_instance *vrtp, struct ast_rtp_instance *trtp, int codecs, int nat_active)
{
struct gtalk_pvt *p;
@@ -566,6 +555,13 @@
ast_mutex_unlock(&p->lock);
return 0;
}
+
+static struct ast_rtp_glue gtalk_rtp_glue = {
+ .type = "Gtalk",
+ .get_rtp_info = gtalk_get_rtp_peer,
+ .get_codec = gtalk_get_codec,
+ .update_peer = gtalk_set_rtp_peer,
+};
static int gtalk_response(struct gtalk *client, char *from, ikspak *pak, const char *reasonstr, const char *reasonstr2)
{
@@ -617,13 +613,13 @@
/* codec points to the first <payload-type/> tag */
codec = iks_first_tag(iks_first_tag(iks_first_tag(pak->x)));
while (codec) {
- ast_rtp_set_m_type(tmp->rtp, atoi(iks_find_attrib(codec, "id")));
- ast_rtp_set_rtpmap_type(tmp->rtp, atoi(iks_find_attrib(codec, "id")), "audio", iks_find_attrib(codec, "name"), 0);
+ ast_rtp_codecs_payloads_set_m_type(ast_rtp_instance_get_codecs(tmp->rtp), tmp->rtp, atoi(iks_find_attrib(codec, "id")));
+ ast_rtp_codecs_payloads_set_rtpmap_type(ast_rtp_instance_get_codecs(tmp->rtp), tmp->rtp, atoi(iks_find_attrib(codec, "id")), "audio", iks_find_attrib(codec, "name"), 0);
codec = iks_next_tag(codec);
}
/* Now gather all of the codecs that we are asked for */
- ast_rtp_get_current_formats(tmp->rtp, &tmp->peercapability, &peernoncodeccapability);
+ ast_rtp_codecs_payload_formats(ast_rtp_instance_get_codecs(tmp->rtp), &tmp->peercapability, &peernoncodeccapability);
/* at this point, we received an awser from the remote Gtalk client,
which allows us to compare capabilities */
@@ -810,7 +806,7 @@
goto safeout;
}
- ast_rtp_get_us(p->rtp, &sin);
+ ast_rtp_instance_get_local_address(p->rtp, &sin);
ast_find_ourip(&us, bindaddr);
if (!strcmp(ast_inet_ntoa(us), "127.0.0.1")) {
ast_log(LOG_WARNING, "Found a loopback IP on the system, check your network configuration or set the bindaddr attribute.");
@@ -951,8 +947,9 @@
tmp->initiator = 1;
}
/* clear codecs */
- tmp->rtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, bindaddr.sin_addr);
- ast_rtp_pt_clear(tmp->rtp);
+ tmp->rtp = ast_rtp_instance_new(NULL, sched, &bindaddr, NULL);
+ ast_rtp_instance_set_prop(tmp->rtp, AST_RTP_PROPERTY_RTCP, 1);
+ ast_rtp_codecs_payloads_clear(ast_rtp_instance_get_codecs(tmp->rtp), tmp->rtp);
/* add user configured codec capabilites */
if (client->capability)
@@ -1014,20 +1011,20 @@
/* Set Frame packetization */
if (i->rtp)
- ast_rtp_codec_setpref(i->rtp, &i->prefs);
+ ast_rtp_codecs_packetization_set(ast_rtp_instance_get_codecs(i->rtp), i->rtp, &i->prefs);
tmp->nativeformats = ast_codec_choose(&i->prefs, what, 1) | (i->jointcapability & AST_FORMAT_VIDEO_MASK);
fmt = ast_best_codec(tmp->nativeformats);
if (i->rtp) {
- ast_rtp_setstun(i->rtp, 1);
- ast_channel_set_fd(tmp, 0, ast_rtp_fd(i->rtp));
- ast_channel_set_fd(tmp, 1, ast_rtcp_fd(i->rtp));
+ ast_rtp_instance_set_prop(i->rtp, AST_RTP_PROPERTY_STUN, 1);
+ ast_channel_set_fd(tmp, 0, ast_rtp_instance_fd(i->rtp, 0));
+ ast_channel_set_fd(tmp, 1, ast_rtp_instance_fd(i->rtp, 1));
}
if (i->vrtp) {
- ast_rtp_setstun(i->rtp, 1);
- ast_channel_set_fd(tmp, 2, ast_rtp_fd(i->vrtp));
- ast_channel_set_fd(tmp, 3, ast_rtcp_fd(i->vrtp));
+ ast_rtp_instance_set_prop(i->vrtp, AST_RTP_PROPERTY_STUN, 1);
+ ast_channel_set_fd(tmp, 2, ast_rtp_instance_fd(i->vrtp, 0));
+ ast_channel_set_fd(tmp, 3, ast_rtp_instance_fd(i->vrtp, 1));
}
if (state == AST_STATE_RING)
tmp->rings = 1;
@@ -1142,9 +1139,9 @@
if (p->owner)
ast_log(LOG_WARNING, "Uh oh, there's an owner, this is going to be messy.\n");
if (p->rtp)
- ast_rtp_destroy(p->rtp);
+ ast_rtp_instance_destroy(p->rtp);
if (p->vrtp)
- ast_rtp_destroy(p->vrtp);
+ ast_rtp_instance_destroy(p->vrtp);
gtalk_free_candidates(p->theircandidates);
ast_free(p);
}
@@ -1207,13 +1204,13 @@
codec = iks_first_tag(iks_first_tag(iks_first_tag(pak->x)));
while (codec) {
- ast_rtp_set_m_type(p->rtp, atoi(iks_find_attrib(codec, "id")));
- ast_rtp_set_rtpmap_type(p->rtp, atoi(iks_find_attrib(codec, "id")), "audio", iks_find_attrib(codec, "name"), 0);
+ ast_rtp_codecs_payloads_set_m_type(ast_rtp_instance_get_codecs(p->rtp), p->rtp, atoi(iks_find_attrib(codec, "id")));
+ ast_rtp_codecs_payloads_set_rtpmap_type(ast_rtp_instance_get_codecs(p->rtp), p->rtp, atoi(iks_find_attrib(codec, "id")), "audio", iks_find_attrib(codec, "name"), 0);
codec = iks_next_tag(codec);
}
/* Now gather all of the codecs that we are asked for */
- ast_rtp_get_current_formats(p->rtp, &p->peercapability, &peernoncodeccapability);
+ ast_rtp_codecs_payload_formats(ast_rtp_instance_get_codecs(p->rtp), &p->peercapability, &peernoncodeccapability);
p->jointcapability = p->capability & p->peercapability;
ast_mutex_unlock(&p->lock);
@@ -1277,16 +1274,16 @@
p->ourcandidates->username);
/* Find out the result of the STUN */
- ast_rtp_get_peer(p->rtp, &aux);
+ ast_rtp_instance_get_remote_address(p->rtp, &aux);
/* If the STUN result is different from the IP of the hostname,
lock on the stun IP of the hostname advertised by the
remote client */
if (aux.sin_addr.s_addr &&
aux.sin_addr.s_addr != sin.sin_addr.s_addr)
- ast_rtp_stun_request(p->rtp, &aux, username);
+ ast_rtp_instance_stun_request(p->rtp, &aux, username);
else
- ast_rtp_stun_request(p->rtp, &sin, username);
+ ast_rtp_instance_stun_request(p->rtp, &sin, username);
if (aux.sin_addr.s_addr) {
ast_debug(4, "Receiving RTP traffic from IP %s, matches with remote candidate's IP %s\n", ast_inet_ntoa(aux.sin_addr), tmp->ip);
@@ -1387,7 +1384,7 @@
if (!p->rtp)
return &ast_null_frame;
- f = ast_rtp_read(p->rtp);
+ f = ast_rtp_instance_read(p->rtp, 0);
gtalk_update_stun(p->parent, p);
if (p->owner) {
/* We already hold the channel lock */
@@ -1438,7 +1435,7 @@
if (p) {
ast_mutex_lock(&p->lock);
if (p->rtp) {
- res = ast_rtp_write(p->rtp, frame);
+ res = ast_rtp_instance_write(p->rtp, frame);
}
ast_mutex_unlock(&p->lock);
}
@@ -1447,7 +1444,7 @@
if (p) {
[... 4740 lines stripped ...]
More information about the svn-commits
mailing list