Commit Graph

4258 Commits

Author SHA1 Message Date
Russell Bryant
fe59cfa7aa Add some more sanity checking on IAX2 dial strings for the case that no peer
or hostname was provided, which is the one part of the dial string that is
absolutely required.  If it's not there, bail out.

(closes issue #11897)
Reported by sokhapkin
Patch by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-01 00:32:49 +00:00
Jason Parker
9742fb53fe Solaris compat fixes for struct in_addr funkiness.
Issue #11885, patch by snuffy.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101482 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-31 19:52:49 +00:00
Russell Bryant
0343bf8348 Add more missing locking of the agents list ...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-31 19:17:05 +00:00
Russell Bryant
70200cec77 Move the locking from find_agent() into the agent dialplan function handler to
ensure that the agent doesn't disappear while we're looking at it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-31 19:07:46 +00:00
Russell Bryant
c6c7c3bf58 Add missing locking to the find_agent() function.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-31 19:04:52 +00:00
Olle Johansson
5e02b0d76e Stop musiconhold on attended transfer.
(closes issue #11872)
Reported by: gareth
Patches: 
      svn-101018.patch uploaded by gareth (license 208)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-30 11:20:31 +00:00
Jason Parker
f60be6bdb8 Initialize an array to 0s if config option not specified.
(closes issue #11860)
Patches:
      misdn_get_config.v1.diff uploaded by IgorG (license 20)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100930 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-29 17:41:43 +00:00
Jason Parker
75007e2ab5 Allow zap groups above 30 to work properly.
(closes issue #11590)
Reported by: tbsky


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100835 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-29 16:10:00 +00:00
Christian Richter
31c5fc22a5 fixed potential segfault in misdn show channels CLI command
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100793 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-29 10:36:19 +00:00
Olle Johansson
52cfa83d42 (closes issue #11736)
Reported by: MVF
Patches: 
      bug11736-2.diff uploaded by oej (license 306)
Tested by: oej, MVF, revolution

(russellb: This was the showstopper for the release.)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-29 08:26:48 +00:00
Mark Michelson
d53c693509 Undoing the deprecation of chan_vpb. It is alive and well.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100673 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-28 20:55:56 +00:00
Russell Bryant
fe50ae6de5 For some reason, the use of this strdupa() is leading to memory corruption on
freebsd sparc64.  This trivial workaround fixes it.

(closes issue #10300, closes issue #11857, reported by mattias04 and Home-of-the-Brave)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-28 18:34:20 +00:00
Jason Parker
58a4fa50ce Correct a comment which made little/no sense.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100624 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-28 18:23:09 +00:00
Russell Bryant
ef78f25e8a Make some deadlock related fixes. These bugs were discovered and reported
internally at Digium by Steve Pitts.
 - Fix up chan_local to ensure that the channel lock is held before the local
   pvt lock.
 - Don't hold the channel lock when executing the timing function, as it can
   cause a deadlock when using chan_local.  This actually changes the code back
   to be how it was before the change for issue #10765.  But, I added some other
   locking that I think will prevent the problem reported there, as well.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-28 17:15:41 +00:00
Tilghman Lesher
7060a6888d When deleting a task from the scheduler, ignoring the return value could
possibly cause memory to be accessed after it is freed, which causes all
sorts of random memory corruption.  Instead, if a deletion fails, wait a
bit and try again (noting that another thread could change our taskid
value).
(closes issue #11386)
 Reported by: flujan
 Patches: 
       20080124__bug11386.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76, flujan, stuarth`


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-27 21:59:53 +00:00
Mark Michelson
53859e0bfc Deprecating chan_vpb. It is now preferred that users of Voicetronix products
use chan_zap in combination with their zaptel drivers.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-25 22:32:41 +00:00
Jason Parker
a70508ed3d This would have never been true, since we're passing (sizeof(req.data) - 1) as the len to recvfrom().
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-25 21:24:49 +00:00
Olle Johansson
107c1c37b4 Second attempt. Don't change invitestate when receiving 18x messages in CANCEL state.
(issue #11736)
Reported by: MVF

Patch by oej.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-23 21:07:16 +00:00
Olle Johansson
d95d9d7132 Make sure we don't cancel destruction on calls in CANCEL state, even if we
get 183 while waiting for answer on our CANCEL.

(issue #11736)
Reported by: MVF
Patches: 
      bug11736.txt uploaded by oej (license 306)
Tested by: MVF


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-23 20:58:20 +00:00
Mark Michelson
3e54e684b2 These flag tests were illogical. They were testing sip_peer flags on a sip_pvt.
Thanks to Russell for helping to get this odd problem figured out.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99878 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-23 16:18:04 +00:00
Olle Johansson
f9cf98d4bf Thanks to Russell's education I realize that BUFSIZ has changed since I learned the C language
over 20 years ago... Resetting chan_sip to the size of BUFSIZ that I expected in my old 
head to avoid to heavy memory allocations on some systems.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-22 20:56:09 +00:00
Olle Johansson
48066f4cfd Add more dependencies on chan_local and add a note to the description of chan_local
so that people don't disable it in menuselect just to clean up.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99594 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-22 17:41:57 +00:00
Olle Johansson
33b77709a7 Cleaning up some documentation that led to confusion in a bug report
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99501 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-22 15:08:14 +00:00
Mark Michelson
cdd8c1a3c3 Fixing an issue wherein monitoring local channels was not possible. During a channel
masquerade, the monitors on the two channels involved are swapped. In 99% of the cases
this results in the desired effect. However, if monitoring a local channel, this caused
the monitor which was on the local channel to get moved onto a channel which is immediately
hung up after the masquerade has completed. By swapping the monitors prior to the masquerade, 
we avoid the problem by tricking the masquerade into placing the monitor back onto the channel
where we want it.

During the investigation of the issue, the channel's monitor was the only thing that was swapped
in such a manner which did not make sense to have done. All other variable swapping made sense.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99426 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-21 23:55:26 +00:00
Joshua Colp
785f7da384 Bump the buffer size for Via headers up to 512. There are some exceptionally large Via headers out there.
(closes issue #11783)
Reported by: ofirroval


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99301 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-21 16:01:00 +00:00
Russell Bryant
6d0ee62540 Have IAX2 optimize the codec translation path just like chan_sip does it. If
the caller's codec is in our codec list, move it to the top to avoid transcoding.

(closes issue #10500)
Reported by: stevedavies
Patches:
      iax-prefer-current-codec.patch uploaded by stevedavies (license 184)
      iax-prefer-current-codec.1.4.patch uploaded by stevedavies (license 184)
Tested by: stevedavies, pj, sheldonh


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99004 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-17 22:37:22 +00:00
Joshua Colp
1156daa2e4 Add missing NULLs at end of two ast_load_realtimes.
(closes issue #11769)
Reported by: tequ
Patches:
      chaniax.patch uploaded by dimas (license 88)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98966 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-16 17:50:10 +00:00
Mark Michelson
7decb0d343 Fix a deadlock in chan_local in local_hangup. There was contention because
the local_pvt was held and it was attempting to lock a channel, which is the
incorrect locking order.

(closes issue #11730)
Reported by: UDI-Doug
Patches:
      11730.patch uploaded by putnopvut (license 60)
	  Tested by: UDI-Doug


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98964 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-16 17:20:11 +00:00
Joshua Colp
d35f5e39a2 Don't drop the old record route information when dealing with packets related to a reinvite.
(closes issue #11545)
Reported by: kebl0155
Patches:
      reinvite-patch.txt uploaded by kebl0155 (license 356)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-16 03:07:24 +00:00
Russell Bryant
48a72bba86 Change a buffer in check_auth() to be a thread local dynamically allocated
buffer, instead of a massive buffer on the stack.  This fixes a crash reported
by Qwell due to running out of stack space when building with LOW_MEMORY defined.

On a very related note, the usage of BUFSIZ in various places in chan_sip is
arbitrary and careless.  BUFSIZ is a system specific define.  On my machine,
it is 8192, but by definition (according to google) could be as small as 256.  
So, this buffer in check_auth was 16 kB.  We don't even support SIP messages 
larger than 4 kB!  Further usage of this define should be avoided, unless it 
is used in the proper context.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-15 23:50:10 +00:00
Russell Bryant
7a007060bd Commit a fix for some memory access errors pointed out by the valgrind2.txt
output on issue #11698.

The issue here is that it is possible for an instance of a translator to get
destroyed while the frame allocated as a part of the translator is still being
processed.  Specifically, this is possible anywhere between a call to ast_read()
and ast_frame_free(), which is _a lot_ of places in the code.  The reason this
happens is that the channel might get masqueraded during this time.  During a
masquerade, existing translation paths get destroyed.

So, this patch fixes the issue in an API and ABI compatible way.  (This one is
 for you, paravoid!)

It changes an int in ast_frame to be used as flag bits.  The 1 bit is still used
to indicate that the frame contains timing information.  Also, a second flag has
been added to indicate that the frame came from a translator.  When a frame with
this flag gets released and has this flag, a function is called in translate.c to
let it know that this frame is doing being processed.  At this point, the flag gets
cleared.  Also, if the translator was requested to be destroyed while its internal
frame still had this flag set, its destruction has been deffered until it finds out
that the frame is no longer being processed.

Admittedly, this feels like a hack.  But, it does fix the issue, and I was not able 
to think of a better solution ...


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-15 23:26:52 +00:00
Joshua Colp
d355eb9c84 Based on the boundary found move over the correct amount.
(closes issue #11750)
Reported by: tasker


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-15 20:08:43 +00:00
Joshua Colp
e3458a4976 Accept "; boundary=" not just ";boundary=" in the multipart mixed content type.
(closes issue #11750)
Reported by: tasker


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-14 22:41:55 +00:00
Tilghman Lesher
0b289ed1b6 Back out changes from revision 97077, since it wasn't perfect
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-11 15:52:31 +00:00
Tilghman Lesher
7f61492a42 1) When we get a translated frame out, clone it, because if the
translator pvt is freed before we use the frame, bad things happen.
2) Getting a failure from ast_sched_delete means that the schedule
ID is currently running.  Don't just ignore it.
(Closes issue #11698)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 23:08:36 +00:00
Philippe Sultan
863ef8d7d2 Set the caller id within the gtalk_alloc function.
As underlined in issue #10437 by Josh, we need to prevent a possible
memory leak. We only set the name part of the caller id, the number
part is not relevant when dealing with JIDs.

Closes issue #11549.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 16:44:24 +00:00
Kevin P. Fleming
d235974bd6 pass the right variable to get an error string... oops
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 15:43:19 +00:00
Kevin P. Fleming
7bfd21933f add error number output to ioctl failure messages to help with debugging
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 15:26:23 +00:00
Joshua Colp
61ee1872b1 Fix various DTMF issues in chan_mgcp.
(closes issue #11443)
Reported by: eferro
Patches:
      dtmf_control_hybrid-inband-mode.patch uploaded by eferro (license 337)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97195 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-08 20:48:20 +00:00
Tilghman Lesher
1b289c2998 Apply multiple crash fixes, found in issue #11386, but not completely
closing that issue.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97077 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-08 18:02:13 +00:00
Tilghman Lesher
58cc575e52 If you change the bindaddr in sip.conf to a non-bound address and reload, sip goes kablooie.
Reported and patched by: one47
(Closes issue #11535)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-04 19:27:25 +00:00
Russell Bryant
6787783ce5 Make use of the temporary channel pointer while the pvt is unlocked.
(closes issue #11675)
Reported by: flefoll
Patches:
      chan_zap.c.patch-store-owner-before-unlock uploaded by flefoll (license 244)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96449 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-04 16:19:22 +00:00
Russell Bryant
6ae86ec183 Don't crash if the iax2 pvt structure has been destroyed before we get to this point
(closes issue #11672, reported by snuffy, patched by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96394 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-03 22:44:22 +00:00
Christian Richter
2a4a61f914 make sure frame is completely clean, before we send it to asterisk as DTMF. If we don't make it clean, it happens that one way audio occurs..
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96199 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-03 12:12:27 +00:00
Christian Richter
be6e667c1e when overlapdial was used and no number was dialed, the call was dropped, now we just jump into the s extension, which makes a lot more sense.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96198 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-03 12:08:40 +00:00
Joshua Colp
b5087d7743 Allocate a SIP refer structure when performing a transfer using BYE with Also so that the transfer information is properly stored. (AST-2008-001)
(closes issue #11637)
Reported by: greyvoip


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@95946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-02 20:24:09 +00:00
Russell Bryant
ce3f27c5d5 Remove duplicate increment of the header count in the add_header() function.
(closes issue #11648)
Reported by: makoto
Patch provided by sergee, committed patch by me, inspired by comments from putnopvut


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@95191 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-28 18:24:59 +00:00
Joshua Colp
e276b231fb Include types.h in chan_h323 as without it it can not be compiled on some operating systems like FreeBSD to name one.
(closes issue #11585)
Reported by: sobomax
Patches:
      chan_h323.c.diff uploaded by sobomax (license 359)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-27 17:32:15 +00:00
Joshua Colp
856bc2ef76 Use ast_strlen_zero to see if our_contact is set or not on the dialog. It is possible for it to be a pointer to NULL.
(closes issue #11557)
Reported by: FuriousGeorge


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-27 17:27:11 +00:00
Joshua Colp
25aef5fc44 file says... build on the builders.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94769 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-25 02:27:08 +00:00