Commit Graph

12882 Commits

Author SHA1 Message Date
Mark Michelson
8fc827e3cd Add context checking when retrieving a vm_state.
This was causing a problem for people who had identically
named mailboxes in separate voicemail contexts.
This commit affects IMAP storage only.

(closes issue #13194)
Reported by: moliveras
Patches:
      13194.patch uploaded by putnopvut (license 60)
Tested by: putnopvut, moliveras



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@140421 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-29 16:01:07 +00:00
Mark Michelson
3e0342deaf Fix SIP's parsing so that if a port is specified
in a string to Dial(), it is not ignored.

(closes issue #13355)
Reported by: acunningham
Patches:
      13355v2.patch uploaded by putnopvut (license 60)
Tested by: acunningham



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@140417 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-29 15:26:52 +00:00
Mark Michelson
ec8c71e9c1 Fix tag checking in get_sip_pvt_byid_locked when
in pedantic mode. The problem was that the wrong
tags would be compared depending on the direction
of the call.

(closes issue #13353)
Reported by: flefoll
Patches:
      chan_sip.c.br14.139015.patch-refer-pedantic uploaded by flefoll (license 244)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@140299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-27 19:49:20 +00:00
Jeff Peeler
7c9fa301c6 add HAVE_PRI if define around dahdi_close_pri_fd
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@140115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-26 16:49:57 +00:00
Russell Bryant
91cec13c3d Fix some bogus scheduler usage in chan_sip. This code used the return value
of a completely unrelated function to determine whether the scheduler should
be run or not.  This would have caused the scheduler to not run in cases where
it should have.  Also, leave a note about another scheduler issue that needs
to be addressed at some point.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@140060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-26 16:07:58 +00:00
Jeff Peeler
dc243f61be (closes issue #12071)
Reported by: tzafrir
Patches:
      dahdi_close.diff uploaded by tzafrir (license 46)
Tested by: tzafrir, jpeeler

This patch fixes closing open file descriptors in the case of an error.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@140056 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-26 15:57:02 +00:00
Russell Bryant
3696fbe740 Fix a race condition with the IAX scheduler thread. A lock and condition are
used here to allow newly scheduled tasks to wake up the scheduler just in case
the new task needs to run sooner than the current wakeup time when the thread
is sleeping.  However, there was a race condition such that a newly scheduled
task would not properly wake up the scheduler or affect the wake up period.
The order of execution would have been:

  1) Scheduler thread determines wake up time of N ms.
  2) Another thread schedules a task and signals the condition, with an
     execution time of < N ms.
  3) Scheduler thread locks and goes to sleep for N ms.

By moving the sleep time determination to inside the critical section, this
possibility is avoided.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@140051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-26 15:27:23 +00:00
Terry Wilson
a418df6432 sounds/Makefile installs sounds using the "new" language directory structure, but languageprefix needs to be set = yes for sounds in subdirectories (digits/1, etc.) to play as the correct language.
Fix the generation of asterisk.conf to include languageprefix=yes


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@140050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-26 15:22:58 +00:00
Kevin P. Fleming
3f0d388eee correct a file location in an error message
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@140029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-26 14:09:22 +00:00
Jeff Peeler
a25c32289b Fix a typo I made. Lesson learned, apply the patch if one exists.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139927 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-25 21:47:33 +00:00
Sean Bright
319a21d960 Some versions of awk (nawk, for example) don't like empty regular expressions
so be slightly more verbose.

(closes issue #13374)
Reported by: dougm
Patches:
      13374.diff uploaded by seanbright (license 71)
Tested by: dougm


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139909 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-25 21:31:03 +00:00
Terry Wilson
7488ddc223 Make SIPADDHEADER() propagate indefinitely
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139869 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-25 20:46:10 +00:00
Mark Michelson
b7585650d9 Fix the logic in config_text_file_save so that if an
UpdateConfig manager action is issued and the
file specified in DstFileName does not yet exist,
an error is not returned.

(closes issue #13341)
Reported by: vadim
Patches:
      13341.patch uploaded by putnopvut (license 60)
	  (with small modification from seanbright)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139769 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-25 15:52:59 +00:00
Steve Murphy
271e1a4acf This patch reverts the changes made via 139347, and 139635, as users
are seeing adverse difference. 

I will un-close 13251.

Back to the drawing board/ concept/ beginning/ whatever!




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-25 15:33:14 +00:00
Steve Murphy
d0f001accc I found some problems with the code I committed earlier, when
I merged them into trunk, so I'm coming back to clean up.
And, in the process, I found an error in the code I added
to trunk and 1.6.x, that I'll fix using this patch also.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-22 22:24:02 +00:00
Jeff Peeler
d2a637a424 (closes issue #13359)
Reported by: Laureano
Patches:
      originate_channel_check.patch uploaded by Laureano (license 265)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-22 21:36:13 +00:00
Mark Michelson
28b9f5b384 Fix compilation when DEBUG_THREAD_LOCALS is selected
(closes issue #13298)
Reported by: snuffy
Patches:
      bug13298_20080822.diff uploaded by snuffy (license 35)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-22 19:45:19 +00:00
Mark Michelson
74e98c5995 Remove show_frame_stats_deprecated since it is not
used anywhere and causes build errors if building under
dev-mode with TRACE_FRAMES selected in menuselect.

(closes issue #13362)
Reported by: snuffy



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@139521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-22 19:23:02 +00:00
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