dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

1668 Commits

Author SHA1 Message Date
qwell 76dccae9d7 Merged revisions 262421 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r262421 | qwell | 2010-05-11 14:55:42 -0500 (Tue, 11 May 2010) | 11 lines
  
  Use a less silly method for modifying a flex-generated file.
  
  The sed syntax that was used wasn't actually valid, causing some versions to
  choke.  This is the method that is used in 1.6.x+ for similar changes.
  
  (closes issue #16696)
  Reported by: bklang
  Patches: 
        16696-sedfix.diff uploaded by qwell (license 4)
  Tested by: qwell
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@262422 f38db490-d61c-443f-a65b-d21fe96a405b
2010-05-11 19:57:24 +00:00
mmichelson 5984d97a09 Merged revisions 260345 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r260345 | mmichelson | 2010-04-30 15:08:15 -0500 (Fri, 30 Apr 2010) | 18 lines
  
  Fix potential crash from race condition due to accessing channel data without the channel locked.
  
  In res_musiconhold.c, there are several places where a channel's
  stream's existence is checked prior to calling ast_closestream on it. The issue
  here is that in several cases, the channel was not locked while checking the
  stream. The result was that if two threads checked the state of the channel's
  stream at approximately the same time, then there could be a situation where
  both threads attempt to call ast_closestream on the channel's stream. The result
  here is that the refcount for the stream would go below 0, resulting in a crash.
  
  I have added proper channel locking to res_musiconhold.c to ensure that
  we do not try to check chan->stream without the channel locked. A Digium customer
  has been using this patch for several weeks and has not had any crashes since
  applying the patch.
  
  ABE-2147
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@260346 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-30 20:11:02 +00:00
qwell 7e91bd6da5 Fix compile on systems without HAVE_NULLSAFE_PRINTF defined.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@259617 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-27 22:47:36 +00:00
mnicholson c18fc0e2ae Update res_fax and res_fax_spandsp to be compatible with Fax For Asterisk 1.2.
The fax session initilization code for T.38 faxes has been rewritten. T.38 session initialization was removed from generic_fax_exec, and split into two different code paths for receive and send.  Also the 'z' option (to send a T.38 reinvite if we do not receive one) was added to sendfax.

In the output of 'fax show sessions', the 'Type' column has been renamed to 'Tech' and replaced with a new 'Tech' column that will report 'G.711' or 'T.38'.

Control of ECM defaults has been added to res_fax

A 'fax show settings' CLI command has been added.

Support of the new AST_T38_REQUEST_PARMS control method request to handle channels that have already received a T.38 reinvite before the FAX application is start has been added.

Support for the 'fax show settings' command has been added to res_fax_spandsp and handling of the ECM flag has been slightly altered.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@258896 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-26 14:18:15 +00:00
tilghman 8046515ec4 Merged revisions 258775 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r258775 | tilghman | 2010-04-25 13:09:05 -0500 (Sun, 25 Apr 2010) | 6 lines
  
  When StopMonitor is called, ensure that it will not be restarted by a channel event.
  (closes issue #16590)
   Reported by: kkm
   Patches: 
         resmonitor-16590-trunk.239289.diff uploaded by kkm (license 888)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@258776 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-25 18:12:14 +00:00
qwell 8d07966e39 Remove ABI differences that occured when compiling with DEBUG_THREADS.
"Bad Things" would happen if Asterisk was compiled with DEBUG_THREADS, but a
loaded module was not (or vice versa).  This also immensely simplifies the
lock code, since there are no longer 2 separate versions of them.

Review: https://reviewboard.asterisk.org/r/508/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@258557 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-22 19:08:01 +00:00
lmadsen c7dd5ecd3c Fix the \brief description in the res_calendar_*.c files.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@258265 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-21 13:26:28 +00:00
jmls f3be709455 Added MixMonitorMute manager command
Added a new manager command to mute/unmute MixMonitor audio on a channel. 
Added a new feature to audiohooks so that you can mute either read / write
(or both) types of frames - this allows for MixMonitor to mute either side
of the conversation without affecting the conversation itself.

(closes issue #16740)
Reported by: jmls

Review: https://reviewboard.asterisk.org/r/487/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@258190 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-21 11:27:27 +00:00
rmudgett f42e29b281 Consolidate ast_channel.cid.cid_rdnis into ast_channel.redirecting.from.number.
SWP-1229
ABE-2161

* Ensure chan_local.c:local_call() will not leak cid.cid_dnid when
copying.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@256104 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-03 02:12:33 +00:00
kpfleming a321328986 Allow symbol export filtering to work properly on platforms that have symbol prefixes.
Some platforms prefix externally-visible symbols in object files generated
from C sources (most commonly, '_' is the prefix). On these platforms,
the existing symbol export filtering process ends up suppressing all the symbols
that are supposed to be left visible. This patch allows the prefix string
to be supplied to the top-level Makefile in the LINKER_SYMBOL_PREFIX variable,
and then generates the linker scripts as required to include the prefix
supplied.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@255906 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-02 18:57:58 +00:00
mmichelson aca5c91a7c Recorded merge of revisions 254452 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r254452 | mmichelson | 2010-03-25 10:59:56 -0500 (Thu, 25 Mar 2010) | 44 lines
  
  Several fixes regarding RFC2833 DTMF detection.
  
  Here is a copy and paste of the details from my request on
  reviewboard that dealt with these changes:
  
  Fix 1. The first change in place is to fix Mantis issue 15811, which deals with a situation where Asterisk will incorrectly interpret out of order RFC2833 frames as duplicate DTMF digits. For instance, we would receive a sequence like:
  
  seqno 1: DTMF 1
  seqno 2: DTMF 1
  seqno 3: DTMF 1
  seqno 4: DTMF 1
  seqno 6: DTMF 1 (end)
  seqno 5: DTMF 1
  seqno 7: DTMF 1 (end)
  seqno 8: DTMF 1 (end)
  
  Prior to this patch when we received the frame with seqno 5, we would interpret this as a new DTMF 1. With this patch, we will check the seqno of the incoming digit and not process the frame if the seqno is lower than the last recorded seqno. Note that we do not record the seqno of the dropped DTMF frame for future processing. While the above situation is what was designed to be fixed, the patch is written in such a way that the following would also be fixed too:
  
  seqno  9: DTMF 1
  seqno 10: DTMF 1 (end)
  seqno 11: DTMF 1 (end)
  seqno 13: DTMF 2
  seqno 12: DTMF 1 (end)
  seqno 14: DTMF 2
  seqno 15: DTMF 2 (end)
  seqno 16: DTMF 2 (end)
  seqno 17: DTMF 2 (end)
  
  In this second situation, the beginning of the DTMF 2 arrives before the final end frame of the DTMF 1. With the patch, seqno 12 is no processed and thus we properly interpret the DTMF.
  
  Fix 2. The second change in place is to fix an issue like the following:
  
  seqno 1: DTMF 1
  seqno 2: DTMF 1
  seqno 3: DTMF 1 (end) *packet lost*
  seqno 4: DTMF 1 (end) *packet lost*
  seqno 5: DTMF 1 (end) *packet lost*
  seqno 6: DTMF 2
  
  When we receive seqno 6, we had code in place that was supposed to properly end the previously unended DTMF 1. The problem was that the code was essentially a no-op. The code would set up an end frame for the DTMF 1 but would immediately overwrite the frame with the begin for DTMF 2. I changed process_dtmf_rfc2833() so that instead of returning a single frame, it is given as an output parameter a list of frames. Each frame that needs to be returned is appended to this list.
  
  Fix 3. The final change is a minor one where an AST_CONTROL_SRCCHANGE frame could get lost. If we process a cisco DTMF or an RFC 3389 frame and no frame was returned, then we would return &ast_null_frame. The problem is that earlier in the function, we may have generated an AST_CONTROL_SRCCHANGE frame and put it in the list of frames we wish to return. This frame would be lost in such a case. The patch fixes this problem
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@254454 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-25 16:04:48 +00:00
kpfleming a37e15e1be Improve handling of T.38 re-INVITEs that arrive before a T.38-capable
application is executing on a channel.

This patch addresses an issue found during working with end-users
using res_fax. If an incoming call is answered in the dialplan, or
jumps to the 'fax' extension due to reception of a CNG tone (with
faxdetect enabled), and then the remote endpoint sends a T.38
re-INVITE, it is possible for the channel's T.38 state to be
'T38_STATE_NEGOTIATING' when the application starts up. Unfortunately,
even if the application wants to use T.38, it can't respond to the
peer's negotiation request, because the AST_CONTROL_T38_PARAMETERS
control frame that chan_sip sent originally has been lost, and the
application needs the content of that frame to be able to formulate a
reply.

This patch adds a new 'request' type to AST_CONTROL_T38_PARAMETERS,
AST_T38_REQUEST_PARMS. If the application sends this request, chan_sip
will re-send the original control frame (with
AST_T38_REQUEST_NEGOTIATE as the request type), and the application
can respond as normal. If this occurs within the five second timeout
in chan_sip, the automatic cancellation of the peer reinvite will be
stopped, and the application will 'own' the negotiation process from
that point onwards.

This also improves the code path in chan_sip to allow sip_indicate(),
when called for AST_CONTROL_T38_PARAMETERS, to be able to return a
non-zero response, which should have been in place before since the
control frame *can* fail to be processed properly. It also modifies
ast_indicate() to return whatever result the channel driver returned
for this control frame, rather than converting all non-zero results
into '-1'. Finally, the new request type intentionally returns a
positive value, so that an application that sends
AST_T38_REQUEST_PARMS can know for certain whether the channel driver
accepted it and will be replying with a control frame of its own, or
whether it was ignored (if the sip_indicate()/ast_indicate() path had
properly supported failure responses before, this would not be
necessary).

This patch also modifies res_fax to take advantage of the new request.

In addition, this patch makes sip_t38_abort() actually lock the
private structure before doing its work... bad programmer, no donut.

This patch also enhances chan_sip's 'faxdetect' support to allow
triggering on T.38 re-INVITEs received as well as CNG tone detection.

Review: https://reviewboard.asterisk.org/r/556/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@254450 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-25 15:27:31 +00:00
lmadsen 63374e809f handle_speechset has 4 arguments.
Update code to reflect that handle_speechset has 4 arguments.

(closes issue #17093)
Reported by: gpatri
Patches: 
      res_agi.patch uploaded by gpatri (license 1014)
Tested by: pabelanger, mmichelson

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@254446 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-25 15:21:26 +00:00
jpeeler 2296fae937 Merged revisions 254235 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r254235 | jpeeler | 2010-03-23 19:37:23 -0500 (Tue, 23 Mar 2010) | 72 lines
  
  Ensure that monitor recordings are written to the correct location (again)
  
  This is an extension to 248860. As such the dialplan test has been extended:
  
  ; non absolute path, not combined
  exten => 5040, 1, monitor(wav,tmp/jeff/monitor_test)
  exten => 5040, n, dial(sip/5001)
  ; absolute path, not combined
  exten => 5041, 1, monitor(wav,/tmp/jeff/monitor_test2)
  exten => 5041, n, dial(sip/5001)
  ; no path, not combined
  exten => 5042, 1, monitor(wav,monitor_test3)
  exten => 5042, n, dial(sip/5001)
  ; combined: changemonitor from non absolute to no path (leaves tmp/jeff)
  exten => 5043, 1, monitor(wav,tmp/jeff/monitor_test4,m)
  exten => 5043, n, changemonitor(monitor_test5)
  exten => 5043, n, dial(sip/5001)
  ; combined: changemonitor from no path to non absolute path
  exten => 5044, 1, monitor(wav,monitor_test6,m)
  exten => 5044, n, changemonitor(tmp/jeff/monitor_test7) ; this wasn't possible before
  exten => 5044, n, dial(sip/5001)
  ; non absolute path, combined
  exten => 5045, 1, monitor(wav,tmp/jeff/monitor_test8,m)
  exten => 5045, n, dial(sip/5001)
  ; absolute path, combined 
  exten => 5046, 1, monitor(wav,/tmp/jeff/monitor_test9,m)
  exten => 5046, n, dial(sip/5001)
  ; no path, combined
  exten => 5047, 1, monitor(wav,monitor_test10,m)
  exten => 5047, n, dial(sip/5001)
  ; combined: changemonitor from non absolute to absolute (leaves tmp/jeff)
  exten => 5048, 1, monitor(wav,tmp/jeff/monitor_test11,m)
  exten => 5048, n, changemonitor(/tmp/jeff/monitor_test12)
  exten => 5048, n, dial(sip/5001)
  ; combined: changemonitor from absolute to non absolute (leaves /tmp/jeff)
  exten => 5049, 1, monitor(wav,/tmp/jeff/monitor_test13,m)
  exten => 5049, n, changemonitor(tmp/jeff/monitor_test14)
  exten => 5049, n, dial(sip/5001)
  ; combined: changemonitor from no path to absolute
  exten => 5050, 1, monitor(wav,monitor_test15,m)
  exten => 5050, n, changemonitor(/tmp/jeff/monitor_test16)
  exten => 5050, n, dial(sip/5001)
  ; combined: changemonitor from absolute to no path (leaves /tmp/jeff)
  exten => 5051, 1, monitor(wav,/tmp/jeff/monitor_test17,m)
  exten => 5051, n, changemonitor(monitor_test18)
  exten => 5051, n, dial(sip/5001)
  ; not combined: changemonitor from non absolute to no path (leaves tmp/jeff)
  exten => 5052, 1, monitor(wav,tmp/jeff/monitor_test19)
  exten => 5052, n, changemonitor(monitor_test20)
  exten => 5052, n, dial(sip/5001)
  ; not combined: changemonitor from no path to non absolute
  exten => 5053, 1, monitor(wav,monitor_test21)
  exten => 5053, n, changemonitor(tmp/jeff/monitor_test22)
  exten => 5053, n, dial(sip/5001)
  ; not combined: changemonitor from non absolute to absolute (leaves tmp/jeff)
  exten => 5054, 1, monitor(wav,tmp/jeff/monitor_test23)
  exten => 5054, n, changemonitor(/tmp/jeff/monitor_test24)
  exten => 5054, n, dial(sip/5001)
  ; not combined: changemonitor from absolute to non absolute (leaves /tmp/jeff)
  exten => 5055, 1, monitor(wav,/tmp/jeff/monitor_test24)
  exten => 5055, n, changemonitor(tmp/jeff/monitor_test25)
  exten => 5055, n, dial(sip/5001)
  ; not combined: changemonitor from no path to absolute
  exten => 5056, 1, monitor(wav,monitor_test26)
  exten => 5056, n, changemonitor(/tmp/jeff/monitor_test27)
  exten => 5056, n, dial(sip/5001)
  ; not combined: changemonitor from absolute to no path (leaves /tmp/jeff)
  exten => 5057, 1, monitor(wav,/tmp/jeff/monitor_test28)
  exten => 5057, n, changemonitor(monitor_test29)
  exten => 5057, n, dial(sip/5001)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@254277 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-24 17:15:05 +00:00
kpfleming 4f7d300b2d Change per-file debug and verbose levels to be per-module, the way
users expect them to work.

'core set debug' and 'core set verbose' can optionally change the
level for a specific filename; however, this is actually for a
specific source file name, not the module that source file is included
in. With examples like chan_sip, chan_iax2, chan_misdn and others
consisting of multiple source files, this will not lead to the
behavior that users expect. If they want to set the debug level for
chan_sip, they want it set for all of chan_sip, and not to have to
also set it for reqresp_parser and other files that comprise the
chan_sip module.

This patch changes this functionality to be module-name based instead
of file-name based.

To make this work, some Makefile modifications were required to ensure
that the AST_MODULE definition is present in each object file produced
for each module as well.

Review: https://reviewboard.asterisk.org/r/574/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@253917 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-23 14:22:27 +00:00
phsultan b8a852910e Prevent a crash when a buddy gets offline.
(closes issue #16760)
Reported by: fiddur
Patches:
      248394.diff uploaded by fiddur (license 678)i with modifications by me
Tested by: fiddur, phsultan


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@253261 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-18 15:59:19 +00:00
seanbright 9891580f11 Include an extra newline after "Aliased CLI command" to get back the prompt.
The other issue mentioned in this bug will be more difficult to resolve since we
have no idea (right now) of knowing if the command that is aliased has been
installed yet.

(issue #16978)
Reported by: jw-asterisk
Tested by: seanbright


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@252848 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-16 19:36:24 +00:00
kpfleming 0727ec7bdf Improve handling of values supplied to FAXOPT(ecm).
Previously, values that began with whitespace were silently treated as 'no',
and all non-'yes' values were also treated as 'no'. Now the supplied value
is specifically checked for a 'yes' or 'no' (or equivalent) value, after skipping
leading whitespace. If the value is not valid, then a warning message is generated.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@252709 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-15 22:48:38 +00:00
twilson 88bfcb6713 Only change the RTP ssrc when we see that it has changed
This change basically reverts the change reviewed in
https://reviewboard.asterisk.org/r/374/ and instead limits the
updating of the RTP synchronization source to only those times when we
detect that the other side of the conversation has changed the ssrc.

The problem is that SRCUPDATE control frames are sent many times where
we don't want a new ssrc, including whenever Asterisk has to send DTMF
in a normal bridge. This is also not the first time that this mistake
has been made. The initial implementation of the ast_rtp_new_source
function also changed the ssrc--and then it was removed because of
this same issue. Then, we put it back in again to fix a different
issue. This patch attempts to only change the ssrc when we see that
the other side of the conversation has changed the ssrc.

It also renames some functions to make their purpose more clear.

Review: https://reviewboard.asterisk.org/r/540/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@252089 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-12 22:04:51 +00:00
jpeeler 7cb8dcb72b Merged revisions 250786 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r250786 | jpeeler | 2010-03-04 19:02:58 -0600 (Thu, 04 Mar 2010) | 9 lines
  
  Fix not being able to specify a URL in MOH class directory.
  
  Don't attempt to chdir on a URL!
  
  (closes issue #16875)
  Reported by: raarts
  Patches: 
        moh-http.patch uploaded by raarts (license 937)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@250787 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-05 01:05:46 +00:00
mnicholson f90164d3b4 Updated CHANGES file to mention res_fax and res_fax_spandsp.
Also fixed MODULEINFO depends and conflicts for app_fax, res_fax, and res_fax_spandsp.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@250302 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-03 15:39:45 +00:00
mnicholson bc9bd7bb7c Merge res_fax and res_fax_spandsp.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@250190 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-02 23:11:06 +00:00
lmadsen 64020820db Fix several XML documentation validate errors.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@249892 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-02 19:02:56 +00:00
jpeeler 7f94645901 Merged revisions 248860 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r248860 | jpeeler | 2010-02-25 15:22:06 -0600 (Thu, 25 Feb 2010) | 18 lines
  
  Ensure that monitor recordings are written to the correct location (again)
  
  This is an extension to 248757. As such the dialplan test has been extended:
  
  exten => 5040, 1, monitor(wav,tmp/jeff/monitor_test,b)
  exten => 5040, n, dial(sip/5001)
  exten => 5041, 1, monitor(wav,/tmp/jeff/monitor_test2,b)
  exten => 5041, n, dial(sip/5001)
  exten => 5042, 1, monitor(wav,monitor_test3,b)
  exten => 5042, n, dial(sip/5001)
  exten => 5043, 1, monitor(wav,tmp/jeff/monitor_test3,m)
  exten => 5043, n, changemonitor(monitor_test4)
  exten => 5043, n, dial(sip/5001)
  exten => 5044, 1, monitor(wav,monitor_test4,m)
  exten => 5044, n, changemonitor(tmp/jeff/monitor_test5) ; this looks to fail by design and emits a warning
  exten => 5044, n, dial(sip/5001)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@248952 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-25 23:09:54 +00:00
jpeeler fb6f7adb60 Merged revisions 248757 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r248757 | jpeeler | 2010-02-25 12:06:54 -0600 (Thu, 25 Feb 2010) | 15 lines
  
  Ensure that monitor recordings are written to the correct location.
  
  Recordings should be placed in the monitor directory when a non-absolute path
  is used.
  
  Exact dialplan used for testing:
  exten => 5040, 1, monitor(wav,tmp/jeff/monitor_test,b)
  exten => 5040, n, dial(sip/5001)
  exten => 5041, 1, monitor(wav,/tmp/jeff/monitor_test2,b)
  exten => 5041, n, dial(sip/5001)
  exten => 5042, 1, monitor(wav,monitor_test3,b)
  exten => 5042, n, dial(sip/5001)
  
  ABE-2101
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@248793 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-25 18:37:56 +00:00
oej dbed743d32 Improve support for RTCP reports without report blocks
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@248108 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-20 22:37:22 +00:00
tilghman 7774002c87 Revert an errant part of a previous cleanup, to fix a memory corruption issue.
(closes issue #16368)
 Reported by: thirionjwf
 Patches: 
       res_speech.c.patch uploaded by thirionjwf (license 955)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@247841 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-18 23:13:46 +00:00
phsultan fbea4f8872 Add a new manager event for our buddies status.
The new JabberStatus event gives a concise view of the status change to the AMI
clients. Thanks fiddur!

(closes issue #16760)
Reported by: fiddur
Patches:
      244498.2.diff uploaded by fiddur (license 678)
Tested by: fiddur, phsultan


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@247500 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-18 16:34:08 +00:00
tilghman 965e087bf8 res_pktccops needs to be able to export a symbol for chan_mgcp
(closes issue #16782)
 Reported by: nahuelgreco
 Patches: 
       res_pktccops.exports uploaded by nahuelgreco (license 162)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@246208 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-10 21:55:42 +00:00
tilghman b65768d7bb Solaris doesn't like outputting a NULL to a %s in format strings.
Detect all platforms that don't like that, either, and ensure that when documentation is
missing, we pass a non-NULL pointer when outputting the corresponding documentation.

(closes issue #16689)
 Reported by: bklang
 Patches: 
       20100209__issue16689__with_tests.diff.txt uploaded by tilghman (license 14)
 
Review: https://reviewboard.asterisk.org/r/497/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@246030 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-10 16:01:28 +00:00
twilson 05ec01c465 Fix crash on 32-bit for users not using https
(closes issue #16778)
Reported by: pitel
Patches: 
      diff.txt uploaded by twilson (license 396)
Tested by: twilson, pitel



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@244945 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-05 17:20:24 +00:00
tilghman 25a47d0a8b Merged revisions 242969 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r242969 | tilghman | 2010-01-25 15:50:22 -0600 (Mon, 25 Jan 2010) | 2 lines
  
  Err, and use the new menuselect define, too.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@242971 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-25 21:51:41 +00:00
tilghman 36b4673685 Merged revisions 242852 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r242852 | tilghman | 2010-01-25 14:15:45 -0600 (Mon, 25 Jan 2010) | 2 lines
  
  Restore FreeBSD to able-to-compile-ish-mode
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@242857 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-25 20:18:15 +00:00
twilson 403a249ddb Fix INTERNAL_OBJ error on stop when calendars.conf missing
Initialize the calendars container before calling load_config and return FAILURE
on allocation failure. Also, use the AST_MODULE_LOAD_* values for return values.
Thanks to rmudgett for pointing out the error and the need to use the defined
values for return


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@242812 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-25 18:01:08 +00:00
tilghman dbf9257276 Merged revisions 242728 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r242728 | tilghman | 2010-01-24 23:42:22 -0600 (Sun, 24 Jan 2010) | 2 lines
  
  Buildbot pointed out an error (thanks, buildbot!)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@242729 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-25 05:45:00 +00:00
tilghman b7b70b913e Merged revisions 242723 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r242723 | tilghman | 2010-01-24 23:33:37 -0600 (Sun, 24 Jan 2010) | 2 lines
  
  Oops, should have used CMD_PREFIX, not ECHO_PREFIX, for the commands.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@242724 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-25 05:34:33 +00:00
seanbright e9e6d14932 Instead of crashing, allocate our header ast_str before we try to use it.
(closes issue #16680)
Reported by: lmadsen
Patches:
      issue16680_20100122.patch uploaded by seanbright (license 71)
Tested by: lmadsen


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@242607 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-24 21:49:17 +00:00
tilghman 8b4dc27865 Merged revisions 242520 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r242520 | tilghman | 2010-01-24 00:33:01 -0600 (Sun, 24 Jan 2010) | 8 lines
  
  Only rebuild bison and flex source files on demand, if bison and flex are detected by the configure script.
  
  Changed after discussion on the -dev list about possible unnecessary build
  failures, due to checkouts/untars causing these special source files to
  possibly be newer than their resulting C files.  This should additionally
  ensure that nobody need learn about extra Makefile arguments to ensure the
  proper files get rebuilt when changes are made to these special source files.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@242521 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-24 06:40:31 +00:00
tilghman a67a960e2a Merged revisions 242423 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r242423 | tilghman | 2010-01-22 15:44:18 -0600 (Fri, 22 Jan 2010) | 7 lines
  
  Rebuild from flex, bison sources when necessary.
  
  (issue #14629)
   Reported by: Marquis
   Patches: 
         20100121__issue14629.diff.txt uploaded by tilghman (license 14)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@242424 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-22 21:45:18 +00:00
dvossel ee8e1dff15 rtp timestamp to timeval calculation fix
The rtp timestamp to timeval calculation was only
accurate for 8kHz audio. This patch corrects this.

Review: https://reviewboard.asterisk.org/r/468/

SWP-648



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@241714 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-20 21:14:47 +00:00
tilghman fb0c85edeb Create iterative method for querying SRV results, and use that for finding AGI servers.
(closes issue #14775)
 Reported by: _brent_
 Patches: 
       20091215__issue14775.diff.txt uploaded by tilghman (license 14)
       hagi-5.patch uploaded by brent (license 388)
 Tested by: _brent_
 Reviewboard: https://reviewboard.asterisk.org/r/378/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@241188 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-19 00:28:49 +00:00
seanbright 1e59f02ddc Get MoH building on OpenSolaris.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240667 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-16 00:54:08 +00:00
seanbright fb6ff080a4 Clarify error message in res_timing_timerfd.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240505 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-15 22:07:31 +00:00
seanbright adc69e041d Convert a few places to use ast_calloc_with_stringfields where applicable.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240368 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-15 18:21:50 +00:00
seanbright cc755d40a9 Plug a memory leak in res_config_ldap.
(closes issue #16257)
Reported by: nito
Patches:
      issue16257_20100111.diff uploaded by seanbright (license 71)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240271 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-14 23:13:02 +00:00
seanbright 44ac5b2fb6 If we aren't running on a machine that support CLOCK_MONOTONIC, don't load.
Group developed and tested by seanbright, Corydon76, Kobaz, and Amorsen.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240226 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-14 20:30:03 +00:00
seanbright 4e574ff098 Fix crash in res_config_ldap.
We need to allocate enough room for 2 pointers, not 2 characters.

(closes issue #16397)
Reported by: bklang
Patches:
      res_config_ldap.patch uploaded by applsplatz (license 949)
Tested by: applsplatz


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@239473 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-12 17:09:12 +00:00
tilghman 04cd031851 Socket level option is SOL_SOCKET, not SO_SOCKET.
(issue #16580)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@239245 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-11 23:19:51 +00:00
seanbright 5943d0abab Pass NULL for the ao2_callback function pointer instead of duplicating cb_true.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@239114 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-11 16:41:44 +00:00
tilghman e73a979682 Add the class actually used in the MusicOnHold start event.
(closes issue #16499)
 Reported by: syspert
 Patches: 
       mohclass.patch uploaded by syspert (license 938)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@238795 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-08 22:54:59 +00:00
tilghman f4f0e41dab Initialize variables that we attempt to free later.
(closes issue #16302)
 Reported by: yahsyn
 Patches: 
       20091124__issue16302.diff.txt uploaded by tilghman (license 14)
 Tested by: yahsyn


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@238754 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-08 22:17:03 +00:00
tilghman fda6c101b6 Merged revisions 237405 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r237405 | tilghman | 2010-01-04 12:19:00 -0600 (Mon, 04 Jan 2010) | 16 lines
  
  Add a flag to disable the Background behavior, for AGI users.
  This is in a section of code that relates to two other issues, namely
  issue #14011 and issue #14940), one of which was the behavior of
  Background when called with a context argument that matched the current
  context.  This fix broke FreePBX, however, in a post-Dial situation.
  Needless to say, this is an extremely difficult collision of several
  different issues.  While the use of an exception flag is ugly, fixing all
  of the issues linked is rather difficult (although if someone would like
  to propose a better solution, we're happy to entertain that suggestion).
  (closes issue #16434)
   Reported by: rickead2000
   Patches: 
         20091217__issue16434.diff.txt uploaded by tilghman (license 14)
         20091222__issue16434__1.6.1.diff.txt uploaded by tilghman (license 14)
   Tested by: rickead2000
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237406 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-04 18:28:28 +00:00
jpeeler c6678d2ee6 Fix timeout for AGI command speech recognize.
(closes issue #16297)
Reported by: semond


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237323 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-04 16:24:51 +00:00
oej f35824d4c4 - Disable res_pktccops by default
- Add dependency in chan_mgcp that was missing
- Add a small amount of doc to the source code


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237284 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-04 07:55:30 +00:00
tilghman c75d2ac2c0 Merged revisions 236184 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r236184 | tilghman | 2009-12-22 20:55:24 -0600 (Tue, 22 Dec 2009) | 4 lines
  
  If EXEC only gets a single argument, don't crash when the second is used.
  (closes issue #16504)
   Reported by: bklang
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@236186 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-23 03:07:48 +00:00
jpeeler 78a06c758e Merged revisions 235940 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r235940 | jpeeler | 2009-12-21 13:43:41 -0600 (Mon, 21 Dec 2009) | 13 lines
  
  Change Monitor to not assume file to write to does not contain pathing.
  
  227944 changed the fname_base argument to always append the configured monitor
  path. This change was necessary to properly compare files for uniqueness. 
  If a full path is given though, nothing needs to be appended and that is
  handled correctly now.
  
  (closes issue #16377)
  (closes issue #16376)
  Reported by: bcnit
  Patches:
        res_monitor.c-issue16376-1.patch uploaded by dant (license 670)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@235941 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-21 19:54:20 +00:00
jpeeler 3c23a5b71c Add auth_policy option to jabber.conf for auto user registration.
The option is global and currently the acceptable values as noted in the sample
config are accept or deny.

(closes issue #15228)
Reported by: lp0


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@235342 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-16 20:25:27 +00:00
tilghman 0c62718430 Merged revisions 235052 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r235052 | tilghman | 2009-12-15 09:29:24 -0600 (Tue, 15 Dec 2009) | 4 lines
  
  Mandatory argument checking
  (closes issue #16446)
   Reported by: nicchap
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@235053 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-15 15:33:49 +00:00
tilghman 1e9f0fe10f Missed a case that emits a WARNING where none is warranted.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@234210 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-10 18:56:23 +00:00
tilghman 633965203f Find another ref leak and change how we manage module references.
(closes issue #16388, closes issue #16279, closes issue #16390)
 Reported by: parisioa
 Patches: 
       20091208__issue16388.diff.txt uploaded by tilghman (license 14)
 Tested by: parisioa, tilghman
 Review: https://reviewboard.asterisk.org/r/442/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@233718 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-08 18:22:44 +00:00
jpeeler a365e23dbc Add applications JabberJoin, JabberLeave, JabberSendGroup for XMPP groupchat
(closes issue #14352)
Reported by: fiddur
Patches: 
      trunk-14352-2.diff uploaded by phsultan (license 73)
Tested by: fiddur


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@233468 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-07 17:59:46 +00:00
tilghman 3a01d7fe14 Buildbot complained
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232982 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-04 05:26:54 +00:00
tilghman e3cfc784dd OS X does not define MSG_NOSIGNAL, but it does have a socket option SO_NOSIGPIPE.
(closes issue #16178)
 Reported by: oej


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232950 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-04 04:52:24 +00:00
tilghman 2c18fba034 Remove debugging line
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232661 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-03 00:09:36 +00:00
tilghman 5713766b01 Fix multiple issues with musiconhold, which led to classes not getting destroyed properly.
* Classes are now tracked past removal from the core container, and module
   removal is actively prevented until all references are freed.
 * A hanging reference stored in the channel has been removed.  This could have
   caused a mismatch and the music state not properly cleared, if two or more
   reloads occurred between MOH being stopped and MOH being restarted.
 * In certain circumstances, duplicate classes were possible.
 * A race existed at reload time between a process being killed and the thread
   responsible for reading from the related pipe respawning that process.
 * Several reference counts have also been corrected.  At least one could have
   caused deleted classes to stick around forever, consuming resources.  This
   originally manifested as MOH external processes that were not killed at
   reload time.
(closes issue #16279, closes issue #16207)
 Reported by: parisioa, dcabot
 Patches: 
       20091202__issue16279__2.diff.txt uploaded by tilghman (license 14)
 Tested by: parisioa, tilghman


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232660 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-03 00:08:55 +00:00
tilghman f4d89e410a More 32->64 bit codec conversions.
In the process of swapping ULAW to a place in the extended codec space, we
found several unhandled cases, where a 32-bit integer was still being used to
handle a codec field.  Most of these have been fixed with this commit, although
there is at least one case (codec_dahdi) which depends upon outside headers to
be altered before a conversion can be made.
(Fixes AST-278, SWP-459)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231850 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-01 20:27:37 +00:00
dvossel 6d3a5bd0a2 Merged revisions 231441 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r231441 | dvossel | 2009-11-30 11:14:08 -0600 (Mon, 30 Nov 2009) | 11 lines
  
  fixes crash caused by RTP comfort noise payload greater than 24 bytes
  
  AST-2009-010
  
  (closes issue #16242)
  Reported by: amorsen
  Patches:
        issue16242.diff uploaded by oej (license 306)
  Tested by: amorsen, oej, dvossel
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231491 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-30 17:28:28 +00:00
tilghman 317ea2e45d Display a list of channel variables in each channel-oriented event.
(Closes AST-33)
Reviewboard:	https://reviewboard.asterisk.org/r/368/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@230111 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-13 20:42:03 +00:00
dvossel 793d179b07 fixes pgsql double free of threadstorage
A thread storage variable was being freed incorrectly, which
resulted in a double free if two queries were made in the same thread.

(closes issue #16011)
Reported by: cristiandimache
Patches:
      issue16011.diff uploaded by dvossel (license 671)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@229093 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-10 15:27:45 +00:00
tilghman 4424b26d1e Fix various problems detected with Valgrind.
* chan_console accessed pvts after deallocation.
 * cdr_mysql stored a pointer that was freed by realloc()
 * The module loader did not check usecount on shutdown, which led to chan_iax2
 reading a timer that was already unloaded.
 * The event subsystem sometimes creates an event with no IEs.  Due to a corner
 condition, the code would read beyond the memory boundary.
 * res_pktccops did not correctly check whether its monitor thread was started.
(closes issue #16062)
 Reported by: alexanderheinz
 Patches: 
       20091109__issue16062.diff.txt uploaded by tilghman (license 14)
 Tested by: tilghman


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@228798 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-09 07:37:52 +00:00
jpeeler 620b29df72 Merged revisions 227944 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r227944 | jpeeler | 2009-11-04 17:47:08 -0600 (Wed, 04 Nov 2009) | 14 lines
  
  Fix incorrect filename comparsion after monitor file change
  
  The logic to detect if a requested file is indeed a different file from the
  current file was incorrect. The main issue being confusion of the use of
  filename_base which was previously set without pathing information and then
  compared to another full path. Robust file comparison logic has been added
  to properly check if two files are the same even if symlinks are used.
  
  (closes issue #15313)
  Reported by: caspy
  Patches: 
        20091103__issue15313__1.4.diff.txt uploaded by jpeeler (license 325)
        but mostly tilghman's work
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227945 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-04 23:50:59 +00:00
tilghman 3bacd4082e Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227580 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-04 14:05:12 +00:00
russell cdb38a0258 Resolve another warning.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227464 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-03 22:13:25 +00:00
tilghman 21f12d5255 Add PacketCable NCS 1.0 support for Docsis/Eurodocsis networks
(closes issue #12950)
 Reported by: alea-soluciones
 Patches: 
       ncs-pktccops-12950-r206803.patch uploaded by alea-soluciones (license 514)
 Tested by: alea-soluciones, adomjan, urtho, nahuelgreco


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227049 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-02 22:29:19 +00:00
russell a0a2975952 Add an "Asterisk Architecture Overview" section to the doxygen documentation.
This is a side project I've been poking at this week.  The intent is to discuss
Asterisk architecture in a top down fashion to help new developers understand how
Asterisk is put together.  There is a ton of stuff to write about, so this will
just continue to evolve over time.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@226606 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-30 04:08:39 +00:00
twilson 8c6ba0cbb7 Don't prepend the URI prefix to the post directory
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@226099 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-27 16:48:54 +00:00
kpfleming 4f428997ca Finish implementaton of astobj2 OBJ_MULTIPLE, and convert ast_channel_iterator to use it.
This patch finishes the implementation of OBJ_MULTIPLE in astobj2 (the
case where multiple results need to be returned; OBJ_NODATA mode
already was supported). In addition, it converts ast_channel_iterators
(only the targeted versions, not the ones that iterate over all
channels) to use this method.

During this work, I removed the 'ao2_flags' arguments to the
ast_channel_iterator constructor functions; there were no uses of that
argument yet, there is only one possible flag to pass, and it made the
iterators less 'opaque'. If at some point in the future someone really
needs an ast_channel_iterator that does not lock the container, we can
provide constructor(s) for that purpose.

Review: https://reviewboard.asterisk.org/r/379/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225244 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-21 21:08:47 +00:00
kpfleming 99373053cf Merged revisions 224670 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r224670 | kpfleming | 2009-10-19 18:44:07 -0500 (Mon, 19 Oct 2009) | 7 lines
  
  Correct timestamp calculations when RTP sample rates over 8kHz are used.
  
  While testing some endpoints that support 16kHz and 32kHz sample rates, some
  log messages were generated due to calc_rxstamp() computing timestamps in a way
  that produced odd results, so this patch sanitizes the result of the
  computations.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@224671 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-19 23:47:39 +00:00
twilson 6d59c9cda0 Properly handle PUT requests for CALENDAR_WRITE()
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@224109 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-15 06:48:17 +00:00
twilson 4df6405120 Add missing 'getnum' field
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@224074 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-14 21:16:57 +00:00
twilson 2f25cd5cc8 use Calendar: instead of Calendar/ for devstate
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@223992 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-13 22:14:22 +00:00
rmudgett 4ec7cf9911 Fix compiler warning.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@223911 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-13 17:11:05 +00:00
twilson 0e46ff9d32 Fix handling of notification calls w/ the dialing api
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@223874 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-13 01:51:46 +00:00
twilson 5f0f1093db Fix handling of floating times and dates
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@223449 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-10 20:02:32 +00:00
twilson b802d5df49 Properly return "free" on confirmed events that are free
CONFIRMED status doesn't imply busy or free, that is handled with the TRANSP
field. Luckily, libical already sets the is_busy status on the span for us.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@223370 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-09 22:04:04 +00:00
twilson 48eb03209f Don't add Attendees during copy, replace them
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@223053 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-09 15:00:49 +00:00
twilson a596e54d5b Remove global variable that makes dlopen unhappy
This isn't the best way to do this, but it is the easiest. There are some
limitations that are going to need to be addressed at some point with reloads
and when I (or someone else) work on that, then the API can be updated to
handle passing the private config data that the calendar tech modules need in
a better way as well.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@223016 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-08 23:11:23 +00:00
oej 0aab9c012d Formatting, moving error messages to ERROR, removing references to unexisting debug output. No functionality changes.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222615 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-07 18:57:29 +00:00
oej 61a843429f Use extref for doxygen references to external libraries (in this case PostgreSQL)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222614 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-07 18:55:25 +00:00
tilghman 5c7b85b039 Change schema query to involve the use of an optional schema parameter.
This change is done in such a way as to allow the driver to continue to
function with older databases which don't have these features.
(closes issue #16000)
 Reported by: jamicque
 Patches: 
       20091002__issue16000.diff.txt uploaded by tilghman (license 14)
       20091002__issue16000__1.6.1.diff.txt uploaded by tilghman (license 14)
 Tested by: jamicque


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222309 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-06 19:31:39 +00:00
tilghman 2d756b1cc7 When we call a gosub routine, the variables should be scoped to avoid contaminating the caller.
This affected the ~~EXTEN~~ hack, where a subroutine might have changed the
value before it was used in the caller.
Patch by myself, tested by ebroad on #asterisk


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222273 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-06 19:17:11 +00:00
kpfleming e299cf0653 Recorded merge of revisions 222152 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r222152 | kpfleming | 2009-10-05 20:16:36 -0500 (Mon, 05 Oct 2009) | 20 lines
  
  Fix ao2_iterator API to hold references to containers being iterated.
  
  See Mantis issue for details of what prompted this change.
  
  Additional notes:
  
  This patch changes the ao2_iterator API in two ways: F_AO2I_DONTLOCK
  has become an enum instead of a macro, with a name that fits our
  naming policy; also, it is now necessary to call
  ao2_iterator_destroy() on any iterator that has been
  created. Currently this only releases the reference to the container
  being iterated, but in the future this could also release other
  resources used by the iterator, if the iterator implementation changes
  to use additional resources.
  
  (closes issue #15987)
  Reported by: kpfleming
  
  Review: https://reviewboard.asterisk.org/r/383/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222176 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-06 01:24:24 +00:00
twilson aaac503322 Remove spurious debug
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221300 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-30 18:47:53 +00:00
twilson b8e1d3fe36 Use rtp properties instead of adding a callback
Thanks, Josh.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221278 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-30 18:21:03 +00:00
twilson bc354c76f4 Merged revisions 221086 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r221086 | twilson | 2009-09-30 09:49:11 -0500 (Wed, 30 Sep 2009) | 25 lines
  
  Change the SSRC by default when our media stream changes
  
  Be default, change SSRC when doing an audio stream changes Asterisk doesn't
  honor marker bit when reinvited to already-bridged RTP streams,resulting in
  far-end stack discarding packets with "old" timestamps that areactually part of
  a new stream.  This patch sends AST_CONTROL_SRCUPDATE whenever there is a
  reinvite, unless the 'constantssrc' is set to true in sip.conf.
  
  The original issue reported to Digium support detailed the following situation:
  ITSP <-> Asterisk 1.4.26.2 <-> SIP-based Application Server Call comes in
  fromITSP, Asterisk dials the app server which sends a re-invite back
  toAsterisk--not to negotiate to send media directly to the ITSP, but to
  indicatethat it's changing the stream it's sending to Asterisk.  The app
  servergenerates a new SSRC, sequence numbers, timestamps, and sets the marker
  bit on the new stream.  Asterisk passes through the teimstamp of the new stream,
  butdoes not reset the SSRC, sequence numbers, or set the marker bit.
  
  When the timestamp on the new stream is older than the timestamp on the
  originalstream, the ITSP (which doesn't know there has been any change) discards
  the newframes because it thinks they are too old.  This patch addresses this by
  changing the SSRC on a stream update unless constantssrc=true is set in
  sip.conf.
  
  Review: https://reviewboard.asterisk.org/r/374/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221266 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-30 17:52:30 +00:00
phsultan 5bec5836a0 Add JABBER_RECEIVE as a dialplan function, implement SendText in Jingle channels
JABBER_RECEIVE (along with JabberSend) makes Asterisk interact with users over
XMPP to process calls.
SendText can be used instead of JabberSend in the context of XMPP based voice
channels (chan_gtalk and chan_jingle).

(closes issue #12569)
Reported by: eech55
Tested by: phsultan, asannucci, lmadsen, jtodd, maxgo

Review: https://reviewboard.asterisk.org/r/88/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220457 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-25 10:54:42 +00:00
seanbright f4ad280e2a Remove some unused defines from res_jabber.
(closes issue #15359)
Reported by: snuffy
Patches:
      bug_res_jabber_unused_defines.diff uploaded by snuffy (license 35)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@218973 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-16 20:32:50 +00:00
mvanbaak 73dc62fb70 use the actual given ip address for 'rtp set debug ip <foo>' instead of the word 'ip'
(closes issue #15711)
Reported by: davidw
Patches:
      2009082800-rtpdebug.diff.txt uploaded by mvanbaak (license 7)
Tested by: davidw


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@218107 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-12 13:08:16 +00:00
mnick 0322a607eb Sets the correct musicclass after an announcement
(closes issue #15279)
Reported by: mbeckwell
Patches:
      patch.txt uploaded by mnick (license )
Tested by: mnick

(closes issue #15832)
Reported by: mbeckwell
Patches:
      patch.txt uploaded by mnick (license 874)
Tested by: mnick




git-svn-id: http://svn.digium.com/svn/asterisk/trunk@217730 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-10 19:39:41 +00:00
tilghman da7e05ef35 Verify support for wide ODBC character types before using them.
(closes issue #15870)
 Reported by: nic_bellamy


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@217638 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-10 18:17:14 +00:00
tzafrir e8c418029f gcc 4.4 fix: union instead of cast
gcc 4.4 has more strict rules for aliasing. It doesn't like a 
struct sockaddr_in pointer pointing to a struct sockaddr. So we make it
a union.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@217445 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-09 18:52:48 +00:00
tilghman 4add6741ee Remove what appears to be an unnecessary define.
(closes issue #15851)
 Reported by: tzafrir


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@217033 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-08 15:30:18 +00:00
oej 7b62ceabb8 Adding MUTEAUDIO() dialplan function and MuteAudio AMI action (pinepeach)
Review: https://reviewboard.asterisk.org/r/345/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215382 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-02 06:23:05 +00:00
tilghman 1a7c218740 Remove unnecessary define for Solaris
(closes issue #15358)
 Reported by: snuffy
 Patches: 
       bug_res_moh_remove_unneeded_include.diff uploaded by snuffy (license 35)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@214611 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-28 16:50:05 +00:00
mvanbaak 24a34a573a cast time_t type variables to long where needed.
This makes res_calendar.c compile on OpenBSD and the same
cast is used in a lot of other places where time_t type vars are used.

(closes issue #15656)
Reported by: mvanbaak
Patches:
      2009081100-rescalendarcompilefix.diff.txt uploaded by mvanbaak (license 7)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@212343 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-15 11:36:19 +00:00
ghenry 8e506c55d2 Added three new attributes and applied a patch to res_config_ldap.c
attributetype ( AstAccountSubscribeContext
        NAME 'AstAccountSubscribeContext'
        DESC 'Asterisk subscribe context'
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)

attributetype ( AstAccountIpAddr
        NAME 'AstAccountIpAddr'
        DESC 'Asterisk aaccount IP address'
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)

attributetype ( AstAccountUserAgent
        NAME 'AstAccountUserAgent'
        DESC 'Asterisk account user context'
        EQUALITY caseIgnoreMatch
        SUBSTR caseIgnoreSubstringsMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)

and patch fix_empty_attributes_1.6.1.4_v2.patch 

(closes issue #13725)
Reported by: macogeek
Patches:
      fix_empty_attributes_1.6.1.4_v2.patch uploaded by xvisor (license 863)
Tested by: suretec




git-svn-id: http://svn.digium.com/svn/asterisk/trunk@211767 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-12 16:00:46 +00:00
tilghman d1ec1aa57d AST-2009-005
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@211539 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-10 19:20:57 +00:00
mmichelson e8cb2dc645 Gracefully handle malformed RTP text packets.
AST-2009-004



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@209235 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-27 20:54:54 +00:00
mmichelson d85d886923 Honor channel's music class when using realtime music on hold.
(closes issue #15051)
Reported by: alexh
Patches:
      15051.patch uploaded by mmichelson (license 60)
Tested by: alexh



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@209197 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-27 20:11:42 +00:00
dbrooks 3a578de20c Fixing typos. Replaces "recieved" with "received" and "initilize" with "initialize"
(closes issue #15571)
Reported by: alecdavis



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@209098 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-27 16:33:50 +00:00
tilghman 170f42a15b Clarify documentation on 'realtime update2' to show more than one condition.
(closes issue #15357)
 Reported by: snuffy
 Patches: 
       bug_fix_doc_update2.diff uploaded by snuffy (license 35)
       (slightly modified by me)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@208052 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-22 16:49:42 +00:00
kpfleming 3dbaf0de9a Merged revisions 207647 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r207647 | kpfleming | 2009-07-21 08:04:44 -0500 (Tue, 21 Jul 2009) | 12 lines
  
  Ensure that user-provided CFLAGS and LDFLAGS are honored.
  
  This commit changes the build system so that user-provided flags (in ASTCFLAGS
  and ASTLDFLAGS) are supplied to the compiler/linker *after* all flags provided
  by the build system itself, so that the user can effectively override the
  build system's flags if desired. In addition, ASTCFLAGS and ASTLDFLAGS can now
  be provided *either* in the environment before running 'make', or as variable
  assignments on the 'make' command line. As a result, the use of COPTS and LDOPTS
  is no longer necessary, so they are no longer documented, but are still supported
  so as not to break existing build systems that supply them when building Asterisk.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@207680 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-21 13:28:04 +00:00
russell ef09b20743 Add an API for reporting security events, and a security event logging module.
This commit introduces the security events API.  This API is to be used by
Asterisk components to report events that have security implications.
A simple example is when a connection is made but fails authentication.  These
events can be used by external tools manipulate firewall rules or something
similar after detecting unusual activity based on security events.

Inside of Asterisk, the events go through the ast_event API.  This means that
they have a binary encoding, and it is easy to write code to subscribe to these
events and do something with them.

One module is provided that is a subscriber to these events - res_security_log.
This module turns security events into a parseable text format and sends them
to the "security" logger level.  Using logger.conf, these log entries may be
sent to a file, or to syslog.

One service, AMI, has been fully updated for reporting security events.
AMI was chosen as it was a fairly straight forward service to convert.
The next target will be chan_sip.  That will be more complicated and will
be done as its own project as the next phase of security events work.

For more information on the security events framework, see the documentation
generated from doc/tex/.  "make asterisk.pdf"

Review: https://reviewboard.asterisk.org/r/273/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@206021 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-11 19:15:03 +00:00
dvossel 4fc4098a76 Merged revisions 205471 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r205471 | dvossel | 2009-07-08 18:15:54 -0500 (Wed, 08 Jul 2009) | 10 lines
  
  Fixes 8khz assumptions
  
  Many calculations assume 8khz is the codec rate. This
  is not always the case.  This patch only addresses chan_iax.c
  and res_rtp_asterisk.c, but I am sure there are other areas
  that make this assumption as well.
  
  Review: https://reviewboard.asterisk.org/r/306/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205479 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 23:19:09 +00:00
russell aa0e8f1b3c Move OpenSSL initialization to a single place, make library usage thread-safe.
While doing some reading about OpenSSL, I noticed a couple of things that
needed to be improved with our usage of OpenSSL.

1) We had initialization of the library done in multiple modules.  This has now
   been moved to a core function that gets executed during Asterisk startup.
   We already link OpenSSL into the core for TCP/TLS functionality, so this
   was the most logical place to do it.

2) OpenSSL is not thread-safe by default.  However, making it thread safe is
   very easy.  We just have to provide a couple of callbacks.  One callback
   returns a thread ID.  The other handles locking.  For more information,
   start with the "Is OpenSSL thread-safe?" question on the FAQ page of
   openssl.org.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205120 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 15:17:19 +00:00
russell ac3b35dcc7 Merge the new Channel Event Logging (CEL) subsystem.
CEL is the new system for logging channel events.  This was inspired after
facing many problems trying to represent what is possible to happen to a call
in Asterisk using CDR records.  For more information on CEL, see the built in
HTML or PDF documentation generated from the files in doc/tex/.

Many thanks to Steve Murphy (murf) and Brian Degenhardt (bmd) for their hard
work developing this code.  Also, thanks to Matt Nicholson (mnicholson) and
Sean Bright (seanbright) for their assistance in the final push to get this
code ready for Asterisk trunk.

Review: https://reviewboard.asterisk.org/r/239/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203638 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-26 15:28:53 +00:00
file 6fe3688a64 Add support for multicast RTP paging.
(closes issue #11797)
Reported by: macbrody

Review: https://reviewboard.asterisk.org/r/270/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203227 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-25 18:25:24 +00:00
tilghman a2eaf0797c Fix 2 typos and add support for wide character types.
Reported by Benny Amorsen via the asterisk-users mailing list.
http://lists.digium.com/pipermail/asterisk-users/2009-June/233622.html


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@201904 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-19 15:47:55 +00:00
dvossel 7803be8ee4 fixes some memory leaks and redundant conditions
(closes issue #15269)
Reported by: contactmayankjain
Patches:
      patch.txt uploaded by contactmayankjain (license 740)
      memory_leak_stuff.trunk.diff uploaded by dvossel (license 671)
Tested by: contactmayankjain, dvossel




git-svn-id: http://svn.digium.com/svn/asterisk/trunk@201678 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-18 16:37:42 +00:00
russell 160722f257 Merged revisions 201600 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r201600 | russell | 2009-06-18 10:24:31 -0500 (Thu, 18 Jun 2009) | 29 lines
  
  Fix memory corruption and leakage related reloads of non files mode MoH classes.
  
  For Music on Hold classes that are not files mode, meaning that we are executing
  an application that will feed us audio data, we use a thread to monitor the
  external application and read audio from it.  This thread also makes use of the
  MoH class object.  In the MoH class destructor, we used pthread_cancel() to ask
  the thread to exit.  Unfortunately, the code did not wait to ensure that the
  thread actually went away.  What needed to be done is a pthread_join() to ensure
  that the thread fully cleans up before we proceed.  By adding this one line, we
  resolve two significant problems:
  
    1) Since the thread was never joined, it never fully goes away.  So, on every
       reload of non-files mode MoH, an unused thread was sticking around.
  
    2) There was a race condition here where the application monitoring thread
       could still try to access the MoH class, even though the thread executing
       the MoH reload has already destroyed it.
  
  (issue #15109)
  Reported by: jvandal
  
  (issue #15123)
  Reported by: axisinternet
  
  (issue #15195)
  Reported by: amorsen
  
  (issue AST-208)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@201610 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-18 15:27:10 +00:00
mmichelson 90de52f0b7 Trunk implementation of setting an alternate RTP source.
This contains the interface by which we can let an rtp instance know
that it might start receiving audio from a new source. This is similar
in nature to revision 197588 of Asterisk 1.4.

Review: https://reviewboard.asterisk.org/r/276



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@201583 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-18 15:20:17 +00:00
eliel 5a1e71bfa3 Show the interface name on error, if it is not found.
If the smdiport specified is not found, show the interface name
instead of '(null)'.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@200841 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-16 12:32:00 +00:00
kpfleming 5fa0b7c277 More 'static' qualifiers on module global variables.
The 'pglobal' tool is quite handy indeed :-)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@200620 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-15 17:34:30 +00:00
kpfleming 12ab0bbe15 Redesigned 'optional API' support.
This patch provides a new implementation of the optional API support defined
in asterisk/optional_api.h; this new version provides solves compatibility
issues with the use of linker version scripts for suppressing global symbols.
In addition, there is now a functional (and tested!) implementation for Mac OS/X,
so module writers no longer need to use special tests before calling optional
API functions. All future implementations must provide these same semantics,
so that module writers can rely on them.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@200519 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-15 16:07:23 +00:00
dvossel 114afd3010 module load priority
This patch adds the option to give a module a load priority. The value represents the order in which a module's load() function is initialized.  The lower the value, the higher the priority.  The value is only checked if the AST_MODFLAG_LOAD_ORDER flag is set.  If the AST_MODFLAG_LOAD_ORDER flag is not set, the value will never be read and the module will be given the lowest possible priority
on load.  Since some modules are reliant on a timing interface, the timing modules have been given a high load priorty.

(closes issue #15191)
Reported by: alecdavis
Tested by: dvossel

Review: https://reviewboard.asterisk.org/r/262/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@199743 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-09 16:22:04 +00:00
eliel 3230c2a50c Move music on hold related applications documentation to XML.
Move MusicOnHold, SetMusicOnHold, StartMusicOnHold, StopMusicOnHold static
documentation to the new AstXML form.

(issue #15245)
Reported by: eliel
Patches:
      res_musiconhold_static_conversion.txt uploaded by lmadsen (license 10)
      (with some fixes and formatting by me)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@199413 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-06 23:03:15 +00:00
eliel 228212e7d5 Move function PP_EACH_USER and PP_EACH_EXTENSION documentation to XML.
Move function PP_EACH_USER and PP_EACH_EXTENSION documentation to the new
AstXML form.

(issue #15245)
Reported by: eliel
Patches:
      res_phoneprov_static_conversion.txt uploaded by lmadsen (license 10)
	(with PP_EACH_USER add by me)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@199411 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-06 22:45:42 +00:00
eliel 84c8feb3ee Move static docs to the new AstXML form.
Move SMDI_MSG and SMDI_MSG_RETRIEVE functions statis documentation
to XML.

(issue #15245)
Reported by: eliel
Patches:
      res_smdi_static_conversion.txt uploaded by lmadsen (license 10)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@199091 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-04 16:29:50 +00:00
eliel 9044d7f9c4 Moved more static documentation to the new AstXML form.
Moved more static docs to XML (pplications and manager actions):
Monitor, StopMonitor, ChangeMonitor, PauseMonitor, UnpauseMonitor.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@198661 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-01 19:37:30 +00:00
eliel 58cda0223b Move JabberSend manager action from static docs to the AstXML form.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@198565 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-01 16:09:42 +00:00
eliel 90ddc9b84f Move static documentation of E|Dead|AGI() application and manager action to XML.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@198561 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-01 15:38:48 +00:00
eliel 6c205ae87e Avoid a crash when res_timing_dahdi is unloaded but wasn't properly loaded.
if dahdi_test_timer() fails, timing_funcs_handle remains NULL causing a crash
when calling ast_unregister_timing_interface() with a NULL pointer.

(closes issue #15234)
Reported by: eliel
Patches:
      timing_dahdi1.diff uploaded by eliel (license 64)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@198437 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-31 01:22:15 +00:00
seanbright 94e54cdb5a Properly terminate the receive buffer before sending to iksemel.
aji_io_recv takes the maximum number of bytes to read (instead of the total
buffer size), so we have to subtract 1 from our buffer size.  Without this, when
we receive packets that are larger than our buffer, iksemel will choke and
things get wonky.

(closes issue #15232)
Reported by: lp0
Patches:
      05302009_res_jabber.c.patch uploaded by seanbright (license 71)
Tested by: seanbright, lp0


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@198375 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-30 20:11:33 +00:00
seanbright 13191f123d Merged revisions 198370 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r198370 | seanbright | 2009-05-30 15:36:20 -0400 (Sat, 30 May 2009) | 12 lines
  
  Properly terminate AMI JabberSend response messages.
  
  The response message (either Error or Success) needs an extra trailing \r\n
  after the fields to inform the client that the message is complete.
  
  (closes issue #14876)
  Reported by: srt
  Patches:
        05302009_1.4_res_jabber.c.diff uploaded by seanbright (license 71)
        asterisk_14876.patch uploaded by srt (license 378)
        trunk-14876-2.diff uploaded by phsultan (license 73)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@198371 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-30 19:38:58 +00:00
russell 2cb6e4532d Merged revisions 198311 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r198311 | russell | 2009-05-29 22:42:46 -0500 (Fri, 29 May 2009) | 5 lines
  
  Fix a crash that occurred when MWI SMDI messages expired.
  
  (closes issue #14561)
  Reported by: cmoss28
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@198312 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-30 03:43:23 +00:00
russell 61e9680b02 Improve handling of trying to ACK too many timer expirations.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@198183 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-29 22:33:31 +00:00
twilson efea35bb6a Add a couple of TODO items so I don't forget
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@198182 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-29 22:21:42 +00:00
russell 68941fa7a5 Resolve issues with choppy sound when using res_timing_pthread.
The situation that caused this problem was when continuous mode was being
turned on and off while a rate was set for a timing interface.  A very easy
way to replicate this bug was to do a Playback() from behind a Local channel.
In this scenario, a rate gets set on the channel for doing file playback.
At the same time, continuous mode gets turned on and off about every 20 ms
as frames get queued on to the PBX side channel from the other side of the
Local channel.

Essentially, this module treated continuous mode and a set rate as mutually
exclusive states for the timer to be in.  When I dug deep enough, I observed
the following pattern:

   1) Set timer to tick every 20 ms.
   2) Wait almost 20 ms ...
   3) Continuous mode gets turned on for a queued up frame
   4) Continuous mode gets turned off
   5) The timer goes back to its tick per 20 ms. state but starts counting
      at 0 ms.
   6) Goto step 2.

Sometimes, res_timing_pthread would make it 20 ms and produce a timer tick,
but not most of the time.  This is what produced the choppy sound (or sometimes
no sound at all).

Now, the module treats continuous mode and a set rate as completely independent
timer modes.  They can be enabled and disabled independently of each other and
things work as expected.


(closes issue #14412)
Reported by: dome
Patches:
      issue14412.diff.txt uploaded by russell (license 2)
      issue14412-1.6.1.0.diff.txt uploaded by russell (license 2)
Tested by: DennisD, russell


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@198146 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-29 20:06:59 +00:00
russell 95162e811d Trim trailing whitespace so that I can work on this bug without it bothering me. :-)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@197960 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-29 16:15:30 +00:00
twilson aec81d8f10 Add Calendaring support for Asterisk
This commit add Calendaring support to Asterisk for iCalendar, CalDAV, and MS
Exchange calendars. Exchange support has only been tested on Exchange Server 2k3
and does not support forms-based authentication at this time (patches *very*
welcome). Exchange support is also currently missing the ability to return a
list of a meting's attendees (again, patches are very, very welcome).

Features include:
  Querying a calendar for events over a specific time range
  Checking a calendar's busy status via the dialplan
  Writing calendar events via the dialplan (CalDAV and Exchange only)
  Handling calendar event notifications through the dialplan

(closes issue #14771)
Tested by: lmadsen, twilson, Shivaprakash

Review: https://reviewboard.asterisk.org/r/58


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@197738 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-28 19:57:18 +00:00
russell d6c1a876ae Merged revisions 196826 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r196826 | russell | 2009-05-26 13:14:36 -0500 (Tue, 26 May 2009) | 9 lines
  
  Resolve a file handle leak.
  
  The frames here should have always been freed.  However, out of luck, there was
  never any memory leaked.  However, after file streams became reference counted,
  this code would leak the file stream for the file being read.
  
  (closes issue #15181)
  Reported by: jkroon
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196843 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-26 18:20:57 +00:00
seanbright f595115292 Add new ast_complete_applications function so that we can use it with the
'channel originate ... application <app>' CLI command.

(And yeah, I cleaned up some whitespace in res_clioriginate.c... big whoop,
wanna fight about it!?)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196758 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-26 14:36:11 +00:00
eliel 8a0a175fb8 Move AGI static documentation to the new AstXML form.
Move AGI commands documentation to XML docs:
'set priority'
'set variable'
'stream file'
'control stream file'
'tdd mode'
'verbose'
'wait for digit'
'speech create'
'speech set'
'speech destroy'
'speech load grammar'
'speech unload grammar'
'speech activate grammar'
'speech deactivate grammar'
'speech recognize'



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196585 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-24 16:17:31 +00:00
eliel 6f75be0f9b Move static AGI commands documentation to XML.
Move AGI commands ('say datetime', 'send image', 'send text', 'set autohangup',
'set callerid', 'set context', 'set extension') documentation to the AstXML
form.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196554 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-23 21:11:31 +00:00
eliel 254c392ab0 Moved static documentation to the AstXML form.
Moved AGI commands static documentation to XML docs ('say alpha', 'say digits',
'say number', 'say phonetic', 'say date' and 'say time').



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196344 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-22 19:11:44 +00:00
eliel cbbfdc573c Implement a new element in AstXML for AMI actions documentation.
A new xml element was created to manage the AMI actions documentation,
using AstXML.
To register a manager action using XML documentation it is now possible
using ast_manager_register_xml().
The CLI command 'manager show command' can be used to show the parsed
documentation.

Example manager xml documentation:
<manager name="ami action name" language="en_US">
    <synopsis>
        AMI action synopsis.
    </synopsis>
    <syntax>
        <xi:include xpointer="xpointer(...)" /> <-- for ActionID
        <parameter name="header1" required="true">
	    <para>Description</para>
	</parameter>
	...
    </syntax>
    <description>
        <para>AMI action description</para>
    </description>
    <see-also>
    	...
    </see-also>
</manager>



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196308 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-22 17:52:35 +00:00
seanbright a09dfb74c6 Fix res_agi compilation after the const-ify the world merge.
Since we are dealing with a 'const char * const' now, we have to create a
temporary copy of the string to work on rather than the original.  Fix inspired
by reporter.  Reviewed by everyone-and-their-mother in #asterisk-dev.

(closes issue #15184)
Reported by: andrew


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196270 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-22 16:51:22 +00:00
seanbright 5254b7f45d Fix build under dev mode and remove some casts that are no longer necessary as
a result of the const-ify the world patch.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196227 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-22 16:10:33 +00:00
kpfleming 230a66da7d Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes:

- CLI command handlers
- CLI command handler arguments
- AGI command handlers
- AGI command handler arguments
- Dialplan application handler arguments
- Speech engine API function arguments

In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing.

Review: https://reviewboard.asterisk.org/r/251/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196072 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-21 21:13:09 +00:00
tilghman cd27c61b1f Recorded merge of revisions 195366 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r195366 | tilghman | 2009-05-18 15:24:13 -0500 (Mon, 18 May 2009) | 8 lines
  
  Add a similar dependency on SMDI for voicemail as already exists for ADSI.
  (closes issue #14846)
   Reported by: pj
   Patches: 
         20090413__bug14846__1.4.diff.txt uploaded by tilghman (license 14)
         20090507__issue14846__1.6.0.diff.txt uploaded by tilghman (license 14)
         20090507__issue14846__1.6.1.diff.txt uploaded by tilghman (license 14)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@195370 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-18 20:52:33 +00:00
eliel 79c8b491f6 Move AGI documentation from static to the XML form.
Move the AGI commands 'receive text', 'receive char' and 'record'
static documentation to XML docs.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@195365 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-18 20:18:43 +00:00
file 26a4949b2d Merged revisions 194208 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r194208 | file | 2009-05-13 10:38:01 -0300 (Wed, 13 May 2009) | 11 lines
  
  Fix RFC2833 issues with DTMF getting duplicated and with duration wrapping over.
  
  (closes issue #14815)
  Reported by: geoff2010
  Patches:
        v1-14815.patch uploaded by dimas (license 88)
  Tested by: geoff2010, file, dimas, ZX81, moliveras
  (closes issue #14460)
  Reported by: moliveras
  Tested by: moliveras
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@194209 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-13 13:39:10 +00:00
kpfleming f58bc31e46 add 'const' qualifiers in various places where they should have been
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@193832 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-12 13:59:35 +00:00
russell 9ca0ace6fd Fix some timer state corruption.
In res_timer_timerfd, handle the case that set_rate gets called while a timer
is still in continuous mode.  In this case, we want to remember the configured
rate, but not actually set it until continuous mode has been disabled.

Thanks to dvossel for finding and helping to debug the problem.

(closes issue #15080)
Reported by: dvossel
Tested by: dvossel


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@193718 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-11 22:04:40 +00:00
file 7560b5641b Make the code that prevents an infinite loop from happening into a case insensitive check.
(thanks eliel)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@192736 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-06 16:09:27 +00:00
file bdaeb6bf91 Fix an infinite loop with tab completion of CLI aliases that reference themselves.
(closes issue #15020)
Reported by: junky


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@192700 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-06 14:35:47 +00:00
tilghman 0b5da784d0 Restore 'asyncagi break' command to 1.6.1 and higher.
(closes issue #14985)
 Reported by: nikkk
 Patches: 
       20090428__bug14985.diff.txt uploaded by tilghman (license 14)
       20090429__bug14985__1.6.1.diff.txt uploaded by tilghman (license 14)
 Tested by: nikkk


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@192171 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-04 19:29:13 +00:00
jpeeler 18563c920b fix typos
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@191213 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-29 22:56:55 +00:00
tilghman 8fc2c0f724 Merge str_substitution branch.
This branch adds additional methods to dialplan functions, whereby the result
buffers are now dynamic buffers, which can be expanded to the size of any
result.  No longer are variable substitutions limited to 4095 bytes of data.
In addition, the common case of needing buffers much smaller than that will
enable substitution to only take up the amount of memory actually needed.
The existing variable substitution routines are still available, but users
of those API calls should transition to using the dynamic-buffer APIs.
Reviewboard: http://reviewboard.digium.com/r/174/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@191140 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-29 18:53:01 +00:00
russell 5405c68442 Merged revisions 190661-190662 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r190661 | russell | 2009-04-27 14:00:54 -0500 (Mon, 27 Apr 2009) | 9 lines

Resolve a crash in res_smdi when used with chan_dahdi.

When chan_dahdi goes to get an SMDI message, it provides no search criteria.
It just grabs the next message that arrives.  This code was written with the
SMDI dialplan functions in mind, since that is now the preferred method of
using SMDI.  However, this broke support of it being used from chan_dahdi.

(closes AST-212)

........
r190662 | russell | 2009-04-27 14:03:59 -0500 (Mon, 27 Apr 2009) | 2 lines

Fix a typo from 190661.

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@190663 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-27 19:08:12 +00:00
russell 89175b7e04 Convert the ast_channel data structure over to the astobj2 framework.
There is a lot that could be said about this, but the patch is a big 
improvement for performance, stability, code maintainability, 
and ease of future code development.

The channel list is no longer an unsorted linked list.  The main container 
for channels is an astobj2 hash table.  All of the code related to searching 
for channels or iterating active channels has been rewritten.  Let n be 
the number of active channels.  Iterating the channel list has gone from 
O(n^2) to O(n).  Searching for a channel by name went from O(n) to O(1).  
Searching for a channel by extension is still O(n), but uses a new method 
for doing so, which is more efficient.

The ast_channel object is now a reference counted object.  The benefits 
here are plentiful.  Some benefits directly related to issues in the 
previous code include:

1) When threads other than the channel thread owning a channel wanted 
   access to a channel, it had to hold the lock on it to ensure that it didn't 
   go away.  This is no longer a requirement.  Holding a reference is 
   sufficient.

2) There are places that now require less dealing with channel locks.

3) There are places where channel locks are held for much shorter periods 
   of time.

4) There are places where dealing with more than one channel at a time becomes 
   _MUCH_ easier.  ChanSpy is a great example of this.  Writing code in the 
   future that deals with multiple channels will be much easier.

Some additional information regarding channel locking and reference count 
handling can be found in channel.h, where a new section has been added that 
discusses some of the rules associated with it.

Mark Michelson also assisted with the development of this patch.  He did the 
conversion of ChanSpy and introduced a new API, ast_autochan, which makes it 
much easier to deal with holding on to a channel pointer for an extended period 
of time and having it get automatically updated if the channel gets masqueraded.
Mark was also a huge help in the code review process.

Thanks to David Vossel for his assistance with this branch, as well.  David 
did the conversion of the DAHDIScan application by making it become a wrapper 
for ChanSpy internally.

The changes come from the svn/asterisk/team/russell/ast_channel_ao2 branch.

Review: http://reviewboard.digium.com/r/203/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@190423 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-24 14:04:26 +00:00
tilghman 23d5f93d74 Support HTTP digest authentication for the http manager interface.
(closes issue #10961)
 Reported by: ys
 Patches: 
       digest_auth_r148468_v5.diff uploaded by ys (license 281)
       SVN branch http://svn.digium.com/svn/asterisk/team/group/manager_http_auth
 Tested by: ys, twilson, tilghman
 Review: http://reviewboard.digium.com/r/223/
 Reviewed by: tilghman,russellb,mmichelson


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@190349 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-23 20:36:35 +00:00
seanbright 523c904d6d Merged revisions 189462 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r189462 | seanbright | 2009-04-20 16:58:39 -0400 (Mon, 20 Apr 2009) | 13 lines
  
  Properly handle @s within hints in AEL.
  
  AEL was not handling the case of a device hint containing an @ symbol, which
  caused parking hints (e.g. hint(park:exten@context)) to error out the parser.
  This patch makes AEL treat the @ the same way it treats colon and ampersand
  now, meaning the characters are included in verbatim.
  
  (closes issue #14941)
  Reported by: bpgoldsb
  Patches:
        bug14941.patch uploaded by seanbright (license 71)
  Tested by: bpgoldsb
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@189464 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-20 21:09:59 +00:00
file 86b8809df4 Fix an incorrect clock rate when sending T140 text.
(closes issue #14029)
Reported by: epicac


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@188413 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-14 17:40:50 +00:00
mmichelson 01e0471101 Fix another crash related to cached realtime music on hold.
This was another off-by-one problem caused by moh_register.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@188102 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-13 19:31:48 +00:00
file 90e787d30c Change how we set the local and remote address.
The code will now only change the address and port. It will not overwrite any other values.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187773 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-10 18:14:47 +00:00
file f52aa65700 Fix some uninitialized memory notices that appeared under valgrind.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187772 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-10 18:02:44 +00:00
mmichelson 3ebc0934e1 Use safe macro practices even though they really aren't necessary.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187424 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-09 17:34:39 +00:00
mmichelson bdf215c55d Fix a crash in res_musiconhold when using cached realtime moh.
The moh_register function links an mohclass and then immediately
unrefs the class since the container now has a reference. The problem
with using realtime music on hold is that the class is allocated,
registered, and started in one fell swoop. The refcounting logic 
resulted in the count being off by one. The same problem did not
happen when using a static config because the allocation and registration
of an mohclass is a separate operation from starting moh. This also did
not affect non-cached realtime moh because the classes are not registered
at all.

I also have modified res_musiconhold to use the _t_ variants of the ao2_
functions so that more info can be gleaned when attempting to trace the
refcounts. I found this to be incredibly helpful for debugging this issue
and there's no good reason to remove it.

(closes issue #14661)
Reported by: sum



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187421 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-09 17:30:39 +00:00
mmichelson 960576989e Merged revisions 187045 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r187045 | mmichelson | 2009-04-08 11:52:03 -0500 (Wed, 08 Apr 2009) | 10 lines
  
  Fix a small logical error when loading moh classes.
  
  We were unconditionally incrementing the number of mohclasses
  registered. However, we should actually only increment if the
  call to moh_register was successful.
  
  While this probably has never caused problems, I noticed it
  and decided to fix it anyway.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187046 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-08 16:52:20 +00:00
file eca1ae36e1 Turn a warning message into a debug message and do not treat two situations as errors when they are not.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187036 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-08 16:27:36 +00:00
file 169ee4d1c8 Fix a log message getting output when it should not have been.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@186687 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-06 23:11:13 +00:00
mmichelson f00656db9e This commit introduces COLP/CONP and Redirecting party information into Asterisk.
The channel drivers which have been most heavily tested with these enhancements are
chan_sip and chan_misdn. Further work is being done to add Q.SIG support and will be
introduced in a later commit. chan_skinny has code added to it here, but according
to user pj, the support on chan_skinny is not working as of now. This will be fixed in
a later commit.

A special thanks goes out to bugtracker user gareth for getting the ball rolling and
providing the initial support for this work. Without his initial work on this, this would
not have been nearly as painless as it was.

This functionality has been tested by Digium's product quality department, as well as a
customer site running thousands of calls every day. In addition, many many many many bugtracker
users have tested this, too.

(closes issue #8824)
Reported by: gareth

Review: http://reviewboard.digium.com/r/201



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@186525 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-03 22:41:46 +00:00
file 0eb1480fe0 Merge in the RTP engine API.
This API provides a generic way for multiple RTP stacks to be
integrated into Asterisk. Right now there is only one present, res_rtp_asterisk,
which is the existing Asterisk RTP stack. Functionality wise this commit
performs the same as previously. API documentation can be viewed in the
rtp_engine.h header file.

Review: http://reviewboard.digium.com/r/209/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@186078 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-02 17:20:52 +00:00
tilghman 2dfad9bd0e Merge changes from str_substitution that are unrelated to that branch.
Included is a small bugfix to an ast_str helper, but most of these changes
are simply doxygen fixes.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@185912 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-01 20:13:28 +00:00
file aa844c8202 Fix speech structure leak in the AGI speech recognition integration.
The AGI dialplan applications did not destroy the speech structure automatically
if it was not destroyed by the running AGI script. They will now do this.

(issue LUMENVOX-15) 


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184673 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-27 15:46:46 +00:00
russell 1ae3284012 Change g_eid to ast_eid_default.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184630 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-27 14:00:18 +00:00
russell f89c5f7e6c Improve performance of the ast_event cache functionality.
This code comes from svn/asterisk/team/russell/event_performance/.

Here is a summary of the changes that have been made, in order of both
invasiveness and performance impact, from smallest to largest.

1) Asterisk 1.6.1 introduces some additional logic to be able to handle
   distributed device state.  This functionality comes at a cost.
   One relatively minor change in this patch is that the extra processing
   required for distributed device state is now completely bypassed if
   it's not needed.

2) One of the things that I noticed when profiling this code was that a
   _lot_ of time was spent doing string comparisons.  I changed the way
   strings are represented in an event to include a hash value at the front.
   So, before doing a string comparison, we do an integer comparison on the
   hash.

3) Finally, the code that handles the event cache has been re-written.
   I tried to do this in a such a way that it had minimal impact on the API.
   I did have to change one API call, though - ast_event_queue_and_cache().
   However, the way it works now is nicer, IMO.  Each type of event that
   can be cached (MWI, device state) has its own hash table and rules for
   hashing and comparing objects.  This by far made the biggest impact on
   performance.

For additional details regarding this code and how it was tested, please see the
review request.

(closes issue #14738)
Reported by: russell

Review: http://reviewboard.digium.com/r/205/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184339 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-25 21:57:19 +00:00
mmichelson b6f36b5053 Merged revisions 183700 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r183700 | mmichelson | 2009-03-23 12:59:28 -0500 (Mon, 23 Mar 2009) | 7 lines
  
  Fix a memory leak in res_monitor.c
  
  The only way that this leak would occur is if Monitor were started
  using the Manager interface and no File: header were given. Discovered
  while reviewing the ast_channel_ao2 review request.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@183766 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-23 18:58:03 +00:00
tilghman 4c69e94e57 2 symbols defined when DEBUG_THREADS
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@183196 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-19 17:00:13 +00:00
kpfleming 7a0260fa84 allow this module to export everything for now
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@183032 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18 21:28:28 +00:00
kpfleming 8e77cd3e6e a few more namespace updates... res_ael_share still needs some work before this can be merged to other release branches
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@182848 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18 02:39:36 +00:00
russell b48669aa8f Merged revisions 182810 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r182810 | russell | 2009-03-17 21:09:13 -0500 (Tue, 17 Mar 2009) | 44 lines

Fix cases where the internal poll() was not being used when it needed to be.

We have seen a number of problems caused by poll() not working properly on 
Mac OSX.  If you search around, you'll find a number of references to using 
select() instead of poll() to work around these issues.  In Asterisk, we've 
had poll.c which implements poll() using select() internally.  However, we 
were still getting reports of problems.

vadim investigated a bit and realized that at least on his system, even 
though we were compiling in poll.o, the system poll() was still being used.  
So, the primary purpose of this patch is to ensure that we're using the 
internal poll() when we want it to be used.

The changes are:

1) Remove logic for when internal poll should be used from the Makefile.  
   Instead, put it in the configure script.  The logic in the configure 
   script is the same as it was in the Makefile.  Ideally, we would have 
   a functionality test for the problem, but that's not actually possible, 
   since we would have to be able to run an application on the _target_ 
   system to test poll() behavior.

2) Always include poll.o in the build, but it will be empty if AST_POLL_COMPAT
   is not defined.

3) Change uses of poll() throughout the source tree to ast_poll().  I feel 
   that it is good practice to give the API call a new name when we are 
   changing its behavior and not using the system version directly in all cases.
   So, normally, ast_poll() is just redefined to poll().  On systems where 
   AST_POLL_COMPAT is defined, ast_poll() is redefined to ast_internal_poll().

4) Change poll() in main/poll.c to be ast_internal_poll().

It's worth noting that any code that still uses poll() directly will work fine 
(if they worked fine before).  So, for example, out of tree modules that are 
using poll() will not stop working or anything.  However, for modules to work 
properly on Mac OSX, ast_poll() needs to be used.

(closes issue #13404)
Reported by: agalbraith
Tested by: russell, vadim

http://reviewboard.digium.com/r/198/

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@182847 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18 02:28:55 +00:00
kpfleming 870bfecfe6 Merged revisions 182808 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r182808 | kpfleming | 2009-03-17 20:55:22 -0500 (Tue, 17 Mar 2009) | 5 lines
  
  Improve the build system to *properly* remove unnecessary symbols from the runtime global namespace. Along the way, change the prefixes on some internal-only API calls to use a common prefix.
  
  With these changes, for a module to export symbols into the global namespace, it must have *both* the AST_MODFLAG_GLOBAL_SYMBOLS flag and a linker script that allows the linker to leave the symbols exposed in the module's .so file (see res_odbc.exports for an example).
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@182826 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18 02:21:23 +00:00
file 6e61300ea9 Merged revisions 181664 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r181664 | file | 2009-03-12 13:56:20 -0300 (Thu, 12 Mar 2009) | 2 lines
  
  Fix incorrect usage of strncasecmp... I really meant to use strcasecmp.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@181665 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-12 16:56:58 +00:00
file 5eb019cb7d Merged revisions 181659-181660 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r181659 | file | 2009-03-12 13:50:37 -0300 (Thu, 12 Mar 2009) | 8 lines
  
  Fix another scenario where depending on configuration the stream would not get read.
  
  For custom commands we don't know whether the audio is coming from a stream or not
  so we are going to have to read the data despite no channels.
  
  (closes issue #14416)
  Reported by: caspy
........
  r181660 | file | 2009-03-12 13:52:45 -0300 (Thu, 12 Mar 2009) | 2 lines
  
  Fix logic flaw in previous commit.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@181661 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-12 16:53:52 +00:00
file 15551ef14e Merged revisions 181655 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r181655 | file | 2009-03-12 13:29:19 -0300 (Thu, 12 Mar 2009) | 10 lines
  
  Fix issue with streaming MOH failing if nobody is listening.
  
  When a music class is setup to actually provide music on hold
  from a stream we need to constantly read audio from it since it
  will constantly be providing audio. This is now done despite there
  being no channels listening to it.
  
  (closes issue #14416)
  Reported by: caspy
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@181656 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-12 16:32:20 +00:00
mmichelson 8682195e7d Add documentation for timing modules used in Asterisk
This document specifies the timing modules available in Asterisk beginning
with Asterisk 1.6.1. The document goes into detail about the differences
between each and gives a general overview of what timing is used for in
Asterisk. There is also a section which can be used to help customize
your setup or to troubleshoot timing issues you may have.

I also added messages to the DAHDI timing test used in res_timing_dahdi.c
that points to this new documentation if people experience problems.

Big thanks to all who contributed comments on this.

(closes issue #14490)
Reported by: mmichelson
Patches:
      timing.txt uploaded by mmichelson (license 60)

Review: http://reviewboard.digium.com/r/164/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@179937 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-03 20:59:16 +00:00
russell 4985115dfa Fix a reference leak in timerfd_set_rate().
(found during a debugging session with dvossel and mmichelson.)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@179465 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-02 23:06:16 +00:00
russell dac9acf538 Mark res_ais as experimental, as the binary event format is subject to change.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@179164 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-27 21:47:18 +00:00
tilghman a9e3b506a0 Oops, wrong direction of command
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@178573 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-25 19:03:35 +00:00
tilghman 48707e53d9 ODBC transaction support
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@177320 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-19 00:26:01 +00:00
murf 14fd9cb2fc Merged revisions 177225 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r177225 | murf | 2009-02-18 15:43:14 -0700 (Wed, 18 Feb 2009) | 34 lines
  
  This patch fixes a regression of sorts that was introduced in 
  rev 24425.
  
  It basically fixes AST-190/ABE-1782.
  
  What was wrong: the user has 6000 extensions in one context; and
  then 6000 contexts, one per extension. The parser could only handle
  about 4893 of the 6000 extens in the single context.
  
  This was due to the regression I mentioned. To get rid of
  shift/reduce conflicts, Luigi set up right-recursive lists
  for globals, context elements, switch lists, and statements.
  Right recursive lists got rid of the warnings, but instead, they
  use up a tremendous amount of stack space when the lists are long.
  
  I saw this a few years back, and resolved not to fix it until
  someone complained. That day has arrived!
  
  After the changes were made, I ran the regression test suite,
  and there were no problems.
  
  I took the test case the user provided, and added 100,000 
  extensions to the single context, that already had 6,000 extens
  in it. (I'll see your 6, and raise you 100!) It takes a few minutes
  to read it all in, check it and generate code for it, but no
  problems.
  
  So, I think I can say that fundamentally, there are no longer
  any limits on the number of items you can place in contexts,
  statement blocks, switches, or globals, beyond your virt mem
  constraints.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@177286 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-18 23:50:57 +00:00
russell 590d768106 Update the timing API to have better support for multiple timing interfaces.
1) Add module use count handling so that timing modules can be unloaded.

2) Implement unload_module() functions for the timing interface modules.

3) Allow multiple timing modules to be loaded, and use the one with the
   highest priority value.

4) Report which timing module is being use in the "timing test" CLI command.

(closes issue #14489)
Reported by: russell

Review: http://reviewboard.digium.com/r/162/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176666 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-17 21:22:40 +00:00
russell 1f57cd4e51 Merge a large set of updates to the Asterisk indications API.
This patch includes a number of changes to the indications API.  The primary
motivation for this work was to improve stability.  The object management
in this API was significantly flawed, and a number of trivial situations could
cause crashes.

The changes included are:

1) Remove the module res_indications.  This included the critical functionality
   that actually loaded the indications configuration.  I have seen many people
   have Asterisk problems because they accidentally did not have an
   indications.conf present and loaded.  Now, this code is in the core,
   and Asterisk will fail to start without indications configuration.

   There was one part of res_indications, the dialplan applications, which did
   belong in a module, and have been moved to a new module, app_playtones.

2) Object management has been significantly changed.  Tone zones are now
   managed using astobj2, and it is no longer possible to crash Asterisk by
   issuing a reload that destroys tone zones while they are in use.

3) The API documentation has been filled out.

4) The API has been updated to follow our naming conventions.

5) Various bits of code throughout the tree have been updated to account
   for the API update.

6) Configuration parsing has been mostly re-written.

7) "Code cleanup"

The code is from svn/asterisk/team/russell/indications/.

Review: http://reviewboard.digium.com/r/149/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176627 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-17 20:41:24 +00:00
tilghman 2a22b3a479 Add assertions in the quest to track down a refcount leak.
(closes issue #14485)
 Reported by: davevg


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176592 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-17 18:49:20 +00:00
russell 8fb186d843 fix a few more XML documentation problems
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@175636 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-13 20:26:49 +00:00
file cdb08bd419 Merged revisions 174218 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r174218 | file | 2009-02-09 10:48:21 -0400 (Mon, 09 Feb 2009) | 4 lines
  
  Don't overwrite our pointer to the music class when music on hold stops. We will use this if it starts again to see if we can resume the music where it left off.
  (closes issue #14407)
  Reported by: mostyn
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@174219 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-09 14:49:24 +00:00
russell 094443d496 Merged revisions 174148 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r174148 | russell | 2009-02-07 10:15:07 -0600 (Sat, 07 Feb 2009) | 2 lines

Fix a race condition that could cause a crash.

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@174149 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-07 16:16:50 +00:00
tilghman 9f49bc01a7 Change the first field, or we don't get the necessary field separation.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@173657 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-05 19:36:29 +00:00
tilghman 84eb734def Add XML documentation for the applications and functions in res_jabber
(closes issue #14405)
 Reported by: snuffy
 Patches: 
       xml_jabber.diff uploaded by snuffy (license 35)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@173503 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-04 21:26:15 +00:00
tilghman 53d7098e43 Fix how we skip fields (to avoid fields which don't exist) when doing an UPDATE.
(closes issue #14205)
 Reported by: maxgo
 Patches: 
       20090128__bug14205__5.diff.txt uploaded by Corydon76 (license 14)
 Tested by: blitzrage


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@172131 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-28 22:48:01 +00:00
russell 82f5ddcd7c Add a todo to finish the XML docs in this module
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@170902 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-24 19:33:15 +00:00
kpfleming a343f7a275 ast_str_SQLGetData is *not* part of the ast_str API, it's part of the ast_odbc API and just happens to use an ast_str as the buffer; move all of it to res_odbc.c and res_odbc.h, renaming appropriately
along the way fix some minor coding style issues in strings.h and add some attribute_pure annotations to functions in the ast_str API



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@169438 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-19 21:42:46 +00:00
mmichelson ab71278068 Fix a logic error that occur when using the timerfd interface
This sequence of events posed a problem

timerfd_timer_open
timerfd_timer_enable_continuous
timerfd_timer_set_rate
timerfd_timer_disable_continuous

The reason was that the timing module was written under the assumption
that timerfd_timer_set_rate would not be called between enabling and
disabling continuous mode. What happened in this situation was that 
timerfd_timer_enable_continuous saved off our previously set timer (in this
situation a 0 timer, meaning it never runs out). Then timerfd_timer_disable_continuous
would restore this 0 timer, even though it logically should set the timer to be whatever
was set in timerfd_timer_set_rate.

Now the behavior in timerfd_timer_set_rate is to overwrite the saved timer that may
or may not have been set in timerfd_timer_enable_continuous. Even if
timerfd_timer_enable_continuous has not been previously called, this will not harm the
operation.

Thanks to Terry Wilson for discovering the problem and giving me a really great debug
capture that pointed out the problem clearly



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@168898 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-16 19:54:39 +00:00
murf edccd10b3a Merged revisions 168745 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r168745 | murf | 2009-01-15 17:19:12 -0700 (Thu, 15 Jan 2009) | 14 lines
  
  This patch fixes a problem where a goto (or jump, in this case)
  fails a consistency check because it can't find a matching 
  extension. The problem was a missing instruction to end
  the range notation in the code where it converts the pattern
  into a regex and uses the regex code to determine the match.
  
  I tested using the AEL code the user supplied, and now,
  the consistency check passes.
  
  
  (closes issue #14141)
  Reported by: dimas
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@168746 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-16 00:34:31 +00:00
kpfleming fe480759d9 remove the PBX_ODBC logic from the configure script, and add GENERIC_ODCB logic that includes copying the relevant LIB and INCLUDE data from either UnixODBC or iODBC, based on which was found; if both were found, prefer UnixODBC
this stops modules from being linked against both sets of libraries on systems that have both installed



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@168734 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-15 20:18:53 +00:00
twilson aa252157fb Fully overwrite a same-named file when uploading
(closes issue #14190)
Reported by: timking


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@168588 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-13 23:05:43 +00:00
russell d056b18a40 Merged revisions 168561 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r168561 | russell | 2009-01-13 13:13:05 -0600 (Tue, 13 Jan 2009) | 2 lines

Revert unnecessary indications API change from rev 122314

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@168562 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-13 19:22:13 +00:00
jpeeler 67837440f9 Merged revisions 168516 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r168516 | jpeeler | 2009-01-12 15:42:34 -0600 (Mon, 12 Jan 2009) | 5 lines
  
  (closes issue #13881)
  Reported by: hoowa
  
  Update the app CDR field for AGI commands that are not executing an application via "exec".
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@168517 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-12 21:51:46 +00:00
russell 1c795337bf Merged revisions 168198 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r168198 | russell | 2009-01-09 16:14:38 -0600 (Fri, 09 Jan 2009) | 2 lines

Make this compile for mvanbaak

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@168200 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-09 22:21:05 +00:00
twilson f002c96f00 Don't leak memory if phoneprov.conf does not exist
(closes issue #14203)
Reported by: jamesgolovich
Patches: 
      asterisk-phoneprovleak.diff.txt uploaded by jamesgolovich (license 176)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@168142 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-09 20:25:25 +00:00
tilghman 205de4564c When using ast_str with a non-ast_str-enabled API, we need to update the buffer
or otherwise, we cannot use ast_str_strlen().


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@168090 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-09 18:30:55 +00:00
tilghman cd081b8545 Merged revisions 167840 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r167840 | tilghman | 2009-01-08 16:08:56 -0600 (Thu, 08 Jan 2009) | 6 lines
  
  Don't truncate database results at 255 chars.
  (closes issue #14069)
   Reported by: evandro
   Patches: 
         20081214__bug14069.diff.txt uploaded by Corydon76 (license 14)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@167894 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-08 22:37:20 +00:00
twilson 5171d4a7f4 Fix some svn:keywords
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@166908 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-30 20:50:05 +00:00
mmichelson 835a0318ee Always use the value of the AGISIGHUP when running an AGI.
Prior to this patch, the value of AGISIGUP was not always
honored when set on a channel.

(closes issue #13711)
Reported by: fmueller
Patches:
      13711.patch uploaded by putnopvut (license 60)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@166470 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-22 23:25:34 +00:00
russell e3658d96ca Cosmetic change - don't mix struct initializer styles.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@166436 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-22 21:45:28 +00:00
russell fddbf8a2c0 Fix a bad typo.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@166377 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-22 20:26:48 +00:00
russell 7d7c94a817 Re-work ref count handling of MoH classes using astobj2 to resolve crashes.
(closes issue #13566)
Reported by: igorcarneiro
Tested by: russell
Review: http://reviewboard.digium.com/r/106/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@166273 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-22 16:10:40 +00:00
russell 0e23ad688a Remove AST_PBX_KEEPALIVE usage from res_agi.
This patch removes the usage of AST_PBX_KEEPALIVE from res_agi.  The only usage
was for the AGI command, "asyncagi break".  This patch removes this feature.
Normally, a feature would not be removed like this.  However, this code is
broken and usage of it will result in a memory leak.

Usage of this feature will make the AGI code return a result of 
AST_PBX_KEEPALIVE.  The PBX handler assumes that another thread has assumed
ownership of the channel.  The channel thread will exit without destroying the
channel.  Unfortunately, _no_ thread has ownership of the channel at this
point.  There are a couple of serious problems here:

1) The only way to recover the caller is to issue a channel redirect.  This
   will work, but this will be done with a masquerade, and the old ast_channel
   structure will be lost.

2) Until the channel redirect happens, there is no code servicing the channel.
   That means nothing is reading audio or handling events coming from the
   channel.  This is very bad.

The recommended way to get this same "break" functionality is to issue the
redirect while the channel is still being handled by the AGI code.  That way,
there will be no memory leak, and there will be no period of time that the
channel is not being serviced.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@166258 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-22 14:16:54 +00:00
mmichelson 3624614b45 Fix crashes in res_odbc.
The variable "class" was being set NULL just prior to
being dereferenced in an ao2_link call. I have moved
the setting of the variable to NULL until after the
ao2_link call.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@165724 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-18 19:34:33 +00:00
russell 2653105176 Merged revisions 165661 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r165661 | russell | 2008-12-18 12:52:18 -0600 (Thu, 18 Dec 2008) | 7 lines

Set the process group ID on the MOH process so that all children will get killed

(closes issue #14099)
Reported by: caspy
Patches:
      res_musiconhold.c.patch.killpg.try2 uploaded by caspy (license 645)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@165662 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-18 18:54:47 +00:00
tilghman 17d5723603 Fix reference counts of the class and add an assertion to the end.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@165541 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-18 16:36:48 +00:00
mmichelson 2af0b38961 Fix a refcount leak in res_odbc
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@165330 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-17 21:46:19 +00:00
mmichelson dc62f16683 Fix the build
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@165326 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-17 21:29:30 +00:00
mmichelson 59ba2416ac Merged revisions 165255 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r165255 | mmichelson | 2008-12-17 14:51:38 -0600 (Wed, 17 Dec 2008) | 7 lines

Fix some memory leaks found while looking at how realtime
configs are handled.

Also cleaned up some coding guidelines violations in app_realtime.c,
mostly related to spacing


........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@165318 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-17 21:17:20 +00:00
twilson 88555f85cc Polycom phones close the connection after reading a little bit of the firmware files, we should stop sending in that case. Also, make that case print out a debug statement instead of a scary WARNING.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@165219 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-17 19:55:10 +00:00
russell 3ad06122c6 Merged revisions 164605 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r164605 | russell | 2008-12-16 08:28:10 -0600 (Tue, 16 Dec 2008) | 5 lines

Don't try to change working directory if a directory was not configured.

(closes issue #14089)
Reported by: caspy

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@164606 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-16 14:31:02 +00:00
seanbright e133c3c22e Use ast_str_strlen() instead of recalculating the string length.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@164054 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-13 18:25:58 +00:00
mvanbaak a27bef90b2 nuke another use of the ast_str internals.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@164028 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-13 13:26:13 +00:00
tilghman a41b34a63c Merge ast_str_opaque branch (discontinue usage of ast_str internals)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@163991 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-13 08:36:35 +00:00
russell b5d34abc10 Add a note to indicate why this only supports one channel for now.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@163828 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-12 23:06:55 +00:00
russell d421673ffc Add a new CLI command, "channel redirect", which is similar in operation
to AMI Redirect.

Review: http://reviewboard.digium.com/r/89/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@163716 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-12 20:12:23 +00:00
mvanbaak c93b9523ff Document default Monitor file location.
(closes issue #14065)
Reported by: kshumard
Patches:
      res_monitor.documentation.patch.txt uploaded by kshumard (license 92)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@163612 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-12 17:22:47 +00:00
russell 4e006d017e Fix a problem where continuous mode will get inadvertently get turned off if set_rate()
is used while continuous mode was already turned on.

(closes issue #13738)
Reported by: smurfix
Patches:
      res.patch.fixed uploaded by smurfix (license 547)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@163241 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-11 21:21:31 +00:00
tilghman 78d80ec22b Merged revisions 163088 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r163088 | tilghman | 2008-12-11 10:51:27 -0600 (Thu, 11 Dec 2008) | 6 lines
  
  Don't wait forever, if there's a specified recording timeout.
  (closes issue #13885)
   Reported by: bamby
   Patches: 
         res_agi.c.patch uploaded by bamby (license 430)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@163089 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-11 16:52:24 +00:00
jpeeler db1bbc8a35 Merged revisions 162926 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r162926 | jpeeler | 2008-12-10 16:52:51 -0600 (Wed, 10 Dec 2008) | 3 lines

Oops, inverted logic for a strcasecmp check. Pointed out by mmichelson, thanks!


........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@162927 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-10 22:53:34 +00:00
file bb812cd83b Fix reloads of aliased CLI commands. Due to changes done to turn it into a single memory allocation we can't just use the existing CLI alias structure. We have to destroy all existing ones and then create new ones.
(closes issue #14054)
Reported by: pj


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@162923 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-10 22:48:58 +00:00
jpeeler 8bb4696640 Merged revisions 162874 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r162874 | jpeeler | 2008-12-10 16:04:18 -0600 (Wed, 10 Dec 2008) | 5 lines

(closes issue #13229)
Reported by: clegall_proformatique

Ensure that moh_generate does not return prematurely before local_ast_moh_stop is called. Also, the sleep in mp3_spawn now only occurs for http locations since it seems to have been added originally only for failing media streams.

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@162891 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-10 22:11:46 +00:00
file f0ab761d9b FreeBSD also needs libgen.h
(closes issue #14051)
Reported by: ys
Patches:
      res_http_post.c.diff uploaded by ys (license 281)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@162660 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-10 16:11:06 +00:00
mvanbaak 65dd912dc1 Make res_snmp.so compile on OpenBSD.
OpenBSD uses an old version of gcc which throws an error
if you use a macro that's not #defined


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@162583 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-10 11:34:09 +00:00
murf 3122653ad6 Merged revisions 162264 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r162264 | murf | 2008-12-09 13:20:54 -0700 (Tue, 09 Dec 2008) | 1 line

In discussion with seanbright on #asterisk-dev,  I have added a default rule, and an option to suppress the default rule from being generated in the flex output, for the sake of those OS's where they didn't tweak flex's ECHO macro, and the compiler doesn't like it. The regressions are OK with this.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@162271 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-09 20:40:31 +00:00
murf 7ef05745e7 Merged revisions 162136 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r162136 | murf | 2008-12-09 11:13:39 -0700 (Tue, 09 Dec 2008) | 1 line

Previous fix used ast_malloc and ast_copy_string and messed up the standalone stuff. Fixed.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@162140 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-09 18:35:35 +00:00
murf 7806fa9c29 Merged revisions 162013 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r162013 | murf | 2008-12-09 09:31:55 -0700 (Tue, 09 Dec 2008) | 45 lines

(closes issue #14019)
Reported by: ckjohnsonme
Patches:
      14019.diff uploaded by murf (license 17)
Tested by: ckjohnsonme, murf

This crash was the result of a few small errors that
would combine in 64-bit land to result in a crash.

32-bit land might have seen these combine to mysteriously
drop the args to an application call, in certain
circumstances.

Also, in trying to find this bug, I spotted
a situation in the flex input, where, in passing
back a 'word' to the parser, it would allocate
a buffer larger than necessary. I changed the
usage in such situations, so that strdup was
not used, but rather, an ast_malloc, followed
by ast_copy_string.

I removed a field from the pval struct, in
u2, that was never getting used, and set in
one spot in the code. I believe it was an
artifact of a previous fix to make switch
cases work invisibly with extens.

And, for goto's I removed a '!' from
before a strcmp, that has been there
since the initial merging of AEL2, that
might prevent the proper target of a 
goto from being found. This was pretty
harmless on its own, as it would just
louse up a consistency check for users.

Many thanks to ckjohnsonme for providing
a simplified and complete set of information
about the bug, that helped considerably in
finding and fixing the problem.

Now, to get aelparse up and running again
in trunk, and out of its "horribly broken" state,
so I can run the regression suite!


........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@162079 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-09 17:18:03 +00:00
eliel 6e243a5434 Janitor, use ARRAY_LEN() when possible.
(closes issue #13990)
Reported by: eliel
Patches:
      array_len.diff uploaded by eliel (license 64)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@161218 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-05 10:31:25 +00:00
eliel bac7193891 Added XML documentation for the following AGI commands:
- get option
        - get variable
        - hangup
        - noop



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@160896 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-04 13:45:32 +00:00
kpfleming bc729d661c we can now build with -Wformat=2, which found a couple of real bugs
because SPRINTF() use non-literal format strings (which cannot be checked), move it into its own module so the rest of func_strings can benefit from format string checking



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@159774 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-29 15:29:33 +00:00
mvanbaak dde3f0f3c1 Make res_config_ldap compile with the official OpenLDAP 2.3.X versions.
They removed the LDAP_DEPRECATED define from their source and since we are using a couple
of deprecated function calls we should define it with a CFLAG.

Tested by me on OpenBSD 4.4 and snuff-home on Linux to make sure everything keeps compiling.
It shouldn't break, we only define the LDAP_DEPRECATED with this which is what 
all 2.2.X and older versions of OpenLDAP did in their own tree.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@159734 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-28 14:20:11 +00:00
phsultan d00e7445a0 Removed duplicate code
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@159701 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-27 20:29:21 +00:00
kpfleming 4d88cfdab5 improve handling of API calls provided by loaded modules through use of some GCC features; this makes app_stack's usage of AGI APIs even cleaner, and will allow it to work 'as expected' either with or without res_agi being loaded
reviewed at http://reviewboard.digium.com/r/62



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@159631 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-26 21:20:50 +00:00