[asterisk-commits] qwell: branch qwell/pimp_my_dtmf r385740 - in /team/qwell/pimp_my_dtmf: ./ ap...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Apr 15 11:35:28 CDT 2013
Author: qwell
Date: Mon Apr 15 11:35:22 2013
New Revision: 385740
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385740
Log:
Multiple revisions 385359,385433,385476,385524,385553,385598,385640,385684,385721
........
r385359 | root | 2013-04-11 15:17:38 -0500 (Thu, 11 Apr 2013) | 15 lines
Blocked revisions 385356
........
Add dependency on libuuid, for res_rtp_asterisk
pjproject is what actually requires libuuid.
(closes issue ASTERISK-21125)
reported by Private Name
(Ed. note: Really? Private Name? I am rolling my eyes so hard right now.)
........
Merged revisions 385357 from file:///srv/subversion/repos/asterisk/trunk
........
r385433 | root | 2013-04-12 04:18:42 -0500 (Fri, 12 Apr 2013) | 51 lines
Multiple revisions 385406,385431
........
r385406 | alecdavis | 2013-04-12 03:18:20 -0500 (Fri, 12 Apr 2013) | 24 lines
IAX2, prevent network thread starting before all helper threads are ready
On startup, it's possible for a frame to arrive before the processing threads were ready.
In iax2_process_thread() the first pass through falls into ast_cond_wait, should a frame arrive
before we are at ast_cond_wait, the signal will be ignored.
The result iax2_process_thread stays at ast_cond_wait forever, with deferred frames being queued.
Fix: When creating initial idle iax2_process_threads, wait for init_cond to be signalled
after each thread is started.
(issue ASTERISK-18827)
Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)
Review https://reviewboard.asterisk.org/r/2427/
........
Merged revisions 385402 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 385403 from http://svn.asterisk.org/svn/asterisk/branches/11
........
r385431 | alecdavis | 2013-04-12 03:52:44 -0500 (Fri, 12 Apr 2013) | 17 lines
IAX2 defer_full_frames fail to get sent
Ensure iax2_process_thread is signalled when a deferred frame is queued to it.
(closes issue ASTERISK-18827)
Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)
Review https://reviewboard.asterisk.org/r/2426/
........
Merged revisions 385429 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 385430 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 385406,385431 from file:///srv/subversion/repos/asterisk/trunk
........
r385476 | root | 2013-04-12 10:18:12 -0500 (Fri, 12 Apr 2013) | 43 lines
Fix One-Way Audio With auto_* NAT Settings When SIP Calls Initiated By PBX
When we reload Asterisk or chan_sip, the flags force_rport and comedia that are
turned on and off when using the auto_force_rport and auto_comedia nat settings
go back to the default setting off. These flags are turned on when needed or
off when not needed at the time that a peer registers, re-registers or initiates
a call. This would apply even when only the default global setting
"nat=auto_force_rport" is being used, which in this case would only affect the
force_rport flag.
Everything is good except for the following: The nat setting is set to
auto_force_rport and auto_comedia. We reload Asterisk and the peer's
registration has not expired. We load in the settings for the peer which turns
force_rport and comedia back to off. Since the peer has not re-registered or
placed a call yet, those flags remain off. We then initiate a call to the peer
from the PBX. The force_rport and comedia flags stay off. If NAT is involved,
we end up with one-way audio since we never checked to see if the peer is behind
NAT or not.
This patch does the following:
* Moves the checking of whether a peer is behind NAT into its own function
* Create a function to set the peer's NAT flags if they are using the auto_* NAT
settings
* Adds calls in sip_request_call() to these new functions in order to setup the
dialog according to the peer's settings
(closes issue ASTERISK-21374)
Reported by: Michael L. Young
Tested by: Michael L. Young
Patches:
asterisk-21374-auto-nat-outgoing-fix_v2.diff Michael L. Young (license 5026)
Review: https://reviewboard.asterisk.org/r/2421/
........
Merged revisions 385473 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 385474 from file:///srv/subversion/repos/asterisk/trunk
........
r385524 | root | 2013-04-12 16:17:22 -0500 (Fri, 12 Apr 2013) | 8 lines
Expose channel snapshot manager blob generation
These functions are already used in one branch (jrose's parking branch)
and will soon be used in other branches as well.
........
Merged revisions 385522 from file:///srv/subversion/repos/asterisk/trunk
........
r385553 | root | 2013-04-12 17:17:39 -0500 (Fri, 12 Apr 2013) | 5 lines
Fix documentation.
........
Merged revisions 385548 from file:///srv/subversion/repos/asterisk/trunk
........
r385598 | root | 2013-04-12 18:17:39 -0500 (Fri, 12 Apr 2013) | 84 lines
Multiple revisions 385573,385585,385595
........
r385573 | elguero | 2013-04-12 17:22:58 -0500 (Fri, 12 Apr 2013) | 36 lines
Fix app_voicemail Segfault And A Few Memory Leaks
The original report was that app_voicemail would crash. This was caused by
ast_config_load() returning CONFIG_STATUS_FILEINVALID but no checks being
performed for that return status. After adding the initial patch to fix this
issue, Jaco Kroon (jkroon) added some fixes to memory leaks he had discovered.
During review, Walter Doekes (wdoekes) suggested adding a helper function in
order to determine if we had a valid configuration or not.
This patch does the following:
* Creates a helper function to check if the configuration is valid
* Adds calls to the new helper function where appropiate
* Fixes memory leaks where the code returned without running
ast_config_destroy() on the configuration that was loaded
(closes issue ASTERISK-21302)
Reported by: Jaco Kroon
Tested by: Jaco Kroon, Michael L. Young
Patches:
asterisk-11.3.0-app_voicemail-ast_config-fixes.patch
Jaco Kroon (license 5671)
asterisk-21302-valid_cfg_and_mem_leaks_v3-1.8.diff
Michael L. Young (license 5026)
Review: https://reviewboard.asterisk.org/r/2443/
........
Merged revisions 385551 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 385557 from http://svn.asterisk.org/svn/asterisk/branches/11
........
r385585 | kmoore | 2013-04-12 17:26:17 -0500 (Fri, 12 Apr 2013) | 14 lines
Allow codec_resample to be unloaded
Ensure that trans_size is correct to prevent uninitialized entries from
preventing reload.
(closes issue ASTERISK-21401)
Reported by: Corey Farrell
Tested by: Corey Farrell
Patches:
codec_resample-unload.patch uploaded by Corey Farrell
........
Merged revisions 385582 from http://svn.asterisk.org/svn/asterisk/branches/11
........
r385595 | elguero | 2013-04-12 17:38:56 -0500 (Fri, 12 Apr 2013) | 22 lines
Fix Manager Segfault When app_queue Is Unloaded
When app_queue is unloaded, some manager commands are not being unregistered
which result in a segfault. This patch corrects this.
(closes issue ASTERISK-21397)
Reported by: Peter Katzmann, Corey Farrell
Tested by: Corey Farrell
Patches:
asterisk-21397-missing-unreg-manager-cmd_1.8.diff
Michael L. Young (license 5026)
asterisk-21397-missing-unreg-manager-cmd_11.diff
Michael L. Young (license 5026)
Review: https://reviewboard.asterisk.org/r/2444/
........
Merged revisions 385593 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 385594 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 385573,385585,385595 from file:///srv/subversion/repos/asterisk/trunk
........
r385640 | root | 2013-04-13 22:17:43 -0500 (Sat, 13 Apr 2013) | 52 lines
Multiple revisions 385635,385638
........
r385635 | mjordan | 2013-04-13 21:35:04 -0500 (Sat, 13 Apr 2013) | 23 lines
Don't attempt to create a voice frame on a read error
Prior to this patch, a read error in snd_pcm_readi would still be treated as a
nominal result when constructing a voice frame from the expected data. Since
the value returned is negative, as opposed to the number of samples read,
this could result in a crash. With this patch, we now return a null frame
when a read error is detected.
Note that the patch on ASTERISK-21329 was modified slightly for this commit,
in that we bail immediately on detecting the read error, rather than bypassing
the construction of the voice frame.
(closes issue ASTERISK-21329)
Reported by: Keiichiro Kawasaki
patches:
chan_alsa.diff uploaded by kawasaki (License 6489)
........
Merged revisions 385633 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 385634 from http://svn.asterisk.org/svn/asterisk/branches/11
........
r385638 | mjordan | 2013-04-13 22:01:33 -0500 (Sat, 13 Apr 2013) | 19 lines
Calculate the timestamp for outbound RTP if we don't have timing information
This patch calculates the timestamp for outbound RTP when we don't have timing
information. This uses the same approach in res_rtp_asterisk. Thanks to both
Pietro and Tzafrir for providing patches.
(closes issue ASTERISK-19883)
Reported by: Giacomo Trovato
Tested by: Pietro Bertera, Tzafrir Cohen
patches:
rtp-timestamp-1.8.patch uploaded by tzafrir (License 5035)
rtp-timestamp.patch uploaded by pbertera (License 5943)
........
Merged revisions 385636 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 385637 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 385635,385638 from file:///srv/subversion/repos/asterisk/trunk
........
r385684 | file | 2013-04-15 09:40:11 -0500 (Mon, 15 Apr 2013) | 2 lines
Fix a deadlock due to queueing a frame from a threadpool thread while holding the channel lock in another thread.
........
r385721 | root | 2013-04-15 11:17:41 -0500 (Mon, 15 Apr 2013) | 15 lines
Fix the svn:keywords property on several files.
Normally I think keyword expansion is silly, but the one time it would have
been good, it didn't work because the property had quotes in it. This patch
fixes obviously busted svn:keywords properties.
........
Merged revisions 385683 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 385689 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 385718 from file:///srv/subversion/repos/asterisk/trunk
........
Merged revisions 385359,385433,385476,385524,385553,385598,385640,385684,385721 from http://svn.asterisk.org/svn/asterisk/team/group/pimp_my_sip
Modified:
team/qwell/pimp_my_dtmf/ (props changed)
team/qwell/pimp_my_dtmf/BSDmakefile (props changed)
team/qwell/pimp_my_dtmf/apps/app_queue.c
team/qwell/pimp_my_dtmf/apps/app_saycounted.c (props changed)
team/qwell/pimp_my_dtmf/apps/app_voicemail.c
team/qwell/pimp_my_dtmf/build_tools/sha1sum-sh (props changed)
team/qwell/pimp_my_dtmf/channels/chan_alsa.c
team/qwell/pimp_my_dtmf/channels/chan_gulp.c
team/qwell/pimp_my_dtmf/channels/chan_iax2.c
team/qwell/pimp_my_dtmf/channels/chan_multicast_rtp.c (props changed)
team/qwell/pimp_my_dtmf/channels/chan_sip.c
team/qwell/pimp_my_dtmf/channels/sig_ss7.c (props changed)
team/qwell/pimp_my_dtmf/channels/sig_ss7.h (props changed)
team/qwell/pimp_my_dtmf/channels/sip/include/security_events.h (props changed)
team/qwell/pimp_my_dtmf/channels/sip/security_events.c (props changed)
team/qwell/pimp_my_dtmf/codecs/codec_resample.c
team/qwell/pimp_my_dtmf/configs/res_curl.conf.sample (props changed)
team/qwell/pimp_my_dtmf/contrib/realtime/mysql/musiconhold.sql (props changed)
team/qwell/pimp_my_dtmf/contrib/realtime/mysql/queue_log.sql (props changed)
team/qwell/pimp_my_dtmf/contrib/realtime/mysql/voicemail_data.sql (props changed)
team/qwell/pimp_my_dtmf/contrib/realtime/mysql/voicemail_messages.sql (props changed)
team/qwell/pimp_my_dtmf/doc/Makefile (props changed)
team/qwell/pimp_my_dtmf/include/asterisk/bridging_features.h (props changed)
team/qwell/pimp_my_dtmf/include/asterisk/bridging_technology.h (props changed)
team/qwell/pimp_my_dtmf/include/asterisk/manager.h
team/qwell/pimp_my_dtmf/include/asterisk/select.h (props changed)
team/qwell/pimp_my_dtmf/include/asterisk/sorcery.h
team/qwell/pimp_my_dtmf/main/manager_channels.c
team/qwell/pimp_my_dtmf/res/res_mutestream.c (contents, props changed)
team/qwell/pimp_my_dtmf/res/res_rtp_multicast.c (contents, props changed)
team/qwell/pimp_my_dtmf/res/res_timing_kqueue.c (props changed)
team/qwell/pimp_my_dtmf/tests/test_expr.c (props changed)
team/qwell/pimp_my_dtmf/tests/test_func_file.c (props changed)
team/qwell/pimp_my_dtmf/tests/test_locale.c (props changed)
team/qwell/pimp_my_dtmf/tests/test_poll.c (props changed)
Propchange: team/qwell/pimp_my_dtmf/
------------------------------------------------------------------------------
--- branch-11-blocked (original)
+++ branch-11-blocked Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-/branches/11:373240,375247,375702
+/branches/11:373240,375247,375702,385356
Propchange: team/qwell/pimp_my_dtmf/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.
Propchange: team/qwell/pimp_my_dtmf/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-/team/group/pimp_my_sip:1-385346 /trunk:1-385317
+/team/group/pimp_my_sip:1-385739 /trunk:1-385317
Propchange: team/qwell/pimp_my_dtmf/BSDmakefile
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-'Date Author Id Revision Yoyo'
+Author Date Id Revision
Modified: team/qwell/pimp_my_dtmf/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/pimp_my_dtmf/apps/app_queue.c?view=diff&rev=385740&r1=385739&r2=385740
==============================================================================
--- team/qwell/pimp_my_dtmf/apps/app_queue.c (original)
+++ team/qwell/pimp_my_dtmf/apps/app_queue.c Mon Apr 15 11:35:22 2013
@@ -9857,6 +9857,9 @@
res |= ast_manager_unregister("QueuePause");
res |= ast_manager_unregister("QueueLog");
res |= ast_manager_unregister("QueuePenalty");
+ res |= ast_manager_unregister("QueueReload");
+ res |= ast_manager_unregister("QueueReset");
+ res |= ast_manager_unregister("QueueMemberRingInUse");
res |= ast_unregister_application(app_aqm);
res |= ast_unregister_application(app_rqm);
res |= ast_unregister_application(app_pqm);
Propchange: team/qwell/pimp_my_dtmf/apps/app_saycounted.c
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-'Date Author Id Revision Yoyo'
+Author Date Id Revision
Modified: team/qwell/pimp_my_dtmf/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/pimp_my_dtmf/apps/app_voicemail.c?view=diff&rev=385740&r1=385739&r2=385740
==============================================================================
--- team/qwell/pimp_my_dtmf/apps/app_voicemail.c (original)
+++ team/qwell/pimp_my_dtmf/apps/app_voicemail.c Mon Apr 15 11:35:22 2013
@@ -1719,6 +1719,14 @@
return res;
}
+/*!
+ * \brief Check if configuration file is valid
+ */
+static inline int valid_config(const struct ast_config *cfg)
+{
+ return cfg && cfg != CONFIG_STATUS_FILEINVALID;
+}
+
/*!
* \brief The handler for the change password option.
* \param vmu The voicemail user to work with.
@@ -1755,7 +1763,7 @@
}
/* Fall-through */
case OPT_PWLOC_VOICEMAILCONF:
- if ((cfg = ast_config_load(VOICEMAIL_CONFIG, config_flags)) && cfg != CONFIG_STATUS_FILEINVALID) {
+ if ((cfg = ast_config_load(VOICEMAIL_CONFIG, config_flags)) && valid_config(cfg)) {
while ((category = ast_category_browse(cfg, category))) {
if (!strcasecmp(category, vmu->context)) {
if (!(tmp = ast_variable_retrieve(cfg, category, vmu->mailbox))) {
@@ -1784,14 +1792,17 @@
reset_user_pw(vmu->context, vmu->mailbox, newpassword);
ast_copy_string(vmu->password, newpassword, sizeof(vmu->password));
ast_config_text_file_save(VOICEMAIL_CONFIG, cfg, "AppVoicemail");
+ ast_config_destroy(cfg);
break;
}
+
+ ast_config_destroy(cfg);
}
/* Fall-through */
case OPT_PWLOC_USERSCONF:
/* check users.conf and update the password stored for the mailbox */
/* if no vmsecret entry exists create one. */
- if ((cfg = ast_config_load("users.conf", config_flags)) && cfg != CONFIG_STATUS_FILEINVALID) {
+ if ((cfg = ast_config_load("users.conf", config_flags)) && valid_config(cfg)) {
ast_debug(4, "we are looking for %s\n", vmu->mailbox);
for (category = ast_category_browse(cfg, NULL); category; category = ast_category_browse(cfg, category)) {
ast_debug(4, "users.conf: %s\n", category);
@@ -1825,6 +1836,8 @@
ast_copy_string(vmu->password, newpassword, sizeof(vmu->password));
ast_config_text_file_save("users.conf", cfg, "AppVoicemail");
}
+
+ ast_config_destroy(cfg);
}
}
}
@@ -4179,7 +4192,7 @@
res = -1;
break;
}
- if (cfg && cfg != CONFIG_STATUS_FILEINVALID) {
+ if (valid_config(cfg)) {
if (!(idata.context = ast_variable_retrieve(cfg, "message", "context"))) {
idata.context = "";
}
@@ -4235,7 +4248,7 @@
if (obj) {
ast_odbc_release_obj(obj);
}
- if (cfg)
+ if (valid_config(cfg))
ast_config_destroy(cfg);
if (fdm != MAP_FAILED)
munmap(fdm, fdlen);
@@ -4714,7 +4727,7 @@
if (strlen(fromfile) < sizeof(fromfile) - 5) {
strcat(fromfile, ".txt");
}
- if (!(msg_cfg = ast_config_load(fromfile, config_flags))) {
+ if (!(msg_cfg = ast_config_load(fromfile, config_flags)) || !(valid_config(msg_cfg))) {
ast_debug(1, "Config load for message text file '%s' failed\n", fromfile);
return;
}
@@ -5106,7 +5119,7 @@
if (strlen(fromfile) < sizeof(fromfile) - 5) {
strcat(fromfile, ".txt");
}
- if ((msg_cfg = ast_config_load(fromfile, config_flags))) {
+ if ((msg_cfg = ast_config_load(fromfile, config_flags)) && valid_config(msg_cfg)) {
if ((v = ast_variable_retrieve(msg_cfg, "message", "callerid"))) {
ast_copy_string(origcallerid, v, sizeof(origcallerid));
}
@@ -7592,7 +7605,7 @@
strncat(backup, "-bak", sizeof(backup) - strlen(backup) - 1);
strncat(backup_textfile, "-bak.txt", sizeof(backup_textfile) - strlen(backup_textfile) - 1);
- if ((msg_cfg = ast_config_load(textfile, config_flags)) && msg_cfg != CONFIG_STATUS_FILEINVALID && (duration_str = ast_variable_retrieve(msg_cfg, "message", "duration"))) {
+ if ((msg_cfg = ast_config_load(textfile, config_flags)) && valid_config(msg_cfg) && (duration_str = ast_variable_retrieve(msg_cfg, "message", "duration"))) {
*duration = atoi(duration_str);
} else {
*duration = 0;
@@ -7628,7 +7641,7 @@
*duration = 0;
/* if we can't read the message metadata, stop now */
- if (!msg_cfg) {
+ if (!valid_config(msg_cfg)) {
cmd = 0;
break;
}
@@ -7712,7 +7725,7 @@
}
}
- if (msg_cfg)
+ if (valid_config(msg_cfg))
ast_config_destroy(msg_cfg);
if (prepend_duration)
*duration = prepend_duration;
@@ -8463,7 +8476,7 @@
snprintf(filename, sizeof(filename), "%s.txt", vms->fn);
RETRIEVE(vms->curdir, vms->curmsg, vmu->mailbox, vmu->context);
msg_cfg = ast_config_load(filename, config_flags);
- if (!msg_cfg || msg_cfg == CONFIG_STATUS_FILEINVALID) {
+ if (!valid_config(msg_cfg)) {
ast_log(LOG_WARNING, "No message attribute file?!! (%s)\n", filename);
return 0;
}
@@ -8541,7 +8554,7 @@
}
}
- if (!msg_cfg) {
+ if (!valid_config(msg_cfg)) {
ast_log(AST_LOG_WARNING, "No message attribute file?!! (%s)\n", filename);
return 0;
}
@@ -13637,7 +13650,7 @@
struct ast_flags config_flags = { 0 };
pwconf = ast_config_load(secretfn, config_flags);
- if (pwconf) {
+ if (valid_config(pwconf)) {
const char *val = ast_variable_retrieve(pwconf, "general", "password");
if (val) {
ast_copy_string(password, val, passwordlen);
@@ -14124,7 +14137,7 @@
fputs("00000002 => 9999,Mrs. Test\n", file);
fclose(file);
- if (!(cfg = ast_config_load(config_filename, config_flags))) {
+ if (!(cfg = ast_config_load(config_filename, config_flags)) || !valid_config(cfg)) {
res = AST_TEST_FAIL;
goto cleanup;
}
@@ -14454,7 +14467,7 @@
RETRIEVE(vms->curdir, vms->curmsg, vmu->mailbox, vmu->context);
msg_cfg = ast_config_load(filename, config_flags);
DISPOSE(vms->curdir, vms->curmsg);
- if (!msg_cfg || msg_cfg == CONFIG_STATUS_FILEINVALID) {
+ if (!valid_config(msg_cfg)) {
ast_log(AST_LOG_WARNING, "No message attribute file?!! (%s)\n", filename);
return 0;
}
@@ -14616,9 +14629,9 @@
break;
}
+ ast_config_destroy(msg_cfg);
+
#ifndef IMAP_STORAGE
- ast_config_destroy(msg_cfg);
-
if (!res) {
make_file(vms->fn, sizeof(vms->fn), vms->curdir, msg);
vms->heard[msg] = 1;
Propchange: team/qwell/pimp_my_dtmf/build_tools/sha1sum-sh
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-'Date Author Id Revision Yoyo'
+Author Date Id Revision
Modified: team/qwell/pimp_my_dtmf/channels/chan_alsa.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/pimp_my_dtmf/channels/chan_alsa.c?view=diff&rev=385740&r1=385739&r2=385740
==============================================================================
--- team/qwell/pimp_my_dtmf/channels/chan_alsa.c (original)
+++ team/qwell/pimp_my_dtmf/channels/chan_alsa.c Mon Apr 15 11:35:22 2013
@@ -483,6 +483,13 @@
} else if (r < 0) {
ast_log(LOG_ERROR, "Read error: %s\n", snd_strerror(r));
}
+
+ /* Return NULL frame on error */
+ if (r < 0) {
+ ast_mutex_unlock(&alsalock);
+ return &f;
+ }
+
/* Update positions */
readpos += r;
left -= r;
Modified: team/qwell/pimp_my_dtmf/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/pimp_my_dtmf/channels/chan_gulp.c?view=diff&rev=385740&r1=385739&r2=385740
==============================================================================
--- team/qwell/pimp_my_dtmf/channels/chan_gulp.c (original)
+++ team/qwell/pimp_my_dtmf/channels/chan_gulp.c Mon Apr 15 11:35:22 2013
@@ -861,10 +861,10 @@
pjsip_tx_data *packet;
if (pjsip_inv_invite(session->inv_session, &packet) != PJ_SUCCESS) {
- return -1;
- }
-
- ast_sip_session_send_request(session, packet);
+ ast_queue_hangup(session->channel);
+ } else {
+ ast_sip_session_send_request(session, packet);
+ }
ao2_ref(session, -1);
return 0;
@@ -877,7 +877,7 @@
struct ast_sip_session *session = pvt->session;
ao2_ref(session, +1);
- if (ast_sip_push_task_synchronous(session->serializer, call, session)) {
+ if (ast_sip_push_task(session->serializer, call, session)) {
ast_log(LOG_WARNING, "Error attempting to place outbound call to call '%s'\n", dest);
ao2_cleanup(session);
return -1;
Modified: team/qwell/pimp_my_dtmf/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/pimp_my_dtmf/channels/chan_iax2.c?view=diff&rev=385740&r1=385739&r2=385740
==============================================================================
--- team/qwell/pimp_my_dtmf/channels/chan_iax2.c (original)
+++ team/qwell/pimp_my_dtmf/channels/chan_iax2.c Mon Apr 15 11:35:22 2013
@@ -9514,6 +9514,9 @@
if (!cur_pkt_buf)
AST_LIST_INSERT_TAIL(&to_here->full_frames, pkt_buf, entry);
+
+ to_here->iostate = IAX_IOSTATE_READY;
+ ast_cond_signal(&to_here->cond);
ast_mutex_unlock(&to_here->lock);
}
@@ -12232,16 +12235,26 @@
ast_cond_init(&thread->cond, NULL);
ast_mutex_init(&thread->init_lock);
ast_cond_init(&thread->init_cond, NULL);
+
+ ast_mutex_lock(&thread->init_lock);
+
if (ast_pthread_create_background(&thread->threadid, NULL, iax2_process_thread, thread)) {
ast_log(LOG_WARNING, "Failed to create new thread!\n");
ast_mutex_destroy(&thread->lock);
ast_cond_destroy(&thread->cond);
+ ast_mutex_unlock(&thread->init_lock);
ast_mutex_destroy(&thread->init_lock);
ast_cond_destroy(&thread->init_cond);
ast_free(thread);
thread = NULL;
continue;
}
+ /* Wait for the thread to be ready */
+ ast_cond_wait(&thread->init_cond, &thread->init_lock);
+
+ /* Done with init_lock */
+ ast_mutex_unlock(&thread->init_lock);
+
AST_LIST_LOCK(&idle_list);
AST_LIST_INSERT_TAIL(&idle_list, thread, list);
AST_LIST_UNLOCK(&idle_list);
Propchange: team/qwell/pimp_my_dtmf/channels/chan_multicast_rtp.c
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-'Author Date Id Revision'
+Author Date Id Revision
Modified: team/qwell/pimp_my_dtmf/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/pimp_my_dtmf/channels/chan_sip.c?view=diff&rev=385740&r1=385739&r2=385740
==============================================================================
--- team/qwell/pimp_my_dtmf/channels/chan_sip.c (original)
+++ team/qwell/pimp_my_dtmf/channels/chan_sip.c Mon Apr 15 11:35:22 2013
@@ -1273,6 +1273,8 @@
static void ast_quiet_chan(struct ast_channel *chan);
static int attempt_transfer(struct sip_dual *transferer, struct sip_dual *target);
static int do_magic_pickup(struct ast_channel *channel, const char *extension, const char *context);
+static void set_peer_nat(const struct sip_pvt *p, struct sip_peer *peer);
+static void check_for_nat(const struct ast_sockaddr *them, struct sip_pvt *p);
/*--- Device monitoring and Device/extension state/event handling */
static int extensionstate_update(const char *context, const char *exten, struct state_notify_data *data, struct sip_pvt *p, int force);
@@ -17107,22 +17109,12 @@
ast_log(LOG_ERROR, "Peer '%s' is trying to register, but not configured as host=dynamic\n", peer->name);
res = AUTH_PEER_NOT_DYNAMIC;
} else {
- if (ast_test_flag(&peer->flags[2], SIP_PAGE3_NAT_AUTO_RPORT)) {
- if (p->natdetected) {
- ast_set_flag(&peer->flags[0], SIP_NAT_FORCE_RPORT);
- } else {
- ast_clear_flag(&peer->flags[0], SIP_NAT_FORCE_RPORT);
- }
- }
- if (ast_test_flag(&peer->flags[2], SIP_PAGE3_NAT_AUTO_COMEDIA)) {
- if (p->natdetected) {
- ast_set_flag(&peer->flags[1], SIP_PAGE2_SYMMETRICRTP);
- } else {
- ast_clear_flag(&peer->flags[1], SIP_PAGE2_SYMMETRICRTP);
- }
- }
-
- ast_copy_flags(&p->flags[0], &peer->flags[0], SIP_NAT_FORCE_RPORT);
+
+ set_peer_nat(p, peer);
+ if (p->natdetected && ast_test_flag(&p->flags[2], SIP_PAGE3_NAT_AUTO_RPORT)) {
+ ast_copy_flags(&p->flags[0], &peer->flags[0], SIP_NAT_FORCE_RPORT);
+ }
+
if (!(res = check_auth(p, req, peer->name, peer->secret, peer->md5secret, SIP_REGISTER, uri2, XMIT_UNRELIABLE))) {
if (sip_cancel_destroy(p))
ast_log(LOG_WARNING, "Unable to cancel SIP destruction. Expect bad things.\n");
@@ -18151,6 +18143,67 @@
return -1;
}
+/*! \brief Set the peers nat flags if they are using auto_* settings */
+static void set_peer_nat(const struct sip_pvt *p, struct sip_peer *peer)
+{
+
+ if (!p || !peer) {
+ return;
+ }
+
+ if (ast_test_flag(&peer->flags[2], SIP_PAGE3_NAT_AUTO_RPORT)) {
+ if (p->natdetected) {
+ ast_set_flag(&peer->flags[0], SIP_NAT_FORCE_RPORT);
+ } else {
+ ast_clear_flag(&peer->flags[0], SIP_NAT_FORCE_RPORT);
+ }
+ }
+
+ if (ast_test_flag(&peer->flags[2], SIP_PAGE3_NAT_AUTO_COMEDIA)) {
+ if (p->natdetected) {
+ ast_set_flag(&peer->flags[1], SIP_PAGE2_SYMMETRICRTP);
+ } else {
+ ast_clear_flag(&peer->flags[1], SIP_PAGE2_SYMMETRICRTP);
+ }
+ }
+}
+
+/*! \brief Check and see if the requesting UA is likely to be behind a NAT.
+ *
+ * If the requesting NAT is behind NAT, set the * natdetected flag so that
+ * later, peers with nat=auto_* can use the value. Also, set the flags so
+ * that Asterisk responds identically whether or not a peer exists so as
+ * not to leak peer name information.
+ */
+static void check_for_nat(const struct ast_sockaddr *addr, struct sip_pvt *p)
+{
+
+ if (!addr || !p) {
+ return;
+ }
+
+ if (ast_sockaddr_cmp(addr, &p->recv)) {
+ char *tmp_str = ast_strdupa(ast_sockaddr_stringify(addr));
+ ast_debug(3, "NAT detected for %s / %s\n", tmp_str, ast_sockaddr_stringify(&p->recv));
+ p->natdetected = 1;
+ if (ast_test_flag(&p->flags[2], SIP_PAGE3_NAT_AUTO_RPORT)) {
+ ast_set_flag(&p->flags[0], SIP_NAT_FORCE_RPORT);
+ }
+ if (ast_test_flag(&p->flags[2], SIP_PAGE3_NAT_AUTO_COMEDIA)) {
+ ast_set_flag(&p->flags[1], SIP_PAGE2_SYMMETRICRTP);
+ }
+ } else {
+ p->natdetected = 0;
+ if (ast_test_flag(&p->flags[2], SIP_PAGE3_NAT_AUTO_RPORT)) {
+ ast_clear_flag(&p->flags[0], SIP_NAT_FORCE_RPORT);
+ }
+ if (ast_test_flag(&p->flags[2], SIP_PAGE3_NAT_AUTO_COMEDIA)) {
+ ast_clear_flag(&p->flags[1], SIP_PAGE2_SYMMETRICRTP);
+ }
+ }
+
+}
+
/*! \brief check Via: header for hostname, port and rport request/answer */
static void check_via(struct sip_pvt *p, const struct sip_request *req)
{
@@ -18214,29 +18267,7 @@
ast_sockaddr_set_port(&p->sa, port);
- /* Check and see if the requesting UA is likely to be behind a NAT. If they are, set the
- * natdetected flag so that later, peers with nat=auto_* can use the value. Also
- * set the flags so that Asterisk responds identically whether or not a peer exists
- * so as not to leak peer name information. */
- if (ast_sockaddr_cmp(&tmp, &p->recv)) {
- char *tmp_str = ast_strdupa(ast_sockaddr_stringify(&tmp));
- ast_debug(3, "NAT detected for %s / %s\n", tmp_str, ast_sockaddr_stringify(&p->recv));
- p->natdetected = 1;
- if (ast_test_flag(&p->flags[2], SIP_PAGE3_NAT_AUTO_RPORT)) {
- ast_set_flag(&p->flags[0], SIP_NAT_FORCE_RPORT);
- }
- if (ast_test_flag(&p->flags[2], SIP_PAGE3_NAT_AUTO_COMEDIA)) {
- ast_set_flag(&p->flags[1], SIP_PAGE2_SYMMETRICRTP);
- }
- } else {
- p->natdetected = 0;
- if (ast_test_flag(&p->flags[2], SIP_PAGE3_NAT_AUTO_RPORT)) {
- ast_clear_flag(&p->flags[0], SIP_NAT_FORCE_RPORT);
- }
- if (ast_test_flag(&p->flags[2], SIP_PAGE3_NAT_AUTO_COMEDIA)) {
- ast_clear_flag(&p->flags[1], SIP_PAGE2_SYMMETRICRTP);
- }
- }
+ check_for_nat(&tmp, p);
if (sip_debug_test_pvt(p)) {
ast_verbose("Sending to %s (%s)\n",
@@ -18304,13 +18335,10 @@
* are set on the peer. So we check for that here and set the peer's
* address accordingly.
*/
+ set_peer_nat(p, peer);
+
if (p->natdetected && ast_test_flag(&peer->flags[2], SIP_PAGE3_NAT_AUTO_RPORT)) {
- ast_set_flag(&peer->flags[0], SIP_NAT_FORCE_RPORT);
ast_sockaddr_copy(&peer->addr, &p->recv);
- }
-
- if (p->natdetected && ast_test_flag(&peer->flags[2], SIP_PAGE3_NAT_AUTO_COMEDIA)) {
- ast_set_flag(&peer->flags[1], SIP_PAGE2_SYMMETRICRTP);
}
if (!ast_apply_acl(peer->acl, addr, "SIP Peer ACL: ")) {
@@ -30011,6 +30039,22 @@
ast_string_field_set(p, peername, ext);
/* Recalculate our side, and recalculate Call ID */
ast_sip_ouraddrfor(&p->sa, &p->ourip, p);
+ /* When chan_sip is first loaded, we may have a peer entry but it hasn't re-registered yet.
+ If the peer hasn't re-registered, we have not checked for NAT yet. With the new
+ auto_* settings, we need to check for NAT so we do not have one-way audio. */
+ check_for_nat(&p->ourip, p);
+ set_peer_nat(p, p->relatedpeer);
+
+ if (p->natdetected && ast_test_flag(&p->flags[2], SIP_PAGE3_NAT_AUTO_RPORT)) {
+ ast_copy_flags(&p->flags[0], &p->relatedpeer->flags[0], SIP_NAT_FORCE_RPORT);
+ }
+
+ if (p->natdetected && ast_test_flag(&p->flags[2], SIP_PAGE3_NAT_AUTO_COMEDIA)) {
+ ast_copy_flags(&p->flags[1], &p->relatedpeer->flags[1], SIP_PAGE2_SYMMETRICRTP);
+ }
+
+ do_setnat(p);
+
build_via(p);
/* Change the dialog callid. */
Propchange: team/qwell/pimp_my_dtmf/channels/sig_ss7.c
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-'Author Date Id Revision'
+Author Date Id Revision
Propchange: team/qwell/pimp_my_dtmf/channels/sig_ss7.h
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-'Author Date Id Revision'
+Author Date Id Revision
Propchange: team/qwell/pimp_my_dtmf/channels/sip/include/security_events.h
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-"Author Date Id Rev URL"
+Author Date Id Revision
Propchange: team/qwell/pimp_my_dtmf/channels/sip/security_events.c
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-"Author Date Id Rev URL"
+Author Date Id Revision
Modified: team/qwell/pimp_my_dtmf/codecs/codec_resample.c
URL: http://svnview.digium.com/svn/asterisk/team/qwell/pimp_my_dtmf/codecs/codec_resample.c?view=diff&rev=385740&r1=385739&r2=385740
==============================================================================
--- team/qwell/pimp_my_dtmf/codecs/codec_resample.c (original)
+++ team/qwell/pimp_my_dtmf/codecs/codec_resample.c Mon Apr 15 11:35:22 2013
@@ -113,7 +113,7 @@
int res = 0;
int x, y, idx = 0;
- trans_size = ARRAY_LEN(id_list) * ARRAY_LEN(id_list);
+ trans_size = ARRAY_LEN(id_list) * (ARRAY_LEN(id_list) - 1);
if (!(translators = ast_calloc(1, sizeof(struct ast_translator) * trans_size))) {
return AST_MODULE_LOAD_FAILURE;
}
Propchange: team/qwell/pimp_my_dtmf/configs/res_curl.conf.sample
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-'Date Author Id Revision Yoyo'
+Author Date Id Revision
Propchange: team/qwell/pimp_my_dtmf/contrib/realtime/mysql/musiconhold.sql
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-'Date Author Id Revision Yoyo'
+Author Date Id Revision
Propchange: team/qwell/pimp_my_dtmf/contrib/realtime/mysql/queue_log.sql
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-'Date Author Id Revision Yoyo'
+Author Date Id Revision
Propchange: team/qwell/pimp_my_dtmf/contrib/realtime/mysql/voicemail_data.sql
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-'Date Author Id Revision Yoyo'
+Author Date Id Revision
Propchange: team/qwell/pimp_my_dtmf/contrib/realtime/mysql/voicemail_messages.sql
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-'Date Author Id Revision Yoyo'
+Author Date Id Revision
Propchange: team/qwell/pimp_my_dtmf/doc/Makefile
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-'Date Author Id Revision Yoyo'
+Author Date Id Revision
Propchange: team/qwell/pimp_my_dtmf/include/asterisk/bridging_features.h
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-'Author Date Id Revision'
+Author Date Id Revision
Propchange: team/qwell/pimp_my_dtmf/include/asterisk/bridging_technology.h
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-'Author Date Id Revision'
+Author Date Id Revision
Modified: team/qwell/pimp_my_dtmf/include/asterisk/manager.h
URL: http://svnview.digium.com/svn/asterisk/team/qwell/pimp_my_dtmf/include/asterisk/manager.h?view=diff&rev=385740&r1=385739&r2=385740
==============================================================================
--- team/qwell/pimp_my_dtmf/include/asterisk/manager.h (original)
+++ team/qwell/pimp_my_dtmf/include/asterisk/manager.h Mon Apr 15 11:35:22 2013
@@ -316,6 +316,37 @@
*/
struct ast_datastore *astman_datastore_find(struct mansession *s, const struct ast_datastore_info *info, const char *uid);
+/*! \brief Struct representing a snapshot of channel state */
+struct ast_channel_snapshot;
+
+/*!
+ * \brief Generate the AMI message body from a channel snapshot
+ * \since 12
+ *
+ * \param snapshot the channel snapshot for which to generate an AMI message
+ * body
+ * \param suffix the suffix to append to the channel fields
+ *
+ * \retval NULL on error
+ * \retval ast_str* on success (must be ast_freed by caller)
+ */
+struct ast_str *ast_manager_build_channel_state_string_suffix(
+ const struct ast_channel_snapshot *snapshot,
+ const char *suffix);
+
+/*!
+ * \brief Generate the AMI message body from a channel snapshot
+ * \since 12
+ *
+ * \param snapshot the channel snapshot for which to generate an AMI message
+ * body
+ *
+ * \retval NULL on error
+ * \retval ast_str* on success (must be ast_freed by caller)
+ */
+struct ast_str *ast_manager_build_channel_state_string(
+ const struct ast_channel_snapshot *snapshot);
+
/*!
* \brief Initialize support for AMI channel events.
* \return 0 on success.
Propchange: team/qwell/pimp_my_dtmf/include/asterisk/select.h
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Mon Apr 15 11:35:22 2013
@@ -1,1 +1,1 @@
-'Date Author Id Revision Yoyo'
+Author Date Id Revision
Modified: team/qwell/pimp_my_dtmf/include/asterisk/sorcery.h
URL: http://svnview.digium.com/svn/asterisk/team/qwell/pimp_my_dtmf/include/asterisk/sorcery.h?view=diff&rev=385740&r1=385739&r2=385740
==============================================================================
--- team/qwell/pimp_my_dtmf/include/asterisk/sorcery.h (original)
+++ team/qwell/pimp_my_dtmf/include/asterisk/sorcery.h Mon Apr 15 11:35:22 2013
@@ -44,7 +44,7 @@
* override configured mappings. They are only used in the case where no configured mapping exists.
*
* Configuring object mappings implicitly creates a basic version of an object type. The object type
- * must be fully registered, however, using the \ref ast_sorcery_object_type_register API call before any
[... 257 lines stripped ...]
More information about the asterisk-commits
mailing list