Commit Graph

12543 Commits

Author SHA1 Message Date
Joshua Colp
8bb334e308 200 OKs in response to a reinvite need to be sent reliably. If the remote side does not receive one the dialog will be torn down.
(closes issue #12208)
Reported by: atrash


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-17 16:24:29 +00:00
Jason Parker
4501c61d73 Backport revision 106439 from trunk. I didn't realize this was broken in 1.4 as well.
Closes issue #12222.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-17 15:15:56 +00:00
Mark Michelson
284f74997d Make sure that we release the lock on the spyee channel if the spyee or spy has hung up
(closes issue #12232)
Reported by: atis



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-17 14:18:26 +00:00
Michiel van Baak
c16da7c25b add missing break to case AST_CONTROL_SRCUPDATE
(closes issue #12228)
Reported by: andrew
Patches:
      SRC.patch uploaded by andrew (license 240)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@108961 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-16 21:47:10 +00:00
Russell Bryant
0ddb8b4a7d Fix a channel name issue. chan_oss registers the "Console" channel type,
but it created channels with an "OSS" prefix.

(closes issue #12194, reported by davidw, patched by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@108796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-14 20:09:22 +00:00
Russell Bryant
ddf66b3a6e Update the SuSE init script to start networking before asterisk, as well.
(closes issue #12200, reported by and change suggested by reinerotto)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@108792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-14 20:04:35 +00:00
Mark Michelson
e0194ffaa7 Fix a race condition in the SIP packet scheduler which could cause a crash.
chan_sip uses the scheduler API in order to schedule retransmission of reliable
packets (such as INVITES). If a retransmission of a packet is occurring, then the
packet is removed from the scheduler and retrans_pkt is called. Meanwhile, if
a response is received from the packet as previously transmitted, then when we 
ACK the response, we will remove the packet from the scheduler and free the packet.

The problem is that both the ACK function and retrans_pkt attempt to acquire the
same lock at the beginning of the function call. This means that if the ACK function
acquires the lock first, then it will free the packet which retrans_pkt is about to
read from and write to. The result is a crash.

The solution:

1. If the ACK function fails to remove the packet from the scheduler and the retransmit
   id of the packet is not -1 (meaning that we have not reached the maximum number of 
   retransmissions) then release the lock and yield so that retrans_pkt may acquire the
   lock and operate.

2. Make absolutely certain that the ACK function does not recursively lock the lock in
   question. If it does, then releasing the lock will do no good, since retrans_pkt will
   still be unable to acquire the lock.

(closes issue #12098)
Reported by: wegbert
(closes issue #12089)
Reported by: PTorres
Patches:
      12098-putnopvutv3.patch uploaded by putnopvut (license 60)
Tested by: jvandal



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@108737 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-14 16:44:08 +00:00
Jason Parker
503ca9f30c Fix a potential segfault if chan (or chan->music_state) is NULL.
Closes issue #12210, credit to edantie for pointing this out.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@108682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-14 14:29:05 +00:00
Russell Bryant
efa3b46cdf Fix another issue that was causing crashes in chanspy. This introduces a new
datastore callback, called chan_fixup().  The concept is exactly like the
fixup callback that is used in the channel technology interface.  This callback
gets called when the owning channel changes due to a masquerade.  Before this
was introduced, if a masquerade happened on a channel being spyed on, the
channel pointer in the datastore became invalid.

(closes issue #12187)
(reported by, and lots of testing from atis)
(props to file for the help with ideas)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@108583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-13 21:38:16 +00:00
Russell Bryant
a10f524dfb Make a tweak that gets the LEDs on polycom phones to blink when an extension that
has been subscribed to goes on hold.  Otherwise, they just stay on like it does
when an extension is in use.

(closes issue #11263)
Reported by: russell
Patches:
      notify_hold.rev1.txt uploaded by russell (license 2)
Tested by: russell


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@108530 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-13 21:06:33 +00:00
Russell Bryant
269d0aa7e8 Fix a couple uses of sprintf. The second one could actually cause an overflow
of a stack buffer.  It's not a security issue though, it only depends on your
configuration.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@108469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-13 20:26:28 +00:00
Mark Michelson
9ff74a2b0a Change AST_SCHED_DEL use to ast_sched_del for autocongestion in chan_sip.
The scheduler callback will always return 0. This means that this id 
is never rescheduled, so it makes no sense to loop trying to delete
the id from the scheduler queue. If we fail to remove the item from the
queue once, it will fail every single time.

(Yes I realize that in this case, the macro would exit early because the
id is set to -1 in the callback, but it still makes no sense to use
that macro in favor of calling ast_sched_del once and being done with it)

This is the first of potentially several such fixes.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@108288 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-12 21:53:46 +00:00
Mark Michelson
f69043c1f0 Added a large comment before the AST_SCHED_DEL macro to explain its purpose as well as when
it is appropriate and when it is not appropriate to use it.

I also removed the part of the debug message that mentions that this is probably a bug because
there are some perfectly legitimate places where ast_sched_del may fail to delete an entry (e.g.
when the scheduler callback manually reschedules with a new id instead of returning non-zero to
tell the scheduler to reschedule with the same idea). I also raised the debug level of the debug
message in AST_SCHED_DEL since it seems like it could come up quite frequently since the macro
is probably being used in several places where it shouldn't be. Also removed the redundant line,
file, and function information since that is provided by ast_log.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@108227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-12 21:16:28 +00:00
Russell Bryant
a169524ff6 (closes issue #12187, reported by atis, fixed by me after some brainstorming
on the issue with mmichelson)

- Update copyright info on app_chanspy.

- Fix a race condition that caused app_chanspy to crash.  The issue was that
  the chanspy datastore magic that was used to ensure that spyee channels did
  not disappear out from under the code did not completely solve the problem.
  It was actually possible for chanspy to acquire a channel reference out of
  its datastore to a channel that was in the middle of being destroyed.  That
  was because datastore destruction in ast_channel_free() was done near the
  end.  So, this left the code in app_chanspy accessing a channel that was
  partially, or completely invalid because it was in the process of being free'd
  by another thread.  The following sort of shows the code path where the race 
  occurred:

  =============================================================================
  Thread 1 (PBX thread for spyee chan)  ||   Thread 2 (chanspy)
  --------------------------------------||-------------------------------------
  ast_channel_free()                    ||
    - remove channel from channel list  ||
    - lock/unlock the channel to ensure ||
      that no references retrieved from ||
      the channel list exist.           ||
  --------------------------------------||-------------------------------------
                                        || channel_spy()
    - destroy some channel data         ||  - Lock chanspy datastore
                                        ||  - Retrieve reference to channel
                                        ||  - lock channel
                                        ||  - Unlock chanspy datastore
  --------------------------------------||-------------------------------------
     - destroy channel datastores       ||
        - call chanspy datastore d'tor  ||  
          which NULL's out the ds'      ||  - Operate on the channel ...
          reference to the channel      ||     
                                        ||
    - free the channel                  || 
                                        ||
                                        ||  - unlock the channel
  --------------------------------------||-------------------------------------
  =============================================================================



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@108135 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-12 19:57:42 +00:00
Kevin P. Fleming
988e55c13f if we receive an INVITE with a Content-Length that is not a valid number, or is zero, then don't process the rest of the message body looking for an SDP
closes issue #11475
Reported by: andrebarbosa



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@108086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-12 19:16:07 +00:00
Joshua Colp
4a8d87fe98 Add a trigger mode that triggers on both read and write. The actual function that returns the combined audio frame though will wait until both sides have fed in audio, or until one side stops (such as the case when you call Wait).
(closes issue #11945)
Reported by: xheliox


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@108083 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-12 18:26:37 +00:00
Russell Bryant
2016f5ba10 Destroy the channel lock after the channel datastores.
(inspired by issue #12187)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@108031 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-12 16:59:07 +00:00
Tilghman Lesher
7c6ceef3ea Document all of the possible realtime fields
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107877 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-12 01:52:40 +00:00
Jason Parker
c4095ece54 Update documentation for pgsql ODBC voicemail.
(closes issue #12186)
Reported by: jsmith
Patches:
      vm_pgsql_doc_update.patch uploaded by jsmith (license 15)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107826 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 23:37:05 +00:00
Jason Parker
ea47c2d0b7 Copy voicemail dependency logic for res_adsi to chan_gtalk (for jabber).
(closes issue #12014)
Reported by: junky


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 20:49:56 +00:00
Kevin P. Fleming
d6b2cb9efb get chan_vpb to build properly in dev mode
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 20:48:58 +00:00
Jason Parker
48523e3596 Add a newline on a log
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 20:47:53 +00:00
Joshua Colp
8f65ef8264 Make sure the visible indication is on the right channel so when the masquerade happens the proper indication is enacted.
(closes issue #11707)
Reported by: iam


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 19:20:01 +00:00
Joshua Colp
d9e83f85a6 Add an additional check for setting conference parameter when using the marked user options. It was possible for it to return to a no listen/no talk state if a masquerade happened.
(closes issue #12136)
Reported by: aragon


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 18:47:33 +00:00
Joshua Colp
d6d14a3694 Fix a minor spelling error.
(closes issue #12183)
Reported by: darrylc


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 17:32:17 +00:00
Kevin P. Fleming
f201a2b11b backport a fix from trunk
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107472 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 15:18:45 +00:00
Kevin P. Fleming
428a560d33 fix various other problems found by gcc 4.3
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107464 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 14:53:03 +00:00
Kevin P. Fleming
9569d74df5 stop checking for mktime() in the configure script... we don't use it, and the test is buggy under gcc 4.3
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 14:33:45 +00:00
Kevin P. Fleming
9f2d2cea4b check for compiler support for -fno-strict-overflow before using it (tested with Debian's gcc 4.3, 4.1 and 3.4)
(closes issue #12179)
Reported by: Netview


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 14:07:59 +00:00
Kevin P. Fleming
2bfb158faf fix small bug in IMAP toolkit testing
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 13:57:08 +00:00
Kevin P. Fleming
553070456b fix up various compiler warnings found with gcc-4.3:
- the output of flex includes a static function called 'input' that is not used, so for the moment we'll stop having the compiler tell us about unused variables in the flex source files (a better fix would be to improve our flex post-processing to remove the unused function)

- main/stdtime/localtime.c makes assumptions about signed integer overflow, and gcc-4.3's improved optimizer tries to take advantage of handling potential overflow conditions at compile time; for now, suppress these optimizations until we can fiure out if the code needs improvement

- main/udptl.c has some references to uninitialized variables; in one case there was no bug, but in the other it was certainly possibly for unexpected behavior to occur

- main/editline/readline.c had an unused variable



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107352 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 11:04:29 +00:00
Terry Wilson
28423c15fc If we fail to alloc a channel, we should re-lock the pvt structure before returning.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 00:59:18 +00:00
Tilghman Lesher
e1bccfc3fe Use non-global storage for eswitch
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107230 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-10 21:32:24 +00:00
Jason Parker
be8690e9a8 Make sure to reenable echo can after a "failed" (canceled, etc) three-way call.
(closes issue #11335)
Reported by: rebuild


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-10 20:27:08 +00:00
Russell Bryant
42caaed426 Fix another bug specifically related to asynchronous call origination. Once the
PBX is started on the channel using ast_pbx_start(), then the ownership of the
channel has been passed on to another thread.  We can no longer access it in this
code.  If the channel gets hung up very quickly, it is possible that we could
access a channel that has been free'd.

(inspired by BE-386)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107161 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-10 20:17:11 +00:00
Russell Bryant
0a4fc5b8c6 Fix some bugs related to originating calls. If the code failed to start a PBX
on the channel (such as if you set a call limit based on the system's load
average), then there were cases where a channel that has already been free'd
using ast_hangup() got accessed.  This caused weird memory corruption and
crashes to occur.

(fixes issue BE-386)
(much debugging credit goes to twilson, final patch written by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-10 20:04:27 +00:00
Russell Bryant
7a47679898 Resolve a compiler warning.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-10 17:13:17 +00:00
Russell Bryant
72e4729ad5 Fix a race condition where the generator can go away
(closes issue #12175, reported by edantie, patched by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-10 16:58:57 +00:00
Joshua Colp
2bf8f9fca3 Move where unanswered CDRs are dropped to the CDR core, not everything uses app_dial.
(closes issue #11516)
Reported by: ys
Patches:
      branch_1.4_cdr.diff uploaded by ys (license 281)
Tested by: anest, jcapp, dartvader


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107016 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-10 14:33:02 +00:00
Kevin P. Fleming
57eaf9dd8f don't generate D-Channel "up" and "down" messages unless the channel state is actually changing; also, generate the "up" message when an implicit "up" occurs due to reception of a normal event when we thought the channel was "down"
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@106945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-08 15:59:42 +00:00
Russell Bryant
a04b584272 Only start the SLA thread if SLA has actually been configured.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@106895 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07 22:51:23 +00:00
Jason Parker
06ba2df183 Fix hardcoded grep in editline, were GNU grep is required.
(closes issue #12124)
Reported by: dmartin


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@106842 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07 22:14:45 +00:00
Joshua Colp
28c66694d3 Ignore source update control frame.
(closes issue #12168)
Reported by: plack


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@106788 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07 19:32:00 +00:00
Russell Bryant
bfed30d5dd Change a warning message to a debug message. This is happening quite frequently,
and it is not worth spamming users with these messages unless we are pretty confident
that it should never happen.  As it stands today, it _will_ and _does_ happen and
until that gets cleaned up a reasonable amount on the development side, let's not
spam the logs of everyone else.

(closes issue #12154)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@106704 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07 17:16:58 +00:00
Tilghman Lesher
417e8fc754 Warn the user when a temporary greeting exists
(Closes issue #11409)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@106635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07 16:22:11 +00:00
Tilghman Lesher
072171ef5d Properly initialize rtp->schedid
(Closes issue #12154)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@106606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07 15:20:52 +00:00
Tilghman Lesher
56e908b787 Safely use the strncat() function.
(closes issue #11958)
 Reported by: norman
 Patches: 
       20080209__bug11958.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@106552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07 06:36:33 +00:00
Mark Michelson
24ca0899c2 Quell an annoying message that is likely to print every single time that
ast_pbx_outgoing_app is called. The reason is that __ast_request_and_dial
allocates the cdr for the channel, so it should be expected that the channel
will have a cdr on it.

Thanks to joetester on IRC for pointing this out



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@106437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-06 22:10:07 +00:00
Tilghman Lesher
e0bc9fcf77 Upgrade to the next release of sounds
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@106328 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-06 04:40:06 +00:00
Russell Bryant
9479a831f0 Fix a potential deadlock and a few different potential crashes.
(closes issue #12145, reported by thiagarcia, patched by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@106237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-05 22:37:09 +00:00