Commit Graph

12864 Commits

Author SHA1 Message Date
Mark Michelson
d8e66b0b1a Fix the build. Thanks, mvanbaak!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-22 17:24:47 +00:00
Mark Michelson
64102eed18 Prevent a deadlock in chan_iax2 resulting from
incorrect locking order between iax2_pvt and
ast_channel structures.

AST-13



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139456 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-22 16:57:38 +00:00
Jeff Peeler
fc0e5dd3f9 Fixes loop that could possibly never exit in the event of a channel never being able to be opened or specify after a restart.
(closes issue #11017)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139387 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-21 23:39:31 +00:00
Steve Murphy
3bb4f66a30 (closes issue #13251)
Reported by: sergee
Tested by: murf



THis is a bold move for a static release fix, but I wouldn't have
made it if I didn't feel confident (at least a *bit* confident)
that it wouldn't mess everyone up.

The reasoning goes something like this:

1. We simply cannot do anything with CDR's at the current point
(in pbx.c, after the __ast_pbx_run loop). It's way too late to
have any affect on the CDRs. The CDR is already posted and gone,
and the remnants have been cleared.

2. I was very much afraid that moving the running of the 'h'
extension down into the bridge code (where it would be now
practical to do it), would result in a lot more calls to the
'h' exten, so I implemented it as another exten under another
name, but found, to my pleasant surprise, that there was a 
1:1 correspondence to the running of the 'h' exten in the
pbx_run loop, and the new spot at the end of the bridge.
So, I ifdef'd out the current 'h' loop, and moved it into
the bridge code. The only difference I can see is the stuff
about the AST_PBX_KEEPALIVE, and hopefully, if this 
is still an important decision point, I can replicate it
if there are complaints. To be perfectly honest,
the KEEPALIVE situation is not totally clear to me,
and how it relates to a post-bridge situation is less
clear. I suspect the users will point out everything
in total clarity if this steps on anyone's toes!

3. I temporarily swap the bridge_cdr into the channel
before running the 'h' exten, which makes it possible
for users to edit the cdr before it goes out the door.
And, of course, with the endbeforehexten config var set,
the users can also get at the billsec/duration vals.
After the h exten finishes, the cdr is swapped back
and processing continues as normal.

Please, all who deal with CDR's, please test this version
of Asterisk, and file bug reports as appropriate!



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-21 23:03:50 +00:00
Philippe Sultan
ab1b8017e2 Apply fix for issue #13310 to branch 1.4, too.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139283 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-21 10:11:00 +00:00
Russell Bryant
6177d367e2 Fix a crash in the ChanSpy application. The issue here is that if you call
ChanSpy and specify a spy group, and sit in the application long enough looping
through the channel list, you will eventually run out of stack space and the
application with exit with a seg fault.  The backtrace was always inside of
a harmless snprintf() call, so it was tricky to track down.  However, it turned
out that the call to snprintf() was just the biggest stack consumer in this
code path, so it would always be the first one to hit the boundary.

(closes issue #13338)
Reported by: ruddy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-20 22:14:35 +00:00
Shaun Ruffell
54388197d2 Fix bug where the samples were not accurate when in G723 mode, which would
cause the timestamp field of the RTP header to be invalid.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-20 19:52:25 +00:00
Kevin P. Fleming
e2fc623d88 Backport support for Zaptel/DAHDI channel-level alarms from trunk/1.6, because not doing so just makes it difficult for people with channels that are in alarm when Asterisk starts up to get them going once the alarm is cleared
(closes issue #12160)
Reported by: tzafrir
Patches:
      asterisk-chanalarms_14.patch uploaded by tzafrir (license 46)
Tested by: tzafrir


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139145 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-20 19:35:59 +00:00
Steve Murphy
811faa8612 (closes issue #13263)
Reported by: brainy
Tested by: murf

The specialized reset routine is tromping on the
flags field of the CDR. I made a change to not
reset the DISABLED bit. This should get rid of this
problem.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139074 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-20 17:14:55 +00:00
Mark Michelson
719645a4a6 sip_read should properly handle a NULL return from sip_rtp_read.
(closes issue #13257)
Reported by: travishein



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-20 15:37:56 +00:00
Jeff Peeler
a763147ee6 add DAHDI_POLICY_WHEN_FULL compatability define for Zaptel
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@138949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-19 23:22:39 +00:00
Mark Michelson
e2fafbb6de Reset agent_pvt variables back to the values in agents.conf
(from what the corresponding channel variables were set to)
when the agent logs out.

(closes issue #13098)
Reported by: davidw
Patches:
      20080731__issue13098_agent_ackcall_not_reset.diff uploaded by bbryant (license 36)
Tested by: davidw



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@138942 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-19 23:17:17 +00:00
Jeff Peeler
05e68b7ca6 Add configuration option to chan_dahdi.conf to allow buffering policy and number of buffers to be configured per channel. Syntax:
buffers=<num of buffers>,<policy>

Where the number of buffers is some non-negative integer and the policy is either "full", "half", or "immediate".



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@138938 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-19 22:56:07 +00:00
Mark Michelson
ccfa1564da Add a lock and unlock prior to the destruction of the chanspy_ds
lock to ensure that no other threads still have it locked. While
this should not happen under normal circumstances, it appears that
if the spyer and spyee hang up at nearly the same time, the following
may occur.

1. ast_channel_free is called on the spyee's channel.
2. The chanspy datastore is removed from the spyee's channel in 
   ast_channel_free.
3. In the spyer's thread, the spyer attempts to remove and destroy the datastore
   from the spyee channel, but the datastore has already been removed in step 2, 
   so the spyer continues in the code.
4. The spyee's thread continues and calls the datastore's destroy callback, 
   chanspy_ds_destroy. This involves locking the chanspy_ds.
5. Now the spyer attempts to destroy the chanspy_ds lock. The problem is that in step 4, 
   the spyee has locked this lock, meaning that the spyer is attempting to destroy a lock 
   which is currently locked by another thread.

The backtrace provided in issue #12969 supports the idea that this is possible
(and has even occurred). This commit does not close the issue, but should help
in preventing one type of crash associated with the use of app_chanspy.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@138886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-19 18:50:53 +00:00
Mark Michelson
6f9bd7d072 Change the inequalities used in app_queue with regards
to timeouts from being strict to non-strict for more
accuracy.

(closes issue #13239)
Reported by: atis
Patches:
      app_queue_timeouts_v2.patch uploaded by atis (license 242)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@138685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-18 20:01:14 +00:00
Kevin P. Fleming
5a0918d421 look for transcoder in proper place based on build against Zaptel or DAHDI
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@138663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-18 16:57:27 +00:00
Sean Bright
7db192138f You know what's awesome? Code that compiles... ;)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@138569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-18 11:57:24 +00:00
Jeff Peeler
fbd79d76b2 fix compilation warnings
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@138516 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-18 02:05:29 +00:00
Jeff Peeler
ffc421d3fc fixes use count to properly decrement if an active dahdi channel is destroyed allowing module to be unloaded
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@138360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-16 01:12:18 +00:00
Jeff Peeler
8982add7a8 add forgotten locks around ss_thread_count in ss_thread for dahdi restart
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@138309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-15 23:41:54 +00:00
Tilghman Lesher
fc195a2df6 More fixes for realtime peers.
(closes issue #12921)
 Reported by: Nuitari
 Patches: 
       20080804__bug12921.diff.txt uploaded by Corydon76 (license 14)
       20080815__bug12921.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@138258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-15 22:33:42 +00:00
Jeff Peeler
4159f6d3f7 initialize condition variable ss_thread_complete using ast_cond_init
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@138238 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-15 21:28:26 +00:00
Jeff Peeler
df0a6baec5 declared static mutexes using AST_MUTEX_DEFINE_STATIC macro
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@138151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-15 19:41:29 +00:00
Jeff Peeler
155afc5a4b Fixes the dahdi restart functionality. Dahdi restart allows one to restart all DAHDI channels, even if they are currently in use. This is different from unloading and then loading the module since unloading requires the use count to be zero. Reloading the module is different in that the signalling is not changed from what it was originally configured. Also, this fixes not closing all the file descriptors for D-channels upon module unload (which would prevent loading the module afterwards).
(closes issue #11017)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@138119 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-15 19:21:51 +00:00
Russell Bryant
8a55c5427e Ensure that when a hangup occurs in autoservice, that a hangup frame gets
properly deferred to be read from the channel owner when it gets taken out
of autoservice.

(closes issue #12874)
Reported by: dimas
Patches: 
      v1-12874.patch uploaded by dimas (license 88)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@138027 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-15 15:07:16 +00:00
Tilghman Lesher
e647244fe8 Additional check for more string specifiers than arguments.
(closes issue #13299)
 Reported by: adomjan
 Patches: 
       20080813__bug13299.diff.txt uploaded by Corydon76 (license 14)
       func_strings.c-sprintf.patch uploaded by adomjan (license 487)
 Tested by: adomjan


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@138023 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-15 14:51:12 +00:00
Tilghman Lesher
5dff477c3e Oops, wrong direction
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@137850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-14 16:55:20 +00:00
Tilghman Lesher
65a16565fd When creating the secondary subchannel name, it is necessary to compare to
the existing channel name without the "Zap/" or "DAHDI/" prefix, since our
test string is also without that prefix.
(closes issue #13027)
 Reported by: dferrer
 Patches: 
       chan_zap-1.4.21.1_fix2.patch uploaded by dferrer (license 525)
       (Slightly modified by me, to compensate for both names)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@137847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-14 16:47:30 +00:00
Russell Bryant
960ebde9ca Comments in this config file were aligned only if your tab size was set to 8.
So, convert tabs to spaces so that things should be aligned regardless of what
tab size you use in your editor.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@137731 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-14 14:05:23 +00:00
Kevin P. Fleming
32434426f0 forgot one module name that changed
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@137679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-14 02:03:04 +00:00
Kevin P. Fleming
e797e4ed72 add support for Zaptel versions that contain the new transcoder interface
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@137677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-14 02:02:15 +00:00
Jeff Peeler
75bdfd1436 Register DAHDISendKeypadFacility application if dahdi_chan_mode is set to DAHDI + Zap. Mark ZapSendKeypadFacility application as deprecated on usage.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@137580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-13 21:35:37 +00:00
Kevin P. Fleming
3afd38a555 add document describing what users will need to be aware of when upgrading to this version and using DAHDI
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@137530 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-13 20:46:19 +00:00
Kevin P. Fleming
2ebf0eee36 remove some more chan_zap references
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@137529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-13 20:42:33 +00:00
Kevin P. Fleming
d98254b147 document dahdichanname option in doc/asterisk-conf.txt
make chan_dahdi read its configuration from zapata.conf if dahdichanname has been set to 'no'



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@137527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-13 20:33:47 +00:00
Sean Bright
1b6d4f92e9 Update docs to reflect the change to cdr_tds
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@137405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-13 14:33:49 +00:00
Sean Bright
284d93f5d9 Bring cdr_tds in line with the other CDR backends and have it try to store
CDR(userfield) if it is set.  The new behavior is to check for the userfield
column on module load, and if it exists, we will store CDR(userfield) when
CDRs are written.  A similar patch already went into trunk and 1.6.0.

(closes issue #13290)
Reported by: falves11


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@137348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-13 00:10:35 +00:00
Kevin P. Fleming
a57dd05769 convert this module to be able to handle DAHDI or Zaptel (reported on asterisk-users, don't know how this got missed before)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@137188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-11 13:33:35 +00:00
Tilghman Lesher
9d294cd934 Deallocate database connection handle on disconnect, as we allocate another
one on connect.
(closes issue #13271)
 Reported by: dveiga


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@137138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-11 00:20:38 +00:00
Russell Bryant
2f11017cc1 Ensure PBX_DAHDI_TRANSCODE will evaluate to 0 if not found instead of empty.
pointed out by tzafrir on #asterisk-dev


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@136999 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-09 17:11:27 +00:00
Tilghman Lesher
6d7a2a5fa4 Merged revisions 136945 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r136945 | tilghman | 2008-08-09 10:24:36 -0500 (Sat, 09 Aug 2008) | 2 lines

Regression fixes for Solaris

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@136946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-09 15:25:36 +00:00
Steve Murphy
195fe34304 (closes issue #13236)
Reported by: korihor

Wow, this one was a challenge!

I regrouped and ran a new strategy for
setting the ~~MACRO~~ value; I set it once
per extension, up near the top. It is only
set if there is a switch in the extension.

So, I had to put in a chunk of code to detect
a switch in the pval tree.

I moved the code to insert the set of ~~exten~~
up to the beginning of the gen_prios routine, 
instead of down in the switch code.

I learned that I have to push the detection
of the switches down into the code, so everywhere
I create a new exten in gen_prios, I make sure
to pass onto it the values of the mother_exten
first, and the exten next.

I had to add a couple fields to the exten
struct to accomplish this, in the ael_structs.h
file. The checked field makes it so we don't
repeat the switch search if it's been done.

I also updated the regressions.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@136726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-08 00:15:34 +00:00
Kevin P. Fleming
31446d74a7 change the required dependency for codec_dahdi to only be satisfied by DAHDI and not Zaptel, as the new transcoder interface is only in DAHDI
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@136560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-07 18:25:31 +00:00
Shaun Ruffell
b6501cdb43 Updated codec_dahdi to use the new transcoder interface in the first DAHDI
release.  Codec dahdi no longer functions with the transcoder interface in
zaptel at this time (which the last zaptel release was 1.4.11).

NOTE: Still needs an update to the configure script to make sure that
codec_dahdi is only built if the new transcoder interface is present in the
drivers.

(Issue: DAHDI-42)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@136544 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-07 18:14:17 +00:00
Tilghman Lesher
925996df48 Update persistent state on all exit conditions.
(closes issue #12916)
 Reported by: sgenyuk
 Patches: 
       app_queue.patch.txt uploaded by neutrino88 (license 297)
 Tested by: sgenyuk, aragon


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@136488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-07 16:50:47 +00:00
Kevin P. Fleming
c269b9ba10 add a raw list of all libraries that any part of Asterisk links directly to
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@136484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-07 16:30:55 +00:00
Kevin P. Fleming
24dedd7016 work around a bug in gcc-4.2.3 that incorrectly ignores the casting away of 'const' for pointers when the developer knows it is safe to do so
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@136458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-07 16:11:17 +00:00
Kevin P. Fleming
b9b6f29610 remove config.cache during distclean, in case the user is using autoconf caching
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@136404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-07 15:07:12 +00:00
Tilghman Lesher
f2ead6dbc5 Also, parse useincomingcalleridonzaptransfer (and add appropriate deprecation
warnings).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@136348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-07 01:31:27 +00:00
Tilghman Lesher
d0721c085f For backwards compatibility with previous 1.4 versions which used "zapchan"
in users.conf, ensure that we still support it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@136304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-07 01:17:14 +00:00