Commit Graph

406 Commits

Author SHA1 Message Date
Tilghman Lesher
2cdedcbe94 Revert change in revision 71656, even though it fixed a bug, because many people were depending upon the (broken) behavior.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@77782 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 18:40:54 +00:00
Russell Bryant
8e7cb1aa7a Fix a couple potential minor memory leaks. load_moh_classes() could return
without destroying the loaded configuration.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@75107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-13 20:35:22 +00:00
Russell Bryant
ab2a84f410 Ensure that adding a user to the list of users of a specific music on hold
class is not done at the same time as any of the other operations on this list
to prevent list corruption.  Using the global moh_data lock for this is not
ideal, but it is what is used to protect these lists everywhere else in the
module, and I am only changing what is necessary to fix the bug.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@75059 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-13 20:07:21 +00:00
Joshua Colp
577c0ebedd Only print out a warning for situations where it is actually helpful. (issue #10187 reported by denke)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@74814 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-12 15:51:24 +00:00
Russell Bryant
4307bca95c Make sure that the ESCAPE immediately follows the condition that uses LIKE.
This fixes realtime extensions with ODBC.
(closes issue #10175, reported by stuarth, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@74656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-11 18:33:23 +00:00
Russell Bryant
abf682606c Only use ESCAPE when LIKE is used.
(issue #10075, this part reported by jmls on IRC, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@74313 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-10 15:30:20 +00:00
Russell Bryant
319b105e17 When the specified class isn't found, properly fall back to the channel's music
class or the default.
(issue #10123, reported by blitzrage, patches from juggie, qwell, and me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@74165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-09 21:00:17 +00:00
Russell Bryant
5e8172892e (closes issue #10075)
Reported by: apsaras
Patches submitted by: Corydon76
Tested by: apsaras

Fix a problem with MSSQL 2005 by explicitly stating that '\' is being used as
an escape character.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@73684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-06 16:06:27 +00:00
Tilghman Lesher
5be40827e5 Issue 10035 - handle_exec returns a result inconsistent with all of the other AGI commands
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@71656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-25 18:12:37 +00:00
Joshua Colp
7e22d574a7 Send an unhold indication when going off hold. (issue #10036 reported by speedy)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@71124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22 16:02:40 +00:00
Jason Parker
01f5e6d56b Fix a few silly usages of ast_playstream() - it only ever returns 0...
Issue 10035


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@71065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22 14:52:18 +00:00
Joshua Colp
234b7d22fe Add parked call extension AFTER the parking slot has been announced, otherwise two threads will try to handle the same channel and it will go kaboom. (issue #9191 reported by japple)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@69846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-19 12:57:55 +00:00
Kevin P. Fleming
de32406990 doh... initializing the pointer variable will work just a bit better
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@62841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-03 00:23:00 +00:00
Kevin P. Fleming
0b78d1542c increase reliability and efficiency of static Realtime config loading via ODBC:
don't request fields we aren't going to use
	don't request sorting on fields that are pointless to sort on
	explicitly request the fields we want, because we can't expect the database to always return them in the order they were created
	
(reported by blitzrage in person (!), patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@62796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-02 23:53:46 +00:00
Russell Bryant
c8a90488d6 Remove an unnecessary check that makes it so if you hang up after doing an
attended transfer before the target extension answers the channel, the transfer
is not successful.  (issue #9338, patch by svanlund)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@62547 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-01 21:55:19 +00:00
Tilghman Lesher
08c29fea9f Change ENV section to use setenv, instead of putenv (Alexandru Pirvulescu <sigxcpu@gmail.com>, reported via -dev list)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@59299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-29 15:33:10 +00:00
Joshua Colp
0b4eeda153 Indicate the filename changed when it is changed. (issue #9311 reported by jsmith)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@59086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-21 18:03:20 +00:00
Olle Johansson
d44c7d9c54 Issue #9069 - If we open with TH we should not close with /TD. (seanbright)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@54771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-16 11:38:03 +00:00
Joshua Colp
8ea5a33c9e Return previous behavior of having MOH pick up where it was left off. (issue #8672 reported by sinistermidget)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@53084 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 21:03:10 +00:00
Joshua Colp
e1dc278941 Yield before reading from zaptel timing source under Solaris so that other threads get a chance to do things. (issue #7875 reported by bob)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@51512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23 01:41:35 +00:00
Joshua Colp
84a751aecd Return previous behavior. ParkedCalls will be able to do DTMF based transfers again. trunk however will get an option to allow this to be set on/off. (issue #8804 reported by nortex)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@51145 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-16 17:36:50 +00:00
Tilghman Lesher
983d09bc21 When doing a fork() and exec(), two problems existed (Issue 8086):
1) Ignored signals stayed ignored after the exec().
2) Signals could possibly fire between the fork() and exec(), causing Asterisk
signal handlers within the child to execute, which caused nasty race conditions.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@48374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-11 00:33:59 +00:00
Russell Bryant
d79533bd94 Ensure that the file position is not incremented beyond the total number of
files available for playback.  (issue #8539, ulogic)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@48356 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-07 18:14:13 +00:00
Joshua Colp
efe92601c5 Do not listen for DTMF on the bridge that comes into existence when ParkedCall is executed. This means native bridging can now occur for this. (issue #8406 reported by kebl0155)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@48154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-30 19:04:11 +00:00
Joshua Colp
6180390206 Remember the pointer to the allocated block of memory so that we can free it and not cause a memory leak. (issue #8449 reported by arkadia)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@48146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-30 18:17:54 +00:00
Tilghman Lesher
9bb51868ca Random MOH wasn't really random (bug 8381)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@48045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-27 17:15:54 +00:00
Tilghman Lesher
a99b6a1c97 If the execute fails a second time, make sure that we don't pass back a stale handle
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@47525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 05:45:11 +00:00
Russell Bryant
7c651a64a7 If random order is enabled for files mode music on hold, set a random initial
position, instead of always starting at the first file, and doing the random
operation only when switching to the next file.
(bug reported by John Lange on the asterisk-dev mailing list)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@47238 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-07 01:22:58 +00:00
Russell Bryant
f18766c30a ignore files in a music on hold directory that begin with '.'
(issue #8249, cboie)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@46964 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-02 17:47:56 +00:00
Steve Murphy
d4b36ffde5 a fix for bug 8251; the var_val needs to accept longer strings or mass confusion and a lot of lost time is the result
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@46803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-01 19:52:43 +00:00
Russell Bryant
78ccdbc123 soxmix and Asterisk expect different file extensions for certain formats. This
was already handled for the wav49 format.  However, it was not handled for
ulaw and alaw.  I fixed this in such a way that using the alternate extensions
for ulaw and alaw will only happen if we know we're calling soxmix, and not a
custom script defined using the MONITOR_EXEC variable.  The wav49 processing
was left alone so that external scripts will see no behavior change.
(issue #7550, reported by mnicholson, proposed patch by junky, committed fix
is a bit different)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@46776 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-01 18:24:17 +00:00
Russell Bryant
234408e7c1 fix some copy/paste bugs in the checking of arguments for the
"control stream file" AGI command (issue #8255, mnicholson)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@46557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 06:13:09 +00:00
Russell Bryant
bf20deeba1 We should always be using _exit() after a fork() or vfork() instead of exit().
This is because exit() does some extra cleanup which in some implementations
of vfork(), for example, can actually modify the state of the parent process,
causing very weird bugs or crashes.  (issue #7971, Nick Gavrikov)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@46361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-27 17:36:07 +00:00
Joshua Colp
87803a8ac6 Put in missing \ns on the end of ast_logs (issue #7936 reported by wojtekka)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@43924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 18:00:30 +00:00
Russell Bryant
0d9ea31f3a Fix a problem that occurred if a user entered a digit that matched a bridge
feature that was configured using multiple digits, and the digit that was
pressed timed out in the feature digit timeout period.  For example, if blind
transfer is configured as '##', and a user presses just '#'.  In this situation,
the call would lock up and no longer pass any frames.
(issue #7977 reported by festr, and issue #7982 reported by michaels and
 valuable input provided by mneuhauser and kuj.  Fixed by me, with testing help
 and peer review from Joshua Colp).

There are a couple of issues involved in this fix:

1) When ast_generic_bridge determines that there has been a timeout, it returned
   AST_BRIDGE_RETRY.  Then, when ast_channel_bridge gets this result, it calls
   ast_generic_bridge over again with the same timestamp for the next event.
   This results in an endless loop of nothing until the call is terminated.
   This is resolved by simply changing ast_generic_bridge to return 
   AST_BRIDGE_COMPLETE when it sees a timeout.

2) I also changed ast_channel_bridge such that if in the process of calculating
   the time until the next event, it knows a timeout has already occured, to
   immediately return AST_BRIDGE_COMPLETE instead of attempting to bridge the
   channels anyway.

3) In the process of testing the previous two changes, I ran into a problem in
   res_features where ast_channel_bridge would return because it determined
   that there was a timeout.  However, ast_bridge_call in res_features would
   then determine by its own calculation that there was still 1 ms before the
   timeout really occurs.  It would then proceed, and since the bridge broke
   out and did *not* return a frame, it interpreted this as the call was over
   and hung up the channels.

   The reason for this was because ast_bridge_call in res_features and
   ast_channel_bridge in channel.c were using different times for their
   calculations.  channel.c uses the start_time on the bridge config, which
   is the time that the feature digit was recieved.  However, res_features
   had another time, 'start', which was set right before calling 
   ast_channel_bridge.  'start' will always be slightly after start_time in the
   bridge config, and sometimes enough to round up to one ms.

   This is fixed by making ast_bridge_call use the same time as 
   ast_channel_bridge for the timeout calculation.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@43778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-27 16:54:30 +00:00
Joshua Colp
754cb0114f Don't close the second file descriptor if it's the same as the first one, as it will have already been closed elsewhere and could cause massive panic. (issue #7699 reported by bn999)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@42148 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-06 20:02:59 +00:00
Tilghman Lesher
39e622f7cf Revert last change - breaks retrieval of builtin variables
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@40901 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-23 16:05:26 +00:00
Russell Bryant
465207a28d use pbx_builtin_getvar_helper() so that GET VARIABLE can retrieve global
variables (issue #7609)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@39935 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-15 22:49:41 +00:00
Joshua Colp
a56f08e345 Treat the file as invalid if we have no valid formats for it (issue #7643 reported by KNK)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@38825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-03 19:54:02 +00:00
Kevin P. Fleming
4f3b40fe79 ensure that the 'feature digit timeout' value is taken into account when deciding how long the bridge should run (this fixes a problem report where a digit press that did not invoke a feature is never passed across the bridge)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@38686 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-01 23:07:06 +00:00
Joshua Colp
83f9228c1d Close the stream when file based MOH stop. This won't get rid of their position in the file but it will cause the translation path to be setup again. (issue #7634 reported by asimpson)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@38654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-01 19:20:05 +00:00
Joshua Colp
f41b9baed4 Add missing code to bring transferee channel out of MOH/autoservice under certain circumstance (issue #7611 reported by guillecabeza with minor mods by myself)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@38585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-31 17:09:10 +00:00
Kevin P. Fleming
648bc1828d remove some more bad examples of using printf
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@37419 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-12 13:54:10 +00:00
Russell Bryant
9807f83d64 fix a place where a frame would be free'd twice
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@33693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-12 20:40:11 +00:00
Tilghman Lesher
070d4d3976 Move set priority up, because at this point in the code, stdout is no longer
the console.  If we're unable to set priority, the error goes to Asterisk as
if it were an AGI command (issue 7335).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@33615 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-12 15:27:18 +00:00
Russell Bryant
9c5890a138 when using moh files mode, don't look for a file past the number of files
that have been loaded, or worse, past the size of the files array


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@31775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-03 17:02:49 +00:00
Kevin P. Fleming
3feead3415 remove pointless forcing of the channel into SLINEAR mode; the write format will be set later based on the file that is chosen to be played to the channel
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@31555 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-01 21:46:50 +00:00
Russell Bryant
71d9095626 if the connection to a FastAGI server fails because of a timeout, log a more
informative log message


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@31194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-05-31 23:50:00 +00:00
Kevin P. Fleming
e9d164d468 support video recording via AGI 'RECORD FILE' command (issue #7068)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@29973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-05-24 16:59:20 +00:00
Kevin P. Fleming
75ca02dbaa backport some mutex initialization and linked list handling fixes from trunk
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@29732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-05-23 17:15:23 +00:00