Compare commits

...

3959 Commits

Author SHA1 Message Date
Leif Madsen
231eb2720b Update the summary files
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26.2@216185 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 20:58:59 +00:00
Leif Madsen
d1f1f1344f Importing release summary for 1.4.26.2 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26.2@216182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 20:38:05 +00:00
Kevin P. Fleming
7e0fe117a3 recover this tag that was accidentally deleted
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26.2@216175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 20:35:39 +00:00
Leif Madsen
1e89d8d1f7 Create release 1.4.26.2 from 1.4.26.1
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26.2@216149 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 20:28:09 +00:00
Leif Madsen
3b5afd092d Creating tag for the release of asterisk-1.4.26.2
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26.2@216138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 20:24:53 +00:00
Leif Madsen
6d361d9aed Importing release summary for 1.4.26.2 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26.2@216107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 20:04:29 +00:00
David Vossel
f1f9cab354 IAX2 security user guide
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26.2@216100 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 19:46:28 +00:00
David Vossel
71ebe2acb0 updating UPGRADE.txt to reflect iax2 security changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26.2@216096 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 19:42:05 +00:00
Russell Bryant
ff3097a592 Blocked revisions 216087 via svnmerge
........
  r216087 | russell | 2009-09-03 14:37:05 -0500 (Thu, 03 Sep 2009) | 2 lines
  
  Fix a typo.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@216089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 19:37:19 +00:00
Russell Bryant
e982c31095 Merged revisions 216080 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
  r216080 | russell | 2009-09-03 14:35:23 -0500 (Thu, 03 Sep 2009) | 2 lines
  
  Add a note about IAX2 to UPGRADE.txt.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@216085 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 19:36:46 +00:00
Leif Madsen
896bbd2b2f Importing release summary for 1.4.26.2 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26.2@216066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 19:30:20 +00:00
David Vossel
4ddc45b27d Merge code associated with AST-2009-006
(closes issue #12912)
Reported by: rathaus
Tested by: tilghman, russell, dvossel, dbrooks




git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26.2@216015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 19:10:21 +00:00
Russell Bryant
5694fcdb14 Merged revisions 216005 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
  r216005 | russell | 2009-09-03 13:42:24 -0500 (Thu, 03 Sep 2009) | 2 lines
  
  Add IAX2 security document related to AST-2009-006.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@216008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 18:44:58 +00:00
David Vossel
ed1951d895 Merge code associated with AST-2009-006
(closes issue #12912)
Reported by: rathaus
Tested by: tilghman, russell, dvossel, dbrooks



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@216000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 18:32:32 +00:00
Leif Madsen
a1cb74329f Importing release summary for 1.4.26.2 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26.2@215953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 16:11:16 +00:00
Leif Madsen
328fb4cbb4 Update .version and ChangeLog files.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26.2@215947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 16:00:03 +00:00
Leif Madsen
1c88d11203 Create 1.4.26.2 from 1.4.26.1.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26.2@215942 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-03 15:50:12 +00:00
Terry Wilson
82b1e162e1 Re-send non-100 provisional responses to prevent cancellation
From section 13.3.1.1 of RFC 3261:

   If the UAS desires an extended period of time to answer the INVITE,
   it will need to ask for an "extension" in order to prevent proxies
   from canceling the transaction. A proxy has the option of canceling
   a transaction when there is a gap of 3 minutes between responses in a
   transaction. To prevent cancellation, the UAS MUST send a non-100
   provisional response at every minute, to handle the possibility of
   lost provisional responses.

(closes issue #11157)
Reported by: rjain
Tested by: twilson

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@215682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-02 21:41:22 +00:00
Dwayne M. Hubbard
fad010ebe7 Use strrchr() so SoftHangup will correctly truncate multi-hyphen channel names
In general channel names are in the form Foo/Bar-Z, but the channel name
could have multiple hyphens and look like Foo/B-a-r-Z.  Use strrchr to
truncate the channel name at the last hyphen.

(closes issue #15810)
Reported by: dhubbard
Patches:
      dw-softhangup-1.4.patch uploaded by dhubbard (license 733)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@215270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-01 23:04:52 +00:00
Tilghman Lesher
fa27e8dffa Also unlock the "other" channel, when returning, due to glare.
(closes issue #15787)
 Reported by: tim_ringenbach
 Patches: 
       chan_local.diff uploaded by tim ringenbach (license 540)
 Tested by: tim_ringenbach


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@214940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-31 16:16:52 +00:00
Tilghman Lesher
fafa668b04 Modify comment to be a bit more accurate.
We have kept this comment around long enough, that it's pretty clear that we're
keeping the code, because changing the code would require a pretty fundamental
architectural shift.  We've also taken criticism in some quarters, because it
was believed that it was referring to the code being nasty.  No, the code isn't
nasty, just the operation itself is rather odd.  Fixed for eternity (probably
not).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@214701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-28 20:13:32 +00:00
Tilghman Lesher
4b133920a5 Use autoconf to detect libcurl, as this enables cross-compilation checks, something we didn't allow before.
(closes issue #15714)
 Reported by: pprindeville
 Patches: 
       20090813__issue15714.diff.txt uploaded by tilghman (license 14)
 Tested by: pprindeville


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@214517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-27 21:45:34 +00:00
Tilghman Lesher
7215954ccf One more build system change, to make the descriptions look better, if we have better information.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@214436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-27 16:53:58 +00:00
Tilghman Lesher
60fd401064 Make autoheader descriptions render correctly in our autoconfig.h file.
(Figured out while working with issue #14906)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@214357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-27 16:03:50 +00:00
David Vossel
899272c2cc ast_write() ignores ast_audiohook_write() results
In ast_write(), if a channel has a list of audiohooks, those
lists are written to and the resulting frame is what ast_write()
should continue with.  The problem was the returned audiohook frame
was not being handled at all, and the original frame passed
into it did not contain the mixed audio, so essentially audio
was being lost.  One result of this was chan_spy's whisper
mode no longer worked.  To complicate the issue, frames
passed into ast_write may either be a single frame, or a list
of frames.  So, as the list of frames is processed in the
audiohook_write, the returned frames had to be added to a new
list.

(closes issue #15660)
Reported by: corruptor
Tested by: dvossel



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@214194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-26 16:36:42 +00:00
Tilghman Lesher
a45f5e5be0 I should always compile before committing...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@214069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-25 19:28:42 +00:00
Tilghman Lesher
10a972f98e Fix pronunciation of German dates.
(closes issue #15273)
 Reported by: Benjamin Kluck
 Patches: 
       say_c.patch uploaded by Benjamin Kluck (license 803)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@214068 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-25 19:26:50 +00:00
Tilghman Lesher
0055593341 Improve error message by informing user exactly which function is missing a parethesis.
(closes issue #15242)
 Reported by: Nick_Lewis
 Patches: 
       pbx.c-funcparenthesis.patch2 uploaded by dbrooks (license 790)
       pbx.c-funcparenthesis-1.4.diff uploaded by loloski (license 68)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@213970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-25 06:34:44 +00:00
Tilghman Lesher
679cefec98 Use the default runlevels for Debian derivatives, instead of making up our own.
(closes issue #14730)
 Reported by: pkempgen


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@213899 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-25 02:40:22 +00:00
Kevin P. Fleming
79221dad8d Ensure that T.38 INVITEs generated by Asterisk properly result in T.38 being enabled.
(closes issue #15373)
Reported by: dcolombo
Patches:
      chan_sip.patch uploaded by mbrancaleoni (license 342)
Tested by: dcolombo, mbrancaleoni


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@213631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-21 20:23:45 +00:00
Tilghman Lesher
1ea4af21ca Permit DEBUG_FD_LEAKS to be used with C++ source files.
(closes issue #15698)
 Reported by: slavon
 Patches: 
       20090817__issue15698.diff.txt uploaded by tilghman (license 14)
 Tested by: slavon, tilghman


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@213559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-21 16:52:53 +00:00
Jason Parker
3300ac5b40 Clarify queues.conf comments to specify that variables should be set in the dialplan.
(closes issue #15755)
Reported by: trendboy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@213493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-21 16:03:21 +00:00
Matthew Nicholson
4fa5fa014f Fix a crash by checking the proper pointer for validity before deferencing it.
(closes issue #15751)
Reported by: atis
Patches:
      ast_bridge_call_peer_cdr.patch uploaded by atis (license 242)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@213339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-20 20:33:07 +00:00
Jeff Peeler
d581b4216a Make all the symbols for the C-client callbacks global
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@213283 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-20 19:53:34 +00:00
David Vossel
941ed1b2fe Fixes memory leak caused by incorrectly freeing mixmonitor
(closes issue #15699)
Reported by: edantie
Patches:
      mixmonitor.patch uploaded by edantie (license 862)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@213103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-19 21:18:37 +00:00
Kevin P. Fleming
f5bc668276 Convert this branch to Opsound music-on-hold.
For more details:
http://blogs.digium.com/2009/08/18/asterisk-music-on-hold-changes/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@212913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-18 20:26:53 +00:00
Sean Bright
a4d1e6120f Delay the creation of temporary files until we have a valid manager command to handle.
Without this patch, asterisk creates a temporary file before determining if the
specified command is valid.  If invalid, we weren't properly cleaning up the file.

(closes issue #15730)
Reported by: zmehmood
Patches:
      M15730.diff uploaded by junky (license 177)
Tested by: zmehmood


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@212763 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-18 16:36:00 +00:00
Richard Mudgett
309898993f Removed some deadwood and added some doxygen comments.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@212727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-18 16:00:56 +00:00
Jeff Peeler
d924b5349e Fix segfault when reloading chan_misdn.
If more ports were specified than configured in misdn.conf a reload would crash
asterisk. The problem was the unconfigured port was using data from the
previously configured port. When the data for an unconfigured port was freed a
crash would result from the double free.

(closes issue #12113)
Reported by: agupta
Patches:
      bug12113.patch uploaded by jpeeler (license 325)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@212498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-17 16:34:56 +00:00
Richard Mudgett
00de2431be Fix uninitialized variable.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@212430 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-17 15:36:28 +00:00
Matthew Nicholson
b35312b15b This patch adds additional checking when generating queue log TRANSFER events.
The additional checks prevent generation of false TRANSFER events in certain situations.

(closes issue #14536)
Reported by: aragon
Patches:
      queue-log-xfer-fix1.diff uploaded by mnicholson (license 96)
Tested by: aragon, mnicholson


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@211953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-12 23:04:02 +00:00
Mark Michelson
ad76c40551 Backport fix so that outbound CANCEL requests have same branch as challenged INVITEs.
There already was code present to be sure that a CANCEL will contain the same branch-id
as the INVITE it is cancelling. However, for INVITES which are challenged downstream,
this mechanism did not work properly. Now this is taken care of.

This is a backport of a fix already present in all 1.6.X branches and in trunk. It also
fixes ABE-1907.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@211807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-12 18:46:09 +00:00
Tilghman Lesher
2c738b7447 Changes to make 1.4.26 into 1.4.26.1
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26.1@211596 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 20:14:34 +00:00
Tilghman Lesher
90e98d0774 Create tag for 1.4.26.1
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26.1@211591 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 20:07:13 +00:00
Tilghman Lesher
90f3605f6f Conversion specifiers, not format specifiers
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@211583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 19:48:48 +00:00
Tilghman Lesher
63cc189747 AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@211528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 19:15:57 +00:00
Tilghman Lesher
541976843e Small oops. Clear the flags which have been checked.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@211274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-09 15:41:01 +00:00
Russell Bryant
a56006702e Resolve a deadlock involving app_chanspy and masquerades.
(ABE-1936)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@211112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-07 20:11:31 +00:00
Tilghman Lesher
17656694c3 QUEUE_MEMBER_LIST _really_ wants the interface name, not the membername.
This is a partial revert of revision 82590, which was an attempted cleanup,
but in reality, it broke QUEUE_MEMBER_LIST, which has always been intended
as a method by which component interfaces could be queried from the queue.
Membername isn't useful here, because that field cannot be used to obtain
further information about the member.  See the documentation on
QUEUE_MEMBER_LIST, RemoveQueueMember, QUEUE_MEMBER_PENALTY, and the various
AMI commands which take a member argument for further justification.
(closes issue #15664)
 Reported by: rain
 Patches: 
       app_queue-queue_member_list.diff uploaded by rain (license 327)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@211038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-07 18:16:28 +00:00
Tilghman Lesher
e87d76cb94 Because channel information can be accessed outside of the channel thread, we must lock the channel prior to modifying it.
(closes issue #15397)
 Reported by: caspy
 Patches: 
       20090714__issue15397.diff.txt uploaded by tilghman (license 14)
 Tested by: caspy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@210913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-06 21:45:01 +00:00
Richard Mudgett
20d63bd1c0 Dialplan starts execution before the channel setup is complete.
*  Issue 15655: For the case where dialing is complete for an incoming
call, dahdi_new() was asked to start the PBX and then the code set more
channel variables.  If the dialplan hungup before these channel variables
got set, asterisk would likely crash.
*  Fixed potential for overlap incoming call to erroneously set channel
variables as global dialplan variables if the ast_channel structure failed
to get allocated.
*  Added missing set of CALLINGSUBADDR in the dialing is complete case.

(closes issue #15655)
Reported by: alecdavis


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@210575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-05 19:18:56 +00:00
Leif Madsen
01416248d5 Update imapstorage.txt documentation.
Updated the imapstorage.txt documentation to reflect that issues with
c-client versions older than 2007 seem to cause crashing issues that
are not seen with more recent versions. Documentation has been updated
to reflect this.

(closes issue #14496)
Reported by: vbcrlfuser
Patches:
      __20090727-imap-documentation-patch.txt uploaded by lmadsen (license 10)
Tested by: lmadsen, mmichelson, dbrooks

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@210563 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-05 18:46:21 +00:00
Kevin P. Fleming
22140c486f Eliminate spurious compiler warnings from system headers on *BSD platforms.
Ensure that system headers located in /usr/local/include are actually treated
as system headers by the compiler, and not as local headers which are subject
to warnings from the -Wundef compiler option and others.

(closes issue #15606)
Reported by: mvanbaak



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@210237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-04 14:51:39 +00:00
David Brooks
29f865ad17 Fixes dialplan wildcard extension taking precedence over call pickup code.
Prior to this patch, a wildcard extension in the dialplan (for example, _*.) would take
precedence over picking up a call in the channel's pickup group. This patch simply moves
the block of code handling pickup group matching to above the extension matching code.

(closes issue #14735)
Reported by: stevedavies

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@210067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-03 16:15:20 +00:00
Tilghman Lesher
ca0f026f41 Reverting index() fix, applying a different methodology, based upon developer discussions.
(related to issue #15639)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@210066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-03 16:11:29 +00:00
Tilghman Lesher
f5a5763ee9 Helps if we export the index() function.
(Related to issue #15639)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@210065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-03 15:42:10 +00:00
Tilghman Lesher
a70128e190 Apparently, some platforms don't have the index() function.
(closes issue #15639)
 Reported by: nmav


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@210064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-03 15:39:41 +00:00
Russell Bryant
ffe395f410 Resolve a valgrind warning about a read from uninitialized memory.
(issue #15396)
Reported by: aragon


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@209879 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-01 11:27:25 +00:00
Russell Bryant
a687e8c53f Modify how Playtones() is used in Milliwatt() to resolve gain issue.
When Milliwatt() was changed internally to use Playtones() so that the proper
tone was used, it introduced a drop in gain in the output signal.  So, use
the playtones API directly and specify a volume argument such that the output
matches the gain of the original Milliwatt() code.

(closes issue #15386)
Reported by: rue_mohr
Patches:
      issue_15386.rev2.diff uploaded by russell (license 2)
Tested by: rue_mohr


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@209838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-01 10:59:05 +00:00
Kevin P. Fleming
b5bea3704c Minor changes inspired by testing with latest GCC.
The latest GCC (what will become 4.5.x) has a few new warnings, that in these
cases found some either downright buggy code, or at least seriously poorly
designed code that could be improved.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@209759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-01 00:52:00 +00:00
Tilghman Lesher
e1226e2411 Publish French extra sounds
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@209315 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-28 00:12:03 +00:00
Mark Michelson
361c9a99e1 Allow for UDPTL to use only even-numbered ports if desired.
There are some VoIP providers out there that will not accept SDP
offers with odd numbered UDPTL ports. While it is my personal opinion
that these VoIP providers are misinterpreting RFC 2327, it really is
not a big deal to play along with their silly little games. Of course,
since restricting UDPTL ports to only even numbers reduces the range
of available ports by half, so the option to use only even port numbers
is off by default. A user can enable the behavior by setting
use_even_ports=yes in udptl.conf.

(closes issue #15182)
Reported by: CGMChris
Patches:
      15182.patch uploaded by mmichelson (license 60)
Tested by: CGMChris



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@209131 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-27 17:44:06 +00:00
Michiel van Baak
0f05b9b9de backport rev 205532 from trunk:
pthread_self returns a pthread_t which is not an unsigned int on all
pthread implementations. Casting it to an unsigned int fixes compiler warnings.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@208990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-27 09:56:13 +00:00
Jeff Peeler
f622e06bbe Fix logic errors from 208746
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@208923 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-27 01:18:31 +00:00
Jeff Peeler
fc5db2b241 Fix compiling under dev-mode with gcc 4.4.0.
Mostly trivial changes, but I did not know of any other way to fix the
"dereferencing type-punned pointer will break strict-aliasing rules" error
without creating a tmp variable in chan_skinny.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@208746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-25 06:19:50 +00:00
Mark Michelson
0660bfbe74 Don't impose an arbitrary limit on member lines in queues.conf
I know what some of you are thinking: "UGH! Mark, why are you using
ast_strdup and ast_free for the string when you can just use ast_strdupa
and let the memory free itself?! Have the bats been chewing on your brain
again?"

Based on past experiences, I don't like using ast_strdupa inside a loop.
It's a good way to potentially exhaust stack space. Also, since this only
happens when reloading queues, I don't think that heap allocations and
frees are going to be a huge problem.

(closes issue #15559)
Reported by: amorsen



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@208622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-24 19:24:28 +00:00
Russell Bryant
55d9c2ecaf Do not log an ERROR if autoservice_stop() returns -1.
This does not indicate an error.  A return of -1 just means that the channel
has been hung up.

(reported in #asterisk-dev)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@208592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-24 18:38:24 +00:00
Mark Michelson
38e98f42bc Only send a BYE when hanging up a channel that is up.
For cases where Asterisk sends an INVITE and receives a non 2XX final
response, Asterisk would follow the INVITE transaction by immediately
sending a BYE, which was unnecessary.

(closes issue #14575)
Reported by: chris-mac



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@208587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-24 18:26:50 +00:00
Mark Michelson
1c46ba9635 Fix a problem where a 491 response could be sent out of dialog.
This generalizes the fix for issue 13849. The initial fix corrected the
problem that Asterisk would reply with a 491 if a reinvite were received
from an endpoint and we had not yet received an ACK from that endpoint
for the initial INVITE it had sent us. This expansion also allows Asterisk
to appropriately handle an INVITE with authorization credentials if Asterisk
had not received an ACK from the previous transaction in which Asterisk had
responded to an unauthorized INVITE with a 407.

(closes issue #14239)
Reported by: klaus3000
Patches:
      14239.patch uploaded by mmichelson (license 60)
Tested by: klaus3000
	  


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@208386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-23 19:24:21 +00:00
Jeff Peeler
594a236e12 Only set the priindication setting when not performing a reload
(closes issue #14696)
Reported by: fdecher



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@208380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-23 19:19:53 +00:00
Mark Michelson
94bc859e81 Remove inaccurate XXX comment.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@208312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-23 16:29:18 +00:00
Mark Michelson
eb5f3170fc Properly handle 183 responses which do not contain an SDP.
(closes issue #15442)
Reported by: ffloimair
Patches:
      15442.patch uploaded by mmichelson (license 60)
Tested by: tkarl, ffloimair


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@208262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-23 15:43:07 +00:00
Tilghman Lesher
98dcd8946e Export symbols for functions included in our compatibility headers.
(closes issue #15556)
 Reported by: smw1218


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@208083 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-22 20:23:53 +00:00
Tilghman Lesher
5dbbf21212 Force an error if a blank is passed to QUOTE (because the documentation states the argument is not optional).
This change makes URIENCODE and QUOTE behave similarly, since the documentation
states that the argument is not optional, for both.
(closes issue #15439)
 Reported by: pkempgen
 Patches: 
       20090706__issue15439.diff.txt uploaded by tilghman (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@207945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-21 22:38:54 +00:00
Jeff Peeler
e07afa4876 Wait for wink before dialing when using E&M wink signaling
There was already code for other signaling types in dahdi_handle_event to
handle dialing if a dial operation dial string was present. Simply add
SIG_EMWINK to the list.

(closes issue #14434)
Reported by: araasch


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@207827 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-21 20:16:55 +00:00
Jeff Peeler
dca651b85d Revert r207573, this approach could potentially block for an unacceptable
amount of time.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@207786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-21 17:15:48 +00:00
Mark Michelson
e0827ae778 Document default timeout for AMI originations.
AST-224



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@207714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-21 14:26:00 +00:00
Kevin P. Fleming
75f1eaf2a1 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@207647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-21 13:04:44 +00:00
Jeff Peeler
8b940dbeb7 Wait for wink before dialing when using E&M wink signaling
This patch adds a new dahdi_wait function to specifically wait for the wink
event. If the wink is not eventually received the channel is hung up. 

(closes issue #14434)
Reported by: araasch
Patches:
      emwinkmod uploaded by araasch (license 693)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@207573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-20 23:23:18 +00:00
Mark Michelson
423a444c0b Answer video SDP offers properly when videosupport is not enabled.
Copied from Review board:

In issue 12434, the reporter describes a situation in which audio and video 
is offered on the call, but because videosupport is disabled in sip.conf, 
Asterisk gives no response at all to the video offer. According to RFC 3264, 
all media offers should have a corresponding answer. For offers we do not 
intend to actually reply to with meaningful values, we should still reply 
with the port for the media stream set to 0.

In this patch, we take note of what types of media have been offered and 
save the information on the sip_pvt. The SDP in the response will take into 
account whether media was offered. If we are not otherwise going to answer 
a media offer, we will insert an appropriate m= line with the port set to 0.

It is important to note that this patch is pretty much a bandage being 
applied to a broken bone. The patch *only* helps for situations where video 
is offered but videosupport is disabled and when udptl_pt is disabled but 
T.38 is offered. Asterisk is not guaranteed to respond to every media offer. 
Notable cases are when multiple streams of the same type are offered. 
The 2 media stream limit is still present with this patch, too.

In trunk and the 1.6.X branches, things will be a bit different since Asterisk 
also supports text in SDPs as well.

(closes issue #12434)
Reported by: mnnojd

Review: https://reviewboard.asterisk.org/r/311
Review: https://reviewboard.asterisk.org/r/313



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@207423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-20 19:39:59 +00:00
Russell Bryant
8b67a33369 Only do the chan->fdno check in ast_read() in a developer build.
I changed this check to only happen in a dev-mode build.  I also added a
comment explaining what is going on.  I also made it so that detection of
this situation does not affect ast_read() operation.

(closes issue #14723)
Reported by: seadweller


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@207360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-20 16:26:24 +00:00
Leif Madsen
6f8a1090c0 Importing release summary for 1.4.26 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26@207358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-20 15:01:23 +00:00
Leif Madsen
24fdfb5efc Update .version and ChangeLog files.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26@207357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-20 14:59:24 +00:00
Leif Madsen
cc4672542b Create release of 1.4.26 from tag 1.4.26-rc6.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26@207356 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-20 14:57:34 +00:00
Jeff Peeler
d162e4b055 Fix format specifier to print out an unsigned long long.
Yep, it's even ifdefed out code. But it made it to the RR list...

(closes issue #14726)
Reported by: lmadsen


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@207155 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-17 19:36:19 +00:00
Jeff Peeler
1e30dcf61c Enhance configuration option for overlapdial allowing direction choice
Previously overlap dialing could only be turned on or off for both incoming and
outgoing calls. New parameters incoming, outgoing, and both have been added to
allow further control. There is no change in default behavior with these new
options and allows in band DTMF to be accepted in one direction if required.

(closes issue #14471)
Reported by: eboscani



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@207092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-17 19:13:27 +00:00
David Vossel
98a6820737 sip option flags handled incorrectly
(issue #15376)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@207033 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-17 18:00:38 +00:00
David Vossel
7c82de7d7e SIP incorrect From: header information when callpres is prohib
Some ITSP make use of the "Anonymous" display name to detect a
requirement to withhold caller id across the PSTN. This does
not work if the display name is "Unknown".

(closes issue #14465)
Reported by: Nick_Lewis
Patches:
      chan_sip.c-callerpres.patch uploaded by Nick (license 657)
      chan_sip.c-callerpres_trunk.patch uploaded by dvossel (license 671)
Tested by: Nick_Lewis, dvossel



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@206938 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-17 16:05:06 +00:00
David Vossel
5510a1c74e error in iax.conf related IP-based access control
(closes issue #15518)
Reported by: pkempgen



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@206872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-16 21:33:19 +00:00
David Vossel
b1fe655954 avoid segfault caused by user error
If the CALLERPRES() dialplan function is set to nothing,
a segfault occurs.  This is user error to begin with, but
I'd rather see a cli warning message than have Asterisk
crash on me.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@206867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-16 21:24:16 +00:00
Tilghman Lesher
ed177d72d4 Fix a memory leak.
(closes issue #15517)
 Reported by: adomjan
 Patches: 
       func_realtime.c-ast_variable_destroy.diff uploaded by adomjan (license 487)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@206807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-16 16:27:35 +00:00
Richard Mudgett
7782df0963 Merged revision 206700 from
https://origsvn.digium.com/svn/asterisk/be/branches/C.2-...

..........
  Fixed chan_misdn crash because mISDNuser library is not thread safe.

  With Asterisk the mISDNuser library is driven by two threads concurrently:
  1. channels/misdn/isdn_lib.c::manager_event_handler()
  2. channels/misdn/isdn_lib.c::misdn_lib_isdn_event_catcher()

  Calls into the library are done concurrently and recursively from
  isdn_lib.c.

  Both threads can fiddle with the master/child layer3_proc_t lists.  One
  thread may traverse the list when the other interrupts it and then removes
  the list element which the first thread was currently handling.  This is
  exactly what caused the crash.  About 60 calls were needed to a Gigaset
  CX475 before it occurred once.

  This patch adds locking when calling into the mISDNuser library.
  This also fixes some cb_log calls with wrong port parameter.

  JIRA ABE-1913
      Patches: misdn-locking.patch (Modified with mostly cosmetic changes)
..........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@206706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-15 20:44:55 +00:00
Sean Bright
455ccbae20 Only print debug info in codec_dahdi if we are asking for it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@206635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-15 15:57:51 +00:00
Richard Mudgett
6db6a73b8d Fixes several call transfer issues with chan_misdn.
*  issue #14355 - Crash if attempt to transfer a call to an application.
Masquerade the other pair of the four asterisk channels involved in the
two calls.  The held call already must be a bridged call (not an
applicaton) or it would have been rejected.

*  issue #14692 - Held calls are not automatically cleared after transfer.
Allow the core to initate disconnect of held calls to the ISDN port.  This
also fixes a similar case where the party on hold hangs up before being
transferred or taken off hold.

*  JIRA ABE-1903 - Orphaned held calls left in music-on-hold.
Do not simply block passing the hangup event on held calls to asterisk
core.

*  Fixed to allow held calls to be transferred to ringing calls.
Previously, held calls could only be transferred to connected calls.
*  Eliminated unused call states to simplify hangup code.
*  Eliminated most uses of "holded" because it is not a word.

(closes issue #14355)
(closes issue #14692)
Reported by: sodom
Patches:
      misdn_xfer_v14_r205839.patch uploaded by rmudgett (license 664)
Tested by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@206487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-14 16:44:47 +00:00
Russell Bryant
8d5516a153 Merged revisions 206384 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
  r206384 | russell | 2009-07-14 09:45:47 -0500 (Tue, 14 Jul 2009) | 6 lines
  
  Ensure apathetic replies are sent out on the proper socket.
  
  chan_iax2 supports multiple address bindings.  The send_apathetic_reply()
  function did not attempt to send its response on the same socket that the
  incoming message came in on.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@206385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-14 14:48:00 +00:00
Richard Mudgett
9f3cd22c7a Fix some memory leaks in chan_misdn.
JIRA ABE-1911


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@206284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-14 00:17:28 +00:00
Leif Madsen
bb26b527fd Use autotagged externals
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26-rc6@206224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-13 18:34:55 +00:00
Leif Madsen
d5b0570bb2 Importing files for 1.4.26-rc6 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26-rc6@206223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-13 18:34:50 +00:00
Leif Madsen
6845057f96 Creating tag for the release of asterisk-1.4.26-rc6
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.26-rc6@206222 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-13 18:34:02 +00:00
Russell Bryant
df4d75f4a7 Print CID match in "show dialplan".
(closes issue #14702)
Reported by: klaus3000
Patches:
      patch_asterisk_1.4.23_CID_matching.txt uploaded by klaus3000 (license 65)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@206126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-13 15:12:08 +00:00
Mark Michelson
12b5e7706c Properly ACK 487 responses to canceled INVITEs.
From the review board request:
The fix from review 298 has exposed a new bug in chan_sip.

When we hang up an outgoing call, we first will dump all the outstanding 
packets on the sip_pvt using __sip_pretend_ack. Then, if we can, we send 
a CANCEL. The problem with this is that since destroyed all the outstanding 
packets on the dialog, we cannot match the incoming 487 response to our 
INVITE. Because we cannot match the response, we do not send an ACK.

To correct this, instead of using __sip_pretend_ack, I have changed the code 
to loop through the list of packets and call __sip_semi_ack on each one 
instead. This causes us to stop retransmitting the requests, but we still have 
them around in case we get responses for them.

When discussing this earlier today with Josh Colp, we both agreed that in the 
majority of cases, this would be enough of a fix. However, we also agreed that 
we should have a safety net in place in case we never receive a response to 
our initial INVITE. To handle this, I have modified __sip_autodestruct to 
behave similar to the way it does in Asterisk 1.4. If there are outstanding 
packets on the sip_pvt, the needdestroy flag is not set, and the last request 
on the dialog was either a CANCEL or BYE, then we set the needdestroy flag and 
reschedule destruction for 10 seconds in the future. If, though, the 
needdestroy flag is set, then we use __sip_pretend_ack to kill the remaining 
outstanding packets so that the monitor thread can destroy the sip_pvt.

I ran two separate tests. First, I placed a call from my Aastra phone to my 
Polycom phone. I hung up the Aastra before the Polycom answered. I verified 
through sip debug output that Asterisk properly ACKed the 487 received from the 
Polycom.

For my second test, I set up a SIPp UAS scenario so that it would send a 200 OK 
in response to a CANCEL but would not send a 487 for the original INVITE. I 
verified that after about 40 seconds, Asterisk properly cleans up the outgoing 
sip_pvt for the call.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@205877 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-10 17:39:13 +00:00
David Vossel
1678f43bfa SIP registration auth loop caused by stale nonce
If an endpoint sends two registration requests in a very short
period of time with the same nonce, both receive 401 responses
from Asterisk, each with a different nonce (the second 401
containing the current nonce and the first one being stale).
If the endpoint responds to the first 401, it does not match
the current nonce so Asterisk sends a third 401 with a newly
generated nonce (which updates the current nonce)... Now if
the endpoint responds to the second 401, it does not match the
current nonce either and Asterisk sends a fourth 401 with a
newly generated nonce... This loop goes on and on.

There appears to be a simple fix for this.  If the nonce from
the request does not match our nonce, but is a good response
to a previous nonce, instead of sending a 401 with a newly
generated nonce, use the current one instead.  This breaks
the loop as the nonce is not updated until a response is
received. Additional logic has been added to make sure no
nonce can be responded to twice though.

(closes issue #15102)
Reported by: Jamuel
Patches:
      patch-bug_0015102 uploaded by Jamuel (license 809)
      nonce_sip.diff uploaded by dvossel (license 671)
Tested by: Jamuel

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@205804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-10 16:23:59 +00:00
Mark Michelson
43a5245325 Ensure that outbound NOTIFY requests are properly routed through stateful proxies.
With this change, we make note of Record-Route headers present in any SUBSCRIBE
request that we receive so that our outbound NOTIFY requests will have the proper
Route headers in them.

(closes issue #14725)
Reported by: ibc



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@205775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-10 15:51:36 +00:00
Richard Mudgett
fb1c512a40 No audio on calls from Asterisk to various ISDN devices until DTMF sent by caller.
Add missing clearing of the dialing flag when the ISDN call is CONNECTED.
(i.e. When libpri generates the event PRI_EVENT_ANSWER.)

(closes issue #15420)
Reported by: scottbmilne
Patches:
      bug15420-1.4.25.1-diff2.txt uploaded by alecdavis (license 585)
Tested by: scottbmilne, alecdavis

(closes issue #15416)
Reported by: avinoash

(closes issue #15389)
Reported by: alecdavis

This patch should also fix the following issue:
(issue #15205)
Reported by: vinsik


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@205728 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-09 23:37:53 +00:00
David Vossel
259998a286 Changing ast_samp2tv to not use floating point.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@205599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-09 16:18:09 +00:00
David Vossel
beaf6217b3 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@205471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 23:15:54 +00:00
David Vossel
2e330f772c moving ast_devstate_to_extenstate to pbx.c from devicestate.c
ast_devstate_to_extenstate belongs in pbx.c.  This change
fixes a compile time error with chan_vpb as well.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@205409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 21:35:12 +00:00
Mark Michelson
16d3415cf3 Prevent phantom calls to queue members.
If a caller were to hang up while a periodic announcement or position
were being said, the return value for those functions would incorrectly
indicate that the caller was still in the queue. With these changes,
the problem does not occur.

(closes issue #14631)
Reported by: latinsud
Patches:
      queue_announce_ghost_call2.diff uploaded by latinsud (license 745)
	  (with small modification from me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@205349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 19:26:13 +00:00
Jason Parker
c43a1be4ec Update config.guess and config.sub from the savannah.gnu.org git repo.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@205288 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 18:19:03 +00:00
David Vossel
9f4c452028 ast_samp2tv needs floating point for 16khz audio
In ast_samp2tv(), (1000000 / _rate) = 62.5 when _rate is 16000.
The .5 is currently stripped off because we don't calculate
using floating points.  This causes madness with 16khz audio.

(issue ABE-1899)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@205215 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 16:53:40 +00:00
Tilghman Lesher
0b1f3adf7f Add redirection warnings for the invalid language codes previously removed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@205188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 16:26:15 +00:00
Russell Bryant
33f54353ba Make OpenSSL usage thread-safe.
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@205149 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 15:54:21 +00:00
Richard Mudgett
202f9967c6 Removed confusing warning message "Got Busy in Connected State"
If an incoming mISDN call is answered with the Answer application and a
subsequent Dial gets a busy endpoint then it is valid for that already
connected channel to get the busy indication.  Asterisk will play the busy
tones until the dialplan plays something else or hangs up the call.

(closes issue #11974)
Reported by: fvdb


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@204834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-02 21:59:43 +00:00
David Vossel
bdada0dce1 moving device state functions from pbx.h to devicestate.h to sync with other branches
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@204755 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-02 18:15:39 +00:00
David Vossel
4c99b19973 Improved mapping of extension states from combined device states.
This fixes a few issues with incorrect extension states and adds
a cli command, core show device2extenstate, to display all possible
state mappings.

(closes issue #15413)
Reported by: legart
Patches:
      exten_helper.diff uploaded by dvossel (license 671)
Tested by: dvossel, legart, amilcar

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@204681 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-02 15:05:57 +00:00
Tilghman Lesher
e8f0570118 More incorrect language codes, plus ensuring that regionalizations use the specified language, and not English for grammar.
(closes issue #15022)
 Reported by: greenfieldtech
 Patches: 
       20090519__issue15022.diff.txt uploaded by tilghman (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@204556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-30 20:23:51 +00:00
Jason Parker
b3e413e910 Fix ast_say_counted_noun to correctly handle Polish. Fix a comment typo in passing.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@204474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-30 18:47:06 +00:00
Tilghman Lesher
60270012a9 "tw" is the language specification for Twi (from Ghana) not Taiwanese.
(closes issue #15346)
 Reported by: volivier
 Patches: 
       20090617__issue15346__1.4.diff.txt uploaded by tilghman (license 14)
       20090617__issue15346__trunk.diff.txt uploaded by tilghman (license 14)
       20090617__issue15346__1.6.0.diff.txt uploaded by tilghman (license 14)
       20090617__issue15346__1.6.1.diff.txt uploaded by tilghman (license 14)
       20090617__issue15346__1.6.2.diff.txt uploaded by tilghman (license 14)
 Tested by: volivier


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@204469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-30 18:23:35 +00:00
Mark Michelson
e5bef05d8f Add error message so that it is clear why a SIP peer was not processed when
a DNS lookup fails on a host or outboundproxy.

(closes issue #13432)
Reported by: p_lindheimer
Patches:
      outboundproxy.patch uploaded by p (license 558)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@204300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-29 22:45:34 +00:00
Mark Michelson
439ce618c5 Fix build oops.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@204246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-29 21:37:05 +00:00
Mark Michelson
9589d9fb2e Fix a problem where chan_sip would ignore "old" but valid responses.
chan_sip has had a problem for quite a long time that would manifest when
Asterisk would send multiple SIP responses on the same dialog before receiving
a response. The problem occurred because chan_sip only kept track of the highest
outgoing sequence number used on the dialog. If Asterisk sent two requests out,
and a response arrived for the first request sent, then Asterisk would ignore
the response. The result was that Asterisk would continue retransmitting the
requests and ignoring the responses until the maximum number of retransmissions
had been reached.

The fix here is to rearrange the code a bit so that instead of simply comparing
the sequence number of the response to our latest outgoing sequence number, we
walk our list of outstanding packets and determine if there is a match. If there is,
we continue. If not, then we ignore the response.

In doing this, I found a few completely useless variables that I have now removed.

(closes issue #11231)
Reported by: flefoll

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@204243 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-29 21:23:43 +00:00
Tilghman Lesher
399bd49b7d Revision 189537 was supposed to make 1.4 more correct. Instead, it broke func_odbc. Reverting.
(closes issue #15317, issue #14614)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@204170 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-29 19:36:01 +00:00
David Vossel
4f3580b882 segfault after SPINLOCK schedule delete
Using the SPINLOCK schedule delete macro can result in the iax_pvt lock
being given up.  This makes it possible for the iax_pvt to dissappear
when we thought we held the mutex the entire time.  To resolve this, the
iax_pvt's ref count is incremented.

(closes issue #15377)
Reported by: aragon
Patches:
      iax_spin_issue_1.4.diff uploaded by dvossel (license 671)
Tested by: aragon, dvossel



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@204067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-29 17:04:04 +00:00
Mark Michelson
a3848ec74c Place unlock of mutex in an else block so that it does not get unlocked twice.
(closes issue #15400)
Reported by: aragon



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@204012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-29 15:04:17 +00:00
Richard Mudgett
f65dccafb6 The ISDN CPE side should not exclusively pick B channels normally.
Before this patch, Asterisk unconditionally picked B channels exclusively
on the CPE side and normally allowed alternative B channels on the network
side.  Now Asterisk does the opposite.

Reasons for the CPE side to normally not pick B channels exclusively:
*  For CPE point-to-multipoint mode (i.e. phone side), the CPE side does
not have enough information to exclusively pick B channels.  (There may be
other devices on the line.)
*  Q.931 gives preference to the network side picking B channels.
*  Some telcos require the CPE side to not pick B channels exclusively.

(closes issue #14383)
Reported by: mbrancaleoni


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@203908 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-27 00:55:12 +00:00
Jeff Peeler
fc73897bbd Make sure to recreate the dahdi pseudo channel after dahdi restart
(closes issue #14477)
Reported by: timking


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@203848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 22:09:19 +00:00
Russell Bryant
fe7923abfc Don't fast forward past the end of a message.
This is nice change for users of the voicemail application.  If someone gets a
little carried away with fast forwarding through a message, they can easily
get to the end and accidentally exit the voicemail application by hitting the
fast forward key during the following prompt.

This adds some safety by not allowing a fast forward past the end of a message.

(closes issue #14554)
Reported by: lacoursj
Patches:
      21761.patch uploaded by lacoursj (license 707)
Tested by: lacoursj


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@203785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 21:16:39 +00:00
David Brooks
64e75ecf80 Fixing voicemail's error in checking max silence vs min message length
Max silence was represented in milliseconds, yet vmminsecs (minmessage) was represented
as seconds.

Also, the inequality was reversed. The warning, if triggered, was "Max silence should 
be less than minmessage or you may get empty messages", which should have been logged 
if max silence was greater than minmessage, but the check was for less than.

Also, conforming if statement to coding guidelines.

closes issue #15331)
Reported by: markd

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@203719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 20:03:42 +00:00
Terry Wilson
5e3e234df6 I didn't see that Mark already fixed the underlying issue!
Yay for removing useless code.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@203380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-25 21:13:10 +00:00
Russell Bryant
090c2f1e4e Fix a case where CDR answer time could be before the start time involving parking.
(closes issue #13794)
Reported by: davidw
Patches:
      13794.patch uploaded by murf (license 17)
      13794.patch.160 uploaded by murf (license 17)
Tested by: murf, dbrooks


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@203375 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-25 21:02:18 +00:00
Terry Wilson
03d3fb7a7a Don't try to free NULL
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@203311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-25 20:09:15 +00:00
Mark Michelson
140d84dfc5 Prevent false positives when freeing a NULL pointer with MALLOC_DEBUG enabled.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@203230 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-25 18:52:22 +00:00
Russell Bryant
c05d6ceccd Resolve a crash related to a T.38 reinvite race condition.
This change resolves a crash observed locally during some T.38 testing.
A call was set up using a call file, and when the T.38 reinvite came in,
the channel state was still AST_STATE_DOWN.  The reason is explained by
a comment in the code that previously lived in the handling of
AST_STATE_RINGING.  This change modifies the logic to handle the same
race condition for any channel state that is not UP.

(closes ABE-1895)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@203115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-25 16:02:16 +00:00
Richard Mudgett
1ac27cf7ec Improved chan_dahdi.conf pritimer error checking.
Valid format is: pritimer=timer_name,timer_value

*  Fixed segfault if the ',' is missing.
*  Completely check the range returned by pri_timer2idx() to prevent
possible access outside array bounds.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@203036 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-24 21:01:43 +00:00
Mark Michelson
a1fa4f0391 Use the handy UNLINK macro instead of hand-coding the same thing in-line.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@202966 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-24 18:28:47 +00:00
David Vossel
d6106936cb MWI NOTIFY contains a wrong URI if Asterisk listens to non-standard port and transport
(closes issue #14659)
Reported by: klaus3000
Patches:
      patch_chan_sip_fixMWIuri_1.4.txt uploaded by klaus3000 (license 65)
      mwi_port-transport_trunk.diff uploaded by dvossel (license 671)
Tested by: dvossel, klaus3000

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@202671 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-23 16:28:46 +00:00
Mark Michelson
f76b499923 Fix more memory leaks that may result if rtp is not successfully allocated.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@202601 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-23 15:22:35 +00:00
Mark Michelson
b0c0c17764 Fix potential memory leak in chan_sip when video rtp is not allocated properly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@202572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-23 15:08:27 +00:00
Russell Bryant
72b285ed96 Report CallerID change during a masquerade.
Reported by: markster


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@202496 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-22 20:08:53 +00:00
Russell Bryant
dcfd8d7c7c Make Polycom subscription type override check more explicit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@202414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-22 16:00:00 +00:00
Mark Michelson
26ba38b8f4 Remove an extra debug line left from previous commit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@202342 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-22 14:44:58 +00:00
Mark Michelson
d31f78a172 Fix a situation in which Asterisk would not stop retransmitting 487s.
If a CANCEL were received by Asterisk, we would send a 487 in response
to the original INVITE and a 200 OK for the CANCEL. If there were a network
hiccup which caused the 200 OK and the 487 to be lost, then the UA communicating
with Asterisk may try to retransmit its CANCEL. Asterisk's response to this used
to be to try sending another 487 to the canceled INVITE and another 200 OK to the
CANCEL.

The problem here is that the originally-sent 487 was sent "reliably" meaning that
it will be retransmitted until it is received properly. So when we receive the second
CANCEL it is likely that the first batch of 487s we sent is still going strong and
reaches the UA. The result was that the second set of 487s would be retransmitted
constantly until the maximum number of retries had been reached.

The fix for this is that if we receive a second CANCEL for an INVITE, then we cancel
the retransmission of the first set of 487s and start a second set. This causes the
dialog to be terminated reasonably.

(closes issue #14584)
Reported by: klaus3000
Patches:
      14584_v2.patch uploaded by mmichelson (license 60)
Tested by: klaus3000



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@202341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-22 14:42:55 +00:00
Mark Michelson
1f7d3e9a01 Fix a possible infinite loop in SDP parsing during glare situation.
There was a while loop in get_ip_and_port_from_sdp which was controlled
by a call to get_sdp_iterate. The loop would exit either if what we were
searching for was found or if the return was NULL. The problem is that
get_sdp_iterate never returns NULL. This means that if what we were searching
for was not present, the loop would run infinitely. This modification of the
loop fixes the problem.

(closes issue #15213)
Reported by: schmidts

(closes issue #15349)
Reported by: samy

(closes issue #14464)
Reported by: pj

(closes issue #15345)
Reported by: aragon
Patches:
      sip_inf_loop.patch uploaded by mmichelson (license 60)
Tested by: aragon



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@202336 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-22 14:34:05 +00:00
Sean Bright
f543251260 Since we don't have sip_pvt_lock() in 1.4, we need to use ast_mutex_* directly.
(closes issue #15366)
Reported by: loloski


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@202153 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-20 17:51:41 +00:00
Matthew Nicholson
e735cdc36b Added deadlock protection to try_suggested_sip_codec in chan_sip.c.
Review: https://reviewboard.asterisk.org/r/287/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@202022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-19 21:21:15 +00:00
David Vossel
f17d5d22d2 timestamp was being converted to host order as a short rather than a long
(closes issue #15361)
Reported by: ffloimair
Patches:
      ts_issue.diff uploaded by dvossel (license 671)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@201993 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-19 20:22:02 +00:00
Tilghman Lesher
5757b115b3 If the "h" extension fails, give it another chance in main/pbx.c.
If the "h" extension fails, give it another chance in main/pbx.c, when it
returns from the bridge code.  Fixes an issue where the "h" extension may
occasionally not fire, when a Dial is executed from a Macro.
Debugged in #asterisk with user tompaw.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@201828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-19 00:40:41 +00:00
Russell Bryant
fce4a98f7c 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@201600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-18 15:24:31 +00:00
Mark Michelson
03909de702 Change the datastore traversal in ast_do_masquerade to use a safe list traversal.
It is possible for datastore fixup functions to remove the datastore from the list
and free it. In particular, the queue_transfer_fixup in app_queue does this. While
I don't yet know of this causing any crashes, it certainly could.

Found while discussing a separate issue with Brian Degenhardt.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@201450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-17 19:59:31 +00:00
David Vossel
86c204f34c StopMixMonitor race condition (not giving up file immediately)
StopMixMonitor only indicates to the MixMonitor thread to stop
writing to the file.  It does not guarantee that the recording's
file handle is available to the dialplan immediately after execution.
This results in a race condition.  To resolve this, the filestream
pointer is placed in a datastore on the channel. When StopMixMonitor
is called, the datastore is retrieved from the channel and the
filestream is closed immediately before returning to the dialplan.
Documentation indicating the use of StopMixMonitor to free files
has been updated as well.

(closes issue #15259)
Reported by: travisghansen
Tested by: dvossel

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@201423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-17 19:28:12 +00:00
David Brooks
ebe2c1829b Checks for NULL sip_pvt pointer in chan_sip.c->acf_channel_read()
Zombie channels could be passed, and chan_sip.c wasn't checking for it.
Could crash Asterisk. Now checking for NULL pointer.

(closes issue #15330)
Reported by: okrief
Tested by: dbrooks


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@201380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-17 18:45:50 +00:00
Kevin P. Fleming
b8417b571b Correct AST_LIST_APPEND_LIST behavior when list to be appended is empty.
When the list to be appended is empty, and the list to be appended to is *not*,
AST_LIST_APPEND_LIST would actually cause the target list to become broken,
and no longer have a pointer to its last entry. This patch fixes the problem.

(reported by Stanislaw Pitucha on the asterisk-dev mailing list)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@201261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-17 12:03:25 +00:00
Kevin P. Fleming
94fa4d11b5 Improve support for media paths that can generate multiple frames at once.
There are various media paths in Asterisk (codec translators and UDPTL, primarily)
that can generate more than one frame to be generated when the application calling
them expects only a single frame. This patch addresses a number of those cases,
at least the primary ones to solve the known problems. In addition it removes the
broken TRACE_FRAMES support, fixes a number of bugs in various frame-related API
functions, and cleans up various code paths affected by these changes.

https://reviewboard.asterisk.org/r/175/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@200991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-16 17:05:38 +00:00
Eliel C. Sardanons
a42ff13c97 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@200875 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-16 13:25:51 +00:00
Mark Michelson
c946be82a9 Add INFO to our allowed methods so that endpoints know they may send it to us.
AST-223



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@200513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15 15:21:46 +00:00
Mark Michelson
af2e7f5eab Suppress a warning message and give a better return code when generating
inband ringing after a call is answered.

(closes issue #15158)
Reported by: madkins
Patches:
      15158.patch uploaded by mmichelson (license 60)
Tested by: madkins



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@200360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-12 19:06:41 +00:00
Sean Bright
a34f50f08b Backport fix for parallel build warnings from trunk r199781.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@200185 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-11 22:20:31 +00:00
Leif Madsen
c5ee7242d8 Fix path for .flavor and .version.
(issue #14737)
Reported by: davidw
Patches:
      flavor.patch uploaded by davidw (license 780)
Tested by: davidw


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@200037 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-11 12:12:06 +00:00
Sean Bright
035b942a7a __WORDSIZE is not available on all platforms, so use sizeof(void *) instead.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@199856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-10 16:08:35 +00:00
Sean Bright
aea9d7d060 Fix a typo in the stack size calculation just introduced.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@199628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-08 19:28:33 +00:00
Sean Bright
0d849d509d Increase the size of our thread stack on 64 bit processors.
We were setting the stack size for each thread to 240KB regardless of
architecture, which meant that in some scenarios we actually had less available
stack space on 64 bit processors (pointers use 8 bytes instead of 4).  So now we
calculate the stack size we reserve based on the platform's __WORDSIZE, which
gives us:

     32 bit -> 240KB
     64 bit -> 496KB
    128 bit -> 1008KB (that's right, we're ready for 128 bit processors)

Patch typed by me but written by several members of #asterisk-dev, including
Kevin, Tilghman, and Qwell.

(closes issue #14932)
Reported by: jpiszcz
Patches:
      06052009_issue14932.patch uploaded by seanbright (license 71)
Tested by: seanbright


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@199626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-08 19:24:32 +00:00
David Vossel
d3bea6da02 Fixes issue with hints giving unexpected results.
Hints with two or more devices that include ONHOLD gave unexpected results.

(closes issue #15057)
Reported by: p_lindheimer
Patches:
      onhold_trunk.diff uploaded by dvossel (license 671)
      pbx.c.1.4.patch uploaded by p (license 558)
      devicestate.c.trunk.patch uploaded by p (license 671)
Tested by: p_lindheimer, dvossel

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@199297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-05 21:19:56 +00:00
David Vossel
ed94be12f0 Additional updates to AST-2009-001
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@199138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-04 19:00:15 +00:00
Sean Bright
7605487610 Safely handle AMI connections/reload requests that occur during startup.
During asterisk startup, a lock on the list of modules is obtained by the
primary thread while each module is initialized.  Issue 13778 pointed out a
problem with this approach, however.  Because the AMI is loaded before other
modules, it is possible for a module reload to be issued by a connected client
(via Action: Command), causing a deadlock.

The resolution for 13778 was to move initialization of the manager to happen
after the other modules had already been lodaded.  While this fixed this
particular issue, it caused a problem for users (like FreePBX) who call AMI
scripts via an #exec in a configuration file (See issue 15189).

The solution I have come up with is to defer any reload requests that come in
until after the server is fully booted.  When a call comes in to
ast_module_reload (from wherever) before we are fully booted, the request is
added to a queue of pending requests.  Once we are done booting up, we then
execute these deferred requests in turn.

Note that I have tried to make this a bit more intelligent in that it will not
queue up more than 1 request for the same module to be reloaded, and if a
general reload request comes in ('module reload') the queue is flushed and we
only issue a single deferred reload for the entire system.

As for how this will impact existing installations - Before 13778, a reload
issued before module initialization was completed would result in a deadlock.
After 13778, you simply couldn't connect to the manager during startup (which
causes problems with #exec-that-calls-AMI configuration files).  I believe this
is a good general purpose solution that won't negatively impact existing
installations.

(closes issue #15189)
(closes issue #13778)
Reported by: p_lindheimer
Patches:
      06032009_15189_deferred_reloads.diff uploaded by seanbright (license 71)
Tested by: p_lindheimer, seanbright

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@199022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-04 14:14:57 +00:00
Sean Bright
f3b85fface Fix a possible crash in pbx_spool.
We were trying to reference members of a struct that had previously been freed.
This patch makes sure that we free the struct after it has been removed from
the spooler queue.

(closes issue #15072)
Reported by: garlew
Patches:
      spool.diff uploaded by garlew (license 376)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@198957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-03 20:39:10 +00:00
David Vossel
ddb4e3f2e7 Generic call forward api, ast_call_forward()
The function ast_call_forward() forwards a call to an extension specified in an ast_channel's call_forward string.  After an ast_channel is called, if the channel's call_forward string is set this function can be used to forward the call to a new channel and terminate the original one.  I have included this api call in both channel.c's ast_request_and_dial() and res_feature.c's feature_request_and_dial().  App_dial and app_queue already contain call forward logic specific for their application and options.

(closes issue #13630)
Reported by: festr

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@198891 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-03 15:49:46 +00:00
Tilghman Lesher
af31809bcf If using the old deprecated format, a reload would cause the class to disappear.
(closes issue #14759)
 Reported by: lidocaineus
 Patches: 
       20090518__issue14759.diff.txt uploaded by tilghman (license 14)
 Tested by: lmadsen


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@198665 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-01 20:07:04 +00:00
Sean Bright
8fc78eae7a 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@198370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-30 19:36:20 +00:00
Russell Bryant
e86b26f1a8 Fix a crash that occurred when MWI SMDI messages expired.
(closes issue #14561)
Reported by: cmoss28


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@198311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-30 03:42:46 +00:00
Sean Bright
48253ef901 Treat an empty FORWARD_CONTEXT the same way we treat a missing one.
(closes issue #15056)
Reported by: p_lindheimer
Patches:
      05292009_bug15056.diff uploaded by seanbright (license 71)
Tested by: p_lindheimer


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@198251 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-30 02:46:41 +00:00
Matthew Nicholson
aa2fd9a4c2 Use AST_CDR_NOANSWER instead of AST_CDR_NULL as the default CDR disposition.
This change also involves the addition of an AST_CDR_FLAG_ORIGINATED flag that is used on originated channels to distinguish: them from dialed channels.

(closes issue #12946)
Reported by: meral
Patches:
      null-cdr2.diff uploaded by mnicholson (license 96)
Tested by: mnicholson, dbrooks

(closes issue #15122)
Reported by: sum
Tested by: sum



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@198068 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-29 18:53:01 +00:00
Sean Bright
be8d983874 Fix 'make config' target for Slackware.
There was a missing semi-colon after the echo statement in the Makefile that was
causing problems for some users.  Fix suggested by reporter.

(closes issue #15225)
Reported by: pdavis


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@197998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-29 18:14:12 +00:00
Leif Madsen
ad5f20b94b Update MixMonitor documentation.
Updated the MixMonitor documentation for the 'b' option so that
it is more obvious that you must not optimize awat the Local
channel when using this option.

(issue #14829)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@197895 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28 23:57:00 +00:00
David Vossel
67928d88a9 'iax show peer blah' now outputs whether or not peer 'blah' is in trunk mode or not.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@197620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28 15:51:52 +00:00
Mark Michelson
590408dca3 Allow for media to arrive from an alternate source when responding to a reinvite with 491.
When we receive a SIP reinvite, it is possible that we may not be able to process the
reinvite immediately since we have also sent a reinvite out ourselves. The problem is
that whoever sent us the reinvite may have also sent a reinvite out to another party,
and that reinvite may have succeeded.

As a result, even though we are not going to accept the reinvite we just received, it
is important for us to not have problems if we suddenly start receiving RTP from a new
source. The fix for this is to grab the media source information from the SDP of the
reinvite that we receive. This information is passed to the RTP layer so that it will
know about the alternate source for media.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@197588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28 15:27:49 +00:00
Eliel C. Sardanons
26cec158af Use the address we already know when reloading a peer with nat=yes.
If we already have an address for a peer, and we are reloading the sip
configuration, try to use that address to contact the peer, instead of
getting it from the Contact.

(closes issue #15194)
Reported by: ibc
Patches:
      sip.patch uploaded by eliel (license 64)
      Tested by: manwe



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@197562 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28 15:21:32 +00:00
Mark Michelson
3268149a1f Add flags to chanspy audiohook so that audio stays in sync.
There are two flags being added to the chanspy audiohook here. One
is the pre-existing AST_AUDIOHOOK_TRIGGER_SYNC flag. With this set,
we ensure that the read and write slinfactories on the audiohook do
not skew beyond a certain tolerance.

In addition, there is a new audiohook flag added here,
AST_AUDIOHOOK_SMALL_QUEUE. With this flag set, we do not allow for
a slinfactory to build up a substantial amount of audio before 
flushing it. For this particular issue, this means that the person 
spying on the call will hear the conversations in real time with very 
little delay in the audio.

(closes issue #13745)
Reported by: geoffs
Patches:
      13745.patch uploaded by mmichelson (license 60)
Tested by: snblitz



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@197537 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28 14:49:13 +00:00
Joshua Colp
eb2a672328 Fix a bug where the flag indicating the presence of rport would get overwritten by the nat setting.
The presence of rport is now stored as a separate flag. Once the dialog is setup and authenticated
(or it passes through unauthenticated) the proper nat flag is set.

(closes issue #13823)
Reported by: dimas


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@197466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28 13:44:58 +00:00
Sean Bright
ad4de8c79c Use bash explicitly when calling build_tools/mkpkgconfig from the Makefile.
Since we use bashisms in build_tools/mkpkgconfig, we should call on bash
explicitly when running from the Makefile, otherwise we get errors during a
'make install.'

(closes issue #15209)
Reported by: seandarcy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@197264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-27 20:12:06 +00:00
Olle Johansson
59a69ff380 Typo fix
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@197259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-27 20:07:04 +00:00
Tilghman Lesher
292448fd86 Use a different determinator on whether to print the delimiter, since leading fields may be blank.
(closes issue #15208)
 Reported by: ramonpeek
 Patch by me, though inspired in part by a patch from ramonpeek


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@197194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-27 19:09:42 +00:00
Jeff Peeler
829907e467 Fix broken attended transfers
The bridge was terminating immediately after the attended transfer was 
completed. The problem was because upon reentering ast_channel_bridge
nexteventts was checked to see if it was set and if so could possibly
return AST_BRIDGE_COMPLETE.

(closes issue #15183)
Reported by: andrebarbosa
Tested by: andrebarbosa, tootai, loloski



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@197124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-27 16:49:38 +00:00
Sean Bright
a2fd7f4e47 Fix handling of the 'state_interface' option of the 'queue add member' CLI
command.

This change relates to r184980, which was a backport of the state interface
changes to app_queue from trunk.  trunk and all of the 1.6.x branches are not
affected.

'queue add member' allows for specifying an interface to use for device state
when adding a queue member via CLI, but the validation code was not properly
updated to reflect this optional argument.

(closes issue #15198)
Reported by: loloski
Patches:
      05272009_app_queue.diff uploaded by seanbright (license 71)
Tested by: loloski


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@197024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-27 13:54:35 +00:00
Russell Bryant
245950ad00 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@196826 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-26 18:14:36 +00:00
Joshua Colp
aca2aadbfa Remove some bash specific stuff from safe_asterisk.
(closes issue #10812)
Reported by: paravoid
Patches:
      safe_asterisk_bashism.diff uploaded by tzafrir (license 46)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@196657 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-26 13:06:09 +00:00
Joshua Colp
e79b7e3c8d Fix a bug where using immediate with mISDN caused a cause code of 16 to get sent back instead of 1 if the 's' extension did not exist.
(closes issue #12286)
Reported by: lmamane


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@196116 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-22 13:54:17 +00:00
David Vossel
620bae6924 Sign problem calculating timestamp for iax frame leads to no audio on the receiving peer.
There are rare cases in which a frame's delivery timestamp is slightly less than the iax2_pvt's offset.  This causes the pvt's timestamp to be a small negative number, but since the timestamp value is unsigned it looks like a huge positive number.  This patch checks for this negative case and sets the ms to zero.  A similar check is already done right below this one in the 'else' statement.

(closes issue #15032)
Reported by: guillecabeza
Patches:
      chan_iax2.c.patch_timestamp uploaded by guillecabeza (license 380)
Tested by: guillecabeza

(closes issue #14216)
Reported by: Andrey Sofronov



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@195991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21 19:04:56 +00:00
Matthew Nicholson
df4812c96e This commit prevents cdr records with AST_CDR_FLAG_ANSLOCKED and AST_CDR_FLAG_LOCKED from being updated in certain cases.
This is accomplished by adding two functions to update the answer time and disposition of calls that checks for the proper lock flags.  These functions are used in the ast_bridge_call() function so that ForkCDR(A) calls are respected.

This patch also modifies the way ast_bridge_call() chooses the cdr record to base the bridged_cdr on.  Previously the first unlocked cdr record would be chosen, now instead the first cdr record is chosen and forked cdr records are moved to the bridge_cdr.  This allows the original cdr record and any forked cdr records to be properly updated with answer and end times.

(closes issue #13797)
Reported by: sh0t
Tested by: sh0t

(closes issue #14744)
Reported by: deepesh


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@195881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21 15:25:50 +00:00
Joshua Colp
91843c8c58 Fix some code that wrongly assumed a pointer would always be non-NULL when dealing with CDRs after a bridge.
(closes issue #15079)
Reported by: barryf


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@195688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-20 17:30:25 +00:00
Joshua Colp
65494bfdf7 Fix a bug where the MeetMe option 'D' did not actually prompt for the pin.
(closes issue #15050)
Reported by: pmhaddad


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@195635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-20 17:14:00 +00:00
Tilghman Lesher
6de96b9120 Ensure thread keys are initialized before attempting to access them.
(closes issue #14889)
 Reported by: jaroth
 Patches: 
       app_voicemail.c.patch uploaded by msirota (license 758)
 Tested by: msirota, BlargMaN


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@195520 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-19 20:12:20 +00:00
Joshua Colp
64c1093e14 Fix a bug where direct RTP setup would partially occur even when disabled if the calling channel was answered.
(issue #13545)
Reported by: davidw
(issue #14244)
Reported by: mbnwa


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@195448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-19 14:41:45 +00:00
Tilghman Lesher
efb22ba096 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@195366 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-18 20:24:13 +00:00
Joshua Colp
ee5ca5fb33 Fix a typo which caused loss of audio when using G729 in some scenarios with a smoother present.
(closes issue #15105)
Reported by: bamby
Patches:
      process-vad-correctly.diff uploaded by bamby (license 430)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@195206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-18 15:51:22 +00:00
Joshua Colp
ac71a26c0f Fix a bug where the codecs of the called party leg were not properly sent back to the caller call leg when reinvited.
(closes issue #13569)
Reported by: bkw918


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@195095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-18 13:53:39 +00:00
Russell Bryant
85483848d0 Don't try to unlock a bogus channel.
(closes issue #15144)
Reported by: cristiandimache


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@195020 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-18 12:57:46 +00:00
David Vossel
ca3481edb9 IAX2 REGAUTH loop
IAX was not sending REGREJ to terminate invalid registrations.  Instead it sent another REGAUTH if the authentication challenge failed.  This caused a loop of REGREQ and REGAUTH frames.

(Related to Security fix AST-2009-001)

(closes issue #14867)
Reported by: aragon
Tested by: dvossel

(closes issue #14717)
Reported by: mobeck
Patches:
      regauth_loop_update_patch.diff uploaded by dvossel (license 671)
Tested by: dvossel



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@194873 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-15 22:43:13 +00:00
Russell Bryant
5b9004d067 Fix some spelling fail.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@194764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-15 18:43:18 +00:00
David Vossel
1e410cdfc5 Update to previous IAX2 "Ghost" Channels patch.
Fixed some comments made on reviewboard for the previous patch.

(issue #14207)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@194685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-15 15:40:37 +00:00
David Vossel
616674ae68 IAX2 "Ghost" Channels
There is a bug tracker issue where people are reporting "Ghost" channels in their 'iax2 show channels' output.  The confusion is caused by channels being listed as "(NONE)" with format "unknown".  These are not channels of coarse.  They are usually just pending registration or poke requests, but it is confusing output.  To help make sense of this I have added two columns to 'iax2 show channels'.  One shows the first message which started the transaction, and the second shows the last message sent by either side of the call.  This helps diagnose why the entry exists and why it may not go away.

(closes issue #14207)
Reported by: clive18

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@194557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-14 22:59:43 +00:00
Kevin P. Fleming
9a14ec91a7 Update URL to Reviewboard
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@194509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-14 22:23:49 +00:00
Mark Michelson
7aa29c797a Fix a race condition where a reinvite could trigger a 482 response.
The loop detection/spiral detection code in chan_sip used the owner
channel's state as a criterion for determining if the incoming INVITE
is a looped request. The problem with this is that the INVITE-handling
code happens in a different thread than the thread that marks the owner
channel as being up. As a result, if a reinvite were to come in very quickly,
say from another Asterisk on the same LAN, it was possible for the reinvite
to arrive before the owner channel had been set to the up state.

This patch corrects the problem by using the invitestate of the sip_pvt
instead, since that can be guaranteed to be set correctly by the time
the reinvite arrives. Since there is a switch statement further in the
INVITE-handling code, the AST_STATE_RINGING state also checks the invitestate
of the sip_pvt in case we should actually be treating the channel as if it were
up already.

(closes issue #12215)
Reported by: jpyle
Patches:
      12215_confirmed.patch uploaded by mmichelson (license 60)
Tested by: lmadsen



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@194484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-14 22:17:55 +00:00
Mark Michelson
7189d75805 Remove an extraneous unlocking operation from ast_channel_free.
In the case that we could not remove the desired channel from the
list of channels, there was an extra call to unlock the channel list.
Since we unlock the list later on in the function anyway, this results
in the list being unlocked twice yet only being locked once.

(closes issue #15098)
Reported by: tim_ringenbach
Patches:
      remove_extra_unlock.diff uploaded by tim (license 540)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@194356 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-13 19:41:44 +00:00
Doug Bailey
0e29c52c46 Pull in a piece of murf's 88166 patch that makes it safe to call
pbx_substitute_variables_helper_full with a non-zero'd buffer 



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@194322 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-13 16:18:36 +00:00
Joshua Colp
0a55b56dc8 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@194208 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-13 13:38:01 +00:00
Tilghman Lesher
c23d9c8960 Fix logic for how to proceed with a single digit extension.
(closes issue #15091)
 Reported by: andrew
 Patches: 
       20090512__issue15091.diff.txt uploaded by tilghman (license 14)
 Tested by: andrew


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@194137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-13 00:52:03 +00:00
Matthew Nicholson
bec8573c37 This change modifies app_queue to properly generate CDR records in failure
situations.

This involves setting a proper cdr disposition coresponding to the given
failure condition and ensuring the proper information is stored in the cdr
record.

(closes issue #13691)
Reported by: dferrer
Tested by: mnicholson

(closes issue #13637)
Reported by: atis
Tested by: atis



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@194028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-12 22:15:45 +00:00
Tilghman Lesher
f6ba2472bd Avoid initializing routines if the authentication fails. Fixes a crash (RR) issue.
(closes issue #14508)
 Reported by: tiziano
 Patches: 
       20090221_2_wrongmailbox.diff.txt uploaded by tiziano (license 377)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@193955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-12 20:39:21 +00:00
Mark Michelson
63c0dca7bd Set the invitestate to INV_CANCELLED only if we are actually sending a SIP CANCEL.
The problem was that the hangup code was setting the invitestate too early. The result of
this was that we would always send a CANCEL request, even if it was not an appropriate
time to do so (e.g. we have not yet received a provisional response for our INVITE).

Note that this same fix had been applied to trunk and the 1.6.X branches starting with
revision 155467. This is why you will see this revision being blocked from those places.

AST-216



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@193880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-12 18:18:44 +00:00
Tilghman Lesher
8425d87bdf Move 300 bytes around on the stack, to make more room for an extension buffer.
This allows more concurrent extensions to be copied for a single voicemail,
without creating a possibility of upsetting existing users, where a dialplan
could run out of stack space where it had run fine before.  Alternatively,
we could have allocated off the heap, but that is a larger change and would
have increased the chance for instability introduced by this change.

This is really solved starting in 1.6.0.11, as the use of an ast_str buffer
allows an unlimited number of extensions (up to available memory).  We
additionally create a new warning message when the buffer length is exceeded,
permitting administrators to see an issue after the fact, whereas previously
the list was silently truncated.
(closes issue #14739)
 Reported by: p_lindheimer
 Patches: 
       20090417__bug14739.diff.txt uploaded by tilghman (license 14)
 Tested by: p_lindheimer


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@193755 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-11 22:48:20 +00:00
Richard Mudgett
4d64b0c937 Sent wrong message to clear a call we started if the other end has not responed yet.
In the state MISDN_CALLING (i.e. SETUP was sent but no answer has arrived yet),
it is not allowed to clear the call with RELEASE_COMPLETE.  It must be
cleared with DISCONNECT.  A RELEASE_COMPLETE is only allowed as an answer
to a SETUP.  (See Q.931 ch. 5.3.2, 5.3.2.a, 5.3.2.b)

Patches:
    chan-misdn-ccstate7.patch uploaded by customer.

JIRA ABE-1862


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@193613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-11 19:09:00 +00:00
Leif Madsen
b0c91953cf Document CHANNEL(transfercapability) in CLI documentation.
(issue #15073)
Reported by: pkempgen
Patches:
      20090511__issue15073.diff.txt uploaded by tilghman (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@193544 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-11 17:35:17 +00:00
Matthew Nicholson
4c8e4a2969 Set the proper disposition on originated calls.
(closes issue #14167)
Reported by: jpt
Patches:
      call-file-missing-cdr2.diff uploaded by mnicholson (license 96)
Tested by: dlotina, rmartinez, mnicholson


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@193391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-08 21:01:25 +00:00
David Vossel
3d0faa34ca "misdn show config" segfaults asterisk, if no MSN lists
(closes issue #14976)
Reported by: alecdavis
Patches:
      misdn_config.diff.txt uploaded by alecdavis (license 585)
Tested by: alecdavis, FabienToune



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@193262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-08 14:51:09 +00:00
Kevin P. Fleming
58b5a85e80 Make absolute paths for logger channels work properly
(Note: This is not a new feature, it was previously undocumented and broken.)

The Asterisk logger has a feature to support absolute pathnames for logger channels, but the code implementing the feature was broken. This has been fixed, and the absolute path feature is now documented in the sample logger.conf.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@193193 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-08 14:03:28 +00:00
Tilghman Lesher
6a5cbae87f Fix Background within a Macro for FreePBX.
If the single digit DTMF is an extension in the specified context, then
go there and signal no DTMF.  Otherwise, we should exit with that DTMF.
If we're in Macro, we'll exit and seek that DTMF as the beginning of an
extension in the Macro's calling context.  If we're not in Macro, then
we'll simply seek that extension in the calling context.  Previously,
someone complained about the behavior as it related to the interior of a
Gosub routine, and the fix (#14011) inadvertently broke FreePBX
(#14940).  This change should fix both of these situations, but with the
possible incompatibility that if a single digit extension does not exist
(but a longer extension COULD have matched), it would have previously
gone immediately to the "i" extension, but will now need to wait for a
timeout.
(closes issue #14940)
 Reported by: p_lindheimer
 Patches: 
       20090420__bug14940.diff.txt uploaded by tilghman (license 14)
 Tested by: p_lindheimer


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@193119 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-07 23:41:11 +00:00
Richard Mudgett
0971bac5bc Give a more helpful message when an incoming call's dialed extension does not match.
Added the dialed extension and context to the chan_misdn messages warning
that the dialed number cannot be matched in the dialplan.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@193050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-07 22:17:06 +00:00
Tilghman Lesher
c57efbe571 Eliminate repetition of fullcontact during reconstruction.
If the fullcontact field appears in both the sippeers and the
sipregs table, then during reconstruction of the field, it will
otherwise be doubled.
(closes issue #14754)
 Reported by: Alexei Gradinari
 Patches: 
       20090506__bug14754.diff.txt uploaded by tilghman (license 14)
 Tested by: lmadsen


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@192932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-07 16:29:08 +00:00
Jeff Peeler
84f708474a Make ParkedCall application stop execution of the dialplan after hang up
Just changed park_exec to always return non-zero. I really wasn't entirely sure
at first if this was a bug. Decided it was since it would be surprising when 
not using ParkedCall in the dialplan to hang up and have dialplan execution
continue.

(closes issue #14555)
Reported by: francesco_r


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@192858 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-06 22:15:19 +00:00
Joshua Colp
202bc9464e Update some old logic to stop both begin and end DTMF frames from reaching the core if rfc2833 is not enabled.
(closes issue #15036)
Reported by: dimas
Patches:
      v1-15036.patch uploaded by dimas (license 88)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@192633 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-06 13:30:51 +00:00
Sean Bright
c489a2f6a3 Fix Javascript error when using astman.js in Internet Explorer.
Internet Explorer (tested with 7.0) does not like trailing commas on constructs
like object initializers, so get rid of them to avoid some errors.

(closes issue #15026)
Reported by: rajnishgiri
Patches:
      bug15026.patch uploaded by seanbright (license 71)
Tested by: seanbright


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@192524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-05 19:56:11 +00:00
Joshua Colp
385e28f532 Fix an incorrect assumption that certain values on the channel will always exist when they may not.
The CDR code involved with bridges wrongly assumed that the currently executing application and data
values will always exist. It is possible for this to be false when call forwarding is involved.

(closes issue #14984)
Reported by: gincantalupo


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@192454 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-05 18:22:27 +00:00
Joshua Colp
6b15b32783 Fix a bug where the followme application would continue trying numbers after the caller hung up.
(closes issue #13624)
Reported by: sgenyuk


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@192429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-05 17:43:30 +00:00
David Vossel
dcb712422a global mohinterpret setting is ignored
mohinterpret and mohsuggest global variables were not copied over during build_users and build_peers.

(closes issue #14728)
Reported by: dimas
Patches:
      v1-14728.patch uploaded by dimas (license 88)
Tested by: dimas, dvossel



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@192213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-04 22:37:31 +00:00
Mark Michelson
b67282e2fd Fix a bug which resulted from the Hebrew voicemail commit.
This fixes a case where a certain message could get played twice.

(closes issue #13155)
Reported by: greenfieldtech
Patches:
      app_voicemail.c.multi-lang-patch uploaded by greenfieldtech (license 369)
Tested by: greenfieldtech



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@191778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-02 18:48:20 +00:00
Mark Michelson
972d9bf53c Kevin has informed me that thi sort of thing is not necessary.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@191629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-02 10:45:24 +00:00
Mark Michelson
85a8916552 Move static buffers to outside for loops in app_chanspy.
Similar to seanbright's commit 191422, this moves some static buffers
to be defined outside of for loops since it is undefined if memory
will be re-used or if the stack will grow with each iteration of the
loop.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@191628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-02 10:21:00 +00:00
Tilghman Lesher
c2d8897257 SIP Response 410 maps to cause code 22 (or 23), not 1.
(closes issue #14993)
 Reported by: BigJimmy
 Patches: 
       causepatch uploaded by BigJimmy (license 371)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@191559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-01 20:00:23 +00:00
Jeff Peeler
98c23ee3cf Fix DTMF not being sent to other side after a partial feature match
This fixes a regression from commit 176701. The issue was that
ast_generic_bridge never exited after the feature digit timeout had elapsed,
which prevented the queued DTMF from being sent to the other side.

This issue was reported to me directly.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@191488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-01 17:40:46 +00:00
Sean Bright
b5ec450104 Move the defintion of the a couple arrays out of loops.
According to Kevin, it is unspecified as to whether a variable defined inside
a block is allocated once by the compiler or for each pass through the block
(loops being the only interesting case), so just define these before we get
into our loop to be sure.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@191422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-01 15:42:48 +00:00
Tilghman Lesher
f8b1da1872 Allow H.323 to compile with FDLEAK checking enabled.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@191220 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-29 23:10:54 +00:00
David Brooks
4a734fd926 Patch to fix tab-completion crash on "remove extension"
This patch simply removes some old code back before Asterisk used editline. 
This fixes the crash that occurred when tab-completing "remove extension".

(closes issue #14689)
Reported by: isaacgal


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@191096 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-29 18:07:59 +00:00
Sean Bright
603a56aa69 Fix a crash in app_queue with very long member lists.
A user reported via #asterisk that with very long lists of members, a crash
occurs in ast_strdupa, so just use a single buffer and ast_copy_string instead
of stack allocating copys of each interface name.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@191041 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-29 15:23:07 +00:00
Kevin P. Fleming
7c82c2b240 Fix 'inconsistent line endings' when autoconf 2.63 is used
Attempt to make configure script regeneration 'safe' using autoconf 2.63, which embeds a bare CR into the script, thus making Subversion complain about inconsistent line endings

This commit changes the MIME type of the configure script to be 'binary' thus making Subversion no longer inspect line endings, and as a bonus 'svn diff' will no longer try to generate diff output for it, which is not generally useful anyway.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@190721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-27 19:29:46 +00:00
Russell Bryant
1c1d4a80e0 Fix a typo from 190661.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@190662 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-27 19:03:59 +00:00
Russell Bryant
8798a0f9dd 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)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@190661 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-27 19:00:54 +00:00
Russell Bryant
03eb22fe76 Remove a bogus ast_channel_unlock().
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@190356 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-23 21:07:07 +00:00
Joshua Colp
a8a55273cf Fix a bug in chan_local glare hangup detection.
If both sides of a Local channel were hung up at around the same time it was
possible for one thread to destroy the local private structure and have the other thread
immediately try to remove the already freed structure from the local channel list.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@190286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-23 19:13:18 +00:00
Olle Johansson
1dac2a69e2 unistd.h is required for usleep() on Darwin. It will not hurt to include it always
on other platforms either.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@190187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-23 10:07:26 +00:00
Tilghman Lesher
c922eca9a8 Detect availability of pthread_rwlock_timedwrlock() before using it.
(closes issue #14930)
 Reported by: tilghman
 Patches: 
       20090420__bug14930.diff.txt uploaded by tilghman (license 14)
 Tested by: mvanbaak, tilghman


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@190092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-22 21:35:03 +00:00
Jeff Peeler
a1b5f4a67d Make chan_h323 respect packetization settings
Previously, packetization settings were ignored and now they are not. A new
config option 'autoframing' has been added to mirror the way chan_sip handles
it. Turning on the autoframing option (available both as a global option or per
peer) overrides the local settings with the remote packetization settings.
Testing was performed with varying packetization levels with the following
codecs: ulaw, alaw, gsm, and g729.

(closes issue #12415)
Reported by: pj
Patches:
      2009012200_h323packetization.diff.txt uploaded by mvanbaak (license 7), 
      modified by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@189991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-22 19:20:53 +00:00
Michiel van Baak
4758539ec5 replace sed with tr to remove \r from downloaded file
On some systems, sed does not recognize \r in the pattern the way it
was used here.
Use tr instead because this works the same across systems.

(closes issue #14936)
Reported by: leobrown
Patches: 
      2009042201_14936.diff.txt uploaded by mvanbaak (license 7)
	  Tested by: leobrown, mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@189849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-22 14:29:28 +00:00
Doug Bailey
62ad2e0849 Remove daemon call on systems that do not support forking.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@189664 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-21 15:52:13 +00:00
Doug Bailey
9d266db16a Add check in configure script to check for GLOB_NOMAGIC and GLOB_BRACE in glob.h
This allows config.c to compile when linked against uclibc that does not support these parameters


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@189601 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-21 14:00:55 +00:00
Tilghman Lesher
591dd05d9e Add a workaround for func_odbc/ARRAY() for problems that occur with certain special characters.
In certain cases, due to the way Set() works in 1.4, values may not get set
properly.  This is a workaround for 1.4 only that corrects for these issues,
without making func_odbc more difficult to use properly.
(closes issue #14614)
 Reported by: wdoekes
 Patches: 
       20090309__bug14614__2.diff.txt uploaded by tilghman (license 14)
       double_set_unescape_workaround_for_func_odbc.osso-and-tilghman-1.diff uploaded by wdoekes (license 717)
 Tested by: wdoekes, tilghman


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@189537 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-20 22:02:16 +00:00
Terry Wilson
59ee389e31 Update CDR appropriately when AST_CAUSE_NO_ANSWER is set
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@189465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-20 21:10:27 +00:00
Terry Wilson
ef9ef40c19 Don't treat a NOANSWER like a CHANUNAVAIL
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@189463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-20 21:00:52 +00:00
Sean Bright
5de742a483 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@189462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-20 20:58:39 +00:00
Doug Bailey
100aa13ae2 Clean up problem with manager implementation of mmap where it was not testing against MAP_FAILED response.
Got rid of shadowed variable used in processign the mmap results. 
Change test of mmap results to compare against MAP_FAILED


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@189391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-20 19:10:56 +00:00
Mark Michelson
df7bee29a5 Move the check for chan->fdno == -1 to after the zombie/hangup check.
Many users were finding that their hung up channels were staying up and
causing 100% CPU usage.

(issue #14723)
Reported by: seadweller
Patches:
      14723_1-4-tip.patch uploaded by mmichelson (license 60)
Tested by: falves11, bamby



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@189277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-20 14:04:41 +00:00
David Vossel
5405c62098 Fixed autologoff in agents.conf not working when agent logs in via AgentLogin app
An agent logs in by calling an extension that calls the AgentLogin app.  In agents.conf ackcall=always is set, so when they get a call they have the choice to either acknowledge it or ignore it.  autologoff=10 is set as well, so if the agent ignores the call over 10sec one may assume that the agent should be logged out (and in this case hungup on as well), but this was not happening.

(closes issue #14091)
Reported by: evandro
Patches:
      autologoff.diff uploaded by dvossel (license 671)

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@189203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-18 01:27:19 +00:00
Richard Mudgett
55e28f890d Modifed/added some debug messages.
JIRA ABE-1835


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@189134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-17 21:27:55 +00:00
Matthew Nicholson
f870165dbe Make Busy() application set the CDR disposition to BUSY.
(closes issue #14306)
Reported by: cristiandimache


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@189009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-17 15:43:09 +00:00
Joshua Colp
df2bc7d715 Fix a bug where a value used to create the channel name was bogus.
This commit fixes the scenario where an incoming call is authenticated
using a peer entry. Previously the channel name was created using either
the username setting from the sip.conf entry or the IP address that the
call came from. Now the channel name will be created using the peer name
itself. This commit will not change the way the channel name is generated
for users or friends.

(closes issue #14256)
Reported by: Nick_Lewis
Patches:
      chan_sip.c-chname.patch uploaded by Nick (license 657)
Tested by: Nick_Lewis, file


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@188946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-17 14:41:25 +00:00
Joshua Colp
bf5b92f004 Fix a situation where the DAHDI channel private structure lock was not unlocked when it should have been.
(issue AST-210)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@188937 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-17 14:25:57 +00:00
Tilghman Lesher
611cf94f90 Only update realtime, if global option rtupdate != false
(closes issue #14885)
 Reported by: deepesh
 Patches: 
       20090413__bug14885.diff.txt uploaded by tilghman (license 14)
 Tested by: deepesh


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@188835 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-16 21:41:13 +00:00
Richard Mudgett
4b6846a9dd Only disable mISDN DSP if Asterisk DSP is enabled. Leave jitter setting alone.
JIRA ABE-1835


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@188833 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-16 21:37:58 +00:00
Tilghman Lesher
caef916825 Umask should not be exported into global namespace.
(closes issue #14912)
 Reported by: jcapp


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@188773 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-16 21:02:29 +00:00
David Vossel
4c6e1bd0a5 National prefix inserted even when caller ID not available
When the caller ID is restricted, the expected behavior is for the caller id to be blank.  In chan_dahdi, the national prefix is placed onto the callers number even if its restricted (empty) causing the caller id to be the national prefix rather than blank.

(closes issue #13207)
Reported by: shawkris
Patches:
      national_prefix.diff uploaded by dvossel (license 671)

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@188646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-15 22:08:40 +00:00
Mark Michelson
730f2882d3 Update ast_readvideo_callback to match ast_readaudio_callback.
This fixes potential refcount errors that may occur on ast_filestreams.

AST-208



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@188582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-15 20:04:20 +00:00
David Vossel
f967bdc670 audio_audiohook_write_list() does not correctly update sample size after ast_translate.
audio_audiohook_write_list() does not take into account that the sample size may change after translation depending on if the original frame is is 8khz or 16khz.  While no 16kz codecs are supported in 1.4 at the moment, this will save headaches in the future if they ever are.  the sample size is now updated after translating to reflect this possibility.  Thanks to jcolp and mmichelson for helping me work this out.

(issue AST-197)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@188287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-14 15:02:04 +00:00
Tilghman Lesher
9eaaa987fc If fileconfig limit exceeds our maximum, then set the limit to the maximum.
(Closes issue #14888)
Reported by: falves11


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@188149 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-13 23:04:15 +00:00
Jeff Peeler
3c027b6378 Fix module embedding for chan_h323.
Include libchanh323.a in the modules.link file so that all the symbols can be
resolved at link time.

(closes issue #11966)
Reported by: dome



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@187962 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-10 22:16:13 +00:00
Russell Bryant
9b0c55768a Support "signaling" in addition to "signalling".
The sample configuration file has references to both spellings.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@187865 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-10 19:26:40 +00:00
Tilghman Lesher
de69468fc2 Add lastms column to the contributed table designs
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@187763 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-10 17:28:46 +00:00
Mark Michelson
a4e46eb871 Handle a SIP race condition (reinvite before an ACK) properly.
RFC 5047 explains the proper course of action to take if a 
reINVITE is received before the ACK from a previous invite
transaction. What we are to do is to treat the reINVITE as
if it were both an ACK and a reINVITE and process it normally.

Later, when we receive the ACK we had been expecting, we will
ignore it since its CSeq is less than the current iseqno of
the sip_pvt representing this dialog.

(closes issue #13849)
Reported by: klaus3000
Patches:
      13849_v2.patch uploaded by mmichelson (license 60)
Tested by: mmichelson, klaus3000



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@187484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 18:51:20 +00:00
Tilghman Lesher
200db93157 Oops, typo
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@187482 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 18:39:07 +00:00
Tilghman Lesher
34672a3919 Race condition between ast_cli_command() and 'module unload' could cause a deadlock.
Add lock timeouts to avoid this potential deadlock.
(closes issue #14705)
 Reported by: jamessan
 Patches: 
       20090320__bug14705.diff.txt uploaded by tilghman (license 14)
 Tested by: jamessan


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@187428 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 18:08:20 +00:00
Tilghman Lesher
1cb43cfa75 Permit zero-length text messages in SIP.
(Related to an issue posted to the -users list, subject "AEL2, BASE64_DECODE and hexadecimal")


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@187362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 16:38:37 +00:00
Tilghman Lesher
6f919c9851 Oops, missed this file in the last commit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@187301 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 04:32:40 +00:00
Tilghman Lesher
a8dc553099 Add debugging mode for diagnosing file descriptor leaks.
(Related to issue #14625)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@187300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 04:31:38 +00:00
Tilghman Lesher
19918c7274 Backport resolution for file descriptor leak in 1.6.0 to 1.4.
This fixes short reads in http manager sessions, such as those done by the
ast-gui branch.  (Fixes AST-198)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@187209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-08 20:39:13 +00:00
Mark Michelson
8e31a331b4 Fix a crash due to too few arguments to RetryDial.
(closes issue #14852)
Reported by: junky
Patches:
      retry_fix.diff uploaded by junky (license 177)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@187135 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-08 19:16:49 +00:00
Mark Michelson
89d04eef98 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@187045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-08 16:52:03 +00:00
Mark Michelson
6562e1025c Make a couple of changes with regards to a new message printed in ast_read().
"ast_read() called with no recorded file descriptor" is a new message added
after a bug was discovered. Unfortunately, it seems there are a bunch of places
that potentially make such calls to ast_read() and trigger this error message
to be displayed. This commit does two things to help to make this message appear
less.

First, the message has been downgraded to a debug level message if dev mode is
not enabled. The message means a lot more to developers than it does to end users,
and so developers should take an effort to be sure to call ast_read only when
a channel is ready to be read from. However, since this doesn't actually cause an
error in operation and is not something a user can easily fix, we should not spam
their console with these messages.

Second, the message has been moved to after the check for any pending masquerades.
ast_read() being called with no recorded file descriptor should not interfere with
a masquerade taking place.

This could be seen as a simple way of resolving issue #14723. However, I still want
to try to clear out the existing ways of triggering this message, since I feel that
would be a better resolution for the issue.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@186984 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-08 15:26:46 +00:00
Mark Michelson
3c97fd86c5 Fix a few typos of the word "frequency."
(closes issue #14842)
Reported by: jvandal
Patches:
      frequency-typo.diff uploaded by jvandal (license 413)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@186841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-08 00:09:04 +00:00
Mark Michelson
c8cdf25ccb Set the AST_FEATURE_WARNING_ACTIVE flag when a p2p bridge returns AST_BRIDGE_RETRY.
Without this flag set, warning sounds will not be properly played to either party
of the bridge.

(closes issue #14845)
Reported by: adomjan


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@186832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-07 23:49:49 +00:00
Tilghman Lesher
56e7ca00c1 Fix Macro documentation to match current (and intended) behavior.
(See -dev mailing list)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@186775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-07 22:16:50 +00:00
Mark Michelson
8c021d9334 Ensure that \r\n is printed after the ActionID in an OriginateResponse.
(closes issue #14847)
Reported by: kobaz



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@186719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-07 20:43:49 +00:00
Mark Michelson
e2c30564bf Revert commit 186445 because it causes the build to fail when IMAP_STORAGE is used.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@186565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-06 13:54:41 +00:00
Kevin P. Fleming
89e29bfdc9 Fix a bug where DAHDI/Zaptel channels would not properly switch formats when requested
Don't offer AST_FORMAT_SLINEAR on DAHDI/Zaptel channels... while it could provide a slight performance benefit, the translation core in Asterisk has some flaws when a channel driver offers multiple raw formats. this fix is much simpler than fixing the translation core to solve that issue (although that will be done later).



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@186458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-03 20:19:20 +00:00
Tilghman Lesher
3d9585f4ba Found a conflict in the last commit, due to multiple targets
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@186445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-03 19:56:48 +00:00
Tilghman Lesher
6d08bad538 Distinguish in a sent email between simple sends and forwards.
(closes issue #11678)
 Reported by: jamessan
 Patches: 
       20090330__bug11678.diff.txt uploaded by tilghman (license 14)
 Tested by: tilghman, lmadsen


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@186415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-03 19:06:58 +00:00
Joshua Colp
ddb260532b Fix a problem with the crypto variable definitions not actually being defined properly.
(closes issue #14804)
Reported by: jvandal


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@186320 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-03 15:48:56 +00:00
Russell Bryant
f3dd49684f Fix a memory leak in cdr_radius.
I came across this while doing some testing of my ast_channel_ao2 branch.
After running a test overnight that generated over 5 million calls, Asterisk
had taken up about 1 GB of my system memory.  So, I re-ran the test with
MALLOC_DEBUG turned on.  However, it showed no leaks in Asterisk during the
test, even though Asterisk was still consuming it somehow.

Instead, I turned to valgrind, which when run with --leak-check=full, told
me exactly where the leak came from, which was from allocations inside the
radiusclient-ng library.  This explains why MALLOC_DEBUG did not report it.

After a bit of analysis, I found that we were leaking a little bit of memory
every time a CDR record was passed to cdr_radius.

I don't actually have a radius server set up to receive CDR records.  However,
I always have my development systems compile and install all modules.  In
addition to making sure there are not build errors across modules, always
loading modules helps find bugs like this, too, so it is strongly recommend for
all developers.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@186229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-03 01:57:44 +00:00
Mark Michelson
09490bb688 Fix instructions in one-step parking comment to make more sense.
Changed a capital K to a lowercase k.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@186174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-02 21:55:34 +00:00
Kevin P. Fleming
6dbc379d01 ensure that the buffer passed to DAHDI_SET_BUFINFO is fully initialized
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@186081 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-02 17:21:29 +00:00
Tilghman Lesher
24fa699663 Merged revisions 186056 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
  r186056 | tilghman | 2009-04-02 12:02:18 -0500 (Thu, 02 Apr 2009) | 2 lines
  
  Fix for AST-2009-003
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@186059 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-02 17:09:13 +00:00
Tilghman Lesher
0487d30a98 Avoid multiple warning messages in SIP, due to this column not existing
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@186057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-02 17:03:59 +00:00
Kevin P. Fleming
090f081e41 the DAHDI_GETCONF, DAHDI_SETCONF and DAHDI_GET_PARAMS ioctls were recently corrected to show that they do, in fact, read data from userspace as part of their work. due to this fix, valgrind now reports a number of cases where chan_dahdi passed an uninitialized (or partially) buffer to these ioctls, which could lead to unexpected behavior.
this patch corrects chan_dahdi to ensure that buffers passed to these ioctls are always fully initialized.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@185952 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-02 13:43:43 +00:00
David Vossel
36c92eec0e Fixes issue with dropped calles due to re-Invite glare and re-Invites never executing after a 491
Acknowledgement for 491 responses were never being processed because it didn't match our pending invite's seqno.  Since the ACK was never processed, the 491 frame would continue to be retransmitted until eventually the call was dropped due to max retries.  Now during a pending invite, if we receive another invite, we send an 491 and hold on to that glare invite's seqno in the "glareinvite" variable for that sip_pvt struct.  When ACK's are received, we first check to see if it is in response to our pending invite, if not we check to see if it is in response to a glare invite.  In this case, it is in response to the glare invite and must be dealt with or the call is dropped.  I've changed the wait time for resending the re-Invite after receving a 491 response to comply with RFC 3261.  Before this patch the scheduled re-Invite would only change a flag indicating that the re-Invite should be sent out, now it actually sends it out as well. 

(closes issue #12013)
Reported by: alx

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@185845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-01 19:02:00 +00:00
Russell Bryant
b66bb8945d Fix a case where DTMF could bypass audiohooks.
This change fixes a situation where an audiohook that wants DTMF would not
actually get it.  This is in the code path where we end DTMF digit length
emulation while handling a NULL frame.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@185771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-01 13:47:30 +00:00
Mark Michelson
7cc775e1ed Fix crash that would occur if an empty member was specified in queues.conf.
(closes issue #14796)
Reported by: pida



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@185599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-31 22:00:01 +00:00
Mark Michelson
36a68f792e Use AST_SCHED_DEL_SPINLOCK instead of manually using the logic.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@185531 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-31 20:55:47 +00:00
Mark Michelson
e2eaf7f862 Fix Russian voicemail intro to say the word "messages" properly.
(closes issue #14736)
Reported by: chappell
Patches:
      voicemail_no_messages.diff uploaded by chappell (license 8)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@185468 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-31 19:45:30 +00:00
David Brooks
a2933fefef Fix incorrect parsing in chan_gtalk when xmpp contains extra whitespaces
To drill into the xmpp to find the capabilities between channels, chan_gtalk 
calls iks_child() and iks_next(). iks_child() and iks_next() are functions in 
the iksemel xml parsing library that traverse xml nodes. The bug here is that 
both iks_child() and iks_next() will return the next iks_struct node 
*regardless* of type. chan_gtalk expects the next node to be of type IKS_TAG, 
which in most cases, it is, but in this case (a call being made from the 
Empathy IM client), there exists iks_struct nodes which are not IKS_TAG data 
(they are extraneous whitespaces), and chan_gtalk doesn't handle that case, 
so capabilities don't match, and a call cannot be made.

iks_first_tag() and iks_next_tag(), on the other hand, will not return the 
very next iks_struct, but will check to see if the next iks_struct is of 
type IKS_TAG. If it isn't, it will be skipped, and the next struct of type 
IKS_TAG it finds will be returned. This assures that chan_gtalk will find 
the iks_struct it is looking for.

This fix simply changes all calls to iks_child() and iks_next() to become 
calls to iks_first_tag() and iks_next_tag(), which resolves the capability 
matching.

The following is a payload listing from Empathy, which, due to the extraneous 
whitespace, will not be parsed correctly by iksemel:

<iq from='dbrooksjab@235-22-24-10/Telepathy' to='astjab@235-22-24-10/asterisk' type='set' id='542757715704'> <session xmlns='http://www.google.com/session' initiator='dbrooksjab@235-22-24-10/Telepathy' type='initiate' id='1837267342'> <description xmlns='http://www.google.com/session/phone'> <payload-type clockrate='16000' name='speex' id='96'/>
 <payload-type clockrate='8000' name='PCMA' id='8'/>
 <payload-type clockrate='8000' name='PCMU' id='0'/>
 <payload-type clockrate='90000' name='MPA' id='97'/>
 <payload-type clockrate='16000' name='SIREN' id='98'/>
 <payload-type clockrate='8000' name='telephone-event' id='99'/>
</description>
</session>
</iq>


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@185362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-31 16:37:12 +00:00
Mark Michelson
c48480f5e4 Fix some state_interface stuff that was in trunk but not in the backport to 1.4.
Issue #14359 was fixed between the time that I posted the review of the backport
of the state interface change for 1.4. This merges the changes from that issue
back into 1.4.

(closes issue #14359)
Reported by: francesco_r



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@185298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-31 15:34:05 +00:00
Joshua Colp
3b1fcc38f1 Fix crash when moving audiohooks between channels.
Handle the scenario where we are called to move audiohooks between channels
and the source channel does not actually have any on it.

(closes issue #14734)
Reported by: corruptor


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@185196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-31 14:06:39 +00:00
Richard Mudgett
63ca43071e Update the channel allocation method documentation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@185121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-30 20:40:11 +00:00
Richard Mudgett
76bfa1d8ef Make chan_misdn BRI TE side normally defer channel selection to the NT side.
Channel allocation collisions are not handled by chan_misdn very well.
This patch simply avoids the problem for BRI only.

For PRI, allocation collisions are still possible but less likely since
there are simply more channels available and each end could use a different
allocation strategy.

misdn.conf options available:
te_choose_channel - Use to force the TE side to allocate channels.
method - Specify the channel allocation strategy.

(closes issue #13488)
Reported by: Christian_Pinedo
Patches:
      isdn_lib.patch.txt uploaded by crich
Tested by: crich, siepkes, festr


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@185120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-30 20:38:11 +00:00
Mark Michelson
fd7d3271c6 Fix queue weight behavior so that calls in low-weight queues are not inappropriately blocked.
(This is copied and pasted from the review request I made for this patch)

Asterisk has some odd behavior when queue weights are used. The current logic used when
potentially calling a queue member is:

If the member we are going to call is part of another queue and _that other queue has any 
callers in it_ and has a higher weight than the queue we are calling from, then don't try 
to contact that member. The issue here is what I have marked with underscores. If the 
higher-weighted queue has any callers in it at all, then the queue member will be unreachable 
from the lower-weighted queue. This has the potential to be really really bad if using a 
queue strategy, such as leastrecent or fewestcalls, with the potential to call the same 
member repeatedly.

The fix proposed by garychen on issue 13220 is very simple and, as far as I can see, works 
well for this situation. With this set of changes, the logic used becomes:

If the member we are going to call is part of another queue, the other queue has a higher 
weight than the queue we are calling from, and the higher weight queue has at least as many 
callers as available members, then do not try to contact the queue member. If the higher 
weighted queue has fewer callers than available members, then there is no reason to deny 
the call to this member since the other queue can afford to spare a member.

Since the fix involved writing a generic function for determining the number of available 
members in the queue, I also modified the is_our_turn function to make use of the new 
num_available_members function to determine if it is our turn to try calling a member. There 
is one small behavior change. Before writing this patch, if you had autofill disabled, then 
if you were the head caller in a queue, you would automatically be told that it was your 
turn to try calling a member. This did not take into account whether there were actually any 
queue members available to take the call. Now we actually make sure there is at least one 
member available to take the call if autofill is disabled.

(closes issue #13220)
Reported by: garychen

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@185031 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-30 16:17:35 +00:00
Mark Michelson
cf7131dd6a Backport state interface changes to app_queue from trunk.
After several issues raised on the Asterisk bugtracker against
the 1.4 branch were determined to be fixable with the state interface
change available in the 1.6.X series, it finally came time to just
suck it up and backport the change.

For a detailed explanation of what this change entails, the original
trunk commit for this feature may be found here:

http://svn.digium.com/view/asterisk?view=revision&revision=97203

In addition, the details for the use of this change to fix the problems
stated in issue #12970 may be found in the review request I made for
this change. It is linked below.

(closes issue #12970)
Reported by: edugs15

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@184980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-30 15:23:59 +00:00
Joshua Colp
df192b77df Improve our handling of T38 in the initial INVITE from a device.
We now answer with matching media streams to what is requested. If an INVITE
is received with both a T38 and RTP media stream this means we answer with both.
For any outgoing calls created as a result of this inbound one no T38 is requested
in the initial INVITE. Instead if we start receiving udptl packets we trigger a
reinvite on the outbound side.

(closes issue #12437)
Reported by: marsosa
Tested by: pinga-fogo, okrief, file, afu

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@184947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-30 14:35:47 +00:00
Russell Bryant
23de13f3da Ensure targs variable is fully initialized.
(closes issue #14758)
Reported by: tim_ringenbach


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@184842 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-29 05:51:55 +00:00
Joshua Colp
0f37862a87 Fix an issue where nat=yes would not always take effect for the RTP session on outgoing calls.
If calls were placed using an IP address or hostname the global nat setting was copied over
but was not set on the RTP session itself. This caused the RTP stack to not perform symmetric RTP
actions.

(closes issue #14546)
Reported by: acunningham


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@184565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-27 13:06:45 +00:00
Kevin P. Fleming
3433f4ecef use new, improved 8kHz prompts
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@184447 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-26 22:17:32 +00:00
David Vossel
d64575ac5c pri loop TestClient/TestServer fails: server SEND DTMF 8
app_test was failing when sending the last DTMF digit, 8, because of the 100ms pause issued after DTMF is sent.  During this pause the other side would hang up causing the test to look like it failed. Now the other side waits a second before hanging up.

(closes issue #12442)
Reported by: tzafrir



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@184388 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-26 21:07:32 +00:00
Eliel C. Sardanons
a81abfbd02 Avoid destroying the CLI line when moving the cursor backward and trying to autocomplete.
When moving the cursor backward and pressing TAB to autocomplete, a NULL is put
in the line and we are loosing what we have already wrote after the actual
cursor position.

(closes issue #14373)
Reported by: eliel
Patches:
      asterisk.c.patch uploaded by eliel (license 64)
      Tested by: lmadsen



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@184188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-25 14:12:54 +00:00
Mark Michelson
4a209dbe40 Change NULL pointer check to be ast_strlen_zero.
The 'digit' variable is guaranteed to be non-NULL, so the if
statement could never evaluate true. Changing to ast_strlen_zero
makes the logic correct.

This was found while reviewing ast_channel_ao2 code review.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@184078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-24 22:34:45 +00:00
Tilghman Lesher
38934ec0d0 Additionally note that the operator option needs an 'o' extension.
(Related to issue #14731)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-24 15:25:42 +00:00
Mark Michelson
3e474b3b75 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@183700 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-23 17:59:28 +00:00
Russell Bryant
19a67b624c Fix a crash in IAX2 registration handling found during load testing with dvossel.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-20 16:53:25 +00:00
Terry Wilson
2da89b3022 Add missing datastore inherit (exists in all other branches)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183481 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 23:37:59 +00:00
David Vossel
f42e9eb6bf Cleaning up a few things in detect disconnect patch
Initialized ast_call_feature in detect_disconnect to avoid accessing uninitialized memory.  Cleaned up /param tags in features.h.  No longer send dynamic features in ast_feature_detect. 

issue #11583


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 19:40:07 +00:00
Tilghman Lesher
e81cde3d9c Reordering, to change prior to unlocking
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183342 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 19:21:30 +00:00
Tilghman Lesher
5fc7a5919a Delay signalling progress until a PRI channel really signals progress.
(closes issue #13034)
 Reported by: klaus3000
 Patches: 
       20090316__bug13034.diff.txt uploaded by tilghman (license 14)
       patch_trunk_183progress_klaus3000.txt uploaded by klaus3000 (license 65)
 Tested by: klaus3000


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183319 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 19:15:33 +00:00
Jason Parker
40c5b00494 Export some more required symbols.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183291 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 18:28:16 +00:00
Russell Bryant
47af9f8fd5 Remove the use of RTLD_NOLOAD, as it is not behaving like expected.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 17:52:52 +00:00
Russell Bryant
3c9a8b9aa6 Allow the AES API to work.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183238 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 17:41:39 +00:00
Russell Bryant
35edd3d0a2 Add missing semicolon in exports script.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183145 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 16:21:56 +00:00
David Vossel
dd17912d68 Allow disconnect feature before a call is bridged
feature.conf has a disconnect option.  By default this option is set to '*', but it could be anything.  If a user wishes to disconnect a call before the other side answers, only '*' will work, regardless if the disconnect option is set to something else.  This is because features are unavailable until bridging takes place.  The default disconnect option, '*', was hardcoded in app_dial, which doesn't make any sense from a user perspective since they may expect it to be something different.  This patch allows features to be detected from outside of the bridge, but not operated on.  In this case, the disconnect feature can be detected before briding and handled outside of features.c.

(closes issue #11583)
Reported by: sobomax
Patches:
	patch-apps__app_dial.c uploaded by sobomax (license 359)
	11583.latest-patch uploaded by murf (license 17)
	detect_disconnect.diff uploaded by dvossel (license 671)
Tested by: sobomax, dvossel
Review: http://reviewboard.digium.com/r/195/






git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 16:15:16 +00:00
Russell Bryant
661c6384ad Allow the CallerID API to work again.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 16:13:18 +00:00
Mark Michelson
338e48e055 Fix an issue where cancelled outgoing SIP calls would erroneously report the device as "in use."
A user was having an issue where if an outgoing SIP call was canceled, the SIP device
would remain in use if we had not received any response to the initial INVITE we sent out.
The SIP device would remain in use until the autocongestion timer was exhausted.

I tracked down the cause of this to be the section of code I am removing here. I asked several
people what the purpose of this code was meant to be, but no one could give me any sort of
answer as to why this was here. The person who was having this issue has been using this patch
for several months and it has stopped the problems they have had.

AST-196



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@183115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 16:04:02 +00:00
Jeff Peeler
3849208a99 fix typo which broke configure
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@182965 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 20:02:40 +00:00
Jeff Peeler
c59e2a92d0 Allow H.323 Plus library to be used in addition to the OpenH323 library
Chan_h323 can now be compiled against both the previously supported versions of
OpenH323 as well as the current H.323 Plus (version 1.20.2). The configure
script has been modified to look in the default install location of h323 to
hopefully help avoid using the environment variables OPENH323DIR and PWLIBDIR.
Also, the CLI command "h323 show version" has been added which indicates which
version of h323 is in use.

(closes issue 0011261)
Reported by: vhatz
Patches:
      asterisk-1.6.0.6-h323plus.patch uploaded by jthurman (license 614)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@182963 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 19:57:05 +00:00
Kevin P. Fleming
e536392919 fix another symbol namespace issue (reported by Andrew on asterisk-dev)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@182882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 11:31:41 +00:00
Russell Bryant
6efa254bea 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@182810 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 02:09:13 +00:00
Kevin P. Fleming
7e1ee720ba 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@182808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 01:55:22 +00:00
Kevin P. Fleming
59f867a5cb revert commit that included extranous changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@182807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 01:51:21 +00:00
Kevin P. Fleming
b8afcedc10 remove accidentally merged properties
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@182803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 01:32:18 +00:00
Kevin P. Fleming
f1f417a9d8 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@182802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 01:28:42 +00:00
Jason Parker
62fbf19157 Allow dahdichanname to work as advertised.
(closes issue #14056)
Reported by: dsedivec
Patches:
      load_from_zapata_conf.patch uploaded by dsedivec (license 638)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@182652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-17 20:13:40 +00:00
Tilghman Lesher
d09fddd38e Fix race in astdb
The underlying db1 implementation does not fully isolate the pages retrieved
from astdb, so the lock protecting accesses needs to be extended until the
copy from the shared memory structure is done.
(closes issue #14682)
 Reported by: makoto


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@182449 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-17 05:50:52 +00:00
David Vossel
3cbc42e2e4 Randomize IAX2 encryption padding
The 16-32 byte random padding at the beginning of an encrypted IAX2 frame turns out to not be all that random at all.  This patch calls ast_random to fill the padding buffer with random data.  The padding is randomized at the beginning of every encrypted call and for every encrypted retransmit frame.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@182281 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-16 17:47:42 +00:00
Tilghman Lesher
a3769669b0 Fixup glare detection, to fix a memory leak of a local pvt structure.
(closes issue #14656)
 Reported by: caspy
 Patches: 
       20090313__bug14656__2.diff.txt uploaded by tilghman (license 14)
 Tested by: caspy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@182208 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-16 15:39:15 +00:00
Mark Michelson
52752df83c Check the DYNAMIC_FEATURES of both the chan and peer when interpreting DTMF.
Dynamic features defined in the applicationmap section of features.conf allow
one to specify whether the caller, callee, or both have the ability to use the
feature. The documentation in the features.conf.sample file could be interpreted
to mean that one only needs to set the DYNAMIC_FEATURES channel variable on the
calling channel in order to allow for the callee to be able to use the features
which he should have permission to use. However, the DYNAMIC_FEATURES variable
would only be read from the channel of the participant that pressed the DTMF
sequence to activate the feature. The result of this was that the callee was
unable to use dynamic features unless the dialplan writer had taken measures
to be sure that the DYNAMIC_FEATURES variable was set on the callee's channel.

This commit changes the behavior of ast_feature_interpret to concatenate the
values of DYNAMIC_FEATURES from both parties involved in the bridge. The features
themselves determine who has permission to use them, so there is no reason to believe
that one side of the bridge could gain the ability to perform an action that they
should not have the ability to perform.

Kevin Fleming pointed out on the asterisk-users list that the typical way that this
was worked around in the past was by setting _DYNAMIC_FEATURES on the calling channel
so that the value would be inherited by the called channel. While this works, the
documentation alone is not enough to figure out why this is necessary for the callee
to be able to use dynamic features. In this particular case, changing the code to match
the documentation is safe, easy, and will generally make things easier for people for
future installations.

This bug was originally reported on the asterisk-users list by David Ruggles.

(closes issue #14657)
Reported by: mmichelson
Patches:
      14657.patch uploaded by mmichelson (license 60)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-13 17:12:32 +00:00
Richard Mudgett
00c1a47c88 Use the correct branch integrated property when generating the version string.
Copied the make_version file from Asterisk trunk.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181898 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-13 01:19:29 +00:00
Mark Michelson
8dbfea83ce Properly send a 487 on an INVITE we have not responded to if we receive a BYE.
If we receive an INVITE from an endpoint and then later receive a BYE from that
same endpoint before we have sent a final response for the INVITE, then we need
to respond to the INVITE with a 487. 

There was logic in the code prior to this commit which seemed to exist solely to 
handle this situation, but there was one condition in an if statement which 
was incorrect. The only way we would send a 487 was if the sip_pvt had no owner
channel. This made no sense since we created the owner channel when we received
the INVITE, meaning that the majority of the time we would never send the 487.
The 487 being sent should not rely on whether we have created a channel. Its
delivery should be dependent on the current state of the initial INVITE transaction.
With this commit, that logic is now correctly in place.

(closes issue #14149)
Reported by: legranjl
Patches:
      14149.patch uploaded by mmichelson (license 60)
Tested by: legranjl



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-12 18:29:48 +00:00
Joshua Colp
1813d4a281 Fix incorrect usage of strncasecmp... I really meant to use strcasecmp.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181664 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-12 16:56:20 +00:00
Joshua Colp
01b90d9092 Fix logic flaw in previous commit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181660 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-12 16:52:45 +00:00
Joshua Colp
2e825bd259 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181659 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-12 16:50:37 +00:00
Joshua Colp
293900d3f2 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@181655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-12 16:29:19 +00:00
Jason Parker
e809699406 Allow prefix to set localstatedir (when used and different from the default).
This is similar to the /etc change that was made for the non-FreeBSD case.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-11 22:18:42 +00:00
Russell Bryant
aedf566905 Make code that updates BRIDGEPEER variable thread-safe.
It is not safe to read the name field of an ast_channel without the channel
locked.  This patch fixes some places in channel.c where this was being done,
and lead to crashes related to masquerades.

(closes issue #14623)
Reported by: guillecabeza


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-11 21:42:58 +00:00
David Vossel
f97c929946 encrypted IAX2 during packet loss causes decryption to fail on retransmitted frames
If an iax channel is encrypted, and a retransmit frame is sent, that packet's iseqno is updated while it is encrypted.  This causes the entire frame to be corrupted.  When the corrupted frame is sent, the other side decrypts it and sends a VNAK back because the decrypted frame doesn't make any sense.  When we get the VNAK, we look through the sent queue and send the same corrupted frame causing a loop.  To fix this, encrypted frames requiring retransmission are decrypted, updated, then re-encrypted.  Since key-rotation may change the key held by the pvt struct, the keys used for encryption/decryption are held within the iax_frame to guarantee they remain correct.

(closes issue #14607)
Reported by: stevenla
Tested by: dvossel

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181340 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-11 17:25:31 +00:00
Joshua Colp
563c72dc84 Fix issue where an attended transfer could not be completed under a rare scenario.
When completing an attended transfer chan_sip does a check to make sure the extension
in the URI portion of the Refer-To header is a local valid extension. We don't actually
need to check this since we know for sure the other channel is already up and talking to
the extension. Some devices do not put the extension in the Refer-To header either, which
can cause the extension check to fail. We now no longer do this check if it is an attended
transfer.

(closes issue #14628)
Reported by: sverre
Patches:
      14628.diff uploaded by file (license 11)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181328 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-11 17:22:52 +00:00
Joshua Colp
b15b319bd6 Fix a problem with inband DTMF detection on outgoing SIP calls when dtmfmode=auto.
When dtmfmode was set to auto the inband DTMF detector was not setup
on outgoing SIP calls. This caused inband DTMF detection to fail.
The inband DTMF detector is now setup for both dtmfmode inband and auto.

(closes issue #13713)
Reported by: makoto


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-11 16:36:50 +00:00
Jeff Peeler
21ca773c28 Fix malloc debug macros to work properly with h323.
The main problem here was that cstdlib was undefining free thereby causing the
proper debug macros to not be used. ast_h323.cxx has been changed to call
ast_free instead to avoid the issue. Because using the ast prefix calls are
a better choice, ast_free_ptr is the new wrapper for free to pass to functions.
Also, a little bit of clean up was done to avoid the debug macros intentionally
being redefined.

(closes issue #13593)
Reported by: pj



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181133 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-11 03:25:04 +00:00
Mark Michelson
280153085e Remove unused variables.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181031 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-11 00:32:40 +00:00
Mark Michelson
849820fd54 Fix incorrect tag checking on transfers when pedantic=yes is enabled.
(closes issue #14611)
Reported by: klaus3000
Patches:
      patch_chan_sip_attended_transfer_1.4.23.txt uploaded by klaus3000 (license 65)
Tested by: klaus3000



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@181029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-11 00:30:26 +00:00
Jason Parker
df31bb22c0 Make things happier when using autoconf 2.62+
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@180941 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-10 22:02:18 +00:00
Mark Michelson
a8e2597803 Make compilation succeed in dev-mode when IMAP storage is enabled.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@180567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-06 18:23:09 +00:00
David Vossel
04836d554d Fix handling of backreferences for ENUM lookups
enum.c did not handle regex backtraces correctly.  The '\1' in the regex is a backreference that requires a pattern match to be inserted.  The way the code used to work is that it would find the backreference and insert the entire input string minus the '+'.  This is incorrect.  The regexec() function takes in a variable called pmatch which is an array of structs containing the start and end indexes for each backreference substring.  The original code actually passed the pmatch array pointer into regexec but never did anything with it.  Now when a backtrace is found, the backtrace number is looked up in the pmatch array and the correct substring is inserted.

(closes issue #14576)
Reported by: chris-mac
Review: http://reviewboard.digium.com/r/187/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@180532 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-06 17:19:55 +00:00
Mark Michelson
aef6c114f1 [IMAP] Fix message retrieval issues when identical mailbox names were defined in separate contexts.
There was a fix put in a while back so that an X-Asterisk-VM-Context message header was
added to stored IMAP voicemails. This would allow for us to differentiate if the same
mailbox name was used in multiple contexts. The problem still left was that not all places
where messages were retrieved actually attempted to use this header for information when
retrieving messages. This commit fixes that so that MWI and message retrieval from VoiceMailMain
work as expected.

(closes issue #13853)
Reported by: vicks1
Patches:
      13853_v2.patch uploaded by mmichelson (license 60)
Tested by: lmadsen



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@180464 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-05 23:26:11 +00:00
Mark Michelson
7e44582f57 Fix broken mailbox parsing when searchcontexts option is enabled.
When using the searchcontexts option in voicemail.conf, the code
made the assumption that all mailbox names defined were unique across
all contexts. However, the code did nothing to actually enforce this
assumption, nor did it do anything to alert a user that he may have
created an ambiguity in his voicemail.conf file by defining the same
mailbox name in multiple contexts.

With this change, we now will issue a nice long warning if searchcontexts
is on and we encounter the same mailbox name in multiple contexts and ignore
any duplicates after the first box. Whether searchcontexts is enabled or not,
if we come across a duplicate mailbox in the same context, then we will issue
a warning and ignore the duplicated mailbox. I have also added a small note
to voicemail.conf.sample in the explanation for searchcontexts explaining
that you cannot define the same mailbox in multiple contexts if you have
enabled the option.

(closes issue #14599)
Reported by: lmadsen
Patches:
      14599.patch uploaded by mmichelson (license 60) (with slight modification)
Tested by: lmadsen



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@180380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-05 18:58:48 +00:00
Kevin P. Fleming
5436d8709f Fix problems when RTP packet frame size is changed
During some code analysis, I found that calling ast_rtp_codec_setpref() on an ast_rtp session does not work as expected; it does not adjust the smoother that may on the RTP session, in fact it summarily drops it, even if it has data in it, even if the current format's framing size has not changed. This is not good.

This patch changes this behavior, so that if the packetization size for the current format changes, any existing smoother is safely updated to use the new size, and if no smoother was present, one is created. A new API call for smoothers, ast_smoother_reconfigure(), was required to implement these changes.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@180372 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-05 18:22:16 +00:00
Joshua Colp
c42b21bc6a Look for the number in a callerid string starting from the end. This way a value using <> can exist in the name portion.
(issue #AST-194)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@180194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-04 19:22:50 +00:00
Jason Parker
5a3bc6b38d Make sure we still support zapchan in users.conf, in addition to dahdichan.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@180010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-03 23:01:06 +00:00
Mark Michelson
ab5b88843c Clarify some documentation of queues.conf.sample
It had always been possible to explicitly specify a "blank"
value for a sound file in queues.conf and have no sound played
back. The problem with this is that it would result in some ugly
CLI warnings from file.c.

This commit introduces a check when playing a file in app_queue
to see if the name of the file is zero-length and return early if
that is the case. Also, the ability to specify the blank sound
files in queues.conf is now mentioned more clearly in queues.conf.sample

(closes issue #14227)
Reported by: caspy




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@180006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-03 22:48:18 +00:00
Joshua Colp
3ef0938c76 Do not assume that the bridge_cdr is still attached to the channel when the 'h' exten is finished executing.
It is possible for a masquerade operation to occur when the 'h' exten is operating. This operation moves
the CDR records around causing the bridge_cdr to no longer exist on the channel where it is expected to.
We can not safely modify it afterwards because of this, so don't even try.

(closes issue #14564)
Reported by: meric


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-03 18:27:09 +00:00
Steve Murphy
604a51f341 These changes allow AEL to better check ${} constructs within $[...], that are concatenated with text.
I modified and added rules in ast_expr2.fl to better handle
the concatenations.

I added some default routines to ast_expr2.y so the standalone would
compile. It also looks like I haven't run this thru bison since 2.1, so
it's good to get this updated.

The Makefile has comments added now for check_expr2 and check_expr to
explain what they are for, and how to run them. 

The testexpr2s stuff has been removed, in favor of check_expr2.

expr2.testinput has been updated to include the two expressions
that inspired these changes (from mcnobody on #asterisk this morning)
The regression has been run and all looks well.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-03 18:11:34 +00:00
Russell Bryant
2e4471d758 Ensure chan->fdno always gets reset to -1 after handling a channel fd event.
Since setting fdno to -1 had to be moved, a couple of other code paths that
do process an fd event return early and do not pass through the code path
where it was moved to.  So, set it to -1 in a few other places, too.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-03 16:45:46 +00:00
Joshua Colp
3f2a1247f4 Move where fdno is set to the default value to *after* the read callback of the channel driver is called.
We have to do this as the underlying channel driver may need the fdno value to determine what to read.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179671 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-03 14:38:09 +00:00
Russell Bryant
a1d249577e Make it easier to detect an improper call to ast_read().
When you call ast_waitfor() on a channel, the index into the channel fds array
that holds the file descriptor that poll() determines has input available is
stored in fdno.  This patch clears out this value after a call to ast_read()
and also reports errors if ast_read() is called without an fdno set.

From a discussion on the asterisk-dev list.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-03 13:53:52 +00:00
Jeff Peeler
4055ec6c57 Fix bridging regression from commit 176701
This fixes a bad regression where the bridge would exit after an attended
transfer was made. The problem was due to nexteventts getting set after the
masquerade which caused the bridge to return AST_BRIDGE_COMPLETE.

(closes issue #14315)
Reported by: tim_ringenbach



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-02 23:54:39 +00:00
Russell Bryant
dadbbb0a56 Move ast_waitfor() down to avoid the results of the API call becoming stale.
This call to ast_waitfor() was being done way too soon in this section of code.
Specifically, there was code in between the call to waitfor and the code that
uses the result that puts the channel in autoservice.  By putting the channel
in autoservice, the previous results of ast_waitfor() become meaningless,
as the autoservice thread will do it's own ast_waitfor() and ast_read()
on the channel.

So, when we came back out of autoservice and eventually hit the block of code
that calls ast_read() on the channel, there may not actually be any input on
the channel available.  Even though the previous call to ast_waitfor() in
app_meetme said there was input, the autoservice thread has since serviced
the channel for some period of time.

This bug manifested itself while dvossel was doing some testing of MeetMe in
Asterisk trunk.  He was using the timerfd timing module.  When the code hit
ast_read() erroneously, it determined that it must have been called because of
input on the timer fd, as chan->fdno was set to AST_TIMING_FD, since that was 
the cause of the last legitimate call to ast_read() done by autoservice.  

In this test, an IAX2 channel was calling into the MeetMe conference.  It was
_much_ more likely to be seen with an IAX2 channel because of the way audio
is handled.  Every audio frame that comes in results in a call to
ast_queue_frame(), which then uses ast_timer_enable_continuous() to notify
the channel thread that a frame is waiting to be handled.  So, the chances
of ast_waitfor() indicating that a channel needs servicing due to a timer
event on an IAX2 event is very high.

Finally, it is interesting to note that if a different timing interface was
being used, this bug would probably not be noticed.  When ast_read() is called
and erroneously thinks that there is a timer event to handle, it calls the
ast_timer_ack() function.  The pthread and dahdi timing modules handle the
ack() function being called when there is no event by simply ignoring it.
In the case of the timerfd module, it results in a read() on the timer fd
that will block forever, as there is no data to read.  This caused Asterisk
to lock up very quickly.

Thanks to dvossel and mmichelson for the fun debugging session.  :-)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179532 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-02 23:34:13 +00:00
Tilghman Lesher
b705454875 When ending a recording with silence detection, remember to reduce the duration.
The end of the recording is correspondingly trimmed, but the duration was not
trimmed by the number of seconds trimmed, so the saved duration was necessarily
longer than the actual soundfile duration.
(closes issue #14406)
 Reported by: sasargen
 Patches: 
       20090226__bug14406.diff.txt uploaded by tilghman (license 14)
 Tested by: sasargen


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179468 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-02 23:09:01 +00:00
Russell Bryant
6706e0be24 Ensure that only one thread is calling ast_settimeout() on a channel at a time.
For example, with an IAX2 channel, you can have both the channel thread and the
chan_iax2 processing threads calling this function, and doing so twice at the
same time is a bad thing.

(Found in a debugging session with dvossel and mmichelson)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-02 22:58:18 +00:00
Jason Parker
5062dff9dd Remove several silly warnings in editline. One about a broken preprocessor directive, and another about strlcpy/strlcat.
(closes issue #14264)
Reported by: dimas


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179395 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-02 20:14:57 +00:00
Jason Parker
c2f0803e77 Update documentation for DIALEDTIME and ANSWEREDTIME variables.
(closes issue #14566)
Reported by: klaus3000
Patches:
      ANSWEREDTIME-1.4-patch.txt uploaded by klaus3000 (license 65)
      ANSWEREDTIME-trunk-patch.txt uploaded by klaus3000 (license 65)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179056 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-27 19:03:56 +00:00
Steve Murphy
5996b58192 This change moves the default feature digit timeout to 1000 ms from the previous default of 500.
As per bug 14515, a dev discussion arrived at a "mediated concensus" 
of a default feature digit timeout of 1.0 sec. Some voted for 1300;
ctooley thought 1500 for distracted phone users in phone booths; 
kpfleming put his foot down at 1.0 sec. 

Users who found the previous default max delay of 250 msec perfect,
are welcome to override the new default. Notice that I said that
250 msec was the default; wait a minute, you might say, the config
file said it was 500 msec!; well, because of the bug fix for 14515,
we found that 500 msec was actually enforcing a max of 250. The bug
fix would restore 500 msec, but we felt even that was a bit tight
for most users... 2000 msec was pushed earlier by mmichelson, so
that reduces to 1000 msec after the bug fix. Enjoy!




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178956 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-26 21:27:32 +00:00
David Vossel
cbd35b45af IAX2 prune realtime fix
Now prune_users() and prune_peers() are called instead of reload_config() to prune all users/peers that are realtime.  These functions remove all users/peers with the rtfriend and delme flags set. iax2_prune_realtime() also lacked the code to properly delete a single friend.  For example. if iax2 prune realtime <friend> was called, only the peer instance would be removed. The user would still remain.

(closes issue #14479)
Reported by: mousepad99
Review: http://reviewboard.digium.com/r/176/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-26 17:24:02 +00:00
Steve Murphy
6fb39726c5 This patch prevents the feature detection timeout from being cut in half.
Because the ast_channel_bridge() call will return 0 and pass
a frame pointer for both DTMF_BEGIN and DTMF_END, the feature_timer
field in hte config struct is getting decremented twice, which 
effectively cuts the digittimeout in half. I added conditions
to the if statement to only let DTMF_END frames to flow thru,
which solved the problem. Also, when the frame pointer is null,
let control flow thru-- this usually happens on timeouts. I added
a comment to the code to explain what's going on and why.

Many thanks to sodom for reporting this problem. Personnally, it always seemed
like something was wrong with the featuredigittimeout, but I never
could quite decide what... and was too busy to investigate.
This bug forced the issue, and now we know.

Sodom had other issues in 14515, but I couldn't reproduce them. If
he still has problems, and wants to get them solved, he is welcome
to reopen 14515.


(closes issue #14515)
Reported by: sodom
Patches:
      14515.patch uploaded by murf (license 17)
Tested by: murf, sodom



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-26 17:09:03 +00:00
Steve Murphy
c4d2dc7967 This patch completes the fixes nec. to make 1.4 asterisk dialplan expressions ($[...]) 8-bit transparent
While I was updating ast_expr2.fl, I missed one rule that would allow 8-bit chars to be caught
in tokens; and in so doing, it absorbs the ${ sequence and messes up the
checking of raw exprs by AEL.

Trunk already has these changes.



(closes issue #14543)
Reported by: klaus3000
Patches:
      patch.14543 uploaded by murf (license 17)
Tested by: murf



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-25 21:00:50 +00:00
Russell Bryant
7374b9195f Update the copyright year for the main page of the doxygen documentation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-25 12:43:36 +00:00
Tilghman Lesher
48933e0c48 Add section about the #exec command in configuration files.
(closes issue #14540)
 Reported by: jtodd
 Patch by: jtodd, with additional notes by tilghman (license 14) 


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-24 23:25:24 +00:00
Russell Bryant
da0d84c3e4 Only set dtmfcount on BEGIN, and ensure it gets reset to 0 properly.
(issue #14460)
Reported by: moliveras
Tested by: russell


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-24 20:36:19 +00:00
Terry Wilson
cdf5240895 Change include order to make compile on Centos 5 with DAHDI
If BIT_TYPES_DEFINED gets defined before linux/types.h is included, the
__s32 type doesn't get defined


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-24 17:02:20 +00:00
Joshua Colp
aa488ca6b0 Skip check for extension when subscribing for MWI.
Since the remote side is not actually subscribing to a specific extension when
subscribing for MWI just skip the check to see if the extension exists. They can't use it
to specify the mailbox either since we require configuration of that in sip.conf

(closes issue #14531)
Reported by: festr


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178205 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-24 15:16:07 +00:00
Russell Bryant
aa5a927b69 Fix infinite DTMF when a BEGIN is received without an END.
This commit is related to rev 175124 of 1.4 where a previous attempt was made
to fix this problem.  The problem with the previous patch was that the inserted
code needed to go _before_ setting the lastrxts to the current timestamp.
Because those were the same, the dtmfcount variable was never decremented, and
so the END was never sent.

In passing, I removed the dtmfsamples variable which was completed unused.  I
also removed a redundant setting of the lastrxts variable.

(closes issue #14460)
Reported by: moliveras


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178141 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-23 23:09:01 +00:00
Tilghman Lesher
4af0175285 Don't print the CR-NL combination when we aren't outputting to the manager.
An embedded CR-NL in a CLI command screws up several AMI parsers that don't
expect to see that combination in the middle of output.

(Closes issue #14305)
Reported by: martins
Patch by: tilghman


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-20 22:59:52 +00:00
Tilghman Lesher
426cee0362 This exception does not appear to still be true for Solaris 10, and OpenSolaris definitely needs it to be removed.
Fixed for snuff-home on -dev channel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-20 21:15:01 +00:00
David Vossel
a5198f55e0 Fixes issue with undefined audio codecs in chan_iax2
During iax2 call negotiation, supported codecs are passed in an Information Element containing a 2 byte field where each bit correlates to a specific codec.  In 1.4 only audio codec bits 0-12 are defined, leaving bits 13-15 undefined.  By default all bits are enabled unless specified otherwise.  Since its a 2 byte field and 13-15 are not defined, these bits are never turned off.  In trunk, bits 13-15 are defined, which means 1.4 is advertising support for codecs it does not have when talking to trunk.  I fixed this by adding #define for undefined audio codec bits.  These bits are then removed from iax2's full bandwidth capabilities.   

(closes issue #14283)
Reported by: jcovert



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-20 20:17:37 +00:00
Steve Murphy
d290eed8e0 This patch fixes a problem with 8-bit input to the ast_expr2 scanner.
The real culprit was the --full argument to flex
in the Makefile! This causes a 7-bit scanner to be
generated.

I reviewed the rules and found one rule where I needed
to specifically include 8-bit chars for a token.

I tested against the text supplied by ibercom, and 
all looks very well.

This has been there a surprisingly long time!


(closes issue #14498)
Reported by: ibercom
Patches:
      14498.patch uploaded by murf (license 17)
Tested by: murf


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-19 22:51:37 +00:00
Tilghman Lesher
4675032a30 Fix up potential crashes, by reducing the sharing between interactive and non-interactive threads.
(closes issue #14253)
 Reported by: Skavin
 Patches: 
       20090219__bug14253.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Skavin


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-19 22:26:01 +00:00
Olle Johansson
25bb888046 Force a MWI notification after subscribe request. Reported by the Resiprocate dev team. Thanks!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-19 18:58:57 +00:00
Joshua Colp
0d96c97ced If we are able to create a speech structure unset the ERROR variable in case it was previously set.
(issue #LUMENVOX-13)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-19 16:37:25 +00:00
Steve Murphy
39a6b55183 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@177225 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-18 22:43:14 +00:00
Jeff Peeler
1183bf1ad0 Modify h323 to build against PTLib as well as the older PWLib
Several changes in PTLib have occurred requiring build time detection. Changes
accounted for include the library name change, config option change, install
location change, and a boolean type change which is handled by ast_ptlib.h.
Also, the sed check has been modified to properly work with autoconf >= 2.62.

(closes issue #14224)
Reported by: bergolth
Patches:
      asterisk-autoconf-sed.patch uploaded by bergolth (license 661)
      asterisk-pwlib-v3.patch uploaded by bergolth (license 661)
Tested by: jpeeler



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-18 20:06:45 +00:00
Tilghman Lesher
c66921ec43 Document the return value of the update method (as requested on -dev list)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177096 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-18 18:30:38 +00:00
Doug Bailey
a591301b89 Merged revisions 177035 manually from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r177035 | dbailey | 2009-02-18 11:24:07 -0600 (Wed, 18 Feb 2009) | 2 lines
  
  Fixed error where a check for an zero length, terminated string was needed.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-18 17:41:05 +00:00
Doug Bailey
bf0b8526b1 Need to take into account the \0 terminator of the old string to determine the amount available.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-18 15:59:22 +00:00
Shaun Ruffell
e731e26bee Several changes to codec_dahdi to play nice with G723.
This commit brings in the changes that were living out on the
svn/asterisk/team/sruffell/asterisk-1.4-transcoder branch.  codec_dahdi.c now
always uses signed linear as the simple codec so that a soft g729 codec will
not end up being preferred to the hardware codec.  There are also changes to
allow codec_dahdi.c to feed packets to the hardware in the native sample size of
the codec.  This solves problems with choppy audio when using G723. 


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176810 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-18 00:34:38 +00:00
Jeff Peeler
de8f6bab86 Modify bridging to properly evaluate DTMF after first warning is played
The main problem is currently if the Dial flag L is used with a warning sound,
DTMF is not evaluated after the first warning sound. To fix this, a flag has 
been added in ast_generic_bridge for playing the warning which ensures that if
a scheduled warning is missed, multiple warrnings are not played back (due to a
feature evaluation or waiting for digits). ast_channel_bridge was modified to
store the nexteventts in the ast_bridge_config structure as that information
was lost every time ast_channel_bridge was reentered, causing a hangup due to
incorrect time calculations.

(closes issue #14315)
Reported by: tim_ringenbach

Reviewed on reviewboard:
http://reviewboard.digium.com/r/163/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-17 21:54:34 +00:00
Tilghman Lesher
7799945eb9 Backport change to 1.4:
Prior to masquerade, move the group definitions to the channel performing the
  masq, so that the group count lingers past the bridge.
  (closes issue #14275)
   Reported by: kowalma
   Patches: 
         20090216__bug14275.diff.txt uploaded by Corydon76 (license 14)
   Tested by: kowalma


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176661 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-17 21:21:41 +00:00
Tilghman Lesher
e891f2a92d After a 'sip reload', qualifies for realtime peers weren't immediately
restarted, instead waiting until the next registration.  We're now
caching the qualify across a reload/restart and starting the qualify
immediately upon loading the peer.
(closes issue #14196)
 Reported by: pdf
 Patches: 
       20090120__bug14196_1.4.diff.txt uploaded by pdf (license 663)
 Tested by: pdf


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176426 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-17 00:49:22 +00:00
David Vossel
03dd54be23 Fixes issue with AST_CONTROL_SRCUPDATE not being relayed correctly during bridging
This should have been committed with rev176247, but I missed it.  srcupdate frames no longer break out of the native bridge, but are not being sent to the other call leg either.  This fixs that.

issue #13749




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176354 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-16 23:30:52 +00:00
Kevin P. Fleming
4d808232cf correct a logic error in the last stringfields commit... don't mark additional space as allocated if the string was built using already-allocated space
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176254 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-16 21:41:46 +00:00
Mark Michelson
b30800adfb Remove unused variable and make dev-mode compilation happy
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176252 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-16 21:39:21 +00:00
Mark Michelson
5ae664d5aa Open the DAHDI pseudo device and set it to be nonblocking atomically
Apparently on FreeBSD, attempting to set the O_NONBLOCKING flag separately
from opening the file was causing an "inappropriate ioctl for device" error.
While I cannot fathom why this would be happening, I certainly am not opposed
to making the code a bit more compact/efficient if it also fixes a bug.

(closes issue #14482)
Reported by: ys
Patches:
      meetme.patch uploaded by ys (license 281)
Tested by: ys



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176249 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-16 21:34:27 +00:00
David Vossel
1a00cbbf1d Fixes issue with AST_CONTROL_SRCUPDATE breaking out of native bridge
In iax2, when a AST_CONTROL_SRCUPDATE is received it breaks from the native bridge, but since there is no code path to handle srcupdate it just goes to be beginning of the loop.  This was causing packet storms of srcupdate frames between servers.  Now srcupdate frames do not break the native bridge for processing.    

(closes issue #13749)
Reported by: adiemus



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176247 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-16 21:28:20 +00:00
Kevin P. Fleming
1b5b3efcae fix a flaw in the ast_string_field_build() family of API calls; these functions made no attempt to reuse the space already allocated to a field, so every time the field was written it would allocate new space, leading to what appeared to be a memory leak.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-16 21:10:38 +00:00
Joshua Colp
22734e39dc Don't have the Via header stored as a stringfield as it can change often during the lifetime of a dialog.
This issue crept up with subscriptions on the AA50. When an outgoing NOTIFY is sent a new branch value
is created and the Via header is changed to reflect it. Since this was a stringfield a new spot in the
pool was used for the value while the old was left untouched/unused. If the current pool was full a new
pool was created. This would cause memory usage to increase steadily.

(issue #AA50-2332)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-16 15:33:53 +00:00
Michiel van Baak
db4dc67740 fix mis-spelling of the word registered.
Reported by De_Mon on #asterisk-dev.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-15 23:37:03 +00:00
Olle Johansson
4c3b9ccf3b format_ilbc does not depend on codec libraries and can therefore always be made. My mistake. Ursäkta!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-15 20:33:17 +00:00
Olle Johansson
beaf6760c4 Disable format_ilbc.so by default, like codec_ilbc.so
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-15 20:20:21 +00:00
Olle Johansson
ada21a8039 Make sure that the debug line is not printed on debug level 0
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-15 19:48:38 +00:00
Jason Parker
3cc3863d28 Zaptel is not DAHDI. Rather, Zaptel is actually Zaptel. (in case you're confused, DAHDI is still DAHDI)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175698 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-13 21:53:16 +00:00
Mark Michelson
3e0b36d9d0 Fix a potential crash situation when using IMAP voicemail
If calling into VoiceMailMain when using IMAP storage, it was
possible to crash Asterisk by hanging up the phone when prompted
for a voicemail mailbox. This patch fixes the issue.

While it may appear that this patch is superficial, it allows code
execution to continue to the failure case just below the IMAP_STORAGE
code block where this patch has been applied

(closes issue #14473)
Reported by: dwpaul
Patches:
      voicemail_imap_crash_no_mailbox.patch uploaded by dwpaul (license 689)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175590 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-13 19:47:48 +00:00
Mark Michelson
7accd1ec46 Fix a place where filestreams were not refcounted properly
This section was already present in trunk and other branches,
but did not exist in 1.4.

(closes issue #14395)
Reported by: ZX81
Patches:
      14395.patch uploaded by putnopvut (license 60)
Tested by: ZX81



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175407 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-12 23:22:44 +00:00
Tilghman Lesher
a13deff994 Fix crashes when receiving certain T.38 packets. Also, increase the maximum
size of T.38 packets and warn users when they try to set the limits above those
maximums.
(closes issue #13050)
 Reported by: schern
 Patches: 
       20090212__bug13050.diff.txt uploaded by Corydon76 (license 14)
 Tested by: schern


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-12 21:19:40 +00:00
Jeff Peeler
46963bc8b5 Fix ParkedCall event information for From field in the case of a blind transfer
If the parker information can not be obtained from the peer, try and see if
the BLINDTRANSFER channel variable has been set. Previously, a blind transfer
to the ParkAndAnnounce app would return nothing for the From.

Closes AST-189



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-12 20:34:36 +00:00
Jeff Peeler
3e396d458a Fix crash in event of failed attempt to transfer to parking
The peer may not necessarily exist, such as in the case of a transfer to
ParkAndAnnounce. In this case don't try to play a sound to it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-12 17:57:10 +00:00
Russell Bryant
bfaa341f58 Don't send DTMF for infinite time if we do not receive an END event.
I thought that this was going to end up being a pretty gnarly fix, but it turns
out that there was actually already a configuration option in rtp.conf, 
dtmftimeout, that was intended to handle this situation.  However, in between 
Asterisk 1.2 and Asterisk 1.4, the code that processed the option got lost.
So, this commit brings it back to life.

The default timeout is 3 seconds.  However, it is worth noting that having
this be configurable at all is not really the recommended behavior in RFC 2833.
From Section 3.5 of RFC 2833:

      Limiting the time period of extending the tone is necessary
      to avoid that a tone "gets stuck". Regardless of the
      algorithm used, the tone SHOULD NOT be extended by more than
      three packet interarrival times. A slight extension of tone
      durations and shortening of pauses is generally harmless.

Three seconds will pretty much _always_ be far more than three packet 
interarrival times.  However, that behavior is not required, so I'm going to
leave it with our legacy behavior for now.

Code from svn/asterisk/team/russell/issue_14460

(closes issue #14460)
Reported by: moliveras


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-12 16:51:13 +00:00
Philippe Sultan
d045d36561 Set the initiator attribute to lowercase in our replies when receiving calls.
This attribute contains a JID that identifies the initiator of the GoogleTalk
voice session. The GoogleTalk client discards Asterisk's replies if the 
initiator attribute contains uppercase characters.

(closes issue #13984)
Reported by: jcovert
Patches:
      chan_gtalk.2.patch uploaded by jcovert (license 551)
Tested by: jcovert


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-12 10:16:21 +00:00
Joshua Colp
70f7c7e9cb Revert RTP changes for continuation of DTMF. Proxy commit by russell via SMS.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-12 00:19:30 +00:00
Russell Bryant
1d4e4ff3d1 Clear out the current event after forcing the end of a digit
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174986 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-12 00:01:02 +00:00
Russell Bryant
9dff8995b4 Fixify infinite DTMF in the case that no RFC2833 END event is ever received
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-11 23:56:37 +00:00
Tilghman Lesher
9e38dd5427 Restore a behavior that was recently changed, when we fixed issue #13962 and
issue #13363 (related to issue #6176).  When a hangup occurs during a Macro
execution in earlier 1.4, the h extension would execute within the Macro
context, whereas it was always supposed to execute only within the main context
(where Macro was called).  So this fix checks for an "h" extension in the
deepest macro context where a hangup occurred; if it exists, that "h" extension
executes, otherwise the main context "h" is executed.
(closes issue #14122)
 Reported by: wetwired
 Patches: 
       20090210__bug14122.diff.txt uploaded by Corydon76 (license 14)
 Tested by: andrew


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174885 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-11 20:54:18 +00:00
Joshua Colp
9fa3324845 Go off hold when we get an empty reinvite telling us to.
(closes issue #14448)
Reported by: frawd
Patches:
      hold_invite_nosdp.patch uploaded by frawd (license 610)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-10 18:50:50 +00:00
Matthew Nicholson
b60ec2baa1 Improve behavior of jitterbuffer when maxjitterbuffer is set.
This change improves the way the jitterbuffer handles maxjitterbuffer and
dramatically reduces the number of frames dropped when maxjitterbuffer is
exceeded.  In the previous jitterbuffer, when maxjitterbuffer was exceeded, all
new frames were dropped until the jitterbuffer is empty.  This change modifies
the code to only drop frames until maxjitterbuffer is no longer exceeded.

Also, previously when maxjitterbuffer was exceeded, dropped frames were not
tracked causing stats for dropped frames to be incorrect, this change also
addresses that problem.

(closes issue #14044)
Patches:
      bug14044-1.diff uploaded by mnicholson (license 96)
Tested by: mnicholson
Review: http://reviewboard.digium.com/r/144/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-10 17:52:42 +00:00
Steve Murphy
680cc35607 This patch solves some compiler complaints
in both 32 and 64-bit environments.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-10 02:27:40 +00:00
Mark Michelson
7f20e5ffab Don't do an SRV lookup if a port is specified
RFC 3263 says to do A record lookups on a hostname
if a port has been specified, so that's what we're
going to do. See section 4.2.

(closes issue #14419)
Reported by: klaus3000
Patches:
      patch_chan_sip_nosrvifport_1.4.23.txt uploaded by klaus3000 (license 65)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174282 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-09 17:11:05 +00:00
Joshua Colp
e2fd8852db 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@174218 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-09 14:48:21 +00:00
Russell Bryant
c347a43c9f Fix a race condition that could cause a crash.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174148 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-07 16:15:07 +00:00
Dwayne M. Hubbard
d29a99cb89 check ast_strlen_zero() before calling ast_strdupa() in sip_uri_headers_cmp()
and sip_uri_params_cmp()

The reporter didn't actually upload a properly-formed patch, instead a 
modified chan_sip.c file was uploaded.  I created a patch to determine the
changes, then modified the suggested changes to create a proper fix.  The
summary above is a complete description of the changes.

(closes issue #13547)
Reported by: tecnoxarxa
Patches:
      chan_sip.c.gz uploaded by tecnoxarxa (license 258)
Tested by: tecnoxarxa


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-06 23:36:03 +00:00
Joshua Colp
c80b2b93b5 Remove a debug message I put in by accident.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-06 17:15:01 +00:00
Joshua Colp
6cda579f17 Some clients do not put the call-id for replaces at the beginning, so support it being anywhere in the string.
(closes issue #14350)
Reported by: fhackenberger


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173967 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-06 17:14:15 +00:00
Matthew Nicholson
5edf9d8a59 Limit the addition of the Contact header in SIP responses according to various
SIP RFCs.

(closes issue #13602)
Reported by: hjourdain
Tested by: mnicholson


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-06 16:20:23 +00:00
Tilghman Lesher
76af76c5f4 Backport OS X fix from trunk
(AGAIN, closes issue #14360)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173900 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-06 15:43:32 +00:00
Mark Michelson
f70845aa24 Fix logic regarding when to perform an SRV lookup for outgoing REGISTER requests
With this fix, we only will perform an SRV lookup at the following times:

* The first time we register with a remote registrar
* If we send a REGISTER but do not receive a response
* If the sendto() function returns an error

While I wrote the patch that fixes this issue, a huge amount of credit is due
to Brett Bryant, who wrote the initial patch on which I based this one.

(closes issue #12312)
Reported by: jrast
Patches:
      12312.patch uploaded by putnopvut (license 60)
Tested by: blitzrage

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-05 23:19:16 +00:00
Jeff Peeler
0b026ce04f Add new configuration option to make shared IMAP mailboxes function as expected.
The new option is "imapvmshareid" which is an ID to tag multiple mailboxes
using the same IMAP storage location to function as one mailbox. This allows
all messages to be retrieved for any user in the group. The patch alters the
'X-Asterisk-VM-Extension' header that is responsible for matching voicemails
for a given user.

(closes issue #13673)
Reported by: howardwilkinson



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-05 20:47:51 +00:00
Mark Michelson
e7478c7b15 Fix situations where queue members could be autopaused unexpectedly
Specifically, this patch prevents us from autopausing members when
we receive a busy or congestion frame from them.

(closes issue #14376)
Reported by: fiddur
Patches:
      14376.patch uploaded by putnopvut (license 60)
Tested by: fiddur



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173692 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-05 20:29:09 +00:00
Mark Michelson
d914df762a Add some missing cleanup to app_mixmonitor
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-05 18:47:24 +00:00
Mark Michelson
8e764c583d Fix a problem where a channel pointer becomes invalid due to masquerading or hanging up.
app_mixmonitor runs its own thread to monitor the channel's activity and write the mixed
audio to a file. Since this thread runs independently of the channel, it is possible that
the mixmonitor thread's channel pointer will point to freed memory when the channel either
is masqueraded or hangs up (technically, both cases are hangups, but we need to handle the
cases slightly differently).

The solution for this is to employ a datastore, which has the nice benefit of allowing us 
to hook into channel masquerades and hangups and update our pointer as necessary. If this
looks familiar, this same technique is employed in app_chanspy. app_chanspy is a bit more
involved since it does a lot more operations on the channel that is being spied upon.

app_mixmonitor does have an extra touch that app_chanspy doesn't have, though. Since there
is a thread race between the channel's thread and the mixmonitor thread on a hangup, we em-
ploy a condition-and-boolean combination to ensure that the channel thread finishes with
our structure before the mixmonitor thread attempts to free it. No crashes!

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-05 17:34:33 +00:00
Mark Michelson
82937be553 Revert my previous change because it was stupid
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173396 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-04 17:44:48 +00:00
Mark Michelson
fed7d2308b Add a missing unlock. Extremely unlikely to ever matter, but it's needed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-04 17:40:29 +00:00
David Vossel
28056ffc94 Fixes issue with IAX2 transfer not handing off calls.
Fixes issue with IAX2 transfers not taking place.  As it was, a call that was being transfered would never be handed off correctly to the call ends because of how call numbers were stored in a hash table.  The hash table, "iax_peercallno_pvt", storing all the current call numbers did not take into account the complications associated with transferring a call, so a separate hash table was required.  This second hash table "iax_transfercallno_pvt" handles calls being transfered, once the call transfer is complete the call is removed from the transfer hash table and added to the peer hash table resuming normal operations. Addition functions were created to handle storing, removing, and comparing items in the iax_transfercallno_pvt table. 

(issue #13468)
Review: http://reviewboard.digium.com/r/140/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173248 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-03 23:35:55 +00:00
Jeff Peeler
87c921a68e Parking attempts made to one end of a bridge no longer will hang up due to a
parking failure.

Parking attempts made using either one-touch, or doing either a blind or 
assisted transfer to the parking extension now keep up the bridge instead of
hanging up the attempted parked party. Normal causes for the parking attempt
to fail includes the specific specified extension (via PARKINGEXTEN) not being 
available or if all the parking spaces are currently in use. To avoid having
to reverse a masquerade park_space_reserve was made to provide foresight if
a parking attempt will succeed and if so reserve the parking space.

(closes issue #13494)
Reported by: mdu113

Reviewed by Russell: http://reviewboard.digium.com/r/133/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-03 21:57:01 +00:00
Tilghman Lesher
13138151e1 Add warning to standard config, that globals may be overridden by other
dialplan configuration files.
(closes issue #14388)
 Reported by: macli


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-03 00:15:59 +00:00
Terry Wilson
1a9018e799 Fix a feature inheritance bug I added after code review
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-02 23:48:06 +00:00
Richard Mudgett
cefe4f025d channels/chan_dahdi.c
*  Added doxygen comments to the major dahdi structures.
*  Fixed PRI using an incorrect string value if the extension
delimiter is not present in the Dial() function.
*  Fixed some uninitialized string variables on FXS ports.

configs/chan_dahdi.conf.sample
*  Updated some documentation.

These changes are already in trunk -r172400


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@172962 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-02 20:28:54 +00:00
Terry Wilson
2b340eab54 Rename new parkedcallparking option to parkedcallreparking
Since this option actually already existed in 1.6.0+, use the same name so as
not to confuse people when they upgrade


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@172639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-31 00:15:09 +00:00
Terry Wilson
4e069885ce Fix feature inheritance with builtin features
When using builtin features like parking and transfers, the AST_FEATURE_* flags
would not be set correctly for all instances when either performing a builtin
attended transfer, or parking a call and getting the timeout callback.  Also,
there was no way on a per-call basis to specify what features someone should
have on picking up a parked call (since that doesn't involve the Dial() command).
There was a global option for setting whether or not all users who pickup a
parked call should have AST_FEATURE_REDIRECT set, but nothing for DISCONNECT,
AUTOMON, or PARKCALL.

This patch:
1) adds the BRIDGE_FEATURES dialplan variable which can be set either in the
dialplan or with setvar in channels that support it.  This variable can be set
to any combination of 't', 'k', 'w', and 'h' (case insensitive matching of the
equivalent dial options), to set what features should be activated on this
channel.  The patch moves the setting of the features datastores into the
bridging code instead of app_dial to help facilitate this.

2) adds global options parkedcallparking, parkedcallhangup, and
parkedcallrecording to be similar to the parkedcalltransfers option for
globally setting features.

3) has builtin_atxfer call builtin_parkcall if being transfered to the parking
extension since tracking everything through multiple masquerades, etc. is
difficult and error-prone

4) attempts to fix all cases of return calls from parking and completed builtin
transfers not having the correct permissions
(closes issue #14274)
Reported by: aragon
Patches: 
      fix_feature_inheritence.diff.txt uploaded by otherwiseguy (license 396)
Tested by: aragon, otherwiseguy

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@172517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-30 17:47:41 +00:00
Tilghman Lesher
c257ffeed0 Lose the CAP_NET_ADMIN at every fork, instead of at startup. Otherwise, if
Asterisk runs as a non-root user and the administrator does a 'restart now',
Asterisk loses the ability to set QOS on packets.
(closes issue #14004)
 Reported by: nemo
 Patches: 
       20090105__bug14004.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@172438 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-29 22:54:29 +00:00
Olle Johansson
3209942b7e Make sure that we always add the hangupcause headers. In some cases, the owner was disconnected before we checked for the cause.
This patch implements a temporary storage in the pvt and use that instead.

The code is based on ideas from code from Adomjan in issue #13385 (Add support for Reason: header)
Thanks to Klaus Darillion for testing!

(closes issue #14294)
related to issue #13385

Reported by: klaus3000 and adomjan
Patches: 
      bug14294b.diff uploaded by oej (license 306)
      Based on 20080829_chan_sip.c-q850reason_header.patch uploaded by adomjan (license 487)
Tested by: oej, klaus3000



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@172169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-29 08:48:18 +00:00
Steve Murphy
13a60eba0c This patch fixes h-exten running misbehavior in manager-redirected
situations.

What it does:
1. A new Flag value is defined in include/asterisk/channel.h,
 AST_FLAG_BRIDGE_HANGUP_DONT, which used as a messenge to the
 bridge hangup exten code not to run the h-exten there (nor
 publish the bridge cdr there). It will done at the pbx-loop
 level instead.
2. In the manager Redirect code, I set this flag on the channel
 if the channel has a non-null pbx pointer. I did the same for the
 second (chan2) channel, which gets run if name2 is set...
 and the first succeeds.
3. I restored the ending of the cdr for the pbx loop h-exten
 running code. Don't know why it was removed in the first place.
4. The first attempt at the fix for this bug was to place code
   directly in the async_goto routine, which was called from a
   large number of places, and could affect a large number of
   cases, so I tested that fix against a fair number of transfer
   scenarios, both with and without the patch. In the process,
   I saw that putting the fix in async_goto seemed not to affect
   any of the blind or attended scenarios, but still, I was
   was highly concerned that some other scenarios I had not tested
   might be negatively impacted, so I refined the patch to 
   its current scope, and jmls tested both. In the process, tho,
   I saw that blind xfers in one situation, when the one-touch
   blind-xfer feature is used by the peer, we got strange 
   h-exten behavior.  So, I  inserted code to swap CDRs and
   to set the HANGUP_DONT field, to get uniform behavior.
5. I added code to the bridge to obey the HANGUP_DONT flag,
   skipping both publishing the bridge CDR, and running
   the h-exten; they will be done at the pbx-loop (higher)
   level instead.
6. I removed all the debug logs from the patch before committing.
7. I moved the AUTOLOOP set/reset in the h-exten code in res_features
   so it's only done if the h-exten is going to be run. A very
   minor performance improvement, but technically correct.


(closes issue #14241)
Reported by: jmls
Patches:
      14241_redirect_no_bridgeCDR_or_h_exten_via_transfer uploaded by murf (license 17)
Tested by: murf, jmls



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@172030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-28 18:51:16 +00:00
Tilghman Lesher
16f378c559 Clarify log message (suggested by manxpower on #asterisk-dev)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171963 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-28 17:25:18 +00:00
Olle Johansson
566429c300 Add a better explanation of the difference between the device namespace and the dialplan for newbies.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171837 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-28 13:07:27 +00:00
Mark Michelson
cade7e1559 Fix devicestate problems for "always-on" agent channels
A revision to chan_agent attempted to "inherit" the device
state of the underlying channel in order to report the
device state of an agent channel more accurately.

The problem with the logic here is that it makes no sense to
use this for always-on agents. If the agent is logged in, then
to the underlying channel, the agent will always appear to be
"in use," no matter if the agent is on a call or not. The reason
is that to the underlying channel, the channel is currently in use
on a call to the AgentLogin application.

The most common cause that I found for this issue to occur was for
a SIP channel to be the underlying channel type for an Agent channel.
If the SIP phone re-registers, then the registration will cause the
device state core to query the device state of the SIP channel. Since the
SIP channel is in use, the Agent channel would also inherit this status.
Once the agent channel was set to "in use" there was no way that the device
state could change on that channel unless the agent logged out.

The solution for this problem is a bit different in 1.4 than it is in the
other branches. In 1.4, there will be a one-line fix to make sure that only
callback agents will inherit device state from their underlying channel type.
For the other branches of Asterisk, since callback support has been removed, there
is also no need for device state inheritance in chan_agent, so I will simply be
removing it from the code.

In addition, the 1.4 source is getting a new comment to help the next person who
edits chan_agent.c. I'm adding a comment that a agent_pvt's loginchan field may be
used to determine if the agent is a callback agent or not.

(closes issue #14173)
Reported by: nathan
Patches:
      14173.patch uploaded by putnopvut (license 60)
Tested by: nathan, aramirez



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-27 21:55:08 +00:00
Mark Michelson
0b74f727d7 Prevent a crash from occurring when a jitter buffer interpolated frame is
removed from a slinfactory

slinfactory used the "samples" field of an ast_frame in order to determine
the amount of data contained within the frame. In certain cases, such as
jitter buffer interpolated frames, the frame would have a non-zero value for
"samples" but have NULL "data"

This caused a problem when a memcpy call in ast_slinfactory_read would attempt
to access invalid memory. The solution in use here is to never feed frames into
the slinfactory if they have NULL "data"

(closes issue #13116)
Reported by: aragon
Patches:
      13116.diff uploaded by putnopvut (license 60)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-27 20:06:01 +00:00
Olle Johansson
bc6f14e8e0 Use the same branch tag in CANCEL as in INVITE
Originally putnopvut implemented some changes in revision 142079 that according to the bug report seemed to have worked then, but somehow fails now.
I guess code, as humans, get old and forget stuff. Anyway, this bug caused CANCEL not to work with picky systems. 

Thanks Fredrik for pointing out where the bug in the SIP messaging was.

(closes issue #14346)
Reported by: oej
Patches: 
      bug14346.diff uploaded by oej (license 306)
Tested by: oej


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-27 14:33:20 +00:00
Russell Bryant
722273ced3 Resolve some synchronization issues in chan_iax2 scheduler handling.
The important changes here are related to the synchronization between threads
adding items into the scheduler and the scheduler handling thread.  By adjusting
the lock and condition handling, we ensure that the scheduler thread sleeps no
longer and no less than it is supposed to.  We also ensure that it does not
wake up more often than it has to.

There is no bug report associated with this.  It is just something that I found
while putting scheduler thread handling into a reusable form (review 129).

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-26 21:31:59 +00:00
Olle Johansson
40a6283695 Don't retransmit 401 on REGISTER requests when alwaysauthreject=yes
(closes issue #14284)
Reported by: klaus3000
Patches: 
      patch_chan_sip_unreliable_1.4.23_14284.txt uploaded by klaus3000 (license 65)
Tested by: klaus3000



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-26 12:51:53 +00:00
Tilghman Lesher
10ed93d16d Correctly track the hookstate
(closes issue #13686)
 Reported by: itiliti
 Patches: 
       20081013__bug13686.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-25 23:44:01 +00:00
Tilghman Lesher
57c31c89eb Err, yeah.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-25 20:40:44 +00:00
Tilghman Lesher
2957e5ae8e Add thread to kill zombies, when child processes don't die immediately on
SIGHUP.
(closes issue #13968)
 Reported by: eldadran
 Patches: 
       20090114__bug13968.diff.txt uploaded by Corydon76 (license 14)
 Tested by: eldadran


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-25 20:30:41 +00:00
Sean Bright
52b97107ea Resolve a logic error that was causing Page() to crash when more than one
channel was specified.

(closes issue #14308)
Reported by: bluefox
Patches:
      20090124__bug14308.diff.txt uploaded by seanbright (license 71)
Tested by: kc0bvu


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@170979 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-25 13:33:20 +00:00
Tilghman Lesher
3c19ad100a Remove superfluous implementation note (closes issue #14319)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@170836 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-24 13:55:02 +00:00
Mark Michelson
8fe9b2a600 Add notes to the idlecheck explanation in res_odbc.conf.sample
(closes issue #14319)
Reported by: klaus3000
Patches:
      patch_idlecheck_res_odbc.conf.sample.txt uploaded by klaus3000 (license 65)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@170719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-23 20:55:26 +00:00
Mark Michelson
c45139dd5d Update contrib/i18n.testsuite.conf to not use deprecated syntax
* Convert Wait,1 to Wait(1)
* Convert SetLanguage to Set(CHANNEL(language))
* Use 'n' for all priorities beyond the first

Also added test for Chinese numbers, too.

(closes issue #14320)
Reported by: dant
Patches:
      i18n.testsuite.conf.issue14320.v2.diff uploaded by dant (license 670)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@170671 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-23 20:21:51 +00:00
Joshua Colp
87c02936b6 When a channel is answered make sure any indications currently playing stop. Usually the phone would do this but if the channel was already answered then they are being generated by Asterisk and we darn well need to stop them.
(closes issue #14249)
Reported by: RadicAlish


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@170648 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-23 20:16:39 +00:00
Tilghman Lesher
d55538fd20 Additions to AST-2009-001
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@170588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-23 19:20:44 +00:00
Joshua Colp
8a1faf0a58 When a call is forwarded stop any active indications. The new channel will provide an indication, if need be, itself.
(closes issue #14310)
Reported by: RadicAlish


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@170568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-23 19:06:54 +00:00
Joshua Colp
5efdade8eb Use the on hold flag to see if the call is on hold or not. It is possible that our address for them will still be valid even though they are on hold.
(closes issue #14295)
Reported by: klaus3000


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@170504 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-23 18:04:08 +00:00
Mark Michelson
1bef118f00 Fix broken call pickup
There was a subtle change in ast_do_masquerade which
resulted in failed attempts to pickup calls. The problem
was that the value of the AST_FLAG_OUTGOING flag was
copied from the clone to the original channel. In the case
of call pickup, this meant that the AST_FLAG_OUTGOING flag
ended up being cleared on the channel that was attempting
to execute the pickup.

Because this flag was not set, when ast_read came across
an answer frame, it ignored it. The result of this was that
the calling channel was never properly answered.

This fix changes the behavior in ast_do_masquerade to set
the flags on the original channel to the union of the flags
on the clone channel. This way, if the AST_FLAG_OUTGOING
flag is set on either of the two channels involved in the
masquerade, the resulting channel will have the flag set
as well.

(closes issue #14206)
Reported by: francesco_r
Patches:
      14206.patch uploaded by putnopvut (license 60)
Tested by: francesco_r, aragon, putnopvut



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@170392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-23 15:40:39 +00:00
Joshua Colp
3ff70ed000 Don't crash if RTCP is not enabled on an RTP structure but statistics are output.
(closes issue #14234)
Reported by: jcovert
Patches:
      rtp.c.patch-1.6.0.3 uploaded by jcovert (license 551)
      rtp.c.patch-svn-165599 uploaded by jcovert (license 551)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@170239 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-22 20:02:35 +00:00
Tilghman Lesher
39e797b9d9 Allow global variables after substitution to be as long as other variables.
(closes issue #14263)
 Reported by: markd
 Patches: 
       20090120__bug14263.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@170158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-22 17:18:07 +00:00
Joshua Colp
c8f9023696 If we are unable to request a DAHDI pseudo channel and we are using the user introduction without review option make sure it gets unset so other code does not blindly assume a DAHDI pseudo channel exists.
(closes issue #14282)
Reported by: cheesegrits


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@170147 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-22 16:50:54 +00:00
Joshua Colp
4ee4e941f8 Do a string comparison instead of pointer comparison since some people specify the context they are actually in as an argument to get around some funkiness.
(closes issue #14011)
Reported by: dveiga
Patches:
      pbx.c.patch uploaded by dveiga (license 665)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@170050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-22 15:13:56 +00:00
Tilghman Lesher
e2d1540779 AST_RWLOCK_INIT_VALUE is always defined. What we really wanted to ask is
whether autoconf detected a static initializer value.  This fixes rwlocks
on all such platforms (mainly, Mac OS X).
(closes issue #13767)
 Reported by: jcovert
 Patches: 
       20090121__bug13767.diff.txt uploaded by Corydon76 (license 14)
 Tested by: jcovert, Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@169943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-22 00:43:31 +00:00
Terry Wilson
3a24e83768 Fix builtin_blindtransfer calling back the wrong channel
Blindtransfer also was calling back the wrong channel when a timeout occurred.
This should be the last of these, as there are no more masq_park_announce calls
that aren't passing orig_chan_name


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@169868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-21 23:23:59 +00:00
Joshua Colp
376d85f96c Read lock the contexts to maintain the locking order when we are notified that the state of a device has changed.
(closes issue #13839)
Reported by: mcallist


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@169867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-21 23:20:47 +00:00
Mark Michelson
9db9bae4d9 Adding revision 169794 to 1.4 since 1.4 is also affected by the issue
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@169797 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-21 22:14:52 +00:00
Tilghman Lesher
e34da1e519 Extra NULLs in the output cause some terminal types to abort in the middle of
a color code, causing terminal weirdness.
(closes issue #14130)
 Reported by: coolmig
 Patches: 
       20090121__bug14130.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76, coolmig


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@169722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-21 21:02:32 +00:00
Terry Wilson
63385b716c One-touch parking was calling back the wrong channel on timeout
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@169581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-20 23:49:34 +00:00
Terry Wilson
0999576f0a Don't play audio to the channel if we've masqueraded
(closes issue #14066)
Reported by: bluefox
Tested by: otherwiseguy, bluefox


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@169485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-20 18:40:56 +00:00
Tilghman Lesher
f311539733 Truncate userevents at the end of a line, when the command exceeds the buffer.
(closes issue #14278)
 Reported by: fnordian


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@169364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-19 19:49:25 +00:00
Mark Michelson
ece7a8f9e9 Prevent a crash in chan_local due to a potential NULL pointer dereference
Move the check for if both channels on a local_pvt have generators to below
where p->chan is checked for NULLity (NULLness?). This prevents a crash from
occurring if p->chan is NULL.

(closes issue #14189)
Reported by: sascha
Patches:
      14189.patch uploaded by putnopvut (license 60)
Tested by: sascha



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@169210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-19 15:52:15 +00:00
Mark Michelson
09b6f02459 Account for possible NULL pointer when we receive a 408 in response to a REGISTER
It may be that by the time we receive a reply to a REGISTER request, the attempt has
timed out and thus the registry structure pointed to by the corresponding sip_pvt has
gone away. This situation was handled properly for a 200 OK response, but the 408
case assumed that the sip_registry struct was non-NULL, thus potentially causing a crash

This commit fixes this assumption and prints out a message to the console if we should
receive a late 408 response to a REGISTER


(closes issue #14211)
Reported by: aborghi
Patches:
      14211.diff uploaded by putnopvut (license 60)
Tested by: aborghi



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-16 22:42:13 +00:00
Tilghman Lesher
d671bb1404 Fix the conjugation of Russian and Ukrainian languages.
(related to issue #12475)
 Reported by: chappell
 Patches: 
       vm_multilang.patch uploaded by chappell (license 8)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-16 18:41:35 +00:00
Steve Murphy
93e9f63794 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@168745 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-16 00:19:12 +00:00
Olle Johansson
464b4a8a84 Meetme actually has realtime but wasn't documented
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-15 18:43:43 +00:00
Terry Wilson
4b25111108 Convert call to park_call_full to masq_park_call_announce
Since we removed the AST_PBX_KEEPALIVE return value, we need to use masqueraded
parking, otherwise we will try to call ast_hangup() in __pbx_run() and in
do_parking_thread() and then promptly crash.
(closes issue #14215)
	Reported by: waverly360	
	Tested by: otherwiseguy
(closes issue #14228)
	Reported by: kobaz
	Tested by: otherwiseguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168716 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-15 18:22:49 +00:00
Tilghman Lesher
daf9a88f60 Blocked revision 168632 from /branches/1.2:
1.2 regression on security fix AST-2009-001
(Closes issue #14238)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168633 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-15 01:20:20 +00:00
Mark Michelson
26658ead16 Fix some crashes from bad datastore handling in app_queue.c
* The queue_transfer_fixup function was searching for and removing
  the datastore from the incorrect channel, so this was fixed.

* Most datastore operations regarding the queue_transfer datastore
  were being done without the channel locked, so proper channel locking
  was added, too.

(closes issue #14086)
Reported by: ZX81
Patches:
      14086v2.patch uploaded by putnopvut (license 60)
Tested by: ZX81, festr



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-15 00:11:01 +00:00
Richard Mudgett
1a80fbd577 * Fixed create_process() allocation of process ID values.
The allocated process IDs could overflow their respective
NT and TE fields.  Affects outgoing calls.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-14 21:48:22 +00:00
Sean Bright
f94caa935b Update autosupport script to supply info for both Zaptel and DAHDI in 1.4 and
be sure to run dahdi_test in 1.6.x and trunk instead of zttest.

(closes issue #14132)
Reported by: dsedivec
Patches:
      asterisk-1.4-autosupport.patch uploaded by dsedivec (license 638)
      asterisk-trunk-autosupport.patch uploaded by dsedivec (license 638)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168614 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-14 20:52:00 +00:00
Steve Murphy
7c1d2de899 app_page was failing to compile in dev-mode on my gcc-4.2.4 system. This change gets rid of the warning.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-14 19:34:35 +00:00
Tilghman Lesher
99313c7b92 Don't read into a buffer without first checking if a value is beyond the end.
(closes issue #13600)
 Reported by: atis
 Patches: 
       20090106__bug13600.diff.txt uploaded by Corydon76 (license 14)
 Tested by: atis


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-14 19:02:55 +00:00
Mark Michelson
3af85c8b97 Fix a logic error I found while searching through chan_agent.c
I found that the allow_multiple_logins function would never return
0 due to an incorrect comparison being used when traversing the
list of agents. While I was modifying this function, I also did
a little bit of coding guidelines cleanup, too.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-14 16:19:26 +00:00
Terry Wilson
b3ea953313 Don't overflow when paging more than 128 extensions
The number of available slots for calls in app_page was hardcoded to 128.
Proper bounds checking was not in place to enforce this limit, so if more than
128 extensions were passed to the Page() app, Asterisk would crash.  This patch
instead dynamically allocates memory for the ast_dial structures and removes
the (non-functional) arbitrary limit.

This issue would have special importance to anyone who is dynamically creating
the argument passed to the Page application and allowing more than 128
extensions to be added by an outside user via some external interface.

The patch posted by a_villacis was slightly modified for some coding guidelines
and other cleanups.  Thanks, a_villacis!
(closes issue #14217)
Reported by: a_villacis
Patches: 
      20080912-asterisk-app_page-fix-buffer-overflow.patch uploaded by a (license 660)
Tested by: otherwiseguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-14 01:27:18 +00:00
Russell Bryant
9161b7fc87 Revert unnecessary indications API change from rev 122314
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-13 19:13:05 +00:00
Terry Wilson
1dc0a2d811 Don't pass a value with a side effect to a macro
(closes issue #14176)
Reported by: paraeco
Patches: 
      chan_sip.c.diff uploaded by paraeco (license 658)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-13 18:34:14 +00:00
Tilghman Lesher
ebe9c9c5db If either conditional is NULL, don't try copying it.
(closes issue #14226)
 Reported by: caspy
 Patches: 
       20090113__bug14226.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-13 17:48:00 +00:00
Jeff Peeler
b01ec2512d (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: https://origsvn.digium.com/svn/asterisk/branches/1.4@168516 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-12 21:42:34 +00:00
Jeff Peeler
f1c216e940 (closes issue #12269)
Reported by: IgorG
Tested by: denisgalvao

This gits rid of the notion of an owning_app allowing the request and hangup to be initiated by different threads. Originating from an active agent channel requires this. The implementation primarily changes __login_exec to wait on a condition variable rather than a lock.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-12 20:26:22 +00:00
Mark Michelson
2d10fef93e I am reverting the fix made in revision 168128 (and its upward merges)
after being contacted by Olle Johansson and being shown how this fix is
incorrect. Thanks to Olle for clearing this up for me.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168482 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-12 14:58:25 +00:00
Russell Bryant
5dca47a8bf s/ringdance/ringcadence/ for Bulgaria
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168480 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-12 14:57:27 +00:00
Kevin P. Fleming
a8af968c1d small commit to test new server
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-10 20:47:31 +00:00
Kevin P. Fleming
066f4cac24 small commit to test new server
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-10 20:38:38 +00:00
Kevin P. Fleming
e87d91c541 update to use new sound file packages that include license files
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168267 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-09 23:12:29 +00:00
Russell Bryant
b28fcc36f2 Make this compile for mvanbaak
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168198 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-09 22:14:38 +00:00
Richard Mudgett
c992d555e3 * Fix for JIRA AST-175/ABE-1757
*  Miscellaneous doxygen comments added.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168191 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-09 21:28:42 +00:00
Mark Michelson
2fe132ca35 Add check_via calls to more request handlers
INFO, NOTIFY, OPTIONS, REFER, and MESSAGE requests
were not checking the topmost Via to determine where
to send the response. Adding check_via calls to those
request handlers solves this.

(closes issue #13071)
Reported by: baron
Patches:
      check_via.patch uploaded by baron (license 531)
Tested by: baron


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@168128 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-09 20:08:04 +00:00
Tilghman Lesher
8c0191f0dc 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@167840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-08 22:08:56 +00:00
Kevin P. Fleming
ead4ba5cd8 remove an unnecessary argument to queue_request()
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-08 17:24:21 +00:00
Kevin P. Fleming
975a706909 When a SIP request or response arrives for a dialog with an associated Asterisk channel, and the lock on that channel cannot be obtained because it is held by another thread, instead of dropping the request/response, queue it for later processing when the channel lock becomes available.
http://reviewboard.digium.com/r/117/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-07 23:32:21 +00:00
Russell Bryant
5fe8bde41a Fix the last couple of places where free() was improperly used directly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-07 22:35:36 +00:00
Russell Bryant
2839e074ef Don't fclose() the file early, the filestream destructor will handle it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-07 22:26:42 +00:00
Russell Bryant
301945890d Only try to close the file if one was actually opened
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-07 22:19:47 +00:00
Russell Bryant
c67d152525 Don't use free() directly. This caused a crash since ast_filestream is now an ao2 object.
Reported by JunK-Y on IRC, #asterisk-dev


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-07 22:03:59 +00:00
Russell Bryant
24ccfad6dc Treat an empty string the same way as a NULL country argument.
In passing, simplify the handling of returning a default tone zone.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167432 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-07 17:29:53 +00:00
Mark Michelson
5eca294b65 Use the correct variable when creating the format string
(closes issue #14177)
Reported by: nic_bellamy
Patches:
      asterisk-trunk-svn-r167242-ast_db_gettree.patch uploaded by nic (license 299)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-06 21:35:57 +00:00
Tilghman Lesher
8476207008 Merged revisions 167259 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
  r167259 | tilghman | 2009-01-06 14:44:03 -0600 (Tue, 06 Jan 2009) | 2 lines
  
  Security fix AST-2009-001.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-06 20:48:05 +00:00
Mark Michelson
543dfee83c A couple of changes to T.38 SDP attribute handling
There are some boolean attributes for T.38 such
as T38FaxFillBitRemoval, T38FaxTranscodingMMR, and
T38FaxTranscodingJBIG. By simply being present, we
should treat these as a "true" value. The current
code, however, was requiring a 1 or 0 as the value
of the attribute in order to parse it. This is due
to the fact that there are some T.38 endpoints and
gateways that also transmit this information
incorrectly. This patch follows the "be liberal in
what you accept and strict in what you send"
philosophy by accepting both the correctly- and 
incorrectly-formatted attributes, but only sending
information as it is supposed to be sent.

It was also discovered that a particular type of 
T.38 gateway sends some non-standard T.38 SDP
attributes. Instead of using T38FaxMaxDatagram
and T38MaxBitRate, it used T38MaxDatagram and
T38FaxMaxRate respectively. We now will properly
accept these attributes as well.

Note that there are a lot of patches cited in
the below commit message template. This is
because the person who submitted these patches is
an awesome person and wrote 1.4, 1.6.0, and 1.6.1
variants.

(closes issue #13976)
Reported by: linulin
Patches:
     chan_sip.c.1.4-update1.diff uploaded by arcivanov (license 648)
	 chan_sip.c.1.6.0-update1.diff uploaded by arcivanov (license 648)
	 chan_sip.c.1.6.1-update1.diff uploaded by arcivanov (license 648)
	 chan_sip.c.1.4-relaxedT38_update1.diff uploaded by arcivanov (license 648)
	 chan_sip.c.1.6.0-relaxedT38_update1.diff uploaded by arcivanov (license 648)
	 chan_sip.c.1.6.1-relaxedT38_update1.diff uploaded by arcivanov (license 648)
Tested by: arcivanov



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167179 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-05 16:51:59 +00:00
Tilghman Lesher
30fe8c619d Repeat attempts to write when we receive -EAGAIN from the driver, as detailed
in the ALSA sample code (see http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2pcm_8c-example.html#a32)
Reported by: Jerry Geis (via the -users list)
Fixed by: me (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@167095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-01 00:01:22 +00:00
Tilghman Lesher
f3f0f40223 Also inherit the musiconhold class.
(Closes #14153)
Reported by: Jerry Geis, via the users list.
Patch by: me (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-31 19:20:35 +00:00
Russell Bryant
d4ac0f7651 Use strncat() instead of an sprintf() in which source and target buffers overlap
http://lists.digium.com/pipermail/asterisk-dev/2008-December/035919.html


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-28 15:13:48 +00:00
Tilghman Lesher
5dd486be22 Compile, even if both DAHDI and Zaptel are not installed.
(Closes issue #14120)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-23 15:35:38 +00:00
Mark Michelson
62c8625f2e Fix a crash resulting from a datastore with inheritance but no duplicate callback
The fix for this is to simply set the newly created datastore's data pointer
to NULL if it is inherited but has no duplicate callback.

(closes issue #14113)
Reported by: francesco_r
Patches:
      14113.patch uploaded by putnopvut (license 60)
Tested by: francesco_r



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-23 15:16:26 +00:00
Tilghman Lesher
45bc54db0a Use the integer form of condition for integer comparisons.
(closes issue #14127)
 Reported by: andrew


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-23 04:05:25 +00:00
Mark Michelson
4133fa7cfc Fix a deadlock relating to channel locks and autoservice
It has been discovered that if a channel is locked prior
to a call to ast_autoservice_stop, then it is likely that
a deadlock will occur. The reason is that the call to 
ast_autoservice_stop has a check built into it to be sure
that the thread running autoservice is not currently trying
to manipulate the channel we are about to pull out of 
autoservice.

The autoservice thread, however, cannot advance beyond where
it currently is, though, because it is trying to acquire
the lock of the channel for which autoservice is attempting
to be stopped.

The gist of all this is that a channel MUST NOT be locked
when attempting to stop autoservice on the channel.

In this particular case, the channel was locked by a call
to ast_read. A call to ast_exists_extension led to autoservice
being started and stopped due to the existence of dialplan
switches.

It may be that there are future commits which handle the same
symptoms but in a different location, but based on my looks through
the code, it is very rare to see a construct such as this one.

(closes issue #14057)
Reported by: rtrauntvein
Patches:
      14057v3.patch uploaded by putnopvut (license 60)
Tested by: rtrauntvein

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-22 20:56:29 +00:00
Russell Bryant
8b68bd17e5 Fix up timeout handling in ast_carefulwrite().
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-22 17:22:56 +00:00
Russell Bryant
acd0af78ea 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@166262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-22 14:45:27 +00:00
Mark Michelson
7fdf99803e Backport of AUDIOHOOK_INHERIT for Asterisk 1.4
(closes issue #13538)
Reported by: mbit
Patches:
      13538.patch uploaded by putnopvut (license 60)
Tested by: putnopvut



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166157 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-19 23:34:57 +00:00
Steve Murphy
e3700a13a4 This merges the masqpark branch into 1.4
These changes eliminate the need for (and use of)
the KEEPALIVE return code in res_features.c;
There are other places that use this result code
for similar purposes at a higher level, these appear
to be left alone in 1.4, but attacked in trunk.

The reason these changes are being made in 1.4, is
that parking ends a channel's life, in some situations,
and the code in the bridge (and some other places),
was not checking the result code properly, and dereferencing
the channel pointer, which could lead to memory corruption
and crashes.

Calling the masq_park function eliminates this danger 
in higher levels.

A series of previous commits have replaced some parking calls
with masq_park, but this patch puts them ALL to rest,
(except one, purposely left alone because a masquerade
is done anyway), and gets rid of the code that tests
the KEEPALIVE result, and the NOHANGUP_PEER result codes.

While bug 13820 inspired this work, this patch does
not solve all the problems mentioned there.

I have tested this patch (again) to make sure I have
not introduced regressions. 

Crashes that occurred when a parked party hung up
while the parking party was listening to the numbers
of the parking stall being assigned, is eliminated.

These are the cases where parking code may be activated:

1. Feature one touch (eg. *3)
2. Feature blind xfer to parking lot (eg ##700)
3. Run Park() app from dialplan (eg sip xfer to 700)
   (eg. dahdi hookflash xfer to 700)
4. Run Park via manager.

The interesting testing cases for parking are:
I. A calls B, A parks B
    a. B hangs up while A is getting the numbers announced.
    b. B hangs up after A gets the announcement, but 
       before the parking time expires
    c. B waits, time expires, A is redialed,
       A answers, B and A are connected, after
       which, B hangs up.
    d. C picks up B while still in parking lot.

II. A calls B, B parks A
    a. A hangs up while B is getting the numbers announced.
    b. A hangs up after B gets the announcement, but 
       before the parking time expires
    c. A waits, time expires, B is redialed,
       B answers, A and B are connected, after
       which, A hangs up.
    d. C picks up A while still in parking lot.

Testing this throroughly involves acting all the permutations
of I and II, in situations 1,2,3, and 4.

Since I added a few more changes (ALL references to KEEPALIVE in the bridge
code eliimated (I missed one earlier), I retested
most of the above cases, and no crashes.

H-extension weirdness.

Current h-extension execution is not completely
correct for several of the cases.

For the case where A calls B, and A parks B, the
'h' exten is run on A's channel as soon as the park
is accomplished. This is expected behavior.

But when A calls B, and B parks A, this will be
current behavior:

After B parks A, B is hung up by the system, and
the 'h' (hangup) exten gets run, but the channel
mentioned will be a derivative of A's...

Thus, if A is DAHDI/1, and B is DAHDI/2,
the h-extension will be run on channel
Parked/DAHDI/1-1<ZOMBIE>, and the 
start/answer/end info will be those 
relating to Channel A.

And, in the case where A is reconnected to
B after the park time expires, when both parties
hang up after the joyful reunion, no h-exten
will be run at all.

In the case where C picks up A from the 
parking lot, when either A or C hang up,
the h-exten will be run for the C channel.

CDR's are a separate issue, and not addressed
here.

As to WHY this strange behavior occurs, 
the answer lies in the procedure followed
to accomplish handing over the channel
to the parking manager thread. This procedure
is called masquerading. In the process,
a duplicate copy of the channel is created,
and most of the active data is given to the
new copy. The original channel gets its name
changed to XXX<ZOMBIE> and keeps the PBX
information for the sake of the original
thread (preserving its role as a call 
originator, if it had this role to begin
with), while the new channel is without
this info and becomes a call target (a
"peer").

In this case, the parking lot manager
thread is handed the new (masqueraded)
channel. It will not run an h-exten
on the channel if it hangs up while
in the parking lot. The h exten will
be run on the original channel instead,
in the original thread, after the bridge
completes.

See bug 13820 for our intentions as
to how to clean up the h exten behavior.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-19 22:30:32 +00:00
Jeff Peeler
e0bec5d67d (closes issue #13480)
Reported by: tzafrir

Replace a bunch of if defined checks for Zaptel/DAHDI through several new defines in dahdi_compat.h. This removes a lot of code duplication. Example from bug:

#ifdef HAVE_ZAPTEL
  fd = open("/dev/zap/pseudo", O_RDWR);
#else
  fd = open("/dev/dahdi/pseudo", O_RDWR);
#endif

is replaced with:
  fd = open(DAHDI_FILE_PSEUDO, O_RDRW);



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@165991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-19 19:48:00 +00:00
Russell Bryant
5de6848d0c Ensure that the chanspy datastore is fully initialized.
This patch resolved some random crash issues observed by a user on a BSD system

(closes issue #14111)
Reported by: ys
Patches:
      app_chanspy.c.diff uploaded by ys (license 281)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@165889 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-19 15:03:02 +00:00
Russell Bryant
991494f2c0 Make ast_carefulwrite() be more careful.
This patch handles some additional cases that could result in partial writes
to the file description.  This was done to address complaints about partial
writes on AMI.

(issue #13546) (more changes needed to address potential problems in 1.6)
Reported by: srt
Tested by: russell
Review: http://reviewboard.digium.com/r/99/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@165796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-18 21:39:25 +00:00
Tilghman Lesher
139be9556b Add mutexes around accesses to the IMAP library interface. This prevents
certain crashes, especially when shared mailboxes are used.
(closes issue #13653)
 Reported by: howardwilkinson
 Patches: 
       asterisk-1.4.21.2-appvoicemail-sharedimap-lock.patch uploaded by howardwilkinson (license 590)
 Tested by: jpeeler


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@165767 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-18 21:14:47 +00:00
Russell Bryant
0d24c2ed92 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@165661 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-18 18:52:18 +00:00
Joshua Colp
3a354c3500 Only care about a compatible codec for early bridging if we are actually bridging to another channel. If we are not we actually want to bring the audio back to us.
(closes issue #13545)
Reported by: davidw


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@165591 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-18 17:11:42 +00:00
Joshua Colp
3a0e7aec6a Do not crash if we are not passed in a followme id.
(closes issue #14106)
Reported by: ys
Patches:
      app_followme.c.2.diff uploaded by ys (license 281)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@165537 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-18 16:07:37 +00:00
Tilghman Lesher
8468d435e8 Reverse the fix from issue #6176 and add proper handling for that issue.
(Closes issue #13962, closes issue #13363)
Fixed by myself (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@165317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-17 21:14:37 +00:00
Mark Michelson
a391fd9b1c 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@165255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-17 20:51:38 +00:00
Mark Michelson
c49c8b9a3a After looking through SIP registration code most of the day, this
is one of the few things I could find that was just plain wrong.
Even though it probably isn't possible for it to happen, it seems weird
to have code that checks if a pointer is NULL and then immediately dereferences
that pointer if it was NULL.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16 23:04:27 +00:00
Russell Bryant
63444acf6b Fix an issue where DEBUG_THREADS may erroneously report that a thread
is exiting while holding a lock.

If the last lock attempt was a trylock, and it failed, it will still be in the
list of locks so that it can be reported.

(closes issue #13219)
Reported by: pj


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16 21:38:29 +00:00
Russell Bryant
c703960acc Do not dereference the channel if AST_PBX_KEEPALIVE has been returned.
This is a bug I noticed while looking at the code for app_macro.  This return code
means that another thread has assumed ownership of the channel and it can no longer
be touched.  (I hate this return code with a passion, by the way.)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164876 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16 21:10:44 +00:00
Russell Bryant
aa60ad0e43 Add "restart gracefully" to the AMI blacklist of CLI commands.
"module unload" was already identified as a command that can not be used 
from the AMI.  "restart gracefully" effectively unloads all modules, and will 
run in to the same problems.

(closes issue #13894)
Reported by: kernelsensei


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16 20:35:25 +00:00
Russell Bryant
083047a794 Fix memory leak and invalid reporting issues with DEBUG_THREADLOCALS.
One issue was that the ast_mutex_* API was being used within the context of the
thread local data destructors.  We would go off and allocate more thread local data
while the pthread lib was in the middle of destroying it all.  This led to a memory 
leak.

Another issue was an invalid argument being provided to the the object_add
API call.

(closes issue #13678)
Reported by: ys
Tested by: russell


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164736 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16 17:06:29 +00:00
Russell Bryant
802d4ebd51 Fix a memory leak related to the use of the "setvar" configuration option.
The problem was that these variables were being appended to the list of vars
on the sip_pvt every time a re-registration or re-subscription came in.
Since it's just a waste of memory to put them there unless the request was an
INVITE, then the fix is to check the request type before copying the vars.

(closes issue #14037)
Reported by: marvinek
Tested by: russell


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164672 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16 15:56:37 +00:00
Steve Murphy
4f807bb183 I added a sentence to clarify why - and ' ' are ignored in patterns
as per bug 14076. Leif says he'll put some stuff about it in the
extensions.conf sample, etc.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164634 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16 15:15:58 +00:00
Russell Bryant
c6f1387e73 Don't try to change working directory if a directory was not configured.
(closes issue #14089)
Reported by: caspy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16 14:28:10 +00:00
Mark Michelson
ccf5565ccd Add the deadlock note to ast_spawn_extension as well
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 19:53:08 +00:00
Mark Michelson
a43cf62956 Add notes to autoservice and pbx doxygen regarding a potential
deadlock scenario so that it is avoided in the future



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 19:45:07 +00:00
Joshua Colp
2850bf37a9 Do not try to unlock a non-existant channel if the transfer fails.
(closes issue #13800)
Reported by: dwagner
Patches:
      asterisk-1.4.22-chan-sip-nullp.patch uploaded by tweety (license 608)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 18:11:21 +00:00
Joshua Colp
b80ffd6d26 Use autoconf logic to determine whether the system has timersub or not. Do not blindly assume Solaris does not.
(closes issue #13838)
Reported by: ano


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164343 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 17:43:59 +00:00
Joshua Colp
dfa5f7c4b4 Can we try not to assign an unsigned int to -1?
(closes issue #14074)
Reported by: wetwired


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164204 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 15:05:08 +00:00
Russell Bryant
3a864cb7b6 Handle a case where a call can be bridged to a channel that is still ringing.
The issue that was reported was about a case where a RINGING channel got 
redirected to an extension to pick up a call from parking.  Once the parked 
call got taken out of parking, it heard silence until the other side answered.  
Ideally, the caller that was parked would get a ringing indication.  This patch
fixes this case so that the caller receives ringback once it comes out of 
parking until the other side answers.

The fixes are:

 - Make sure we remember that a channel was an outgoing channel when doing 
   a masquerade.  This prevents an erroneous ast_answer() call on the channel,
   which causes a bogus 200 OK to be sent in the case of SIP.

 - Add some additional comments to explain related parts of code.

 - Update the handling of the ast_channel visible_indication field.  Storing 
   values that are not stateful is pointless.  Control frames that are events 
   or commands should be ignored.

 - When a bridge first starts, check to see if the peer channel needs to be 
   given ringing indication because the calling side is still ringing.

 - Rework ast_indicate_data() a bit for the sake of readability.

(closes issue #13747)
Reported by: davidw
Tested by: russell
Review: http://reviewboard.digium.com/r/90/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 14:31:37 +00:00
Tilghman Lesher
d8ff8d169d Change the default calldurationlimit from the special value 0 to -1, so we
can better detect an exceptional case.  This follows on to the changes made
in revision 156386.  Related to issue #13851.
(closes issue #13974)
 Reported by: paradise
 Patches: 
       20081208__bug13974.diff.txt uploaded by Corydon76 (license 14)
 Tested by: file, blitzrage, ZX81


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@164082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-13 23:22:02 +00:00
Russell Bryant
36996f4312 Set the reviewboard:url property on 1.4, as well
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-12 22:20:26 +00:00
Tilghman Lesher
6d268e6d39 Simple fix for Ctrl-C not immediately exiting Asterisk, but also add a
pointer inside editline to look back to asterisk.c, so others don't spend
as much time as I did looking (in the wrong place) for the appropriate
function.
Reported by: ZX81, via the #asterisk-users channel
Fixed by: me (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163761 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-12 22:03:10 +00:00
Russell Bryant
2404b83404 Specify uint32_t for variables storing a CRC32 so that it is actually 32 bits
on 64-bit machines, as well.

(inspired by issue #13879)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-12 14:40:31 +00:00
Russell Bryant
c518ed3be1 Resolve issues that could cause DTMF to be processed out of order.
These changes come from team/russell/issue_12658

1) Change autoservice to put digits on the head of the channel's frame readq 
   instead of the tail.  If there were frames on the readq that autoservice 
   had not yet read, the previous code would have resulted in out of order 
   processing.  This required a new API call to queue a frame to the head 
   of the queue instead of the tail.

2) Change up the processing of DTMF in ast_read().  Some of the problems 
   were the result of having two sources of pending DTMF frames.  There 
   was the dtmfq and the more generic readq.  Both were used for pending 
   DTMF in various scenarios.  Simplifying things to only use the frame 
   readq avoids some of the problems.

3) Fix a bug where a DTMF END frame could get passed through when it 
   shouldn't have.  If code set END_DTMF_ONLY in the middle of digit emulation,
   and a digit arrived before emulation was complete, digits would get 
   processed out of order.

(closes issue #12658)
Reported by: dimas
Tested by: russell, file
Review: http://reviewboard.digium.com/r/85/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-12 13:44:08 +00:00
Tilghman Lesher
f6ef5d5d6c When a Ctrl-C or Ctrl-D ends a remote console, on certain shells, the terminal
is messed up.  By intercepting those events with a signal handler in the remote
console, we can avoid those issues.
(closes issue #13464)
 Reported by: tzafrir
 Patches: 
       20081110__bug13464.diff.txt uploaded by Corydon76 (license 14)
 Tested by: blitzrage


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-11 23:35:55 +00:00
Matthew Nicholson
11e2a937dc Clean up the dundi cache every 5 minutes.
(closes issue #13819)
Reported by: adomjan
Patches:
      pbx_dundi.c-clearcache.patch uploaded by adomjan (license 487)
      dundi_clearecache3.diff uploaded by mnicholson (license 96)
Tested by: adomjan


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-11 22:44:31 +00:00
Russell Bryant
32fff369e7 Fix some observed slowdowns in dialplan processing.
The change is to remove autoservice usage from dialplan functions that do not
need it because they do not perform operations that potentially block.

(closes issue #13940)
Reported by: tbelder


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-11 21:46:29 +00:00
Russell Bryant
d67d8cd2f3 Fix an issue that made it so you could only have a single caller executing
a custom feature at a time.  This was especially problematic when custom
features ran for any appreciable amount of time.

The fix turned out to be quite simple.  The dynamic features are now stored
in a read/write list instead of a list using a mutex.

(closes issue #13478)
Reported by: neutrino88
Fix suggested by file


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-11 16:54:51 +00:00
Tilghman Lesher
d9fb8362bc 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@163088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-11 16:51:27 +00:00
Mark Michelson
60c9cae6d6 Revert this cast to long. Using time_t here causes build failures on a
FreeBSD 32-bit build.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163084 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-11 16:46:22 +00:00
Mark Michelson
ef56f0dbd4 Fix a potential crash due to unsafe datastore handling.
This patch also contains a conversion from using long to time_t
for representing times for a queue, as well as some whitespace
fixes.

(closes issue #14060)
Reported by: nivek
Patches:
      datastore_fixup.patch.corrected uploaded by nivek (license 636)
	  with slight modification from me
Tested by: nivek



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@163080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-11 16:24:43 +00:00
Jeff Peeler
dda2438b03 Oops, inverted logic for a strcasecmp check. Pointed out by mmichelson, thanks!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-10 22:52:51 +00:00
Jeff Peeler
90efa9de78 (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: https://origsvn.digium.com/svn/asterisk/branches/1.4@162874 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-10 22:04:18 +00:00
Joshua Colp
f7521fb0db Fix subscription based MWI up a bit. We only want to put sip: at the beginning of the URI if it is not already there and revert code to ignore destination check if subscribing for MWI.
(closes issue #12560)
Reported by: vsauer
Patches:
      patch001.diff uploaded by ramonpeek (license 266)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-10 19:01:17 +00:00
Joshua Colp
ee47cfddbe When a SIP peer unregisters set the expiry time back to 0 so that the 200 OK contains an expires of 0.
(closes issue #13599)
Reported by: hjourdain
Patches:
      chan_sip.c.diff uploaded by hjourdain (license 583)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162738 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-10 17:50:43 +00:00
Steve Murphy
8f25d5a5c2 (closes issue #14022)
Reported by: wetwired
Tested by: murf

I checked, and I added a mod to the trunk version
of Asterisk that would make it 8-bit transparent
on 27 Nov 2007, but I made no such updates to
1.4. My best guess is that 1.4 was released, and
it was not appropriate to commit an enhancement.

But I'm going to add the same fixes to 1.4 now,
for the following reasons:
1. wetwired is correct; 1.4 is **mostly** 8-bit
   transparent now. This is because the lexical
   token forming rules use . in most 'word'
   state continuances.  It's just the beginning
   of a 'word' that is picky.
2. Accepting 8-bit chars in some places and
   not others leads to bug reports like this.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162671 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-10 16:45:01 +00:00
Mark Michelson
4cad4bff2c Update to stringfield handling so that side-effects on
parameters are not evaluated multiple times.

An example where this caused a problem was in chan_sip.c, with
the line

  ast_string_field_set(p, fromdomain, ++fromdomain);

This patch was originally uploaded to issue #13783 by
jamessan. While the issue was closed for other reasons, this
patch is valid and fixes a separate problem, and is thus
being committed.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162670 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-10 16:44:37 +00:00
Mark Michelson
d18bb8dc44 Revert fix for issue 13570. It has caused more problems than
it helped to fix.

(closes issue #13783)
Reported by: navkumar


(closes issue #14025)
Reported by: ffs



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-10 16:24:56 +00:00
Mark Michelson
597b4d414a Add missing documentation to misdn.txt
(closes issue #14052)
Reported by: festr
Patches:
      misdn.txt.patch uploaded by festr (license 443)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162659 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-10 16:10:25 +00:00
Joshua Colp
a6edd8ba5f Increment the sequence number on the end packets for RFC2833. After reading the RFC some more and doing some testing I agree with this change.
(closes issue #12983)
Reported by: vt
Patches:
      dtmf_inc_seqnum_on_end_pkts.diff uploaded by vt (license 520)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162653 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-10 16:05:29 +00:00
Tilghman Lesher
8a7982c1ff Oops, should be "tz", not "zonetag".
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 23:08:53 +00:00
Russell Bryant
c2446000d9 Remove the test_for_thread_safety() function completely.
The test is not valid.  Besides, if we actually suspected that recursive
mutexes were not working, we would get a ton of LOG_ERROR messages when
DEBUG_THREADS is turned on.

(inspired by a discussion on the asterisk-dev list)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 22:17:39 +00:00
Tilghman Lesher
5134bb74a9 We appear to have documented tz= in the [general] section of voicemail.conf,
without actually having implemented it.  Oops.
(Reported by Olivier on the -users list)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 21:53:25 +00:00
Joshua Colp
a7520ee4bf Add 'down' as a valid state for directed call pickup. This creeps up when we receive session progress when dialing a device and not ringing.
(closes issue #14005)
Reported by: ddl


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 21:14:29 +00:00
Russell Bryant
5d985ce022 Fix an issue where callers on an incoming call on an SLA trunk would not hear ringback.
We need to make sure that we don't start writing audio to the trunk channel until we're
actually ready to answer it.  Otherwise, the channel driver will treat it as inband
progress, even though all they are getting is silence.

(closes issue #12471)
Reported by: mthomasslo


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 20:57:35 +00:00
Joshua Colp
7eeb7f7493 Fix double declaration of 'x' on the PPC platform.
(closes issue #14038)
Reported by: ffloimair


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 20:44:32 +00:00
Mark Michelson
b234c024a0 If we fail to start a thread for the pbx to run in, we need to
be sure to decrease the number of active calls on the system.

This fix may relate to ABE-1713, but it is not certain yet.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 20:28:44 +00:00
Steve Murphy
8582a3e924 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@162264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 20:20:54 +00:00
Joshua Colp
114c659195 Make sure that the timestamp for DTMF is not the same as the previous voice frame and do not send audio when transmitting DTMF as this confuses some equipment.
(closes issue #13209)
Reported by: ip-rob
Patches:
      13209.diff uploaded by file (license 11)
Tested by: ip-rob, bujones


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162204 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 19:47:07 +00:00
Joshua Colp
7209e0e173 Take video into account when early bridging RTP.
(closes issue #13535)
Reported by: davidw


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 19:06:14 +00:00
Steve Murphy
fd31201630 Previous fix used ast_malloc and ast_copy_string and messed up the standalone stuff. Fixed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162136 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 18:13:39 +00:00
Tilghman Lesher
cbbd837a34 For some reason, after a distclean, gcc started returning
'value computed is not used'.  Fixing (for --enable-dev-mode).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 17:07:50 +00:00
Russell Bryant
97bb6d4c65 Allow DISA to handle extensions that start with #.
(closes issue #13330)
Reported by: jcovert


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@162014 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 16:46:53 +00:00
Steve Murphy
a36a0d7dbd (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: https://origsvn.digium.com/svn/asterisk/branches/1.4@162013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 16:31:55 +00:00
Russell Bryant
53c30bd359 Fix a problem with GROUP() settings on a masquerade.
The previous code carried over group settings from the old channel to the new
one.  However, it did nothing with the group settings that were already on the
new channel.  This patch removes all group settings that already existed on the
new channel.

I have a more complicated version of this patch which addresses only the most
blatant problem with this, which is that a channel can end up with multiple
group settings in the same category.  However, I could not think of a use case
for keeping any of the group settings from the old channel, so I went this route
for now.

(closes AST-152)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@161948 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 14:52:25 +00:00
Joshua Colp
fbf46c34b0 Make the usereqphone option work again.
(closes issue #13474)
Reported by: mmaguire
Patches:
      20080912_bug13474.diff uploaded by mmaguire (license 571)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@161725 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-08 17:52:10 +00:00
Sean Bright
ffc0c7e4ae Merged revisions 161421 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
  r161421 | seanbright | 2008-12-05 15:50:23 -0500 (Fri, 05 Dec 2008) | 8 lines
  
  Fix build errors on FreeBSD (uint -> unsigned int).
  
  (closes issue #14006)
  Reported by: alphaque
  Patches:
        astobj2.h-patch uploaded by alphaque (license 259)
        (Slightly modified by seanbright)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@161426 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-05 21:02:20 +00:00
Dwayne M. Hubbard
ca75782a96 kill a warning
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@161354 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-05 16:51:17 +00:00
Russell Bryant
d0f53b09cf Fix a NULL format string warning found by buildbot.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@161287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-05 14:12:14 +00:00
Jeff Peeler
ba3f49c71f (closes issue #13835)
Reported by: matt_b
Tested by: jpeeler

This mirrors a check that was present in ast_rtp_read to also be in ast_rtp_raw_write to not schedule sending the receiver report if the remote RTCP endpoint address isn't present in the RTCP structure.

Closes AST-142.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@161013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-04 18:30:41 +00:00
Mark Michelson
5397638a2f Fix a callerid parsing issue. If someone formatted callerid like the
following: "name <number>" (including the quotation marks), then the parts
would be parsed as 

name: "name
number: number

This is because the closing quotation mark was not discovered since the number
and everything after was parsed out of the string earlier. Now, there is a check
to see if the closing quote occurs after the number, so that we can know if we
should strip off the opening quote on the name.

Closes AST-158



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-04 16:44:18 +00:00
Tilghman Lesher
16f94acd53 Some compilers warn on null format strings; some don't (caught by buildbot)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 21:54:07 +00:00
Jason Parker
f978100475 Only show this warning when we want to show it.
(closes issue #13982)
Reported by: coolmig
Patches:
      chan_agent.c.patch uploaded by coolmig (license 621)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 21:38:07 +00:00
Steve Murphy
ba6d2c67ac (closes issue #13597)
Reported by: john8675309
Patches:
      patch.13597 uploaded by murf (license 17)
Tested by: murf, john8675309

This patch causes the setcid func to update the CDR
clid after setting the channel field.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160703 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 20:41:42 +00:00
Tilghman Lesher
e616d516e3 During bridge code, the channel bridge may return a retry code, if a transfer
was initiated but not yet completed.  If the bridge is immediately retried,
then we may send a storm of TXREQ packets, even though the first set is sent
reliably (retransmitted).  Fixes AST-137.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160570 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 17:55:12 +00:00
Tilghman Lesher
648d21d098 If an entry is added to the directory during a scan when another entry expires,
then that new entry will not be processed promptly, but must wait for either a
future entry to start or a current entry's retry to occur.  If no other entries
exist in the directory (other than the new entries) when a bunch expire, then
the new entries must wait until another new entry is added to be processed.
This was a rather weird race condition, really.  Fixes AST-147.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 17:34:34 +00:00
Tilghman Lesher
6326f47ce5 Don't start scanning the directory until all modules are loaded, because some
required modules (channels, apps, functions) may not yet be in memory yet.
Fixes AST-149.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 16:58:34 +00:00
Tilghman Lesher
cc3b3e68f0 Jon Bonilla (Manwe) pointed out on the -dev list:
"I guess that having only ip-phones in mind is not a good approach. Since it is
possible to have a sip proxy connected to asterisk we could receive a 407
(unauthorized) or 483 (too many hops) as response and dialog ending would not be
a good behavior."
So modified.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160480 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 14:09:35 +00:00
Terry Wilson
de2bff02a1 Channel is masqueraded, don't keep alive
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160411 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-02 23:58:08 +00:00
Terry Wilson
cedbee5b75 A situation like A calls B, A builtin_atxfers B to C, C parks B would lead to a crash. Thanks to file for telling me how to fix it!
(closes issue #13854)
Reported by: Adam Lee
Tested by: otherwiseguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160390 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-02 23:04:23 +00:00
Tilghman Lesher
a8736b03e9 When the text does not match exactly (e.g. RTP/SAVP), then the %n conversion
fails, and the resulting integer is garbage.  Thus, we must initialize the
integer and check it afterwards for success.
(closes issue #14000)
 Reported by: folke
 Patches: 
       asterisk-sipbg-sscanf-1.4.22.diff uploaded by folke (license 626)
       asterisk-sipbg-sscanf-1.6.0.1.diff uploaded by folke (license 626)
       asterisk-sipbg-sscanf-trunk-r159896.diff uploaded by folke (license 626)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-02 17:42:09 +00:00
Terry Wilson
a3724485b4 make compile with dev mode and malloc debug
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-02 01:16:30 +00:00
Tilghman Lesher
1653a9ef65 Ensure that Asterisk builds with --enable-dev-mode, even on the latest gcc
and glibc.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160207 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-02 00:25:16 +00:00
Russell Bryant
dfec3b69d6 Apply some logic used in iax2_indicate() to iax2_setoption(), as well, since they
both have the potential to send control frames in the middle of call setup.  We
have to wait until we have received a message back from the remote end before
we try to send any more frames.  Otherwise, the remote end will consider it
invalid, and we'll get stuck in an INVAL/VNAK storm.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@160003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-01 17:27:30 +00:00
Michiel van Baak
8f27432e76 Get rid of the useless format string and argument in the Bogus/ manager channelname.
Noted by kpfleming and name Bogus/manager suggested by eliel


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-01 16:08:36 +00:00
Russell Bryant
380e2abf27 Force a "make clean" to avoid a bizarre build issue ...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159900 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-01 14:52:56 +00:00
Michiel van Baak
1a6c64660d make manager compile on OpenBSD.
The last (10th) argument to ast_channel_alloc here should be a pointer
and NULL is not really a pointer.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159897 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-01 14:05:41 +00:00
Kevin P. Fleming
50515ed372 update dev-mode compiler flags to match the ones used by default on Ubuntu Intrepid, so all developers will see the same warnings and errors
since this branch already had some printf format attributes, enable checking for them and tag functions that didn't have them

format attributes in a consistent way



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-29 16:58:29 +00:00
Kevin P. Fleming
a738a1f6e7 rename these files so as to avoid conflicts when users update their working copies and have unversioned files already in place
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-26 20:21:04 +00:00
Kevin P. Fleming
7459a56dbb simplify (and slightly bug-fix) the recent developer-oriented COMPILE_DOUBLE mode
add channels/busy.h and channels/ringtone.h to the repository instead of generating them repeatedtly; most users do not change the settings to build them, but the Makefile rules are still there if they wish to do so

ensure that 'make clean' removes dependency files for .i files that are created in COMPILE_DOUBLE mode



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-26 18:36:24 +00:00
Steve Murphy
141ab56b86 (closes issue #12694)
Reported by: yraber
Patches:
      12694.2nd.diff uploaded by murf (license 17)
Tested by: murf, laurav

Thanks to file (Joshua Colp) for his IAX fix.

the change to cdr.c allows no-answer to percolate
up into CDR's, and feels like the right place to
locate this fix; if BUSY is done here, no-answer
should be, too.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25 22:41:10 +00:00
Tilghman Lesher
10e70eaecf Don't try to send a response on a NULL pvt.
(closes issue #13919)
 Reported by: barthpbx
 Patches: 
       chan_iax2.c.patch uploaded by eliel (license 64)
 Tested by: barthpbx


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25 21:56:48 +00:00
Tilghman Lesher
dd5a228991 Merged revisions 159245 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
  r159245 | tilghman | 2008-11-25 15:37:06 -0600 (Tue, 25 Nov 2008) | 7 lines
  
  Regression fix for last security fix.  Set the iseqno correctly.
  (closes issue #13918)
   Reported by: ffloimair
   Patches: 
         20081119__bug13918.diff.txt uploaded by Corydon76 (license 14)
   Tested by: ffloimair
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25 21:40:28 +00:00
Russell Bryant
07741a3261 Add ao2_trylock() to go along with ao2_lock() and ao2_unlock()
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25 17:34:50 +00:00
Terry Wilson
e8f9274ca7 Add missing variable declaration in the PPC code
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159096 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25 16:23:38 +00:00
Tilghman Lesher
929c14e432 System call ioperm is non-portable, so check for its existence in autoconf.
(Closes issue #13863)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@159025 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-25 04:50:00 +00:00
Jeff Peeler
c7dcb086dd (closes issue #13786)
Reported by: tzafrir

When compiling against Zaptel dahdi_compat will now only define all the DAHDI defines if the Zaptel define is present. Also, there is no such thing as DAHDI_PRI.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-22 00:04:36 +00:00
Steve Murphy
890386410a In reference to the fix made for 13871, I was
merging the fix into 1.6.0 and realized I missed
the code in the h-exten block, and didn't catch it
because my test case had the h-exten commented out.

So, this corrects the code I missed, as a 
preventative against another crash report.
Tested with the h-exten defined, all is well.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-21 23:14:50 +00:00
Tilghman Lesher
cd4b144fb0 The passed extension may not be the same in the list as the current entry,
because we strip spaces when copying the extension into the structure.
Therefore, use the copied item to place the item into the list.
(found by lmadsen on -dev, fixed by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-21 23:07:46 +00:00
Russell Bryant
a0bf88537a When compiling with DEBUG_THREADS, report the real file/func/line for ao2_lock/ao2_unlock
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-21 22:05:55 +00:00
Steve Murphy
596f31a1a1 (closes issue #13871)
Reported by: mdu113

This one is totally my fault. The code doesn't even
create a bridge if the channel CDR has POST_DISABLED.
I didn't check for that at the end of the bridge.
Fixed with a few small insertions. Tested. Looks
good. No cdr generated, no crash, no unnecc. data
objects created either.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158483 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-21 21:19:47 +00:00
Mark Michelson
72a8661580 This change had somehow gotten reverted due to a
completely unrelated commit. Thanks to Theo Belder
on the Asterisk-dev list for pointing this out.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-21 15:24:19 +00:00
Mark Michelson
6a632a5a2b There was an issue when attempting to reference an embedded
frame in a freed ast_filestream. This patch makes use of the
ao2 functions to make sure that we do not free an ast_filestream
structure until the embedded ast_frame has been "freed" as well.

(closes issue #13496)
Reported by: fst-onge
Patches:
      filestream_frame_1_4.diff uploaded by putnopvut (license 60)
Tested by: putnopvut

Closes AST-89



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 18:06:48 +00:00
Mark Michelson
3668ba67ab We don't handle 4XX responses to BYE well. According to
section 15 of RFC 3261, we should terminate a dialog if we
receive a 481 or 408 in response to our BYE. Since I am aware
of at least one phone manufacturer who may sometimes send a 
404 as well, I am being liberal and saying that any 4XX response
to a BYE should result in a terminated dialog.


(closes issue #12994)
Reported by: pabelanger
Patches:
      12994.patch uploaded by putnopvut (license 60)

Closes AST-129



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 17:48:42 +00:00
Mark Michelson
3a1a981e2e Make sure to set the hangup cause on the calling channel in the case
that ast_call() fails. For incoming SIP channels, this was causing
us to send a 603 instead of a 486 when the call-limit was reached on
the destination channel.

(closes issue #13867)
Reported by: still_nsk
Patches:
      13867.diff uploaded by putnopvut (license 60)
Tested by: blitzrage



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 17:33:06 +00:00
Richard Mudgett
238cd9ea24 Merged revision 157977 from
https://origsvn.digium.com/svn/asterisk/team/group/issue8824

........
Fixes JIRA ABE-1726

The dial extension could be empty if you are using MISDN_KEYPAD
to control ISDN provider features.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@158010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-20 01:46:09 +00:00
Kevin P. Fleming
187f6d485a the gcc optimizer frequently finds broken code (use of uninitalized variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems.
with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course).

while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@157859 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-19 21:34:47 +00:00
Mark Michelson
a6fac748de Add some missing invite state changes necessary in the sip_write
function. Not setting the invite state correctly on the call was
resulting in the Record application leaving empty files. I also
have updated the doxygen comment next to the declaration of the
INV_EARLY_MEDIA constant to reflect that we also use this state
when we *send* a 18X response to an INVITE.

(closes issue #13878)
Reported by: nahuelgreco
Patches:
      sip-early-media-recording-1.4.22.patch uploaded by nahuelgreco (license 162)
	  Tested by: putnopvut


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@157503 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-18 22:47:57 +00:00
Jeff Peeler
161a05a3d1 (closes issue #13899)
Reported by: akkornel

This fix is the result of a bug fix in ast_app_separate_args r124395. If an argument does not exist it should always be set to a null string rather than a null pointer.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@157365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-18 19:13:33 +00:00
Mark Michelson
3429c9de5e Fix a crash in the end_bridge_callback of app_dial and
app_followme which would occur at the end of an attended
transfer. The error occurred because we initially stored
a pointer to an ast_channel which then was hung up due
to a masquerade.

This commit adds a "fixup" callback to the bridge_config
structure to allow for end_bridge_callback_data to be
changed in the case that a new channel pointer is needed
for the end_bridge_callback.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@157305 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-18 18:25:55 +00:00
Kevin P. Fleming
9bfbfb5496 when an individual directory dist-clean is run, run clean in that directory first, and when running top-level dist-clean, do not run subdirectory clean operations twice
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@157163 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-15 19:31:03 +00:00
Kevin P. Fleming
eeae8abc61 dist-clean should remove dependency information files as well
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@157162 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-15 19:24:24 +00:00
Kevin P. Fleming
dda8791081 major update to doxygen configuration file:
1) update to doxygen 1.5.x style file, as used in trunk

2) tell doxygen where are header files are, so include-file processing can be done

3) make all macros that are used to define variables/functions be expanded, so that doxygen will properly document the resulting variable/function

4) make all macros that are used to provide the contents of a variable (structure) be expanded, so that doxygen will be able to document the resulting fields

5) suppress compiler attributes (__attribute__(xxx)) from being seen by doxygen, so it will properly match up function definition and usage (for an example of th effect of this, look at the doxygen docs for ast_log() from before and afte this commit)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@157104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-15 18:00:32 +00:00
Mark Michelson
b753654cbd If the prompt to reenter a voicemail password timed out, it
resulted in the password not being saved, even if the input matched
what you gave when first prompted to enter a new password. This is
because the return value of ast_readstring was checked, but not checked
properly.

This bug was discovered by Jared Smith during an Asterisk training course.
Thanks for reporting it!



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156816 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-14 15:18:59 +00:00
Tilghman Lesher
bc208d63c2 ast_waitfordigit() requires that the channel be up, for no good logical
reason.  This prevents While/EndWhile from working within the "h"
extension.
Reported by: jgalarneau (for ABE C.2)
Fixed by: me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156755 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-14 00:41:37 +00:00
Tilghman Lesher
ad1cd04005 Provide more space for all the data which can appear in an originating
channel name.
(closes issue #13398)
 Reported by: bamby
 Patches: 
       manager.c.diff uploaded by bamby (license 430)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-13 21:24:00 +00:00
Kevin P. Fleming
53c3cdab37 revert this change... non-functional changes don't belong here
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156510 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-13 11:58:41 +00:00
Kevin P. Fleming
350cec723a correct minor syntax error... no functional change
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-13 11:51:27 +00:00
Tilghman Lesher
382459fac8 When using call limits under 1 second, infinite call lengths are allowed,
instead.
(closes issue #13851)
 Reported by: ruddy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 21:18:57 +00:00
Steve Murphy
3557bc1b4d It turns out that the 0x0XX00 codes being returned for
N, X, and Z are off by one, as per conversation with
jsmith on #asterisk-dev;  he was teaching a class
and disconcerted that this published rule was not
being followed, with patterns _NXX, _[1-8]22 and
_[2-9]22... and NXX was winning, but [1-8] should
have been. 

This change, tested on these 3 patterns now 
picks the proper one.

However, this change may surprise users who
set up dialplans based on previous behavior,
which has been there for what, 2 and half 
years or so now.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 19:36:16 +00:00
Tilghman Lesher
7e353eeaa1 If the SLA thread is not started, then reload causes a memory leak.
(closes issue #13889)
 Reported by: eliel
 Patches: 
       app_meetme.c.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 19:26:45 +00:00
Jeff Peeler
738ec1fb71 For whatever reason, gcc only warned me about the possible use of an uninitialized variable when compiling 1.6.1.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 19:10:12 +00:00
Tilghman Lesher
1d023ca457 Revert revision 132506, since it occasionally caused IAX2 HANGUP packets not
to be sent, and instead, schedule a task to destroy the iax2 pvt structure
10 seconds later.  This allows the IAX2 HANGUP packet to be queued,
transmitted, and ACKed before the pvt is destroyed.
(closes issue #13645)
 Reported by: dzajro
 Patches: 
       20081111__bug13645__3.diff.txt uploaded by Corydon76 (license 14)
 Tested by: vazir
 Reviewed: http://reviewboard.digium.com/r/51/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 18:39:21 +00:00
Jeff Peeler
c9cec47bf0 (closes issue #13173)
Reported by: pep

This change adds an announce_thread responsible for playing announcements to an existing conference. This allows all announcing to be immediately stopped if necessary but more importantly allows other threads that need to play something to not block. There are multiple benefits to this, but the actual bug is for solving the scenario for a channel to be unusable after hang up for the entire duration of the parting announcement. The parting announcement can be extremely long depending on what the user recorded upon joining the conference.

Reviewed by Russell on Review Board:
http://reviewboard.digium.com/r/25/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156178 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 17:53:44 +00:00
Mark Michelson
bd9001e16b When doing some tests, I was having a crash at the end of every call
if an attended transfer occurred during the call. I traced the cause to
the CDR on one of the channels being NULL. murf suggested a check in
the end bridge callback to be sure the CDR is non-NULL before proceeding,
so that's what I'm adding.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 17:38:33 +00:00
Russell Bryant
96d185b5aa Move the sanity check that makes sure "always fork" is not set along with the
console option to be after the code that reads options from asterisk.conf.  
This resolves a situation where Asterisk can start taking up 100% when
misconfigured.
(Thanks to Bryce Porter (x86 on IRC) for letting me log in to his system to
 figure out what was causing the 100% CPU problem.)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 17:29:52 +00:00
Mark Michelson
abc56833ad Channel drivers assume that when their indicate callback
is invoked, that the channel on which the callback was called
is locked. This patch corrects an instance in chan_agent where
a channel's indicate callback is called directly without first
locking the channel.

This was leading to some observed locking issues in chan_local,
but considering that all channel drivers operate under the
same expectations, the generic fix in chan_agent is the right
way to go.

AST-126



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@155861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-10 21:07:39 +00:00
Tilghman Lesher
52e17f5cf8 I got tired of saying this in every single bugnote referring to this file.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@155803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-10 20:49:59 +00:00
Sean Bright
f2ecc4c80e Use static functions here instead of nested ones. This requires a small
change to the ast_bridge_config struct as well.  To understand the reason
for this change, see the following post:

    http://gcc.gnu.org/ml/gcc-help/2008-11/msg00049.html


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@155553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-09 01:08:07 +00:00
Tilghman Lesher
a0386906cf Clarify error message.
(closes issue #13809)
 Reported by: denke
 Patches: 
       20081104__bug13809.diff.txt uploaded by Corydon76 (license 14)
 Tested by: denke


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@155398 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-07 22:27:32 +00:00
Mark Michelson
a5ebe35d26 The documentation listed the ability to set 'maxmsg' per
context. The truth is that you can only set this in the general section
or per mailbox. Thus I am updating the sample config file to be more
accurate.

Thanks to sasargen on IRC for bringing up this issue.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@155011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-06 19:45:52 +00:00
Mark Michelson
a82f9caadf The logic of a strcasecmp call was reversed
(closes issue #13841)
Reported by: clegall_proformatique



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@154724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-05 16:44:34 +00:00
Steve Murphy
8c352bb9aa This fix was prompted by communication from user, who was seeing thousands of error logs... looks like EAGAIN. Made such uninteresting.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@154685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-05 16:06:53 +00:00
Tilghman Lesher
537f626328 On busy systems, it's possible for the values checked within a single line
of code to change, unless the structure is locked to ensure a consistent
state.
(closes issue #13717)
 Reported by: kowalma
 Patches: 
       20081102__bug13717.diff.txt uploaded by Corydon76 (license 14)
 Tested by: kowalma


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@154365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-04 20:49:33 +00:00
Richard Mudgett
f7c8bfed9c JIRA ABE-1703
mISDN sets the channel to the wrong state when it receives
the indication AST_CONTROL_RINGING.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@154266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-04 19:01:08 +00:00
Tilghman Lesher
66d3d10d8c Make the monitor thread non-detached, so it can be joined (suggested by Russell
on -dev list).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@154263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-04 18:58:05 +00:00
Tilghman Lesher
799fe53401 Attempting to expunge a mailbox when the mailstream is NULL will crash Asterisk.
(Closes issue #13829)
Reported by: jaroth
Patch by: me (modified jaroth's patch)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@154066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-03 22:27:10 +00:00
Tilghman Lesher
9f7707dae8 Remove the potential for a division by zero error.
(Closes issue #13810)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@154060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-03 21:48:21 +00:00
Kevin P. Fleming
18df35a2c1 somehow missed a bunch of gcc 4.3.x warnings in this branch on the first pass
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@153823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-03 13:01:18 +00:00
Russell Bryant
0d1441526e features.h depends on linkedlists.h, so include it
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@153651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02 19:51:17 +00:00
Kevin P. Fleming
add5ff5b05 fix a bunch of potential problems found by gcc 4.3.x, primarily bare strings being passed to printf()-like functions and ignored results from read()/write() and friends
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@153337 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-01 18:22:39 +00:00
Terry Wilson
705d6f3742 Add end_bridge_callback for app_follome and add AUTOLOOP flag to res_features
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@153270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-31 22:36:57 +00:00
Tilghman Lesher
1c4d34a0f7 Turn off qualify on uncached realtime peers.
(Closes issue #13383)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@153114 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-31 16:30:32 +00:00
Terry Wilson
6280e04736 Recent CDR fixes moved execution of the 'h' exten into the bridging code, so variables that were set after ast_bridge_call was called would not show up in the 'h' exten. Added a callback function to handle setting variables, etc. from w/in the bridging code. Calls back into a nested function within the function calling ast_bridge_call
(closes issue #13793)
Reported by: greenfieldtech


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@153095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-31 15:45:29 +00:00
Sean Bright
db2283b512 The -I argument to aclocal needs a space before the include directory name.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-30 20:58:24 +00:00
Tilghman Lesher
ac0c617f43 Cannot join detached threads. See http://www.opengroup.org/onlinepubs/000095399/functions/pthread_join.html
(Closes issue #13400)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-30 20:33:28 +00:00
Tilghman Lesher
e8b8a35b3d Unlock before returning, when extension doesn't exist.
(closes issue #13807)
 Reported by: eliel
 Patches: 
       chan_local.c.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-30 19:43:38 +00:00
Kevin P. Fleming
1a56159a79 instead of comparing the string pointer to 0, let's compare the value that was actually parsed out of the string (found by sparse)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152811 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-30 16:53:48 +00:00
Russell Bryant
c1cdf01a0e Fix an incorrect usage of sizeof()
(closes issue #13795)
Reported by: andrew53
Patches:
	chan_sip_sizeof.patch uploaded by andrew53 (license 519)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-29 05:23:51 +00:00
Steve Murphy
fffb7722be A little documentation cross-ref between features and
dial and queue... I wasted some time (stupidly) trying
to get the one-touch parking stuff working, because it
didn't occur to me that I had to also have the corresponding
options in the dial command! Duh! (In all this time, I never
set this up before!)
So, to keep some poor fool from suffering the same fate,
I made the features.conf.sample file mention the corresponding
opts in dial/queue; and the docs for dial/app specifically
mention the corresponding decls in the feature.conf file.

I hope this doesn't spoil some vast, eternal plan...



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-29 05:19:04 +00:00
Steve Murphy
961bc7e758 The magic trick to avoid this crash is not to
try to find the channel by name in the list,
which is slow and resource consuming, but rather
to pay attention to the result codes from the
ast_bridge_call, to which I added the 
AST_PBX_NO_HANGUP_PEER_PARKED value, which
now are returned when a channel is parked.

If you get AST_PBX_KEEPALIVE,
then don't touch the channel pointer.

If you get AST_PBX_NO_HANGUP_PEER, or
AST_PBX_NO_HANGUP_PEER_PARKED, then don't
touch the peer pointer.

Updated the several places where the results
from a bridge were not being properly obeyed,
and fixed some code I had introduced so that
the results of the bridge were not overridden 
(in trunk).

All the places that previously tested for 
AST_PBX_NO_HANGUP_PEER now have to check for
both AST_PBX_NO_HANGUP_PEER and AST_PBX_NO_HANGUP_PEER_PARKED.

I tested this against the 4 common parking
scenarios:


1. A calls B; B answers; A parks B; B hangs up while A is getting the parking
slot announcement, immediately after being put on hold.

2. A calls B; B answers; A parks B; B hangs up after A has been hung up, but
before the park times out.

3. A calls B; B answers; B parks A; A hangs up while B is getting the parking slot announcement, immediately after being put on hold.

4. A calls B; B answers; B parks A; A hangs up after B has been hung up, but before the park times out.


No crash.

I also ran the scenarios above against valgrind, and accesses looked good.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152535 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-29 04:36:32 +00:00
Tilghman Lesher
fd9de775c5 Quoting in the wrong direction
(Fixes AST-107)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-28 22:32:34 +00:00
Tilghman Lesher
785f27a29a Reset all DIAL variables back to blank, in case Dial is called multiple times
per call (which could otherwise lead to inconsistent status reports).
(closes issue #13216)
 Reported by: ruddy
 Patches: 
       20081014__bug13216.diff.txt uploaded by Corydon76 (license 14)
 Tested by: ruddy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-28 17:04:56 +00:00
Jeff Peeler
1400db9dfc Buffer policy setting for half is not needed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-27 23:28:49 +00:00
Tilghman Lesher
2156982d3e Inherit ALL elements of CallerID across a local channel.
(closes issue #13368)
 Reported by: Peter Schlaile
 Patches: 
       20080826__bug13368.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152215 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-27 21:32:00 +00:00
Sean Bright
a300fefab6 Since passing \0 as the second argument to strchr is valid (and will
match the trailing \0 of a string) we need to check that first, otherwise
we end up with incorrect results.  Fix suggested by reporter.

(closes issue #13787)
Reported by: meitinger


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152059 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-26 20:23:36 +00:00
Russell Bryant
17f164852c Move AMI initialization to occur after loading modules. This prevents a
deadlock when someone tries to initiate a module reload from the AMI just
as Asterisk is starting.

(closes issue #13778)
Reported by: hotsblanc
Fix suggested by hotsblanc


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@151905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-25 10:59:02 +00:00
Terry Wilson
3f6d4154b8 Backport fix from 1.6.0 that allows you to set parkedcalltransfers=no|caller|callee|both, but default to both which would be the equivalent of the existing behaviour.
The problem was that if someone parked a call, the callee and caller would both get assigned the builtin transfer feature, which would not only be potentially giving someone the ability to transfer themselves when they shouldn't have it, but would also dissallow reinviting the media off of the call.
(closes issue #12854)
	Reported by: davidw
	Patches: 
	      parkingfix4.diff.txt uploaded by otherwiseguy
		  Tested by: davidw, otherwiseguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@151763 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-23 16:04:42 +00:00
Kevin P. Fleming
bc51c18f3d rename this macro to properly reflect what it does
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@151241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-20 04:57:33 +00:00
Kevin P. Fleming
fe3cd94ec6 break up acinclude.m4 into individual files, which will make it easier to maintain, easier to add new macros (less patching) and will ease maintenance of these macros across Asterisk branches
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@151240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-20 04:45:56 +00:00
BJ Weschke
656de6f30d As per kpfleming's comments to the prior commit, I'm reverting some of the changes here.
A comment was made in bug #13726 
 "3. The same mistake as in (2) is done in a few other places in the code that check for: #if defined(HAVE_ZAPTEL) || defined(HAVE_DAHDI)
Harmless, but still incorrect."

 In the case of main/asterisk.c, this is not incorrect because without HAVE_ZAPTEL defined, we're missing
 the include for ioctl and the namespace that defines DAHDI_TIMERCONFIG which is still required when
 using Zaptel with the 1.4 branch.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@151167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-19 19:51:16 +00:00
BJ Weschke
77b4928d8d Fix the 1.4 branch compile again broken with r150557 when using with Zaptel and not DAHDI
(closes issue #13740)
 reported by: jmls
 patch by: bweschke



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@151100 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-19 19:07:05 +00:00
BJ Weschke
4ac62c324b Using the GetVar handler in AMI is potentially dangerous (insta-crash [tm]) when you use a dialplan function that requires a channel and then you don't provide one or provide an invalid one in the Channel: parameter. We'll handle this situation exactly the same way it was handled in pbx.c back on r61766.
We'll create a bogus channel for the function call and destroy it when we're done. If we have trouble allocating the bogus channel then we're not going to try executing the function call at all and run the risk of crashing.
 (closes issue #13715)
 reported by: makoto
 patch by: bweschke


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@150816 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-18 01:42:23 +00:00
Steve Murphy
8f30902385 Interesting crash. In this case, you exit the
bridge with peer completely GONE. 

I moved the channel find call up to cover the
whole peer CDR reset code segment. This appears
to solve the crash without changing the logic
at all.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@150637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-17 17:18:31 +00:00
Jason Parker
979e2cd58d Correctly allow chan_dahdi to compile against older versions of Zaptel.
Don't always define HAVE_ZAPTEL_CHANALARMS (since we check if it's defined..)
Minor cleanup to make things clear.

(closes issue #13726)
Reported by: tzafrir
Patches:
      dahdi_def.diff uploaded by tzafrir (license 46)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@150557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-17 15:31:35 +00:00
Mark Michelson
47cf653623 Reverting changes from commits 150298 and 150301 since
I was mistakenly under the assumption that dialplan functions
*always* required that a channel be present. I need to go
home earlier, I think :)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@150304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16 23:40:54 +00:00
Mark Michelson
d61eb37af6 And don't forget to return on the error condition
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@150301 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16 23:35:07 +00:00
Mark Michelson
e9035cc286 Don't try to call a dialplan function's read callback from
the manager's GetVar handler if an invalid channel has
been specified. Several dialplan functions, including
CHANNEL and SIP_HEADER, do not check for NULL-ness of
the channel being passed in.

(closes issue #13715)
Reported by: makoto



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@150298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16 23:34:37 +00:00
Richard Mudgett
4fa4c33f6d Fix memory leak found by customer
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@150124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16 15:56:06 +00:00
Steve Murphy
1985be224e This patch is relevant to:
ABE-1628 and RYM-150398 and AST-103 in internal Digium 
bug trackers.

These fixes address a really subtle memory corruption
problem that would happen in machines heavily loaded
in production environments. The corruption would
always take the form of the STMT object getting
nulled out and one of the unixODBC calls would
crash trying to access statement->connection.

It isn't fully proven yet, but the server has
now been running 2.5 days without appreciable
memory growth, or any gain of %cpu, and no 
crashes. Whether this is the problem or not
on that server, these fixes are still warranted.

As it turns out, **I** introduced these errors
unwittingly, when I corrected another crash earlier.
I had formed the build_query routine, and failed
to remove mutex_unlock calls in 3 places in the
transplanted code. These unlocks would only
happen in error situations, but unlocking the
mutex early set the code up for a catastrophic
failure, it appears. It would happen only once
every 100K-200K or more calls, under heavy load... 
but that is enough.

If another crash occurs, with the same MO, 
I'll come back and remove my confession from the log, and
we'll keep searching, but the fact that we
have Asterisk dying from an asynchronous
wiping of the STMT object, only on some connection
error, and that the server has lived for 2.5
days on this code without a crash, sure make
it look like this was the problem!

Also, in several points, Statement handles are
set to NULL after SQLFreeHandle. This was mainly
for insurance, to guarantee a crash. As it turns
out, the code does not appear to be attempting
to use these freed pointers.

Asterisk owes a debt of gratitude to Federico Alves
and Frediano Ziglio for their untiring efforts in
finding this bug, among others.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@150056 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16 15:26:10 +00:00
BJ Weschke
829ffbc857 Another documentation fix.
(closes issue #13708)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@149840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-15 21:34:02 +00:00
BJ Weschke
1d21453b49 An update to the documentation/example of agents.conf.sample with the correct parameter for this feature as defined in chan_agent.c
(closes issue #13709)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@149683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-15 18:28:54 +00:00
Kevin P. Fleming
1573ebed8c fix some problems when parsing SIP messages that have the maximum number of headers or body lines that we support
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@149452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-15 10:30:40 +00:00
Mark Michelson
0145ae2870 Change this warning to an error message. Suggestion
comes from Sean Bright. Thanks Sean!



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@149266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14 23:43:58 +00:00
Mark Michelson
6189f028ae Call register_peer_exten even in the case that the peer's
IP/port does not change.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@149207 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14 23:10:26 +00:00
Mark Michelson
c19ca186c1 Add a tolerance period for sync-triggered audiohooks
so that if packetization of audio is close (but not equal)
we don't end up flushing the audiohooks over small
inconsistencies in synchronization.

Related to issue #13005, and solves the issue
for most people who were experiencing the problem.
However, a small number of people are still experiencing
the problem on long calls, so I am not closing
the issue yet



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@149204 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14 23:00:01 +00:00
Mark Michelson
3c205d2d3f Update the queue with the correct number of calls and
whether the call was completed within the service level
when a transfer takes place. This way, we do not "break"
the leastrecent and fewestcalls strategies by not logging
a call until after the transferred call has ended.

(closes issue #13395)
Reported by: Marquis
Patches:
      app_queue.c.transfer.patch uploaded by Marquis (license 32)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@149200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14 22:40:42 +00:00
Mark Michelson
eda1b995f8 Don't allow reserved characters to be used in register
lines in sip.conf.

(closes issue #13570)
Reported by: putnopvut



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@149130 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14 20:49:02 +00:00
Tilghman Lesher
124e45e739 Check correct values in the return of ast_waitfor(); also, get rid of a
possible memory leak.
(closes issue #13658)
 Reported by: explidous
 Patch by: me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@149061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14 20:09:06 +00:00
Leif Madsen
c2f7267ebf Add in some missing updates to the CHANGES file for sip.conf
(closes issue #13100)
Reported and patch by: gknispel_proformatique


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@148990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14 19:05:12 +00:00
Tilghman Lesher
2d65bd3f1f Some compilers warn, some don't. Fixing.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@148987 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14 19:03:08 +00:00
Tilghman Lesher
f4584aa9ff Ensure that mail headers are 7-bit clean, even when UTF-8 characters are used
in headers like 'Subject' and 'To'.
Closes AST-107.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@148916 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14 17:41:08 +00:00
Mark Michelson
1533c5e6cb Deadlock prevention in chan_local.
(closes issue #13676)
Reported by: tacvbo
Patches:
      13676.patch uploaded by putnopvut (license 60)
Tested by: tacvbo



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@148912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14 17:33:38 +00:00
Kevin P. Fleming
5c7f06103d on Ubuntu (at least), recent versions of ld in binutils delete all debugging symbols when -x is supplied; since the reasons why -x is being passed are lost in the mists of time, remove it so debugging will work properly
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@148736 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14 10:30:54 +00:00
Kevin P. Fleming
0b7476c21c it would be nice if this message printing code had actually been tested before it was committed...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@148611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-14 07:54:41 +00:00
Tilghman Lesher
8dad2a85a5 User not notified of temporary greeting, if ODBC storage is in use.
(closes issue #13659)
 Reported by: moliveras
 Patches: 
       20081009__bug13659.diff.txt uploaded by Corydon76 (license 14)
 Tested by: moliveras


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@148257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-10 16:25:31 +00:00
Tilghman Lesher
276f78ae7d When blank, callerid name and number should display "unknown caller" in voicemail
emails.
(Closes issue #13643)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@147997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-09 19:38:33 +00:00
Jeff Peeler
b1da541a92 (closes issue #13139)
Reported by: krisk84
Tested by: krisk84

This change prevents a call that is placed in the parkinglot to be picked up before the PBX is finished. If another extension dials the parking extension before the PBX thread has completed at minimum warnings will occur about the PBX not properly being terminated. At worst, a crash could occur.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@147941 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-09 18:56:00 +00:00
Kevin P. Fleming
d7be4318bb when parsing a text configuration option, ensure that the buffer on the stack is actually large enough to hold the legal values of that option, and also ensure that sscanf() knows to stop parsing if it would overrun the buffer (without these changes, specifying "buffers=...,immediate" would overflow the buffer on the stack, and could not have worked as expected)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@147681 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-08 22:22:09 +00:00
Joshua Colp
38402d868c If we receive DTMF make sure that the state of the speech structure goes back to being not ready. (issue #LUMENVOX-8)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@147517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-08 14:51:42 +00:00
Kevin P. Fleming
325aa9652f revert this change until i can understand why it results in locking order changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@147430 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-07 23:14:57 +00:00
Kevin P. Fleming
198b01597b don't start a PBX on incoming PRI call channels until after we're done setting channel variables and other things on the channel, otherwise the channel might go away (if the dialplan hangs up quickly) before we are done, which results in a spectacular crash
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@147429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-07 22:59:08 +00:00
Sean Bright
3c576b4262 Make 'imapsecret' an alias to 'imappassword' in voicemail.conf.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@147193 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-07 16:48:30 +00:00
Tilghman Lesher
93ef1ee4ef Dialplan functions should not actually return 0, unless they have modified the
workspace.  To signal an error (and no change to the workspace), -1 should be
returned instead.
(closes issue #13340)
 Reported by: kryptolus
 Patches: 
       20080827__bug13340__2.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@146799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-06 20:52:04 +00:00
Tilghman Lesher
850cd15e26 Check whether an extension exists in the _call method, rather than the _alloc
method, because we need to evaluate the callerid (since that data affects
whether an extension exists).
(closes issue #13343)
 Reported by: efutch
 Patches: 
       20080915__bug13343.diff.txt uploaded by Corydon76 (license 14)
 Tested by: efutch


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@146711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-06 16:51:21 +00:00
Kevin P. Fleming
e1fc602c64 ensure that the private structure for pseudo channels is created without 'leaking' configuration data from other configured channels
(closes issue #13555)
Reported by: jeffg
Patches:
      issue_13555.patch uploaded by kpfleming (license 421)
Tested by: jeffg


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@146643 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-06 15:57:49 +00:00
Jason Parker
8eb7b7e43c Fix silly formatting.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@146448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-05 21:17:44 +00:00
Sean Bright
9f0f616c1e Change some preprocessor macros to struct definitions so that we get
app_rpt to build with DAHDI.

(closes issue #13576)
Reported by: blitzrage


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@146244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-03 22:51:22 +00:00
Jeff Peeler
fc2e08f823 (closes issue #13425)
Reported by: mdu113
Tested by: mdu113

Similar to r143204, masquerade the channel in the case of Park being called from AGI.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@146129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-03 20:44:22 +00:00
Steve Murphy
b161b2df6e (closes issue #13579)
Reported by: dwagner

(closes issue #13584)
Reported by: dwagner
Tested by: murf, putnopvut

The thought occurred to me that the res= from the extension spawn
was ending up being returned from the bridge.

"Thou shalt not poison the return value". Made the change
and it appears to allow blind xfers to work as normal.

If I'm wrong, reopen the bugs. But it looks good to me!

Many thanks to putnopvut for helping me reproduce this!



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@146026 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-03 17:12:54 +00:00
Tilghman Lesher
afae26f04d Backport support for some of the keyword modifications used in 1.6 (while warning that
some options aren't really supported) and add some warning messages.  Some credit to
oej, who was complaining in #asterisk-dev.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@145839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-02 16:39:56 +00:00
Tilghman Lesher
1178fb0bc4 Some sanity checks that may have led to prior crashes, found by codefreeze-lap
(murf) on IRC.  Also some cleanup of incorrectly-used constants.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@145751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-02 15:13:21 +00:00
Leif Madsen
f82c12f5d0 Update the realtime_pgsql.sql script to create the setinterfacevar column.
(closes issue #13549)
Reported by: fiddur



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@145479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-01 17:18:30 +00:00
Richard Mudgett
27b54f4c1c channels/chan_misdn.c
channels/misdn/isdn_lib.c
*  Miscellaneous other fixes from trunk to make merging easier later.

........
r145200 | rmudgett | 2008-09-30 16:00:54 -0500 (Tue, 30 Sep 2008) | 7 lines

*  Miscellaneous formatting changes to make v1.4 and trunk
more merge compatible in the mISDN area.

channels/chan_misdn.c
*  Eliminated redundant code in cb_events() EVENT_SETUP

........
r144257 | crichter | 2008-09-24 03:42:55 -0500 (Wed, 24 Sep 2008) | 9 lines

improved helptext of misdn_set_opt.
........
r142181 | rmudgett | 2008-09-09 12:30:52 -0500 (Tue, 09 Sep 2008) | 1 line

Cleaned up comment

........
r138738 | rmudgett | 2008-08-18 16:07:28 -0500 (Mon, 18 Aug 2008) | 30 lines

channels/chan_misdn.c
*  Made bearer2str() use allowed_bearers_array[]
*  Made use the causes.h defines instead of hardcoded numbers.
*  Made use Asterisk presentation indicator values if either of the
mISDN presentation or screen options are negative.
*  Updated the misdn_set_opt application option descriptions.
*  Renamed the awkward Caller ID presentation misdn_set_opt
application option value not_screened to restricted.
Deprecated the not_screened option value.

channels/misdn/isdn_lib.c
*  Made use the causes.h defines instead of hardcoded numbers.
*  Fixed some spelling errors and typos.
*  Added all defined facility code strings to fac2str().

channels/misdn/isdn_lib.h
*  Added doxygen comments to struct misdn_bchannel.

channels/misdn/isdn_lib_intern.h
*  Added doxygen comments to struct misdn_stack.

channels/misdn_config.c
configs/misdn.conf.sample
*  Updated the mISDN presentation and screen parameter descriptions.

doc/misdn.txt (doc/tex/misdn.tex)
*  Updated the misdn_set_opt application option descriptions.
*  Fixed some spelling errors and typos.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@145293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-30 23:55:24 +00:00
Kevin P. Fleming
d10c4137fb fix some minor issues with rev 144924
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@144925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-27 15:13:30 +00:00
Kevin P. Fleming
50a28e9853 improve header inclusion process in a few small ways:
- it is no longer necessary to forcibly include asterisk/autoconfig.h; every module already includes asterisk.h as its first header (even before system headers), which serves the same purpose
  - astmm.h is now included by asterisk.h when needed, instead of being forced by the Makefile; this means external modules will build properly against installed headers with MALLOC_DEBUG enabled
  - simplify the usage of some of these headers in the AEL-related stuff in the utils directory


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@144924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-27 15:00:48 +00:00
Mark Michelson
02d2b17006 This patch was applied to 1.4 but it completely
does not apply since the "found" pointer is not
passed in to this function. If this is going to
be backported, it needs to be done differently or
a deeper backport needs to be done.

Edit: This commit reverts commit number 144677.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@144758 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-26 22:14:59 +00:00
Steve Murphy
089b6a1477 (closes issue #13563)
Reported by: mnicholson
Patches:
      found1.diff uploaded by mnicholson (license 96)

This patch was mainly meant to apply to trunk and 1.6.x,
but I'm applying it to 1.4 also, which should be a perfectly
harmless fix to the vast majority of users who are not using
external switches, but the few who might be affected 
will not have to go to the pain of filing a bug report.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@144677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-26 17:47:13 +00:00
Steve Murphy
8524d212f6 (closes issue #12101)
Reported by: MVF
Tested by: neutrino88, urzedo, murf, thiagofernandes

Many thanks to neutrino88 for this patch, which
solves a problem whereby channels get a CANCEL
request, respond to it properly, but end up 
in a hung state, infinitely being rescheduled.
This fix is a bit crude, in that catches the
problem at a rather late phase, but it may
prevent infinite rescheduling problems that
might still arise.

It might have been better to find out why,
in the course of protocol handling, the channel
was not destroyed, but we leave that to 
future generations.

Many thanks to urzedo and thiagofernandes for
their work in verifying that the patch code
indeed is being executing, and averting the
problem.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@144420 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-25 16:12:14 +00:00
Tilghman Lesher
987835bbfe Backport Hebrew language to voicemail.
(closes issue #13155)
 Reported by: greenfieldtech
 Patches: 
       voicemail-hebrew-patch-1.4-SVN.c.patch uploaded by greenfieldtech (license 369)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@144356 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-25 01:44:47 +00:00
Christian Richter
4bc71ce504 improved helptext of misdn_set_opt.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@144238 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-24 08:20:52 +00:00
Steve Murphy
ee2d2f2cae (closes issue #13489)
Reported by: DougUDI
Tested by: murf

(closes issue #13490)
Reported by: seanbright
Tested by: murf

(closes issue #13467)
Reported by: edantie
Tested by: murf, edantie, DougUDI


This crash happens because we are unsafely handling old pointers.
The channel whose cdr is being handled, has been hung up and 
destroyed already. I reorganized the code a bit, and tried not
to lose the fork-cdr-chain concepts of the previous code.
I now verify that the 'previous' channel (the channel we
had when the bridge was started), still exists, by looking it up
by name in the channel list. I also do not try to reset the
CDR's of channels involved in bridges. 

Testing shows it solves the crash problem, and should not
negatively impact previous fixes involving CDR's generated
during/after blind transfers. (The reason we need to reset
the CDR's on the "beginning" channels in the first place).




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@144066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-23 16:41:49 +00:00
Steve Murphy
b7a9ab7203 In at least one machine, we noted that the timestr
was not getting set in the STMT; it was coming out,
usually, as binary garbage to an mssql server.
These changes fixed the problem. The only thing
I can venture forth as a guess, is that the pointer
is being stored in the interface, not a copy of the
string. Because we ripped the build process into a 
subroutine, the timestr became a temp. stack variable,
and between the time the STMT got built and the
time it was executed on the server, the string being
pointed to was damaged. At any rate, even if this
theory is false, and some mechanism was at fault,
this fix worked reliably where it didn't before.

Why this bug didn't bite last week, I have no idea.
This change basically defines the timestr buffer
in the calling function, extending the life of the
buffer to cover both the STMT's building and
processing to the server.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@143964 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-23 14:22:10 +00:00
Sean Bright
5ffbc15de7 Use the advertised header size in .au files instead of just assuming they
are 24 bytes (the minimum).

(closes issue #13450)
Reported by: jamessan
Patches:
      pcm-header.diff uploaded by jamessan (license 246)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@143903 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-22 22:49:00 +00:00
Sean Bright
c83cefe9be Make vmail.cgi work with mailboxes defined in users.conf, too.
(closes issue #13187)
Reported by: netvoice
Patches:
      20080911__bug13187.diff.txt uploaded by Corydon76 (license 14)
      (Slightly modified to take alchamist's comments on mantis into account)
Tested by: msales, alchamist, seanbright


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@143736 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-20 00:50:10 +00:00
Steve Murphy
fc6f84e9e9 This fix comes from a debugging session on a test box that has been getting hung channels when the mssqlserver bounces. All the connections then become invalid, and must be reconnected. The cdr_odbc backend had code to do it, but depended on re-establishing the connection, but re-using the STMT that had been built. By trial and error, we determined that the STMT could not be re-used after the connection was re-established. and must be rebuilt. These changes accomplish this.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@143674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-19 21:07:05 +00:00
Doug Bailey
d4748ad3c3 Adjust for technology when generating user extension
(issue #13332)
Reported by: wizzy
Tested by: bkruse


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@143612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-19 16:17:14 +00:00
Steve Murphy
92d91e43e0 A micro-fix, in sip_park_thread, where d is freed before the func is done using it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@143534 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-18 22:11:51 +00:00
Jeff Peeler
5d6a7c270b compare peer and chan instead of looking at the parked user (pu), which could have possibly already have been freed by the parking thread
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@143475 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-18 21:01:23 +00:00
Tilghman Lesher
128c387bf2 When callerid is blank, we want to use "unknown caller" in those cases, too.
(closes issue #13486)
 Reported by: tomo1657
 Patches: 
       20080917__bug13486.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@143404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-17 20:55:47 +00:00
Mark Michelson
af35ef7d73 Allow for "G.729" if offered in an SDP even though
it is not RFC 3551 compliant. Some Cisco switches
will send this in an SDP, and it doesn't hurt to
be able to accept this.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@143337 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-17 18:24:15 +00:00
Jeff Peeler
407b16efd7 (closes issue #13493)
Reported by: mdu113
Patches:
      bug13493.diff uploaded by jpeeler (license 325)
Tested by: mdu113

Changed park_call_full to hold the parkinglot lock a little longer, which protects the parkeduser struct from being freed out from underneath. Made sure that the parking extension is added to the parking context while holding the lock thereby ensuring that there are no spurious warnings from removal attempts when a hangup occurs while the parking lot is being announced.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@143270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-16 21:44:21 +00:00
Jeff Peeler
a3289918e3 (closes issue #13465)
(closes issue #13425)
Reported by: mdu113
Patches:
      bug13425.diff uploaded by jpeeler (license 325)
Tested by: mdu113

The main change here was to masquerade the channel if the channel that was to be parked was running a PBX on it. The PBX thread can then maintain full control of the channel (the zombie) as it expects to while allowing the parking thread full control of the real (parked) channel.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@143204 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-16 16:14:25 +00:00
Tilghman Lesher
84b197673b Set the raw formats at the same time as the other formats.
(closes issue #13240)
 Reported by: jvandal
 Patches: 
       20080813__bug13240.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@143140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-15 21:29:32 +00:00
Jeff Peeler
ca37a64754 (closes issue #12965)
Reported by: rlsutton2

Prevents local channels from playing MOH at each other which was causing ast_generic_bridge to loop much faster.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@142927 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12 22:22:28 +00:00
Tilghman Lesher
a4ebc105ef Create rules for disallowing contacts at certain addresses, which may
improve the security of various installations.  As this does not change
any default behavior, it is not classified as a direct security fix for
anything within Asterisk, but may help PBX admins better secure their
SIP servers.
(closes issue #11776)
 Reported by: ibc
 Patches: 
       20080829__bug11776.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76, blitzrage


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@142865 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12 20:37:18 +00:00
Michiel van Baak
bc9f006e3e fix copyright year range
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@142807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12 17:59:25 +00:00
Tilghman Lesher
496b85d5ed Missing merge from 1.2 fixes errant exit on DTMF, only when language is Italian
(cf commit 34242)
(Closes issue #7353)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@142744 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12 16:38:02 +00:00
Tilghman Lesher
8dfa8b6d0e Don't return a free'd pointer, when a file cannot be opened.
(closes issue #13462)
 Reported by: wackysalut


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@142740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12 16:27:32 +00:00
Steve Murphy
eccd14d7f0 Tested by: sergee, murf, chris-mac, andrew, KNK
This is a "second attempt" to restore the previous "endbeforeh" behavior
in 1.4 and up. In order to capture information concerning all the
legs of transfers in all their infinite combinations, I was forced
to this particular solution by a chain of logical necessities, the
first being that I was not allowed to rewrite the CDR mechanism from 
the ground up!

This change basically leaves the original machinery alone, which allows
IVR and local channel type situations to generate CDR's as normal, but
a channel flag can be set to suppress the normal running of the h exten.
That flag would be set by the code that runs the h exten from the
ast_bridge_call routine, to prevent the h exten from being run twice.
Also, a flag in the ast_bridge_config struct passed into ast_bridge_call
can be used to suppress the running of the h exten in that routine. This
would happen, for instance, if you use the 'g' option in the Dial app.

Running this routine 'early' allows not only the CDR() func to be used
in the h extension for reading CDR variables, but also allows them to
be modified before the CDR is posted to the backends.

While I dearly hope that this patch overcomes all problems, and 
introduces no new problems, reality suggests that surely someone
will have problems. In this case, please re-open 13251 (or 13289),
and we'll see if we can't fix any remaining issues.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@142675 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-12 04:29:34 +00:00
Steve Murphy
aa58c91fbe (closes issue #13364)
Reported by: mdu113

Well, fundamentally, the problems revealed in 13364 are
because of the ForkCDR call that is done before the dial. 
When the bridge is in place, it's dealing with the first
(and wrong) cdr in the list.

So, I wrote a little func to zip down to the first non-locked
cdr in the chain, and thru-out the ast_bridge_call, these
results are used instead of raw chan->cdr and peer->cdr pointers.
This shouldn't affect anyone who isn't forking cdrs before a
dial, and should correct the cdr's of those that do.

So, this change ends up correcting the dstchannel
and userfield; the disposition was fixed by a previous
patch, it was OK coming into this problem.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@142575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-11 22:55:49 +00:00
Steve Murphy
dca52e11c5 (closes issue #12318)
Reported by: krtorio

I made a small change to the code that handles local channel situations.
In that code, I copy the answer time from the peer cdr, to the bridge_cdr,
but I wasn't also copying the disposition from the peer cdr.

So, Now I copy the disposition, and I've tested against 
these cases:

1. phone 1 never answers the phone; no cdr is generated at all.
   this should show up as a manager command failure or something.

2. phone 2 never answers. CDR is generated, says NO ANSWER

3. phone 2 is busy. CDR is generated, says BUSY

4. phone 2 answers: CDR is generated, times are correct; disposition
   is ANSWERED, which is correct. The start time is the time that
   the manager dialed the first phone. The answer time is the time
   the second phone picks up.

I purposely left the cid and src fields blank; since this call really
originates from the manager, there is no 'easy' data to put in these
fields. If you feel strongly that these fields should be filled in,
re-open this bug and I'll dig further.





git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@142474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-10 21:58:17 +00:00
Sean Bright
42e0a95c2f Fix detection of PWLIB and OpenH323 version when spacing in the headers
isn't consistent.

(closes issue #13426)
Reported by: bamby
Patches:
      detect_openh323.diff uploaded by bamby (license 430)
      (Modified by me to use sed instead of tr)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@142416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-10 19:05:46 +00:00
Tilghman Lesher
2f789ddab8 Publish new extra sounds version.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@142358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-10 16:54:29 +00:00
Russell Bryant
4b5b6ffa27 It is a normal situation that a task gets put in the scheduler that should run
as soon as possible.  Accept "0" as an acceptable time to run, and also treat
negative as "run now", and don't print a debug message about it.

(inspired by a message asking about the "request to schedule in the past"
 debug message on the -dev list)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@142354 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-10 16:39:53 +00:00
Mark Michelson
3cf97e5d90 Make sure that the branch sent in CANCEL requests
matches the branch of the INVITE it is cancelling.

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

(closes issue #13198)
Reported by: rickead2000
Tested by: rickead2000



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@142218 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-09 19:15:28 +00:00
Mark Michelson
09c3b90918 When determining if codecs used by SIP peers allow
the media to be natively bridged, use the jointcapability
instead of the peercapability.

It seems that the intent of using the peercapability was to
expand the choice of codecs for the call to increase the
chances of being able to native bridge the channels. The 
problem is that if a codec were settled on for the native
bridge and that wasn't a codec that was configured to be used
by Asterisk for that peer, then Asterisk would send a 
REINVITE with no codecs in the SDP which is a bug no matter
how you slice it.


(closes issue #13076)
Reported by: ramonpeek
Patches:
      13076.patch uploaded by putnopvut (license 60)
Tested by: tbelder



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@142079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-09 16:19:17 +00:00
Russell Bryant
5730a3169a Ensure that the stored CDR reference is still valid after the bridge before
poking at it.  Also, keep the channel locked while messing with this CDR.

(fixes crashes reported in issue #13409)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@142063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-09 15:40:24 +00:00
Mark Michelson
02fb0b646e Fix pedantic mode of chan_sip to only check the
remote tag of an endpoint once a dialog has
been confirmed. Up until that point, it is possible
and legal for the far-end to send provisional
responses with a different To: tag each time. With
this patch applied, these provisional messages
will not cause a matching problem.

(closes issue #11536)
Reported by: ibc
Patches:
      11536v2.patch uploaded by putnopvut (license 60)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@141809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-08 21:10:10 +00:00
Russell Bryant
79d074c9fa When doing an async goto, detect if the channel is already in the middle of a
masquerade.  This can happen when chan_local is trying to optimize itself out.
If this happens, fail the async goto instead of bursting into flames.

(closes issue #13435)
Reported by: geoff2010


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@141806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-08 21:02:36 +00:00
Jason Parker
c2eee2c415 Remove RPM package targets from Makefile (and all associated parts).
This has never worked in 1.4, and we decided that it makes no sense to be done here.
There are many distros out there that already have "proper" spec files that can be (re)used.

Closes issue #13113
Closes issue #10950
Closes issue #10952


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@141741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-08 20:15:42 +00:00
Russell Bryant
00605e78a4 Actually use Zaptel CFLAGS if using Zaptel instead of DAHDI
This fixes building against Zaptel when using a custom path


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@141678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-08 16:26:00 +00:00
Steve Murphy
a05ebb78af This fix comes from Joshua Colp The Brilliant, who, given the trace, came up with a solution. This will most likely will close 13235 and 13409. I'll wait till Monday to verify, and then close these bugs.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@141565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-06 20:13:16 +00:00
Tilghman Lesher
0e8f3075bc Reverting behavior change (AGI should not exit non-zero on SUCCESS)
(closes issue #13434)
 Reported by: francesco_r


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@141503 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-06 15:23:42 +00:00
Mark Michelson
9f079b3158 Agent's should not try to call a channel's indicate callback
if the channel has been hung up. It will likely crash
otherwise

ABE-1159



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@141366 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-05 21:10:32 +00:00
Mark Michelson
8ac105b26d Since greetings are not stored in IMAP, we should
not be DISPOSE'ing of them the same way we do with
other messages.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@141267 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-05 16:35:54 +00:00
Mark Michelson
20d7257914 Commit 140417 had a logic flaw in it which
caused port 5060 to always be used when dialing
a peer if no explicit port was specified. This
broke the behavior of implicitly using the port
from which the peer registered if no port is
specified. This commit fixes the logic flaw.

(closes issue #13424)
Reported by: mdu113
Patches:
      13424.patch uploaded by putnopvut (license 60)
Tested by: mdu113



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@141217 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-05 16:00:24 +00:00
Steve Murphy
8f720a0bdf A small change to prevent double-posting of CDR's; thanks to Daniel Ferrer for bringing it to our attention
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@141156 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-05 14:15:43 +00:00
Steve Murphy
00256a00c2 (closes issue #13357)
Reported by: pj
Tested by: murf

(closes issue #13416)
Reported by: yarns
Tested by: murf

If you find this message overly verbose, relax, it's probably
not meant for you. This message is meant for probably only
two people in the whole world: me, or the poor schnook that
has to maintain this code because I'm either dead or unavailable
at the moment.

This fix solves two reports, both having to do with embedding
a function call in a ${} construct. It was tricky because the
funccall syntax has parenthesis () in it. And up till now,
the 'word' token in the flex stuff didn't allow that, because
it would tend to steal the LP and RP tokens. To be truthful,
the "word" token was the trickiest, most unstable thing in
the whole lexer. I was lucky it made this long without complaints.
I had to choose every character in the pattern with extreme
care, and I knew that someday I'd have to revisit it. Well,
the day has come.

So, my brilliant idea (and I'm being modest), was to use the 
surrounding ${} construct to make a state machine and capture 
everything in it, no matter what it contains. But, I have to now
treat the word token like I did with comments, in that I turn
the whole thing into a state-machine sort of spec, with new
contexts "curlystate", "wordstate", and "brackstate".

Wait a minute, "brackstate"? Yes, well, it didn't take very many
regression tests to point out if I do this for ${} constructs,
I also have to do it with the $[] constructs, too.

I had to create a separate pcbstack2 and pcbstack3 because
these constructs can occur inside macro argument lists, and
when we have two state machines operating on the same structures
we'd get problems otherwise. I guess I could have stopped at
pcbstack2 and had the brackstate stuff share it, but it doesn't
hurt to be safe. So, the pcbpush and pcbpop routines also now
have versions for "2" and "3".

I had to add the {KEYWORD} construct to the initial pattern for
"word", because previously word would match stuff like "default7",
because it was a longer match than the keyword "default". But,
not any more, because the word pattern only matches only one or
two characters now, and it will always lose. So, I made it the
winner again by making an optional match on any of the keywords
before it's normal pattern.

I added another regression test to make sure we don't
lose this in future edits, and had to fix just one regression,
where it no longer reports a 'cascaded' error, which I guess
is a plus.

I've given some thought as to whether to apply these fixes to
1.4 and the 1.6.x releases, vs trunk; I decided to put it in
1.4 because one of the bug reports was against 1.4; and it
is unexpected that AEL cannot handle this situation. It actually
reduced the amount of useless "cascade" error messages that
appeared in the regressions (by one line, ehhem). There is
a possible side-effect in that it does now do more careful
checking of what's in those ${} constructs, as far as matching
parens, and brackets are concerned. Some users may find a an
insidious problem and correct it this way. This should be 
exceedingly rare, I hope.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@141094 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-04 23:15:07 +00:00
Jeff Peeler
1c8fff43ad (closes issue #11979)
Fixes multiple parking problems:
Crash when executing a park on an extension dialed by AGI due to not returning the proper return code.
Crash when using a builtin feature that was a subset of a enabled dynamic feature.
Crash due to always hanging up the peer despite the fact that the peer was supposed to be parked.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@141028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-04 17:00:29 +00:00
Mark Michelson
3bf0a6c221 Fix voicemail forwarding when using ODBC storage.
(closes issue #13387)
Reported by: moliveras
Patches:
      13387.patch uploaded by putnopvut (license 60)
Tested by: putnopvut, moliveras



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@140850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-03 14:29:15 +00:00
Russell Bryant
cb07ce5fa0 Don't freak out if the poll emulation receives NULL for the pollfds array
(closes issue #13307)
Reported by: jcovert


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@140816 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-03 13:24:35 +00:00
Mark Michelson
df5793b73c After adding the context checking to app_voicemail
for IMAP storage, I left out a crucial place to 
copy the context to the vm_state structure. This
is the correction.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@140751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-02 23:47:49 +00:00
Steve Murphy
32218b2529 I am turning the warnings generated in ast_cdr_free and post_cdr into verbose level 2 messages. Really, they matter little to end users. You either get the CDR's you wanted, or you don't, and it is a bug.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@140747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-02 23:36:56 +00:00
Steve Murphy
84800b8fb0 After reconsidering, with respect to 13409, ast_cdr_detach should be OK, better in fact, than ast_cdr_free, which generates lots of useless warnings that will undoubtably generate complaints.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@140690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-02 22:40:13 +00:00
Steve Murphy
f255b55947 (closes issue #13409)
Reported by: tomaso
Patches:
      asterisk-1.6.0-rc2-cdrmemleak.patch uploaded by tomaso (license 564)

I basically spent the day, verifying that this patch 
solves the problem, and doesn't hurt in non-problem 
cases. Why valgrind did not plainly reveal this leak
absolutely mystifies and stuns me. 

Many, many thanks to tomaso for finding and providing the fix.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@140670 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-02 22:15:57 +00:00
Sean Bright
161b31df57 Make sure to use the correct length of the mohinterpret and mohsuggest
buffers when copying configuration values.

(closes issue #13336)
Reported by: decryptus_proformatique
Patches:
      chan_iax2_mohinterpret_mohsuggest_general_settings.patch uploaded by decryptus (license 555)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@140605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-02 18:14:57 +00:00
Mark Michelson
e1b81179dc After working on the ao2_containers branch, I noticed
something a bit strange. In all cases where we provide
a callback function to ao2_container_alloc, the callback
function would only return 0 or CMP_MATCH. After inspecting
the ao2_callback() code carefully, I found that if you're
only looking for one specific item, then you should return
CMP_MATCH | CMP_STOP. Otherwise, astobj2 will continue
traversing the current bucket until the end searching for
more matches.

In cases like chan_iax2 where in 1.4, all the peers are
shoved into a single bucket, this makes for potentially
terrible performance since the entire bucket will be
traversed even if the peer is one of the first ones come
across in the bucket.

All the changes I have made were for cases where the 
callback function defined was passed to ao2_container_alloc
so that calls to ao2_find could find a unique instance
of whatever object was being stored in the container.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@140488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-29 17:34:17 +00:00
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
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
Richard Mudgett
57e3570b62 * The allowed_bearers setting in misdn.conf misspelled one
of its options: digital_restricted.
*  Fixed some other spelling errors and typos.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@136241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-06 21:18:53 +00:00
Mark Michelson
7dcb58af43 We only need to unregister the QueueStatus manager
command once on an unload



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@136238 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-06 20:42:15 +00:00
Tilghman Lesher
43bd872365 -C option takes a filename, not a directory path.
(closes issue #13007)
 Reported by: klaus3000


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@136190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-06 20:14:54 +00:00
Russell Bryant
2ec4a1b050 Remove the use of --no-print-directory when compiling subdirectories.
This allows vim :make functionality to work properly when errors have
occurred in the build.  Without printing the directories, vim did not
know how to find the file that the error occurred in.

If the extra bit of build noise annoys anyone, just let me know, and
I'll make this optional.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@136168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-06 18:58:37 +00:00
Mark Michelson
b48adf96dc Since adding the AST_CONTROL_SRCUPDATE frame type,
there are places where ast_rtp_new_source may be called
where the tech_pvt of a channel may not yet have an
rtp structure allocated. This caused a crash in chan_skinny,
which was fixed earlier, but now the same crash has been 
reported against chan_h323 as well. It seems that the best 
solution is to modify ast_rtp_new_source to not attempt to 
set the marker bit if the rtp structure passed in is NULL.

This change to ast_rtp_new_source also allows the removal
of what is now a redundant pointer check from chan_skinny.

(closes issue #13247)
Reported by: pj



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@136062 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-06 15:58:40 +00:00
Tilghman Lesher
b8550b63bc Fix a longstanding bug in channel walking logic, and fix the explanation to
make sense.
(Closes issue #13124)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@135949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-06 03:53:36 +00:00
Tilghman Lesher
cd17593356 Since powerof() can return an error condition, it's foolhardy not to detect and
deal with that condition.
(Related to issue #13240)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@135915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-06 03:24:56 +00:00
Tilghman Lesher
1a0c9841dd 1) Bugfix for debugging code
2) Reduce compiler warnings for another section of debugging code
(Closes issue #13237)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@135899 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-06 03:02:59 +00:00
Mark Michelson
91222d7c12 Remove properties that should not be here
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@135850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-06 00:29:54 +00:00
Mark Michelson
bae517b1e2 Revert inadvertent changes to app_skel that occurred when
I was testing for a memory leak



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@135847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-06 00:27:54 +00:00
Mark Michelson
b8bbf8b61a Merging the issue11259 branch.
The purpose of this branch was to take into account
"burps" which could cause jitterbuffers to misbehave.
One such example is if the L option to Dial() were used
to inject audio into a bridged conversation at regular
intervals. Since the audio here was not passed through
the jitterbuffer, it would cause a gap in the jitterbuffer's
timestamps which would cause a frames to be dropped for a 
brief period.

Now ast_generic_bridge will empty and reset the jitterbuffer
each time it is called. This causes injected audio to be handled
properly.

ast_generic_bridge also will empty and reset the jitterbuffer
if it receives an AST_CONTROL_SRCUPDATE frame since the change
in audio source could negatively affect the jitterbuffer.

All of this was made possible by adding a new public API call
to the abstract_jb called ast_jb_empty_and_reset.

(closes issue #11259)
Reported by: plack
Tested by: putnopvut



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@135841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-06 00:25:10 +00:00
Steve Murphy
ee8adb313e (closes issue #12982)
Reported by: bcnit
Tested by: murf

I discovered that also, in the previous bug fixes and changes,
the cdr.conf 'unanswered' option is not being obeyed, so
I fixed this.

And, yes, there are two 'answer' times involved in this
scenario, and I would agree with you, that the first 
answer time is the time that should appear in the CDR.
(the second 'answer' time is the time that the bridge
was begun).

I made the necessary adjustments, recording the first
answer time into the peer cdr, and then using that to
override the bridge cdr's value.

To get the 'unanswered' CDRs to appear, I purposely
output them, using the dial cmd to mark them as
DIALED (with a new flag), and outputting them if
they bear that flag, and you are in the right mode.

I also corrected one small mention of the Zap device
to equally consider the dahdi device.

I heavily tested 10-sec-wait macros in dial, and
without the macro call; I tested hangups while the
macro was running vs. letting the macro complete
and the bridge form. Looks OK. Removed all the
instrumentation and debug.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@135799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-05 23:13:20 +00:00
Tilghman Lesher
42a5577557 In a conversion to use ast_strlen_zero, the meaning of the flag IAX_HASCALLERID
was perverted.  This change reverts IAX2 to the original meaning, which was,
that the callerid set on the client should be overridden on the server, even if
that means the resulting callerid is blank.  In other words, if you set
"callerid=" in the IAX config, then the callerid should be overridden to blank,
even if set on the client.  Note that there's a distinction, even on realtime,
between the field not existing (NULL in databases) and the field existing, but
set to blank (override callerid to blank).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@135747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-05 21:34:46 +00:00
Sean Bright
0fa63ffb6f Use PATH_MAX for filenames
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@135597 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-05 13:25:00 +00:00
Russell Bryant
c981603ce4 fix a config sample typo
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@135536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-04 20:15:03 +00:00
Tilghman Lesher
aa158e2e46 Define ASTSBINDIR for script
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@135482 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-04 17:07:52 +00:00
Tilghman Lesher
b0e9870535 Memory leak on unload
(closes issue #13231)
 Reported by: eliel
 Patches: 
       app_voicemail.leak.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@135479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-04 16:56:19 +00:00
Russell Bryant
0b91843b15 Add a minor clarification to the documentation of mohinterpret and mohsuggest
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@135473 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-04 16:26:17 +00:00
Michiel van Baak
c5ef42b87c make app_ices compile on OpenBSD.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@135058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-01 11:43:46 +00:00
Michiel van Baak
3f2b34e888 fix some potential deadlocks in chan_skinny
(closes issue #13215)
Reported by: qwell
Patches:
      2008080100_bug13215.diff.txt uploaded by mvanbaak (license 7)
Tested by: mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@135055 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-01 10:55:27 +00:00
Kevin P. Fleming
192cadcd9d accomodate users who seem to lack a sense of humor :-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134983 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-31 22:18:11 +00:00
Tilghman Lesher
da57d237e6 Specify codecs in callfiles and manager, to allow video calls to be set up
from callfiles and AMI.
(closes issue #9531)
 Reported by: Geisj
 Patches: 
       20080715__bug9531__1.4.diff.txt uploaded by Corydon76 (license 14)
       20080715__bug9531__1.6.0.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-31 21:53:19 +00:00
Russell Bryant
9105d1ecff Get app_ices working again
(closes issue #12981)
Reported by: dlogan
Patches:
      20080709__app_ices_v2_update_trunk.diff uploaded by bbryant (license 36)
      20080709__app_ices_v2_update_14.diff uploaded by bbryant (license 36)
Tested by: bbryant


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-31 19:37:26 +00:00
Steve Murphy
08450d1a93 (closes issue #11849)
Reported by: greyvoip
Tested by: murf

OK, a few days of debugging, a bunch of instrumentation
in chan_sip, main/channel.c, main/pbx.c, etc. and 5 solid 
notebook pages of notes later, I  have made the small
tweek necc. to get the start time right on the second 
CDR when:

  A Calls B
  B answ.
  A hits Xfer button on sip phone,
  A dials C and hits the OK button,
  A hangs up
  C answers ringing phone
  B and C converse
  B and/or C hangs up

But does not harm the scenario where:

  A Calls B
  B answ.
  B hits xfer button on sip phone,
  B dials C and hits the OK button,
  B hangs up
  C answers ringing phone
  A and C converse
  A and/or C hangs up

The difference in start times on the second CDR is because
of a Masquerade on the B channel when the xfer number is 
sent. It ends up replacing the CDR on the B channel with
a duplicate, which ends up getting tossed out. We keep 
a pointer to the first CDR, and update *that* after the
bridge closes. But, only if the CDR has changed.

I hope this change is specific enough not to muck
up any current CDR-based apps. In my defence, I 
assert that the previous information was wrong,
and this change fixes it, and possibly other
similar scenarios.

I wonder if I should be doing the same thing
for the channel, as I did for the peer, but
I can't think of a scenario this might affect.
I leave it, then, as an exersize for the users,
to find the scenario where the chan's CDR 
changes and loses the proper start time.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-31 19:23:42 +00:00
Russell Bryant
d90285f4f5 In case we have some processing threads that free more frames than they allocate,
do not let the frame cache grow forever.

(closes issue #13160)
Reported by: tavius
Tested by: tavius, russell


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134814 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-31 16:45:31 +00:00
Mark Michelson
f51e53921c Add more timeout checks into app_queue, specifically
targeting areas where an unknown and potentially
long time has just elapsed. Also added a check
to try_calling() to return early if the timeout
has elapsed instead of potentially setting a negative
timeout for the call (thus making it have *no* timeout
at all).


(closes issue #13186)
Reported by: miquel_cabrespina
Patches:
      13186.diff uploaded by putnopvut (license 60)
Tested by: miquel_cabrespina



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134758 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-31 15:56:18 +00:00
Tilghman Lesher
e5939d2f3e Oops, wrong define
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134704 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30 22:39:57 +00:00
Steve Murphy
aaf314cf46 (closes issue #13197)
Reported by: pj

(closes issue #13051)
Reported by: pj

This patch substitutes commas in the expr 
supplied to the if () statement, as in
if ( expr ) ...

This solves both the bugs above, and makes
the source symmetric with switch statements,
which were earlier reported to need this sort
of treatment.

I tested this using the examples, both for
the compiler and at run time. Looks good.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30 22:02:07 +00:00
Tilghman Lesher
ef03217c4b Qwell pointed out, via IRC, that the previous fix only worked when explicitly
set.  When nothing is set, and the option is implied, it breaks, because
configure sets the prefix to 'NONE'.  Fixing.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30 21:38:50 +00:00
Russell Bryant
a3bc8d9d7c Reduce stack consumption by 12.5% of the max stack size to fix a crash when
compiled with LOW_MEMORY.

(closes issue #13154)
Reported by: edantie


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30 20:37:17 +00:00
Russell Bryant
7a5caf1a57 Fix a memory leak in func_curl. Every thread that used this function leaked
an allocation the size of a pointer.
(reported by jmls in #asterisk-dev)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30 19:52:53 +00:00
Tilghman Lesher
932ad2c19c Only override sysconfdir and mandir when prefix=/usr
(closes issue #13093)
 Reported by: pabelanger


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30 19:47:16 +00:00
Tilghman Lesher
0dff9821d6 launch_netscript sometimes returns -1, which fails to set AGISTATUS. Map
failure to -1, so that AGISTATUS is always set.
(closes issue #13199)
 Reported by: smw1218


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134480 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30 19:03:44 +00:00
Mark Michelson
0257f5a967 Fix a spot where a function could return without bringing
a channel out of autoservice.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134475 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30 18:31:47 +00:00
Kevin P. Fleming
ced15f2814 use the proper method for building version.h
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134352 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30 15:29:17 +00:00
Kevin P. Fleming
7b61edde36 build against the now-typedef-free dahdi/user.h
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134254 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-29 22:05:57 +00:00
Mark Michelson
b7aa2fb03c Merging the imap_consistency branch.
The main aim of this branch was to make the IMAP
code function in the same manner as the ODBC code
does, eliminating the need for so many IMAP-specific
code chunks. The focal point of all of this work was
to make the various macros (e.g. RETRIEVE, DISPOSE) 
functionally equivalent.

While doing the above work, I also fixed a few bugs
that I came across in my testing. Among these were

1. Fixed message forwarding. This was completely 
broken when using IMAP.
2. Fixed the inability to save new messages as old
and vice versa.
3. Fixed the "delete" options in voicemail.conf when
using IMAP storage.

Even though a few bugs were fixed and the code is
a lot more consistent, the one thing that was *not*
improved in this branch was performance.

The merge of this to trunk may not come immediately
due to the amount of work it will probably involve.

(closes issue #12764)
Reported by: balsamcn



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-29 15:54:48 +00:00
Tilghman Lesher
0b2e233479 Detect when sox fails to raise the volume, because sox can't read the file.
(closes issue #12939)
 Reported by: rickbradley
 Patches: 
       20080728__bug12939.diff.txt uploaded by Corydon76 (license 14)
 Tested by: rickbradley


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134161 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-28 21:50:50 +00:00
Russell Bryant
46b65b2cc0 Add the licensing section to the docs in 1.4, as well, so that we can work on
having an accurate list for each version of Asterisk that is supported


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@133980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-26 15:31:21 +00:00
Tilghman Lesher
8e0165bb17 Remove unnecessary mmap flag
(Closes issue #13161)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@133709 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-25 18:00:33 +00:00
Tilghman Lesher
c5b4e1aec8 Fix some errant device states by making the devicestate API more strict in
terms of the device argument (only without the unique identifier appended).
(closes issue #12771)
 Reported by: davidw
 Patches: 
       20080717__bug12771.diff.txt uploaded by Corydon76 (license 14)
 Tested by: davidw, jvandal, murf


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@133649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-25 17:19:39 +00:00
Russell Bryant
5ae8161b45 Merged revisions 133577 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r133577 | russell | 2008-07-25 10:00:13 -0500 (Fri, 25 Jul 2008) | 2 lines

Fix the IAX2 URI for calling Digium

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@133578 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-25 15:00:31 +00:00
Mark Michelson
a99f3d9365 We need to make sure to null-terminate the "name"
portion of SIP URI parameters so that there are no
bogus comparisons.

Thanks to bbryant for pointing this out.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@133572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-25 14:40:10 +00:00
Tilghman Lesher
580ca7408c Fix rtautoclear and rtcachefriends
(Closes issue #12707)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@133488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-24 21:17:55 +00:00
Tilghman Lesher
bdf5dc4a4c Blocked revisions 133360 via svnmerge
........
r133360 | tilghman | 2008-07-23 22:46:01 -0500 (Wed, 23 Jul 2008) | 2 lines

This part was not correctly patched for AST-2008-010.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@133361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-24 03:48:07 +00:00
Jason Parker
82e28307c0 inbandrelease is gone - it's now inbanddisconnect
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@133295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-23 21:49:03 +00:00
Kevin P. Fleming
888d269e8f revert an optimization that broke ABI... thanks russell!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@133237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-23 21:05:22 +00:00
Kevin P. Fleming
cd12517eeb make some more changes to the dahdi/zap channel name support stuff to ensure allthe globals are 'const', and clean up mmichelson's changes to app_chanspy to simplify the code
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@133226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-23 20:42:30 +00:00
Mark Michelson
252c5728fc As suggested by seanbright, the PSEUDO_CHAN_LEN in
app_chanspy should be set at load time, not at compile
time, since dahdi_chan_name is determined at load time.

Also changed the next_unique_id_to_use to have the 
static qualifier.

Also added the dahdi_chan_name_len variable so that
strlen(dahdi_chan_name) isn't necessary. Thanks to
seanbright for the suggestion.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@133169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-23 19:39:47 +00:00
Mark Michelson
9482af686b Zap/pseudo is ten characters, but DAHDI/pseudo is
twelve. The strncmp call in next_channel should
account for this.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@133104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-23 19:06:16 +00:00
Mark Michelson
ba642db1f4 Update the "last" channel in next_channel in app_chanspy so
that the same pseudo channel isn't constantly returned.

related to issue #13124



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@133101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-23 18:57:17 +00:00
Mark Michelson
1fbde6a2f3 Small cleanup. Move the declaration of the DAHDI_SPANINFO
variable to the block where it is used. This allows one
less #ifdef HAVE_PRI to clutter things up.

Thanks to Tzafrir for pointing this out on #asterisk-dev



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@133038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-23 17:50:01 +00:00
Mark Michelson
32bc585a57 Fix building of chan_dahdi when HAVE_PRI is not
defined.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-23 17:05:04 +00:00
Kevin P. Fleming
b134688e7e ensure that after a channel is created, if it happened to be in 'channel alarm' state, when that alarm clears we won't generate a spurious 'alarm cleared' message
(closes issue #12160)
Reported by: tzafrir



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132942 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-23 15:52:29 +00:00
Kevin P. Fleming
f6d7c63346 minor optimization for stringfields: when a field is being set to a larger value than it currently contains and it happens to be the most recent field allocated from the currentl pool, it is possible to 'grow' it without having to waste the space it is currently using (or potentially even allocate a new pool)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-23 11:52:18 +00:00
Christian Richter
b6ca1a1b06 another Fix because of r119585, this commit has broken high frequented BRI Ports, there was a possibility that a channel, that was marked as in_use would be reused later, the corresponding port could got stuck then. So it is recommended to upgrade for chan_misdn users.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132826 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-23 11:37:50 +00:00
Mark Michelson
d6aef7347a Allow Spiraled INVITEs to work correctly within Asterisk.
Prior to this change, a spiraled INVITE would cause a 482
Loop Detected to be sent to the caller. With this change,
if a potential loop is detected, the Request-URI is inspected
to see if it has changed from what was originally received. If
pedantic mode is on, then this inspection is fully RFC 3261
compliant. If pedantic mode is not on, then a string comparison
is used to test the equality of the two R-URIs.

This has been tested by using OpenSER to rewrite the R-URI
and send the INVITE back to Asterisk.

(closes issue #7403)
Reported by: stephen_dredge



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-22 22:14:24 +00:00
Kevin P. Fleming
6a0bcc4754 fix up namespace pollution for dahdi_chan_mode enum
correct registration of AMI actions in chan_dahdi; in zap-only mode, only register the Zap flavors of the actions (and use Zap prefixes for headers and acks), but in dahdi+zap mode, register both Zap and DAHDI flavors of actions



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-22 22:11:01 +00:00
Kevin P. Fleming
99d9727a84 add rules to create preprocessor output... useful for debugging macros
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132784 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-22 22:09:37 +00:00
Tilghman Lesher
04614238c5 Merged revisions 132711 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r132711 | tilghman | 2008-07-22 16:14:10 -0500 (Tue, 22 Jul 2008) | 2 lines

Fixes for AST-2008-010 and AST-2008-011

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-22 21:19:39 +00:00
Kevin P. Fleming
08a0f08234 ensure that if any alarms exist at channel creation time, they are handled identically to if they occurred later, so that later alarm clearing will work properly and 'make sense'
(closes issue #12160)
Reported by: tzafrir



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-22 21:17:23 +00:00
Kevin P. Fleming
5ef465d386 make AST_C_COMPILE_CHECK able to print a 'pretty' description of what it is doing
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132704 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-22 20:49:41 +00:00
Olle Johansson
fe25fe728c The most common question on the #asterisk iRC channel and on mailing lists
seems to be in regards to an error message when retransmit fails. This
is frequently misunderstood as a failure of Asterisk, not a failure of
the network to reach the other party.

This document tries to assist the Asterisk user in sorting out these
issues by explaining the logic and pointing at some possible 
causes. Hopefully, we will get other questions now :-)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132645 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-22 20:10:26 +00:00
Kevin P. Fleming
e2c41c9ee4 correct wording in comment
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132642 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-22 19:57:43 +00:00
Kevin P. Fleming
0faccba9cb use renamed libpri API call for controlling this feature (was improperly named before)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132641 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-22 19:49:11 +00:00
Kevin P. Fleming
6ef40852de teach chan_dahdi how to find the D-channel on BRI spans, and don't attempt to use channel 24 as a D-channel on spans of unexpected sizes
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-21 22:45:16 +00:00
Brett Bryant
222f6d733a Fix a bug where SENDTEXTSTATUS isn't set properly when it isn't
supported on a channel (yet _another_ useful patch by eliel).

(issue #13081)
Reported by: eliel
Patches:
      app_sendtext1.4.c uploaded by eliel (license 64)
Tested by: eliel


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-21 20:51:45 +00:00
Brett Bryant
2172cc71b1 Fix a bug in 1.4 branch with iax2 channels not being removed when a call was rejected (from the calling box, not the box that denied the
registration). Related to revisions 132466 in trunk, and 132467 in 1.6.0. Earlier I had accidently tested 1.4 with a backport from those revisions, 
so I didn't see this problem (oops).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132506 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-21 20:30:12 +00:00
Kevin P. Fleming
00228e42d0 grant a license exception to allow distribution of Asterisk binaries that use the UW IMAP Toolkit (which is licensed under a non-GPL-compatible license)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-19 16:45:52 +00:00
Tilghman Lesher
31fec93dca Fix for Taiwanese number syntax
(closes issue #12319)
 Reported by: CharlesWang
 Patches: 
       saynumber-tw-1.4.18.1.patch uploaded by CharlesWang (license 444)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18 19:06:10 +00:00
Tilghman Lesher
678b90e2a0 Textual clarification
(closes issue #13106)
 Reported by: flefoll
 Patches: 
       config.c.br14.120173.patch-unknown-directive uploaded by flefoll (license 244)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18 18:47:50 +00:00
Tilghman Lesher
79b6c3f9d6 Spinlock within the destroy, to allow a scheduled job to continue, if it's
waiting on the mutex which the destroy thread has.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@132042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18 17:33:42 +00:00
Tilghman Lesher
0f738146e8 Oops
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@131988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18 17:10:01 +00:00
Tilghman Lesher
89b6e63a8b Preserve ABI compatibility with last change
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@131985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18 16:46:23 +00:00
Tilghman Lesher
64bbce9b9b Make the ast_assert call within ast_sched_del report something useful.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@131970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18 16:30:31 +00:00
Kevin P. Fleming
ced50934cb remove the dlfcn compatibility stuff, because no platforms that Asterisk currently runs on it use it, and it doesn't build anyway
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@131921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18 16:15:41 +00:00
Brett Bryant
5d4058b41a Fix a bug in blind transfers where the BLINDTRANSFER variable isn't always set to the other end of the blind transfer.
(closes issue #12586)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@131915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18 15:34:42 +00:00
Tilghman Lesher
e0baf8a871 Revert part of issue #5620 (revision 6965) as it appears that it was in error.
This should fix talk call progress on analog lines.
(closes issue #12178)
 Reported by: michael-fig
 Patches: 
       20080717__bug12178.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@131790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-17 20:35:44 +00:00
Brett Bryant
8a427aed77 Fix a bug in iax2 registration that allowed peers to register with
case-insensitive names (user_cmp_cb and peer_cmp_cb are now both 
case-sensitive).

(closes issue #13091)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@131491 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-16 22:17:07 +00:00
Tilghman Lesher
b0586bd055 Apparently, in certain cases, a callno is already destroyed when iax2_destroy is called.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@131480 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-16 21:46:06 +00:00
Russell Bryant
4fb20c3291 Always ensure that the channel's tech_pvt reference is NULL after calling the
destroy callback.
(closes issue #13060)
Reported by: jpgrayson
Patches:
      chan_iax2_tech_pvt_crash.patch uploaded by jpgrayson (license 492)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@131421 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-16 20:47:53 +00:00
Mark Michelson
592497392b Move the init_queue call back to where it used to be (changed
Sept 12 last year). It was moved then to prevent a memory leak.
Since then, the same memory leak recurred and was fixed in a 
better way.

Now it has been found that the placement of this init_queue
call can cause problems if a realtime queue has values changed
to an empty string. The problem is that the default value
for that queue parameter would not be set.

(closes issue #13084)
Reported by: elbriga



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@131369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-16 20:23:02 +00:00
Mark Michelson
47924ba64d Apparently, "thread safety" is important, whatever
that means. :P

(Thanks Russell!)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@131357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-16 19:37:08 +00:00
Mark Michelson
e10908c6d2 Make absolutely certain that the transfer datastore
is removed from the calling channel once the caller
is finished in the queue. This could have weird con-
sequences when dialing local queue members when multiple
transfers occur on a single call.

Also fixed a memory leak that would occur when an
attended transfer occurred from a queue member.

(closes issue #13047)
Reported by: festr



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@131299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-16 18:57:34 +00:00
Steve Murphy
3fcfa47611 (closes issue #13090)
Reported by: murf

The problem was that, esoteric as it is, because the hangerupper
context immediately preceded the std-priv-extent macro, that 
the checking code accidentally would fall from traversing hangerupper
into the std-priv-exten macro, where it would hit the hangerupper
in the 'includes', and proceed into an infinite recursion.

A small fix to traverse into the statements of the context instead
of the context solves this issue.

I also added some commented out printfs for debug, which were pretty
handy in the face of a dorky gdb.

This was a problem around since the package was first written;
but evidently pretty rare in turning up in the field.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@131242 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-16 17:53:43 +00:00
Michiel van Baak
4a3a733924 remove 4 lines of redundant code.
(closes issue #13080)
Reported by: gknispel_proformatique
Patches:
      trunk_ast_cdr_setapp.patch uploaded by gknispel (license 261)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@131012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-15 17:47:15 +00:00
Tilghman Lesher
9fda1e767c astman_send_error does not need a newline appended -- the API takes care of
that for us.
(closes issue #13068)
 Reported by: gknispel_proformatique
 Patches: 
       asterisk_1_4_astman_send.patch uploaded by gknispel (license 261)
       asterisk_trunk_astman_send.patch uploaded by gknispel (license 261)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-15 17:19:13 +00:00
Tilghman Lesher
b2947c0348 Override the callerid in all cases when the callerid is set in the user, not
just when a remote callerid is set.  Also, if not set in the user, allow the
remote CallerID to pass through.
(closes issue #12875)
 Reported by: dimas
 Patches: 
       20080714__bug12875.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130889 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-14 23:59:13 +00:00
Mark Michelson
cb503c4cb4 Add a check to the CAN_EARLY_BRIDGE macro in app_dial to
be sure there are no audiohooks present on the channels
involved. This fixed a one-way audio situation I had in
my test setup. I couldn't find any open issues that suggested
one-way audio with regards to mixmonitor (or other audiohook)
usage, though.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-14 17:50:21 +00:00
Michiel van Baak
dd1c912f45 notify the user that dnsmgr refresh wont work when dnsmgr is not enabled.
Previously this command would automagically appear and disappear.
This was confusing.

(closes issue #12796)
Reported by: chappell
Patches:
      dnsmgr_refresh_3.diff uploaded by chappell (license 8)
Tested by: russell, chappell, mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-14 17:10:21 +00:00
Russell Bryant
2d8ce72343 Bump up the debug level for a message.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130634 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-14 10:38:14 +00:00
Michiel van Baak
b47deb444c fix memory leak when originate from manager cannot create a thread
(closes issue #13069)
Reported by: gknispel_proformatique
Patches:
      asterisk_trunk_action_originate.patch uploaded by gknispel (license 261)
	  Tested by: gknispel_proformatique, mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-13 22:48:51 +00:00
Tilghman Lesher
95c8fc64bc Reverting 2 changesets, as it breaks incoming IAX2 calls
(Related to issue #12963)
Reported by: mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130514 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-13 17:56:10 +00:00
Michiel van Baak
32a392ae0c in 1.4 the functions still have | as argument seperator.
This commit fixes the use of RAND in the ael random function.

(closes issue #13061)
Reported by: danpwi


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-12 10:25:52 +00:00
Kevin P. Fleming
17c5dbc3a5 forcibly remove the modules that are changing names
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11 22:23:29 +00:00
Kevin P. Fleming
75c6f9ab0f a whole pile of Zaptel/DAHDI compatibility work, with lots more to come... this tree is not yet ready for users to be easily upgrading or switching, but it needs to be :-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11 22:12:26 +00:00
Mark Michelson
c6d393a0bf Remove redundant logic
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130236 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11 20:03:23 +00:00
Mark Michelson
6edecf4598 Fix a typo in audiohook_read_frame_both.
While this change has not been proven to fix any
specific issue, it is incorrect and could cause
unforeseen problems.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11 19:13:29 +00:00
Tilghman Lesher
4e59c52935 Ensure that a destination callno of 0 will not match for frames that do not
start a dialog (new, lagrq, and ping).
(closes issue #12963)
 Reported by: russellb
 Patches: 
       chan_iax2_dup_new_fix4.patch uploaded by jpgrayson (license 492)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11 18:51:56 +00:00
Tilghman Lesher
f29986aac8 Pass the devicestate from an underlying channel up through the Agent channel.
This should make the Agent always report the correct device state, even when
the underlying channel is used for other purposes.
(closes issue #12773)
 Reported by: davidw
 Patches: 
       20080710__bug12773.diff.txt uploaded by Corydon76 (license 14)
 Tested by: davidw


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11 16:50:42 +00:00
Kevin P. Fleming
92ef406265 new installations should be using DAHDI instead of Zaptel, so the sample config file is now chan_dahdi.conf instead of zapata.conf
also, convert remaining references to zapata.conf in various places



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11 16:08:03 +00:00
Kevin P. Fleming
2ea77b3508 add support for a configuration parameter for 'inband audio during RELEASE', which is currently mandatory in libpri-1.4.4 but will become configurable in libpri-1.4.5 later today
(related to issue #13042)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11 15:41:56 +00:00
Russell Bryant
37f91908e6 add a simple ASTOBJ_TRYWRLOCK macro ...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@129970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11 14:18:43 +00:00
Kevin P. Fleming
a07df230fa simplify calculation
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@129967 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11 14:14:52 +00:00
Kevin P. Fleming
043c97235c fix a flaw found while experimenting with structure alignment and padding; low-fence checking would not work properly on 64-bit platforms, because the compiler was putting 4 bytes of padding between the fence field and the allocation memory block
added a very obvious runtime warning if this condition reoccurs, so the developer who broke it can be chastised into fixing it :-)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@129966 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11 14:03:52 +00:00
Kevin P. Fleming
59466ca614 don't attempt to set user/group ownership of extracted sound files (reported on asterisk-users)
(closes issue #13059)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@129907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11 12:15:42 +00:00
Tilghman Lesher
411e8582c3 Correctly deal with duplicate NEW frames (due to retransmission). Also, fixup
the destination call number matching to be more strict and reliable.
(closes issue #12963)
 Reported by: jpgrayson
 Patches: 
       chan_iax2_dup_new_fix3.patch uploaded by jpgrayson (license 492)
 Tested by: jpgrayson, Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@129803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-10 21:57:05 +00:00
Tilghman Lesher
74c78a9e3a Oops
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@129741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-10 21:19:48 +00:00
Russell Bryant
5f919770b0 Note that pbx_spool.so is the module used for call files
(inspired by a question in #asterisk)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@129567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-10 16:03:59 +00:00
Sean Bright
53df8e7dbb Update svn:ignore
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@129505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-10 13:57:19 +00:00
Mark Michelson
e5c3ba2e73 Fix a problem where inbound rfc2833 audio would be sent to the
core instead of being P2P bridged. When the core regenerated
the rfc2833 packet for the outbound leg, the SSRC would be different
than the RTP audio on the call leg causing DTMF detection issues on
the far end.

(closes issue #12955)
Reported by: tonyredstone
Patches:
      dynamic_rtp.patch uploaded by tsearle (license 373)
Tested by: tonyredstone



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@129436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-09 19:32:20 +00:00
Sean Bright
239c5d6f2c Look for the system installed awk instead of assuming it's at /usr/bin/awk.
Pointed out by jmls via #asterisk-dev.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@129343 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-09 13:41:21 +00:00
Mark Michelson
1645c410d4 Update documentation to have the correct option name
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@129208 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 21:31:51 +00:00
Mark Michelson
7b1c12bcb0 Backport TCP-related timeouts to IMAP voicemail in 1.4
since it should solve bugs people are experiencing. Specifically,
there are times where communication with the IMAP server causes
system calls to block forever. If this should happen when querying
the mailbox so that chan_sip's do_monitor thread can send MWI to
a phone, it means that SIP calls cannot be processed any more.

The timeout options are outlined in doc/imapstorage.txt. Defaults
for the timeouts are sixty seconds.

(closes issue #12987)
Reported by: mthomasslo



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@129158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 21:09:10 +00:00
Tilghman Lesher
e46bb5f5bc Cause SIP to return a 480 instead of a 404 when a sip peer exists, but is not
registered.
(closes issue #12885)
 Reported by: ibc
 Patches: 
       20080701__bug12885__2.diff.txt uploaded by Corydon76 (license 14)
 Tested by: ibc


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@129149 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 20:27:47 +00:00
Tilghman Lesher
56e30a7677 Timestamp decoding for video mini-frames is bogus, because the timestamp only
includes 15 bits, unlike voice frames, which contain a 16-bit timestamp.
(closes issue #13013)
 Reported by: jpgrayson
 Patches: 
       chan_iax2_unwrap_ts.patch uploaded by jpgrayson (license 492)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@129047 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 16:45:23 +00:00
Olle Johansson
3b0f179912 Don't hangup the call if we can't resolve the Contact if there's a proxy
route set for the call.
----
This comment was added a while ago and today it hit me badly. 

/* OEJ: Possible issue that may need a check:
	If we have a proxy route between us and the device,
	should we care about resolving the contact
	or should we just send it?
*/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@128950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 09:52:21 +00:00
Olle Johansson
9a253f3fe6 Fix issues where repeated messages where ignored, but retransmitted reliably instead of unreliably.
Reported by: johan
Patches: 
      12746.txt uploaded by oej (license 306)
Tested by: johan
(issue #12746)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@128912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 09:06:08 +00:00
Tilghman Lesher
37d56a983f Check for non-NULL before stripping characters.
(closes issue #12954)
 Reported by: bfsworks
 Patches: 
       20080701__bug12954.diff.txt uploaded by Corydon76 (license 14)
 Tested by: deti


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@128856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-08 00:01:30 +00:00
Tilghman Lesher
03ba0f7ef0 Stop using deprecated method, as requested by Kevin.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@128812 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-07 23:21:52 +00:00
Russell Bryant
626914d267 Fix handling of when a pvt disappears. Properly return the pvt locked
and don't hold the pvt lock while destroying the ast_channel.

(closes issue #13014)
Reported by: jpgrayson
Patches:
      chan_iax2_ast_iax2_new2.patch uploaded by jpgrayson (license 492)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@128795 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-07 22:41:48 +00:00
Sean Bright
bb95fdcdab Remove spurious trailing whitespace from log messages and fix a spelling error
in a log message.

(closes issue #13017)
Reported by: jpgrayson
Patches:
      chan_iax2_space_after_newline.patch uploaded by jpgrayson (license 492)
      chan_iax2_spelling.patch uploaded by jpgrayson (license 492)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@128737 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-07 20:47:56 +00:00
Mark Michelson
2ac560c495 By using the iaxdynamicthreadcount to identify a thread, it was possible
for thread identifiers to be duplicated. By using a globally-unique monotonically-
increasing integer, this is now avoided.

(closes issue #13009)
Reported by: jpgrayson
Patches:
      chan_iax2_dyn_threadnum.patch uploaded by jpgrayson (license 492)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@128639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-07 17:02:28 +00:00
Kevin P. Fleming
d227632177 use tzafrir's patch to fix this problem properly... i made the previous set of changes without thoroughly testing them, doh!
(closes issue #12911)
Reported by: tzafrir
Patches:
      custum_dahdi_configure_2.diff uploaded by tzafrir (license 46)
Tested by: tzafrir



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@128637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-07 16:51:50 +00:00
Tilghman Lesher
7073477f44 Move the free down one
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@128029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-04 16:11:03 +00:00
Tilghman Lesher
e9d086a277 Fix the 'dialplan remove extension' logic, so that it a) works with cidmatch,
and b) completes contexts correctly when the extension is ambiguous.
(closes issue #12980)
 Reported by: licedey
 Patches: 
       20080703__bug12980.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@127973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-04 03:30:30 +00:00
Kevin P. Fleming
589c7bdb3a remove this, it has been moved to the main Makefile
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@127895 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-03 22:20:16 +00:00
Kevin P. Fleming
0e91ad574f a couple of small Solaris-related fixes
(closes issue #11885)
Reported by: snuffy, asgaroth



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@127892 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-03 22:18:38 +00:00
Kevin P. Fleming
3b34ed635e ensure that DAHDI_INCLUDE and ZAPTEL_INCLUDE are added in all the places needed
improve AST_EXT_LIB_CHECK to accept (and remember) additional CFLAGS data like it does in trunk already

(closes issue #12911)
Reported by: tzafrir



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@127754 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-03 16:12:58 +00:00
Steve Murphy
e9f5152eba The CDRfix4/5/6 omnibus cdr fixes.
(closes issue #10927)
Reported by: murf
Tested by: murf, deeperror

(closes issue #12907)
Reported by: falves11
Tested by: murf, falves11


(closes issue #11849)
Reported by: greyvoip

As to 11849, I think these changes fix the core problems 
brought up in that bug, but perhaps not the more global
problems created by the limitations of CDR's themselves
not being oriented around transfers.

Reopen if necc, but bug reports are not the best
medium for enhancement discussions. We need to start
a second-generation CDR standardization effort to cover
transfers.

(closes issue #11093)
Reported by: rossbeer
Tested by: greyvoip, murf




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@127663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-03 00:16:25 +00:00
Mark Michelson
27a3ead8a7 Fix thread-safety of some of the pbx_builtin_getvar_helper calls
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@127560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-02 20:47:38 +00:00
Tilghman Lesher
65d72fd813 Merged revisions 127466 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r127466 | tilghman | 2008-07-02 13:31:11 -0500 (Wed, 02 Jul 2008) | 6 lines

Solaris fix
(closes issue #12949)
 Reported by: snuffy
 Patches: 
       bug_12949.diff uploaded by snuffy (license 35)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@127501 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-02 19:47:15 +00:00
Mark Michelson
2ddc2e2ca0 Add error message to failed open(2) calls inside the copy() function of
app_voicemail. This idea came as part of my work in helping to resolve
issue #12764.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@127244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 23:36:40 +00:00
Tilghman Lesher
a904d0f74f Disable the old, slow search for matching callno in chan_iax2 (but allow it to be reenabled for debugging)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@127133 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 20:25:37 +00:00
Tilghman Lesher
be6ac151e8 Oops
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@127069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 19:05:28 +00:00
Tilghman Lesher
00b8646ae2 Change around how we schedule pings and lagrqs, and fix a reason why the
jobs were not getting properly cancelled.
(closes issue #12903)
 Reported by: stevedavies
 Patches: 
       20080620__bug12903__2.diff.txt uploaded by Corydon76 (license 14)
 Tested by: stevedavies


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@127068 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 18:52:53 +00:00
Tilghman Lesher
f2946061d0 Suppress annoying warning by finding the remaining cases where the callno is not in the hash.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126999 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 16:50:46 +00:00
Olle Johansson
d3ba59fdc7 Use domain part of SIP uri in register= configuration as fromdomain.
Reported by: one47
Patches: 
      sip-reg-fromdom2.dpatch uploaded by one47 (license 23)
(closes issue #12474)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 14:59:31 +00:00
Olle Johansson
c68c56c3f6 Handle escaped URI's in call pickups. Patch by oej and IgorG.
Reported by: IgorG
Patches: 
      bug12299-11062-v2.patch uploaded by IgorG (license 20)
Tested by: IgorG, oej
(closes issue #12299)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126899 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 14:27:33 +00:00
Olle Johansson
fcb5675ffb Clear up documentation on "domain=" setting in sip.conf
Reported by: davidw
(closes issue #12413)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126844 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 12:53:01 +00:00
Olle Johansson
d96900ad80 Report 200 OK to all in-dialog OPTIONs requests (to confirm that the dialog
exist). Don't bother checking the request URI.

(closes issue #11264)
Reported by: ibc


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 11:51:38 +00:00
Olle Johansson
8e0a99b7e3 Fix bad XML for hold notification.
Reported by: gowen72
Patches: 
      hold.patch uploaded by gowen72 (license 432)
(closes issue #12942)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01 07:49:15 +00:00
Jeff Peeler
95961ba037 Load the proper channel configuration file based on which driver was detected.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-30 23:11:16 +00:00
Tilghman Lesher
84ab258c12 Add note about other names for EuroISDN
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-30 22:30:37 +00:00
Russell Bryant
791f9b12d3 Fix a typo in the non-DEBUG_THREADS version of the recently added DEADLOCK_AVOIDANCE()
macro.  This caused the lock to not actually be released, and as a result, not
avoid deadlocks at all.  This resolves the issues reported in the last while about
Asterisk locking up all over the place (and most commonly, in chan_iax2).

(closes issue #12927)
(closes issue #12940)
(closes issue #12925)
(potentially closes others ...)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-30 16:05:08 +00:00
Olle Johansson
af5c8fedce Send all responses to an INVITE reliably, so that we retransmit if we don't get an ACK and
also fail if we don't get the very same precious ACK. Based on patch by tsearle, with
my own additions.

(closes issue #12951)

Reported by: tsearle
Patches: 
      busy_retransmit.patch uploaded by tsearle (license 373)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126516 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-30 12:50:55 +00:00
Kevin P. Fleming
31a9e3085d ignore warnings for prototypes in GTK headers
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126395 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-29 18:05:34 +00:00
Tilghman Lesher
16b6a965d8 When we get a 408 Timeout, don't stop trying to re-register.
(closes issue #12863)
 Reported by: ricvil


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126056 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-27 22:01:09 +00:00
Tilghman Lesher
c20daa7d8c Since HAVE_DAHDI is defined to HAVE_ZAPTEL in dahdi_compat.h, we must first
check for HAVE_ZAPTEL.
(closes issue #12938)
 Reported by: opticron
 Patches: 
       tonezone_compat.diff uploaded by opticron (license 267)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@125893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-27 16:46:05 +00:00
Tilghman Lesher
db4ae54745 In this debugging function, copy to a buffer instead of using potentially unsafe pointers.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@125793 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-27 13:45:03 +00:00
Tilghman Lesher
226a47ccfd Add proper deadlock avoidance.
(closes issue #12914)
 Reported by: ozan
 Patches: 
       20080625__bug12914.diff.txt uploaded by Corydon76 (license 14)
 Tested by: ozan


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@125740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-27 12:19:39 +00:00
Jason Parker
a9d6021211 Make sure to unlock the lock_info lock (huh?). Possible deadlock?
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@125587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-26 23:03:15 +00:00
Mark Michelson
28004bb651 Add the interface of a queue member to the output of the "queue show" command
so that it can easily be associated with a queue member's name. This helps
so that the appropriate queue member can be removed or paused since the 
interface is required, not the member's name.

(closes issue #12783)
Reported by: davevg
Patches:
      app_queue.diff uploaded by davevg (license 209) with small mod from me



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@125585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-26 22:52:39 +00:00
Mark Michelson
3d2bc51957 Backport of attended transfer queue_log patch from trunk.
This patch allows for attended transfers to be logged in the
queue_log the same way that blind transfers have always been.

It was decided by popular opinion on the asterisk-dev mailing
list that this should be backported to 1.4. Thanks to everyone
who gave an opinion.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@125530 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-26 22:02:55 +00:00
Mark Michelson
033e0392e7 Prior to this patch, the "queue show" command used cached
information for realtime queues instead of giving up-to-date
info. Now realtime is queried for the latest and greatest in
queue info.

(closes issue #12858)
Reported by: bcnit
Patches:
      queue_show.patch uploaded by putnopvut (license 60)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@125476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-26 20:56:01 +00:00
Olle Johansson
bd8199b12c Add support for peer realm based auth (a few missing lines, the rest is well documented but never worked)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@125384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-26 16:32:08 +00:00
Kevin P. Fleming
a57e614df8 ensure that (whenever possible) if we generate a log message because an ioctl() call to DAHDI/Zaptel failed, that we include the reason it failed by including the stringified error number
(issue AST-80)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@125327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-26 15:30:33 +00:00
Tilghman Lesher
9b4a5d8310 Check for rtcp structure before trying to delete schedule.
(closes issue #12872)
 Reported by: destiny6628
 Patches: 
       20080621__bug12872.diff.txt uploaded by Corydon76 (license 14)
 Tested by: destiny6628


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@125276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-26 11:01:21 +00:00
Tilghman Lesher
40784f499c Document ackcall=always.
(closes issue #12852)
 Reported by: davidw


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@125218 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-26 01:24:26 +00:00
Kevin P. Fleming
994998a9da allow tonezone to live in a different place than DAHDI/Zaptel, since dahdi-tools and dahdi-linux are now separate packages and can be installed in different places
don't include tonezone.h in dahdi_compat.h, because only a couple of modules need it

get app_rpt building again after the DAHDI changes

(closes issue #12911)
Reported by: tzafrir



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@125132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-25 22:21:30 +00:00
Tilghman Lesher
5f4939828b Pvt deadlock causes some channels to get stuck in Reserved status.
(closes issue #12621)
 Reported by: fabianoheringer
 Patches: 
       20080612__bug12621.diff.txt uploaded by Corydon76 (license 14)
 Tested by: fabianoheringer


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@124965 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-25 00:46:24 +00:00
Tilghman Lesher
b8e3e5c6d5 Occasionally control characters find their way into CallerID. These need to
be stripped prior to placing CallerID in the headers of an email.
(closes issue #12759)
 Reported by: RobH
 Patches: 
       20080602__bug12759__2.diff.txt uploaded by Corydon76 (license 14)
 Tested by: RobH


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@124910 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-24 21:08:52 +00:00
Tilghman Lesher
f54c6f52ac Don't access the pvt structure if unable to acquire the lock.
(closes issue #12162)
 Reported by: norman
 Patches: 
       12162-lockfail.diff uploaded by qwell (license 4)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@124908 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-24 20:52:43 +00:00
Kevin P. Fleming
df919a669d emit a warning if the old IAX2 call searching code finds a call when the new code did not... so that we can get rid of the old code in 2-3 months
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@124743 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-23 21:22:08 +00:00
Steve Murphy
a8f8c021d2 (closes issue #12910)
Reported by: chris-mac

Sorry, my testing did not contain the simple case of forkCDR(v),
I am much embarrassed to admit.  If I had, I would have 
more solidly initialized the opts element for varset.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@124540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-22 02:54:52 +00:00
Tilghman Lesher
6bcc02490f usleep with a value over 1,000,000 is nonportable. Changing to use sleep()
instead.  (closes issue #12814)
 Reported by: pputman
 Patches: 
       app_rtp_sleep.patch uploaded by pputman (license 81)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@124450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-20 23:12:33 +00:00
Tilghman Lesher
634d72f549 If the last character in a string to be parsed is the delimiter, then we should
count that final empty string as an additional argument.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@124395 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-20 22:02:55 +00:00
Jeff Gehlbach
52af36f02f Fix issues in digium-mib.txt and asterisk-mib.txt to placate smilint - bug 12905
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@124372 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-20 21:14:40 +00:00
Tilghman Lesher
859c491cd0 When using a Local channel, started by a call file, with a destination of an
AGI script, the AGI script does not always get notified of a hangup if the
underlying channel hangs up early.
(closes issue #11833)
 Reported by: IgorG
 Patches: 
       local_hangup-v1.diff uploaded by IgorG (license 20)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@124315 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-20 20:16:02 +00:00
Tilghman Lesher
db334a1edc It's possible for a hangup to be received, even just after the initial cid
spill.
(closes issue #12453)
 Reported by: Alex728
 Patches: 
       20080604__bug12453.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@124182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19 22:53:22 +00:00
Mark Michelson
83efc923de Fix IMAP forwarding so that messages are sent to the proper mailbox.
(closes issue #12897)
Reported by: jaroth
Patches:
      destination_forward.patch uploaded by jaroth (license 50)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@124112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19 20:28:41 +00:00
Brett Bryant
f35ccc37be Merge revision 124064 from trunk. Add errors that report any locks held by threads when they are being closed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@124066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19 19:55:36 +00:00
Tilghman Lesher
64151b28f3 Change informative messages to use the _multiple variant when multiple formats
are possible.
(Closes issue #12848)
Reported by klaus3000


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123930 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19 16:58:19 +00:00
Tilghman Lesher
d5481a1303 Only process 40 arguments (20 files) at once with xargs, because some older
shells may force xargs to separate on an odd boundary.
(Closes issue #12883)
Reported by Nik Soggia


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123909 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19 16:26:03 +00:00
Tilghman Lesher
3841c847a3 Correct description of notifyringing option.
(Closes issue #12890)
Reported by gminet


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19 16:20:41 +00:00
Tilghman Lesher
f03638747b The RDTSC instruction was introduced on the Pentium line of microprocessors,
and is not compatible with certain 586 clones, like Cyrix.  Hence, asking for
i386 compatibility was always incorrect. See http://en.wikipedia.org/wiki/RDTSC
(Closes issue #12886)
Reported by tecnoxarxa


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123869 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19 16:07:23 +00:00
Tilghman Lesher
92047fec99 Add support for saying numbers in Hebrew.
(closes issue #11662)
 Reported by: greenfieldtech
 Patches: 
       say.c.patch-12042008 uploaded by greenfieldtech (license 369)
       Hebrew-Sounds.ods uploaded by greenfieldtech
       (with signficant changes to the spreadsheet by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123769 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-18 22:08:30 +00:00
Tilghman Lesher
29261555d4 Set the variables top-down, so that if a script sets a variable more than once,
the last one will take precedence.
(closes issue #12673)
 Reported by: phber
 Patches: 
       20080519__bug12673.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123710 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-18 20:22:42 +00:00
Mark Michelson
524f305187 Make chan_sip build under dev mode with compilers >= GCC 4.2
Thanks to jpeeler for alerting me of this



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-17 20:26:38 +00:00
Tilghman Lesher
5b0a9ddd36 Fix 3 more places where not locking the structure could cause the wrong lock to be
unlocked.  (Closes issue #12795)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-17 18:56:53 +00:00
Mark Michelson
1335983061 Cisco BTS sends SIP responses with a tab between the Cseq number and
SIP request method in the Cseq: header. Asterisk did not handle this
properly, but with this patch, all is well.

(closes issue #12834)
Reported by: tobias_e
Patches:
      12834.patch uploaded by putnopvut (license 60)
Tested by: tobias_e



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-17 18:09:16 +00:00
Mark Michelson
d7fbc9aae2 davidw pointed out that the holdtime calculation used by
app_queue does not use "boxcar" filtering as the comments
say. The term "boxcar" means that the number of samples used
to calculate stays constant, with new samples replacing the
oldest ones. The queue holdtime calculation uses all holdtime
samples collected since the queue was loaded, so the comment
has been changed to be accurate.

(closes issue #12781)
Reported by: davidw



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-17 15:56:55 +00:00
Russell Bryant
82cf65f89a Fix a memory leak in astobj2 that was pointed out by seanbright. When a container
got destroyed, the underlying bucket list entry for each object that was in the
container at that time did not get free'd.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123271 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-17 15:48:31 +00:00
Tilghman Lesher
cc09f7c8ef Port "hasvoicemail" change from SIP to other channel drivers
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123113 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16 19:50:12 +00:00
Tilghman Lesher
b815ecf349 People expect that if "hasvoicemail" is set in users.conf, even if "mailbox"
isn't set, that SIP will detect a mailbox.
(closes issue #12855)
 Reported by: PLL
 Patches: 
       20080614__bug12855__2.diff.txt uploaded by Corydon76 (license 14)
 Tested by: PLL


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123110 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16 19:21:58 +00:00
Joshua Colp
461020bed4 Only compare the first 15 characters so that even if the charset is specified we still accept it as SDP.
(closes issue #12803)
Reported by: lanzaandrea
Patches:
      chan_sip.c.diff uploaded by lanzaandrea (license 496)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122919 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16 12:31:09 +00:00
Joshua Colp
5ce568d24d Don't send a BYE on a dialog that is already gone during a REFER.
(closes issue #12865)
Reported by: flefoll
Patches:
      chan_sip.c.br14.121495.patch-ALREADYGONE uploaded by flefoll (license 244)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122869 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16 12:08:28 +00:00
Mark Michelson
5cc15b3468 Short circuit the loop in autoservice_run if there are no channels to poll.
If we continued, then the result would be calling poll() with a NULL
pollfd array. While this is fine with POSIX's poll(2) system call, those
who use Asterisk's internal poll mechanism (Darwin systems) would have
a failed assertion occur when poll is called.

(related to issue #10342)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-13 21:44:53 +00:00
Jeff Peeler
a2266547c6 fixed dahdi compatability header from assuming either dahdi or zaptel is installed (may not have either)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-13 18:57:24 +00:00
Terry Wilson
d432d18723 Remove extra option from previous solution attempt
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122617 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-13 17:45:55 +00:00
Jeff Peeler
20229139b5 (closes issue #12846)
Reported by: Netview
Tested by: jpeeler

Use correct location to search for tonezone.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-13 17:36:56 +00:00
Terry Wilson
e128c2a314 This should fix the behavior of the 'T' dial feature being passed incorrectly to the transferee when builtin_atxfers are used.
Also, doing a builtin_atxfer to parking was broken and is fixed here as well.

(closes issue #11898)
	Reported by: sergee
	Tested by: otherwiseguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-13 16:29:07 +00:00
Jeff Peeler
f9818af8dd Adds DAHDI support alongside Zaptel. DAHDI usage favored, but all Zap stuff should continue working. Release announcement to follow.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 19:08:20 +00:00
Mark Michelson
9f669a3a09 Properly play a holdtime message if the announce-holdtime option is
set to "once."

(closes issue #12842)
Reported by: ramonpeek
Patches:
      patch001.diff uploaded by ramonpeek (license 266)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 18:50:58 +00:00
Russell Bryant
836d5c5afa Fix some race conditions that cause ast_assert() to report that chan_iax2 tried
to remove an entry that wasn't in the scheduler


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 18:22:44 +00:00
Jeff Peeler
0c0a5cdc73 (closes issue #12193)
Reported by: davidw
Patch by: Corydon76, modified by me to work properly with ParkAndAnnounce app



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122208 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 15:46:08 +00:00
Tilghman Lesher
3ca503066a Flipflop the sections for two options, since the section for 'X' (exit context)
may otherwise absorb keypresses meant for 's' (admin/user menu).
(closes issue #12836)
 Reported by: blitzrage
 Patches: 
       20080611__bug12836.diff.txt uploaded by Corydon76 (license 14)
 Tested by: blitzrage


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 15:18:39 +00:00
Tilghman Lesher
4767c11e8b Occasionally, the alertpipe loses its nonblocking status, so detect and correct
that situation before it causes a deadlock.  (Reported and tested by ctooley
via #asterisk-dev)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122130 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 15:11:30 +00:00
Steve Murphy
50449140e8 Arkadia tried to warn me, but the code added to ast_cdr_busy, _failed, and _noanswer was redundant. Didn't spot it until I was resolving conflicts in trunk. Ugh. Redundant code removed. It wasn't harmful. Just dumb.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 14:51:44 +00:00
Steve Murphy
5c2cf0f3c0 (closes issue #10668)
Reported by: arkadia
Tested by: murf, arkadia

Options added to forkCDR() app and the CDR() func to
remove some roadblocks for CDR applications.

The "show application ForkCDR" output was upgraded
to more fully explain the inner workings of forkCDR.

The A option was added to forkCDR to force the
CDR system to NOT change the disposition on the
original CDR, after the fork. This involves
ast_cdr_answer, _busy, _failed, and so on.

The T option was added to forkCDR to force 
obedience of the cdr LOCKED flag in the
ast_cdr_end, all the disposition changing
funcs (ast_cdr_answer, etc), and in the
ast_cdr_setvar func.

The CHANGES file was updated to explain ALL
the new options added to satisfy this bug report
(and some requests made verbally and via 
email, irc, etc, over the past months/year)

The 's' option was added to the CDR() func,
to force it to skip LOCKED cdr's in the
chain.

Again, the new options should be totally transparent
to existing apps! Current behavior of CDR,
forkCDR, and the rest of the CDR system should
not change one little bit. Until you add the
new options, at least!



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 13:47:34 +00:00
Terry Wilson
c340004d76 Backport fix for 11520--for some reason I didn't do this back in February when I patched for trunk.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@121992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-11 23:47:23 +00:00
Tilghman Lesher
1c7d9e4c9a Make calls to ast_assert() actually test something, so that the error message
printed is not nonsensical (reported by mvanbaak via #asterisk-bugs).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@121861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-11 18:18:16 +00:00
Jeff Peeler
28bb6bf00c add instructions for logging gdb output via set logging on
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@121804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-11 16:11:09 +00:00
Christian Richter
21152f98f8 fixed issue with previous commit, the find_free_channel test for channels which where inuse was broken.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@121751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-11 09:28:04 +00:00
Sean Bright
43505344ad Fixes a problem with some buggy versions of GNU awk (3.1.3) not liking carriage returns in scripts.
(closes issue #12749)
Reported by: alinux
Tested by: Laureano (on #asterisk-dev), juggie


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@121596 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-10 18:34:45 +00:00
Joshua Colp
fb87cc02f9 If we are destroying a dialog only set the MWI dialog pointer on the related peer to NULL if it is the dialog currently being destroyed.
(closes issue #12828)
Reported by: ramonpeek


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@121495 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-10 13:34:27 +00:00
Joshua Colp
88f21bd666 Update BRIDGEPEER variable before we do a generic bridge in case we just broke out of a native bridge and fell through to generic.
(closes issue #12815)
Reported by: ramonpeek


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@121442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-10 12:52:06 +00:00
Russell Bryant
a3e4233c7d Do not attempt to do emulation if an END digit is received and the length is
less than the defined minimum digit length, and the other end only wants END
digits (SIP INFO, for example).

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@121280 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-09 16:35:40 +00:00
Mark Michelson
c9915a8f27 A unique situation of timeouts brought forth a failure situation for
autologoff in chan_agent. If using AgentCallbackLogin-style agents, 
then if the timeout specified by the Dial() to reach the agent's phone
was shorter than the timeout specified in queues.conf, then autologoff
would only work if the caller hung up while the agent's phone was ringing.
This patch allows autologoff to work in this situation when the call in
queue transfers to the next available agent (as it would have if the timeout
in queues.conf were less than the timeout in the Dial()).

(closes issue #12754)
Reported by: Rodrigo
Patches:
      12754.patch uploaded by putnopvut (license 60)
Tested by: Rodrigo



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@121229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-09 15:02:37 +00:00
Russell Bryant
7e3b1dc9ac Don't run LIST_HEAD_DESTROY on a STATIC list
(closes issue #12807)
Reported by: ys
Patches: 
      chan_agent_local.diff uploaded by ys (license 281)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@121078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-07 14:10:56 +00:00
Jeff Peeler
4162c566ad add another LOW_MEMORY define I forgot
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-06 18:29:14 +00:00
Jeff Peeler
b9eb1170df only define thread storage variable if necessary for LOW_MEMORY
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120908 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-06 18:05:15 +00:00
Jeff Peeler
a8281b2bcc Correction to commmit 120863, make sure proper destructor function is called as well define two thread storage local variables.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120885 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-06 16:39:20 +00:00
Jeff Peeler
6d12307629 This fixes a crash when LOW_MEMORY is turned on. Two allocations of the ast_rtp struct that were previously allocated on the stack have been modified to use thread local storage instead.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120863 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-06 15:33:15 +00:00
Russell Bryant
47e3de10cf fix filename
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-05 18:03:45 +00:00
Russell Bryant
4d8b50486d Add the UPGRADE.txt file from Asterisk 1.2, for handy reference.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120731 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-05 18:01:25 +00:00
Philippe Sultan
d9ad9cc1e4 Ignore appended resource when comparing JIDs.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120675 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-05 16:56:15 +00:00
Russell Bryant
dae683eb3f It turns out that searching on the forwarding station isn't very useful for
most people, so pull in the changes that allow searching for SMDI messages
based on other components of the SMDI message.  Also, update the SMDI
documentation.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120671 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-05 16:38:52 +00:00
Mark Michelson
d600851f16 Make sure that the string we set will survive the unref of
the queue member.

Thanks to Russell, who pointed this out.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-04 22:05:33 +00:00
Tilghman Lesher
547e232ef4 If we fail to setup the PRI request channel, don't continue, exit with an error.
(closes issue #11989)
 Reported by: Corydon76
 Patches: 
       20080213__zap_memleak.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-04 18:35:47 +00:00
Russell Bryant
be1dc4a3da Make the "dialplan remove include" CLI command actually work. Also, tweak
some formatting, and make the success message a little bit more clear.
(closes AST-52)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120371 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-04 16:26:43 +00:00
Mark Michelson
f145259724 Tab completion when removing a member should give the member's interface,
not the name, since the interface is what is expected for the command.

(closes issue #12783)
Reported by: davevg



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120285 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-04 14:11:12 +00:00
Joshua Colp
7b230ded04 Fix a log message and add a message for when the dialplan is done reloading.
(closes issue #12716)
Reported by: chappell
Patches:
      dialplan_reload_2.diff uploaded by chappell (license 8)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120282 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-04 13:31:09 +00:00
Tilghman Lesher
815951acdc Due to incorrect use of the AST_LIST_INSERT_HEAD() macro the loopback switch
cannot perform any translation on the extension number before searching for it
in the target context.
(closes issue #12473)
 Reported by: chappell
 Patches: 
       pbx_loopback.c.diff uploaded by chappell (license 8)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 22:41:04 +00:00
Jeff Peeler
27855de29f (closes issue #11594)
Reported by: yem
Tested by: yem

This change decreases the buffer size allocated on the stack substantially in config_text_file_load when LOW_MEMORY is turned on. This change combined with the fix from revision 117462 (making mkintf not copy the zt_chan_conf structure) was enough to prevent the crash.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 22:15:33 +00:00
Russell Bryant
a5f4960b3c Fix another place where peer->callno could change at a very bad time, and also
fix a place where a peer was used after the reference was released.
(inspired by rev 120001)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 21:34:55 +00:00
Tilghman Lesher
98b11ad0ee When listing the manager users, managers in users.conf are not shown, even
though they are allowed to connect.
(closes issue #12594)
 Reported by: bkruse
 Patches: 
       12594-managerusers-2.diff uploaded by qwell (license 4)
 Tested by: bkruse


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 18:23:32 +00:00
Tilghman Lesher
088ac37bfc Save the callno when we're poking, because our peer structure could change
during destruction (and thus we unlock the wrong callno, causing a
cascade failure).
(closes issue #12717)
 Reported by: gewfie
 Patches: 
       20080525__bug12717.diff.txt uploaded by Corydon76 (license 14)
 Tested by: gewfie


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120001 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 16:10:53 +00:00
Steve Murphy
6f93af198e Updated the regressions on AEL. Hadn't updated
this for the changes I made to preserve ${EXTEN}
in switches, which affected several tests because
it adds extra priorities, and at least one needed to be updated
because of the removal of the empty extension warning
message.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119966 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 15:26:56 +00:00
Steve Murphy
bfd56d7f25 as per http://lists.digium.com/pipermail/asterisk-users/2008-June/212934.html,
which is a message from Philipp Kempgen, requesting that the WARNING
that an extension is empty be reduced to a NOTICE or less, as empty
extensions are syntactically possible, and no big deal.

With which I agree, and have removed that WARNING message entirely.
I think it is not necessary to see this message. It didn't 
state that a NoOp() was inserted automatically on your behalf,
and really, as users, who cares? Why freak out dialplan writers
with unnecessary warnings? The details of the machinations a compiler goes
thru to produce working assembly code is of little interest
to most programmers-- we will follow the unix principal of
doing our work silently.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119929 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 14:49:46 +00:00
Joshua Colp
6d78e78947 Treat ECONNREFUSED as an error that will stop further retransmissions. (issue #AST-58, patch from Switchvox)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 14:46:24 +00:00
Russell Bryant
f4cd9e3958 Revert a change made for issue #12479. This change caused a regression such that
a dial string such as (IAX2/foo) did not automatically fall back to dialing the 's'
extension anymore.

(closes issue #12770)
Reported by: dagmoller


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-02 20:08:04 +00:00
Russell Bryant
8a9d52bc7f Improve CLI command blacklist checking for the command manager action. Previously,
it did not handle case or whitespace properly.  This made it possible for blacklisted
commands to get executed anyway.
(closes issue #12765)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119742 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-02 14:39:45 +00:00
Philippe Sultan
59410a3f01 Do not link the guest account with any configured XMPP client (in
jabber.conf). The actual connection is made when a call comes in
Asterisk.

Fix the ast_aji_get_client function that was not able to retrieve an
XMPP client from its JID.

(closes issue #12085)
Reported by: junky
Tested by: phsultan

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-02 14:32:53 +00:00
Russell Bryant
35ea2643d4 Even of the first PING or LAGRQ doesn't get sent because it comes up too soon,
make sure to reschedule so it gets sent later.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-02 12:30:17 +00:00
Christian Richter
b145e2f8da fixed compile issue when dev-mode is enabled
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119636 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-02 09:29:21 +00:00
Christian Richter
a3fe7673a9 Added counter for unhandled_bmsg Print, this prevents the logs to be flooded to fast and save CPU in this error scenario. Added 'last_used' element to bc structure, when a bchannel changes from used to free this exact time will be marked in last_used. When a new channel is requested the find_free_chan function will check if the new empty channel was used within the last second, if yes it will search for the next channel, if no it will return this channel. This simple mechanism has prooven to prevent race conditions where the NT and TE tried to allocate the exact same channel at the same time (RELEASE cause: 44).
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-02 08:35:28 +00:00
Russell Bryant
69213c8eb6 Change a debug message to an actual debug message
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-02 01:06:09 +00:00
Russell Bryant
c6c26f7c34 Fix another typo in documentation
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119530 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-02 01:03:22 +00:00
Michiel van Baak
383a1ece6b small typo fix 'retires' => 'retries'
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119478 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-01 20:47:55 +00:00
Tilghman Lesher
c9ddda2b1f When joinempty=strict, it only failed on join if there were busy members. If
all members were logged out OR paused, then it (incorrectly) let callers join
the queue.
(closes issue #12451)
 Reported by: davidw


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-30 21:17:45 +00:00
Joshua Colp
9f123152fa Fix a bug I found while testing for another issue.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119354 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-30 19:46:37 +00:00
Michiel van Baak
1540ba27c1 dont use a bashism way to check the $VERSION variable.
The rc/init.d scripts, and safe_asterisk work on normal sh now again.
Tested on:
OpenBSD 4.2 (me)
Debian etch (me)
Ubuntu Hardy (me and loloski)
FC9 (loloski)

(closes issue #12687)
Reported by: loloski
Patches:
      20080529-12687-safe_asterisk-fixversion.diff.txt uploaded by mvanbaak (license 7)
	  Tested by: loloski, mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119301 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-30 16:44:39 +00:00
Russell Bryant
31d518c8e6 Merged revisions 119237 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r119237 | russell | 2008-05-30 07:49:39 -0500 (Fri, 30 May 2008) | 7 lines

- Instead of only enforcing destination call number checking on an ACK, check
  all full frames except for PING and LAGRQ, which may be sent by older versions
  too quickly to contain the destination call number.
  (As suggested by Tim Panton on the asterisk-dev list)
- Merge changes from team/russell/iax2-frame-race, which prevents PING and LAGRQ
  from being sent before the destination call number is known.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119238 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-30 12:55:36 +00:00
Russell Bryant
9a01bdae26 Fix a race condition in channel autoservice. There was still a small window of opportunity
for a DTMF frame, or some other deferred frame type, to come in and get dropped.

(closes issue #12656)
(closes issue #12656)
Reported by: dimas
Patches:
      v3-12656.patch uploaded by dimas (license 88)
	  -- with some modifications by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119156 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29 22:24:29 +00:00
Russell Bryant
3d461c7cb6 Oddly enough, all of the contents of audiohook.h were in there twice. I have
removed the second copy.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29 20:48:33 +00:00
Tilghman Lesher
b2f0add41c Call waiting tone occurs too often, because it's getting serviced by both
subchannels.
(closes issue #11354)
 Reported by: cahen
 Patches: 
       20080512__bug11354.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29 20:24:11 +00:00
Russell Bryant
e4f25aab4b - Fix a typo in the argument to Playtones
- use ast_safe_sleep() instead of calling the wait application
(thanks to tilghman for pointing these out!)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29 19:04:52 +00:00
Russell Bryant
e0c741c5e3 Merged revisions 119008 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r119008 | russell | 2008-05-29 13:45:21 -0500 (Thu, 29 May 2008) | 7 lines

Merge changes from team/russell/iax2-another-fix-to-the-fix

As described in the following post to the asterisk-dev mailing list, only
enforce destination call numbers when processing an ACK.

http://lists.digium.com/pipermail/asterisk-dev/2008-May/033217.html

(closes issue #12631)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29 18:49:12 +00:00
Russell Bryant
ecc4690b4b - Mark app_milliwatt dependent on res_indications (thanks to jsmith)
- fix a typo in a log message (thanks to qwell)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118961 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29 17:51:29 +00:00
Russell Bryant
e5b9da59e2 Change milliwatt to use the proper tone by default (1004 Hz) instead of 1000 Hz.
An option is there to use 1000 Hz for anyone that might want it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118956 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29 17:38:38 +00:00
Tilghman Lesher
ba9f012573 Define also when not DEBUG_THREADS
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118954 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29 17:33:01 +00:00
Tilghman Lesher
65808210e9 Add some debugging code that ensures that when we do deadlock avoidance, we
don't lose the information about how a lock was originally acquired.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29 17:20:16 +00:00
Steve Murphy
e58b5c63c6 (closes issue #10668)
(closes issue #11721)
(closes issue #12726)
Reported by: arkadia
Tested by: murf

These changes:

1. revert the changes made via bug 10668; 
   I should have known that such changes,
   even tho they made sense at the time,
   seemed like an omission, etc, were actually
   integral to the CDR system via forkCDR.
   It makes sense to me now that forkCDR didn't
   natively end any CDR's, but rather depended
   on natively closing them all at hangup time
   via traversing and closing them all, whether
   locked or not. I still don't completely 
   understand the benefits of setvar and answer
   operating on locked cdrs, but I've seen 
   enough to revert those changes also, and
   stop messing up users who depended on that
   behavior. bug 12726 found reverting the changes
   fixed his changes, and after a long review
   and working on forkCDR, I can see why.
2. Apply the suggested enhancements proposed
   in 10668, but in a completely compatible
   way. ForkCDR will behave exactly as before,
   but now has new options that will allow some
   actions to be taken that will slightly 
   modify the outcome and side-effects of
   forkCDR. Based on conversations I've had 
   with various people, these small tweaks
   will allow some users to get the behavior
   they need. For instance, users executing
   forkCDR in an AGI script will find the
   answer time set, and DISPOSITION set, 
   a situation not covered when the routines
  were first written.
3. A small problem in the cdr serializer
   would output answer and end times even
   when they were not set. This is now 
   fixed.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118858 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-29 00:25:28 +00:00
Brett Bryant
3ab48f9299 merge revision 118702 from trunk to 1.4 -- Fixes a bug in chan_iax that uses send_command to poke a peer while a channel is unlocked in some cases, and because it can cause seemingly random failures could be related to some bugs in the tracker...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118716 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-28 16:10:48 +00:00
Joshua Colp
405dfcb54a Add an option to use the source IP address of RTP as the destination IP address of UDPTL when a specific option is enabled. If the remote side is properly configured (ports forwarded) then UDPTL will flow.
(closes issue #10417)
Reported by: cstadlmann


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-28 14:23:34 +00:00
Joshua Colp
a403fd8ea1 Fix an issue where codec preferences were not set on dialogs that were not authenticated via a user or peer and allow framing to work without rtpmap in the SDP.
(closes issue #12501)
Reported by: slimey


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-27 19:32:38 +00:00
Tilghman Lesher
1a73396c9d When showing an error message for a command, don't shorten the command output,
as it tends to confuse the user (it's fine for suggesting other commands,
however).
 Reported by: seanbright (on #asterisk-dev)
 Fixed by: me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-27 19:15:27 +00:00
Mark Michelson
a7f2c5dbf9 Russell noted to me that in the case that separate threads use their
own addressing system, the fix I made for issue 12376 does not guarantee
uniqueness to the datastores' uids. Though I know of no system that works
this way, I am going to change this right now to prevent trying to track
down some future bug that may occur and cause untold hours of debugging
time to track down.

The change involves using a global counter which increases with each new
chanspy_ds which is created. This guarantees uniqueness.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-27 19:07:26 +00:00
Tilghman Lesher
7ca3880d4e NULL character should terminate only commands back to the core, not log
messages to the console.
(closes issue #12731)
 Reported by: seanbright
 Patches: 
       20080527__bug12731.diff.txt uploaded by Corydon76 (license 14)
 Tested by: seanbright


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-27 18:58:09 +00:00
Michiel van Baak
68589940b4 small update to the g() option of app_voicemail to
note that gain changes only work on zap channels right now.

issue #12578 shows it's not clear right now.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-27 17:17:20 +00:00
Mark Michelson
9460de70ef Add a unique id to the datastore allocated in app_chanspy since
it is possible that multiple spies may be listening to the same
channel.

(closes issue #12376)
Reported by: DougUDI
Patches:
      12376_chanspy_uid.diff uploaded by putnopvut (license 60)
Tested by: destiny6628

(closes issue #12243)
Reported by: atis



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-27 16:38:38 +00:00
Tilghman Lesher
0ed598406b Add a note that pbx_config.so is needed for Local channels.
(Closes issue #12671)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-27 15:45:37 +00:00
Tilghman Lesher
0dab692af5 Realtime flag affects construction in multiple ways, so consulting whether
rtcachefriends was set was done too soon (needed to be done inside build_peer,
not just as a flag to build_peer).
Also, fullcontact needed to be reconstructed, because realtime separates the
embedded ';' into multiple fields.
(closes issue #12722)
 Reported by: barthpbx
 Patches: 
       20080525__bug12722.diff.txt uploaded by Corydon76 (license 14)
 Tested by: barthpbx
 (Much of the discussion happened on #asterisk-dev for diagnosing this issue)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118251 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-25 16:02:04 +00:00
Jeff Peeler
ac177d4459 Fix a few things I missed to ensure zt_chan_conf structure is not modified in mkintf
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118163 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-23 21:21:35 +00:00
Tilghman Lesher
3fcdfbf20f Add format type checking for recently de-inlined function
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118055 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-23 13:18:44 +00:00
Tilghman Lesher
c8e3c498d0 Add information on using the Asterisk console, including tab command line
completion.  (Closes issue #12681)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-23 12:59:16 +00:00
Russell Bryant
a3d59980ea Don't declare a function that takes variable arguments as inline, because it's
not valid, and on some compilers, will emit a warning.

http://gcc.gnu.org/onlinedocs/gcc/Inline.html#Inline

(closes issue #12289)
Reported by: francesco_r
Patches by Tilghman, final patch by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@118048 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-23 12:30:53 +00:00
Tilghman Lesher
2454daba41 Also remove preamble from asynchronous events (reported by jsmith on #asterisk-dev)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117899 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-22 18:53:53 +00:00
Tilghman Lesher
2691e0d5b0 Take into account the length of delimiters when calculating result string length.
(closes issue #12696)
 Reported by: adomjan
 Patches: 
       func_realtime.c-longdelimiter.patch uploaded by adomjan (license 487)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-22 16:47:03 +00:00
Jeff Peeler
b77e30e6f5 Ensure that passed in zt_chan_conf structure is not modified in mkintf.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 20:11:14 +00:00
Joshua Colp
6627976f63 Apply the autoframing setting to dialogs that do not get matched against a user or peer.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117574 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 19:38:28 +00:00
Tilghman Lesher
7cf2eecaf6 Revert accidental commit of the last change
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 18:44:53 +00:00
Tilghman Lesher
0b0f6a1a58 Strip the preamble from the output also when -rx is not being used
(Related to issue #12702)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 18:40:14 +00:00
Russell Bryant
67634386e9 Don't filter the magic character in the network verboser. It gets filtered
once it reaches the client.
(related to issue #12702, pointed out by tilghman)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117514 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 18:28:46 +00:00
Russell Bryant
2c4b2d92dd 1) Don't print the verbose marker in front of every message from ast_verbose()
being sent to remote consoles.

2) Fix pbx_gtkconsole to filter out the verbose marker.

(related to issue #12702)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 18:19:34 +00:00
Russell Bryant
8183ebfbcc Don't display the verbose marker for calls to ast_verbose() that do not include
a VERBOSE_PREFIX in front of the message.
(closes issue #12702)
Reported by: johnlange
Patched by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 18:11:51 +00:00
Jeff Peeler
e9e2df2283 Pass a pointer for the conf parameter to the function mkintf rather than the whole zt_chan_conf structure.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 16:58:40 +00:00
Joshua Colp
b5ac40e980 Use the right pthread lock and condition when waiting.
(closes issue #12664)
Reported by: tomo1657
Patches:
      res_smdi.c.patch uploaded by tomo1657 (license 484)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117135 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-19 16:50:52 +00:00
Tilghman Lesher
c10b6550ea The addition of usleep(2) within ast_assert requires the inclusion of the unistd.h header
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-19 16:05:05 +00:00
Joshua Colp
48f4538a8d Make chan_h323 work with pwlib 1.12.0
(closes issue #12682)
Reported by: bamby
Patches:
      pwlib_nopipe.diff uploaded by bamby (license 430)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117081 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-19 15:22:10 +00:00
Russell Bryant
915e1b570f Avoid access of uninitialized memory. This caused a bunch of crashes for me
while doing load testing of development branch where I'm working on some
performance improvements.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@116978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-19 03:44:04 +00:00
Joshua Colp
53061c109f Check to make sure an RTP structure exists before calling ast_rtp_new_source on it.
(closes issue #12669)
Reported by: sbisker


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@116799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-16 20:28:11 +00:00
Tilghman Lesher
01f5aee7ac Avoid zombies when the channel exits before the AGI.
(closes issue #12648)
 Reported by: gkloepfer
 Patches: 
       20080514__bug12648.diff.txt uploaded by Corydon76 (license 14)
 Tested by: gkloepfer


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@116466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-14 21:38:09 +00:00
Russell Bryant
4b2a679f9e Add ast_assert(), which can be used to handle fatal errors. It is only compiled
in if dev-mode is enabled, and only aborts if DO_CRASH is defined.
(inspired by issue #12650)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@116463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-14 21:32:00 +00:00
Jason Parker
32945354d3 Document exitcontext in app_voicemail sample config
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@116409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-14 20:43:08 +00:00
Joshua Colp
66bf888d62 Add linux-gnueabi in.
(closes issue #12529)
Reported by: tzafrir


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@116352 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-14 18:53:39 +00:00
Tilghman Lesher
aa32d71fcc Detect another way for a connection to have gone away.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@116296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-14 16:46:48 +00:00
Olle Johansson
59adcca238 Accept text messages even with
Content-Type: text/plain;charset=Södermanländska


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@116230 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-14 12:51:06 +00:00
Mark Michelson
1167869a80 A change to the way channel locks are handled when DEBUG_CHANNEL_LOCKS is defined.
After debugging a deadlock, it was noticed that when DEBUG_CHANNEL_LOCKS
is enabled in menuselect, the actual origin of channel locks is obscured
by the fact that all channel locks appear to happen in the function
ast_channel_lock(). This code change redefines ast_channel_lock to be a
macro which maps to __ast_channel_lock(), which then relays the proper
file name, line number, and function name information to the core lock
functions so that this information will be displayed in the case that
there is some sort of locking error or core show locks is issued.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@116088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-13 23:47:49 +00:00
Russell Bryant
01de8fa419 Fix a deadlock involving channel autoservice and chan_local that was debugged
and fixed by mmichelson and me.

We observed a system that had a bunch of threads stuck in ast_autoservice_stop().
The reason these threads were waiting around is because this function waits to
ensure that the channel list in the autoservice thread gets rebuilt before the
stop() function returns.  However, the autoservice thread was also locked, so
the autoservice channel list was never getting rebuilt.

The autoservice thread was stuck waiting for the channel lock on a local channel.
However, the local channel was locked by a thread that was stuck in the autoservice
stop function.

It turned out that the issue came down to the local_queue_frame() function in
chan_local.  This function assumed that one of the channels passed in as an
argument was locked when called.  However, that was not always the case.  There
were multiple cases in which this channel was not locked when the function was
called.  We fixed up chan_local to indicate to this function whether this channel
was locked or not.  The previous assumption had caused local_queue_frame() to
improperly return with the channel locked, where it would then never get unlocked.

(closes issue #12584)
(related to issue #12603)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@116038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-13 21:17:23 +00:00
Russell Bryant
92ff649dd6 Fix an issue that I noticed in autoservice while mmichelson and I were debugging
a different problem.  I noticed that it was theoretically possible for two threads
to attempt to start the autoservice thread at the same time.  This change makes the
process of starting the autoservice thread, thread-safe.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-13 21:05:57 +00:00
Joshua Colp
48dd08e321 Use the right flag to open the audio in non-blocking.
(closes issue #12616)
Reported by: nicklewisdigiumuser


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115944 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-13 20:28:23 +00:00
Tilghman Lesher
2fc71fe563 If the socket dies (read returns 0=EOF), return immediately.
(Closes issue #12637)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115884 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-13 18:36:13 +00:00
Mark Michelson
f1696e2133 If a thread holds no locks, do not print any information on the thread when issuing
a core show locks command. This will help to de-clutter output somewhat.

Russell said it would be fine to place this improvement in the 1.4 branch, so that's
why it's going here too.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-12 17:51:14 +00:00
Joshua Colp
f0efe0d2b5 Improve res_ninit and res_ndestroy autoconf logic on the Darwin platform.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-09 16:34:08 +00:00
Russell Bryant
09c28afa6d Remove debug output.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-08 19:19:50 +00:00
Russell Bryant
03c5a410ad Merged revisions 115564 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r115564 | russell | 2008-05-08 14:14:04 -0500 (Thu, 08 May 2008) | 25 lines

Fix a race condition that bbryant just found while doing some IAX2 testing.
He was running Asterisk trunk running IAX2 calls through a few Asterisk boxes,
however, the audio was extremely choppy.  We looked at a packet trace and saw
a storm of INVAL and VNAK frames being sent from one box to another.

It turned out that what had happened was that one box tried to send a CONTROL
frame before the 3 way handshake had completed.  So, that frame did not include
the destination call number, because it didn't have it yet.  Part of our recent
work for security issues included an additional check to ensure that frames that
are supposed to include the destination call number have the correct one.  This
caused the frame to be rejected with an INVAL.  The frame would get retransmitted
for forever, rejected every time ...

This race condition exists in all versions that got the security changes,
in theory.  However, it is really only likely that this would cause a problem in
Asterisk trunk.  There was a control frame being sent (SRCUPDATE) at the _very_
beginning of the call, which does not exist in 1.2 or 1.4.  However, I am fixing
all versions that could potentially be affected by the introduced race condition.

These changes are what bbryant and I came up with to fix the issue.  Instead of
simply dropping control frames that get sent before the handshake is complete,
the code attempts to wait a little while, since in most cases, the handshake
will complete very quickly.  If it doesn't complete after yielding for a little
while, then the frame gets dropped.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-08 19:15:25 +00:00
Russell Bryant
442079ab0b Don't give up on attempting an outbound registration if we receive a 408 Timeout.
(closes issue #12323)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-08 16:11:33 +00:00
Russell Bryant
0353109ec1 remove postgres_cdr.sql, as the CDR schema is in realtime_pgsql.sql, as well
(closes issue #9676)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-08 15:37:49 +00:00
Russell Bryant
5e851ededb Don't exit the script if Asterisk is not running.
(closes issue #12611)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-08 15:32:08 +00:00
Russell Bryant
4a1081e590 Don't use a channel before checking for channel allocation failure.
(closes issue #12609)
Reported by: edantie


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-08 15:24:54 +00:00
Russell Bryant
1ae49dd240 Use the same method for executing Asterisk as the rest of the script.
(closes issue #12611)
Reported by: b_plessis


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-08 14:40:53 +00:00
Russell Bryant
f27d0168a2 Track peer references when stored in the sip_pvt struct as the peer related to
a qualify ping or a subscription.  This fixes some realtime related crashes.
(closes issue #12588)
(closes issue #12555)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-07 18:17:19 +00:00
Russell Bryant
e1c4c9e7b6 Merged revisions 115511 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r115511 | russell | 2008-05-07 11:22:49 -0500 (Wed, 07 May 2008) | 3 lines

Remove remnants of dlinkedlists.  I didn't actually use them in the final version
of my IAX2 improvements.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-07 16:24:09 +00:00
Jason Parker
38191b0908 Merged revisions 115421 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r115421 | qwell | 2008-05-06 14:54:57 -0500 (Tue, 06 May 2008) | 7 lines

read requires an argument on some non-bash shells

(closes issue #12593)
Reported by: bkruse
Patches:
      getilbc.sh_12593_v1.diff uploaded by bkruse (license 132)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-06 19:55:29 +00:00
Jason Parker
00415742a5 Switch to using ast_random() rather than just rand().
This does not fix the bug reported, but I believe it is correct.

(from issue #12446)
Patches:
      bug_12446.diff uploaded by snuffy (license 35)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-06 19:34:58 +00:00
Tilghman Lesher
273afe2080 Don't print the terminating NUL. (Closes issue #12589)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-06 19:31:39 +00:00
Joshua Colp
9c2bac0487 Add in missing argument.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-06 13:54:15 +00:00
Tilghman Lesher
869b7b2b4d Separate verbose output from CLI output, by using a preamble.
(closes issue #12402)
 Reported by: Corydon76
 Patches: 
       20080410__no_verbose_in_rx_output.diff.txt uploaded by Corydon76 (license 14)
       20080501__no_verbose_in_rx_output__1.4.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 22:50:31 +00:00
Joshua Colp
6e6849f1a0 Make sure that either the main speex library contains preprocess functions or that speexdsp does. If both fail then speex stuff can not be built.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 22:10:05 +00:00
Mark Michelson
1eee42a78a Don't consider a caller "handled" until the caller is bridged with
a queue member. There was too much of an opportunity for the member
to hang up (either during a delay, announcement, or overly long
agi) between the time that he answered the phone and the time when
he actually was bridged with the caller. The consequence of this
was that if the member hung up in that interval, then proper
abandonment details would not be noted in the queue log if the caller
were to hang up at any point after the member hangup.

(closes issue #12561)
Reported by: ablackthorn



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115320 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 21:41:34 +00:00
Tilghman Lesher
732e3bec3e Reverse order, such that user configs override default selections
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 20:17:55 +00:00
Tilghman Lesher
6142d1648c Err, the documentation on the return value of ast_odbc_backslash_is_escape is exactly backwards.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 19:55:55 +00:00
Russell Bryant
fbf07008d9 Avoid putting opaque="" in Digest authentication. This patch came from switchvox.
It fixes authentication with Primus in Canada, and has been in use for a very long
time without causing problems with any other providers.
(closes issue AST-36)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 19:49:25 +00:00
Russell Bryant
3cf37ba42e Blocked revisions 115296 via svnmerge
........
r115296 | russell | 2008-05-05 12:53:26 -0500 (Mon, 05 May 2008) | 28 lines

Merge changes from team/russell/iax2_find_callno_1.2

These changes address a critical performance issue introduced in the latest
release.  The fix for the latest security issue included a change that made
Asterisk randomly choose call numbers to make them more difficult to guess by
attackers.  However, due to some inefficient (this is by far, an understatement)
code, when Asterisk chose high call numbers, chan_iax2 became unusable after
just a small number of calls.  On a small embedded platform, it would not be
able to handle a single call.  On my Intel Core 2 Duo @ 2.33 GHz, I couldn't
run more than about 16 IAX2 channels.  Ouch.

These changes address some performance issues of the find_callno() function
that have bothered me for a very long time.  On every incoming media frame,
it iterated through every possible call number trying to find a matching
active call.  This involved a mutex lock and unlock for each call number
checked.  So, if the random call number chosen was 20000, then every media
frame would cause 20000 locks and unlocks.  Previously, this problem was
not as obvious since Asterisk always chose the lowest call number it could.

A second container for IAX2 pvt structs has been added.  It is an astobj2
hash table.  When we know the remote side's call number, the pvt goes into
the hash table with a hash value of the remote side's call number.  Then,
lookups for incoming media frames are a very fast hash lookup instead of an
absolutely insane array traversal.

In a quick test, I was able to get more than 3600% more IAX2 channels
on my machine with these changes.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 17:53:54 +00:00
Tilghman Lesher
70aedcea79 When starting Asterisk, bug out if Asterisk is already running.
(closes issue #12525)
 Reported by: explidous
 Patches: 
       20080428__bug12525.diff.txt uploaded by Corydon76 (license 14)
 Tested by: mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115285 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-05 03:22:25 +00:00
Joshua Colp
9ecb9277ad Expand the test function for GCC attributes so that more complex attributes are properly recognized.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115282 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-04 02:09:44 +00:00
Joshua Colp
a8c56a51d6 For my next trick I will make these work with what our autoconf header file gives us.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-04 01:50:59 +00:00
Joshua Colp
65e2b0a8fb Treat warnings as errors when checking if a GCC attribute exists. We have to do this as GCC will just ignore the attribute and pop up a warning, it won't actually fail to compile.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-04 01:43:26 +00:00
Brett Bryant
61bee5aa54 Add new "pri show version" command to show the libpri version for support reasons.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-02 20:25:42 +00:00
Mark Michelson
89453ef4c1 Clarify a comment that was, well, just wrong. It turns out that
ignoring the way that macros expand. Instead, I have clarified in the
comment why the macro will work even if the scheduler id for the
task to be deleted changes during the execution of the macro.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-02 14:28:19 +00:00
Tilghman Lesher
291dd88595 Change the comment of deprecated to an actual compiler deprecation
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-01 23:20:25 +00:00
Tilghman Lesher
dceb0835da '#' is another reserved character for URIs that also needs to be escaped.
(closes issue #10543)
 Reported by: blitzrage
 Patches: 
       20080418__bug10543.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@115017 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-01 18:59:08 +00:00
Russell Bryant
5f1f3ed473 Merge changes from team/russell/iax2_find_callno and iax2_find_callno_1.4
These changes address a critical performance issue introduced in the latest
release.  The fix for the latest security issue included a change that made
Asterisk randomly choose call numbers to make them more difficult to guess by
attackers.  However, due to some inefficient (this is by far, an understatement)
code, when Asterisk chose high call numbers, chan_iax2 became unusable after
just a small number of calls.  On a small embedded platform, it would not be
able to handle a single call.  On my Intel Core 2 Duo @ 2.33 GHz, I couldn't
run more than about 16 IAX2 channels.  Ouch.

These changes address some performance issues of the find_callno() function
that have bothered me for a very long time.  On every incoming media frame,
it iterated through every possible call number trying to find a matching
active call.  This involved a mutex lock and unlock for each call number
checked.  So, if the random call number chosen was 20000, then every media
frame would cause 20000 locks and unlocks.  Previously, this problem was
not as obvious since Asterisk always chose the lowest call number it could.

A second container for IAX2 pvt structs has been added.  It is an astobj2
hash table.  When we know the remote side's call number, the pvt goes into
the hash table with a hash value of the remote side's call number.  Then,
lookups for incoming media frames are a very fast hash lookup instead of an
absolutely insane array traversal.

In a quick test, I was able to get more than 3600% more IAX2 channels
on my machine with these changes.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114891 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30 16:30:01 +00:00
Olle Johansson
26fc3d5ac6 Don't crash on bad SIP replys.
Fix created in Huntsville together with Mark M (putnopvut)

(closes issue #12363)
Reported by: jvandal
Tested by: putnopvut, oej


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30 16:23:17 +00:00
Kevin P. Fleming
8b8a6f2486 use the ARRAY_LEN macro for indexing through the iaxs/iaxsl arrays so that the size of the arrays can be adjusted in one place, and change the size of the arrays from 32768 calls to 2048 calls when LOW_MEMORY is defined
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30 14:46:57 +00:00
Kevin P. Fleming
148bd701f0 pay attention to *all* header files for dependency tracking, not just the local ones (inspired by r578 of asterisk-addons by tilghman)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114875 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30 12:14:07 +00:00
Mark Michelson
b066825d56 Use the MACRO_CONTEXT and MACRO_EXTEN channel variables instead of the channel's macrocontext
and macroexten fields. This is needed because if macros are daisy-chained, the incorrect 
context and extension are placed on the new channel. I also added locking to the channel prior
to accessing these variables as noted in trunk's janitor project file.


(closes issue #12549)
Reported by: darren1713
Patches:
      app_queue.c.macroextenpatch uploaded by darren1713 (license 116)
	       (with modifications from me)
Tested by: putnopvut



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-29 19:40:06 +00:00
Jason Parker
06b0749cfd Change warning message to debug, since there are cases where 0 results is perfectly fine.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-29 17:08:55 +00:00
Kevin P. Fleming
2ddaeeaf59 Merged revisions 114822 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r114822 | kpfleming | 2008-04-29 07:52:32 -0500 (Tue, 29 Apr 2008) | 2 lines

stop script from appending source code if run multiple times

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-29 12:53:12 +00:00
Tilghman Lesher
a4732cfb3c When modules are embedded, they take on a different name, without the ".so"
extension.  Specifically check for this name, when we're checking if a module
is loaded.
(Closes issue #12534)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114708 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-28 04:47:39 +00:00
Sean Bright
eb8e9d5dc5 When we don't explicitly pass a path to the --with-tds configure option, we
may end up finding tds.h in /usr/local/include instead of /usr/include.  If
this happens, the grep that looks for the version (from tdsver.h) will fail
and we'll have some problems during the build.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114695 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-27 01:26:15 +00:00
Tilghman Lesher
13a438e295 Clicking forward without selecting a message leaves an errant .lock file.
(closes issue #12528)
 Reported by: pukepail
 Patches: 
       patch.diff uploaded by pukepail (license 431)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-26 13:15:21 +00:00
Russell Bryant
609ed327eb Use consistent logic for checking to see if a call number has been chosen yet.
Also, remove some redundant logic I recently added in a fix.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114673 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-25 21:54:40 +00:00
Mark Michelson
fcd288a33e Move the unlock of the spyee channel to outside the start_spying() function so that
the channel is not unlocked twice when using whisper mode.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114662 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-25 19:32:02 +00:00
Tilghman Lesher
6d2c05cbec Reference documentation files that actually exist.
(closes issue #12516)
 Reported by: linuxmaniac
 Patches: 
       diff_rev114611.patch uploaded by linuxmaniac (license 472)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-25 15:53:52 +00:00
Mark Michelson
709502b119 Re-invite RTP during a masquerade so that, for instance, an AMI
redirect of two channels which are natively bridged will preserve audio
on both channels. This prevents a problem with Asterisk not re-inviting
due to one of the channels having being a zombie.

(closes issue #12513)
Reported by: mneuhauser
Patches:
      asterisk-1.4-114602_restore-RTP-on-fixup.patch uploaded by mneuhauser (license 425)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114632 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 21:35:08 +00:00
Mark Michelson
44c157b36a Output of channel variables when eventwhencalled=vars was set
was being truncated two characters. This patch corrects the
problem.

(closes issue #12493)
Reported by: davidw



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 20:43:03 +00:00
Mark Michelson
8eee7feb2b Resolve a deadlock in chan_local by releasing the channel lock
temporarily.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114624 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 20:04:24 +00:00
Tilghman Lesher
0cd455c19b Ensure that when we set the accountcode, it actually shows up in the CDR.
(Fix for AMI Originate)
(Closes issue #12007)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 19:53:36 +00:00
Russell Bryant
57c68bcb3a Fix a silly mistake in a change I made yesterday that caused chan_iax2 to blow
up very quickly.
(issue #12515)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 15:55:21 +00:00
Olle Johansson
2acde60c29 Only have one max-forwards header in outbound REFERs.
Discovered in the Asterisk SIP Masterclass in Orlando. Thanks Joe!


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-24 14:55:18 +00:00
Russell Bryant
2f6cbc76ec Improve some broken cookie parsing code. Previously, manager login over HTTP
would only work if the mansession_id cookie was first.  Now, the code builds
a list of all of the cookies in the Cookie header.  This fixes a problem
observed by users of the Asterisk GUI.
(closes AST-20)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23 22:18:12 +00:00
Russell Bryant
74694c686d Fix an issue that caused getting the correct next channel to not always work.
Also, remove setting the amount of time to wait for a digit from 5 seconds back
down to 1/10 of a second.  I believe this was so the beep didn't get played over
and over really fast, but a while back I put in another fix for that issue.

(closes issue #12498)
Reported by: jsmith
Patches:
      app_chanspy_channel_walk.trunk.patch uploaded by jsmith (license 15)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114597 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23 20:49:18 +00:00
Jason Parker
02bd4cbebc Fix reload/unload for res_musiconhold module.
(closes issue #11575)
Reported by: sunder
Patches:
      M11575_14_rev3.diff uploaded by junky (license 177)
      bug11575_trunk.diff.txt uploaded by jamesgolovich (license 176)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114594 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23 18:28:44 +00:00
Russell Bryant
f8848a7fe8 Store the manager session ID explicitly as 4 byte ID instead of a ulong. The
mansession_id cookie is coded to be limited to 8 characters of hex, and this
could break logins from 64-bit machines in some cases.
(inspired by AST-20)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114591 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23 17:55:31 +00:00
Russell Bryant
694a6b4abb Fix find_callno_locked() to actually return the callno locked in some more cases.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23 17:16:32 +00:00
Olle Johansson
5980514bb0 Add 502 support for both directions, not only one... (see r114571)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23 16:51:41 +00:00
Joshua Colp
d4ebf1dff1 Instead of stopping dialplan execution when SayNumber attempts to say a large number that it can not print out a message informing the user and continue on.
(closes issue #12502)
Reported by: bcnit


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23 14:54:11 +00:00
Tilghman Lesher
0c777767c9 Treat a 502 just like a 503, when it comes to processing a response code
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 23:51:44 +00:00
Russell Bryant
5648feb3e9 When we receive a full frame that is supposed to contain our call number,
ensure that it has the correct one.
(closes issue #10078)
(AST-2008-006)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 22:15:36 +00:00
Russell Bryant
b3a211bdc3 I thought I was going to be able to leave 1.4 alone, but that was not the case.
I ran into some problems with G.722 in 1.4, so I have merged in all of the fixes
in this area that I have made in trunk/1.6.0, and things are happy again.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114550 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 21:14:55 +00:00
Russell Bryant
e4ed5a76f1 Trivial change to read the number of samples from a frame before calling ast_write()
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 19:45:00 +00:00
Russell Bryant
d87023aef0 After a parked call times out, allow the call back to the parker to time out.
(closes issue #10890)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 18:29:56 +00:00
Russell Bryant
0f59f5491d If the dial string passed to the call channel callback does not indicate an
extension, then consider the extension on the channel before falling back
to the default.

(closes issue #12479)
Reported by: darren1713
Patches:
      exten_dial_fix_chan_iax2.c.patch uploaded by darren1713 (license 116)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114537 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 18:03:33 +00:00
Russell Bryant
39d1303e14 Merge changes from team/russell/issue_9520
These changes make sure that the reference count for sip_peer objects properly
reflects the fact that the peer is sitting in the scheduler for a scheduled
callback for qualifying peers or for expiring registrations.  Without this, it
was possible for these callbacks to happen at the same time that the peer was
being destroyed.  This was especially likely to happen with realtime peers, and
for people making use of the realtime prune CLI command.

(closes issue #9520)
Reported by: kryptolus
Committed patch by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 15:20:37 +00:00
Joshua Colp
3053679ade Only drop audio if we receive it without a progress indication. We allow other frames through such as DTMF because they may be needed to complete the call.
(closes issue #12440)
Reported by: aragon


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114322 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-21 14:39:32 +00:00
Tilghman Lesher
5955dbc3c1 Ensure that help text terminates with a newline
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-19 13:57:17 +00:00
Tilghman Lesher
0dc35f4e26 MOH usage information needs a terminating newline, or else
"asterisk -rx 'help moh reload'" will hang.  Reported via
-dev list, fixed by me.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-19 13:49:50 +00:00
Russell Bryant
c8c2c33550 Don't destroy a manager session if poll() returns an error of EAGAIN.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-18 21:48:06 +00:00
Russell Bryant
992264a77f ensure directories are created before we try to install stuff into them
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-18 20:01:09 +00:00
Russell Bryant
87aea83bdc SUBDIRS_INSTALL is already listed as a subtarget for bininstall
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-18 19:58:55 +00:00
Mark Michelson
f32e7af11a Clearing up error messages so they make a bit more sense. Also removing a redundant error
message.

Issue AST-15



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-18 17:44:29 +00:00
Russell Bryant
de529ba5f7 Ensure that we don't ast_strdupa(NULL)
(closes issue #12476)
Reported by: davidw
Patch by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114248 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-18 15:24:09 +00:00
Sean Bright
da91e55eaf Only complete the SIP channel name once for 'sip show channel <channel>'
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114245 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-18 13:33:32 +00:00
Tilghman Lesher
9f6634f7c1 For consistency sake, ensure that the values that ${CALLINGPRES} returns are valid as an
input to SetCallingPres.  (Closes issue #12472)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114242 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-18 06:49:16 +00:00
Russell Bryant
46c685af6c Remove redundant safety net. The check for the autoservice channel list state
accomplishes the same goal in a better way.

(issue #12470)
Reported By: atis


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114230 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-17 22:15:43 +00:00
Mark Michelson
2dbf0778b3 Declaration of the peer channel in this scope was making it so the peer variable defined
in the outer scope was never set properly, therefore making iterating through the channel
list always restart from the beginning. This bug would have affected anyone who called
chanspy without specifying a first argument.

(closes issue #12461)
Reported by: stever28



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-17 21:03:29 +00:00
Mark Michelson
171a6a24bb Add prototype for ast_dsp_frame_freed. I'm not sure how this was
compiling before...



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-17 16:50:46 +00:00
Mark Michelson
71b704ef78 It was possible for a reference to a frame which was part of a freed DSP to still be
referenced, leading to memory corruption and eventual crashes. This code change ensures
that the dsp is freed when we are finished with the frame. This change is very similar
to a change Russell made with translators back a month or so ago.

(closes issue #11999)
Reported by: destiny6628
Patches:
      11999.patch uploaded by putnopvut (license 60)
Tested by: destiny6628, victoryure



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114207 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-17 16:28:03 +00:00
Russell Bryant
afdcdafb2b Fix the bininstall target to install from subdirs, as well.
(closes issue AST-8, patch from bmd at switchvox)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114204 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-17 16:23:45 +00:00
Philippe Sultan
2ebfcb323b Use keepalives effectively in order diagnose bug #12432.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114198 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-17 13:42:23 +00:00
Tilghman Lesher
176add9ecd Add special case for when the agi cannot be executed, to comply with the documentation that
we return failure in that case.
(closes issue #12462)
 Reported by: fmueller
 Patches: 
       20080416__bug12462.diff.txt uploaded by Corydon76 (license 14)
 Tested by: fmueller


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114195 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-17 12:56:38 +00:00
Sean Bright
e7072918e0 Make sure we have enough room for the recording's filename.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114191 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-17 10:51:20 +00:00
Kevin P. Fleming
cbc844ae8a use the ZT_SET_DIALPARAMS ioctl properly by initializing the structure to all zeroes in case it contains fields that we don't write values into (which it does as of Zaptel 1.4.10)
(closes issue #12456)
Reported by: fnordian



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-16 20:46:38 +00:00
Tilghman Lesher
19a16f4634 Backport revisions for latest vpb drivers to 1.4
(Closes issue #12457)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-16 19:59:37 +00:00
Jason Parker
89e7986ccb Fix "fallthrough" behavior here, so config options in a previously configured user don't override settings in general.
(closes issue #12458)
Reported by: tzafrir
Patches:
      chanzap_users_sections.diff uploaded by tzafrir (license 46)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-16 17:30:09 +00:00
Joshua Colp
c99280a59e Include the proper headers for using mkdir on FreeBSD.
(closes issue #12430)
Reported by: ys
Patches:
      app_meetme.c.diff uploaded by ys (license 281)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-16 14:10:46 +00:00
Olle Johansson
29c90c2fa0 Handle subscribe queues in all situations... Thanks to festr_ on irc for telling me about this bug.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114148 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-15 20:26:05 +00:00
Jason Parker
44db216023 Update Digium autosupport script, for more useful information.
(closes issue #12452)
Reported by: angler
Patches:
      autosupport.diff uploaded by angler (license 106)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-15 17:17:18 +00:00
Jason Parker
e4d2e03956 Allow autofill to work in the general section of queues.conf.
Additionally, don't try to (re)set options when they have empty values in realtime (all unset columns would have an empty value).

(closes issue #12445)
Reported by: atis
Patches:
      12445-autofill.diff uploaded by qwell (license 4)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114133 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-15 16:18:08 +00:00
Jason Parker
5fbfbc6b7c The call_token on the pvt can occasionally be NULL, causing a crash.
If it is NULL, we can skip this channel, since it can't the one we're looking for.

(closes issue #9299)
Reported by: vazir


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-14 18:31:57 +00:00
Mark Michelson
524efc5cd5 Increase the retry count when attempting to show channels. This apparently
cleared an issue someone was seeing when attempting to show channels when
the load was high.

(closes issue #11667)
Reported by: falves11
Patches:
      11677.txt uploaded by russell (license 2)
Tested by: falves11



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114117 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-14 17:41:03 +00:00
Mark Michelson
f1683753b8 If the datastore has been moved to another channel due to a masquerade, then
freeing the datastore here causes an eventual double free when the new channel
hangs up. We should only free the datastore if we were able to successfully remove
it from the channel we are referencing (i.e. the datastore was not moved).

(closes issue #12359)
Reported by: pguido



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-14 16:24:22 +00:00
Mark Michelson
f689fffa71 Save a local copy of the generate callback prior to unlocking the channel in
case the generate callback goes NULL on us after the channel is unlocked. Thanks
to Russell for pointing this need out to me.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-14 14:58:02 +00:00
Joshua Colp
1e771acf2e It is possible for the remote side to say they want T38 but not give any capabilities.
(closes issue #12414)
Reported by: MVF


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-14 14:52:46 +00:00
Joshua Colp
19b8841503 Don't change the SSRC when a new source comes into play, this might happen quite often and depending on the remote side... they might not like this.
(closes issue #12353)
Reported by: dimas


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114100 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-14 13:52:49 +00:00
Terry Wilson
2d791a431f Several places in the code called find_callno() (which releases the lock on the pvt structure) and then immediately locked the call and did things with it. Unfortunately, the call can disappear between the find_callno and the lock, causing Bad Stuff(tm) to happen.
Added find_callno_locked() function to return the callno withtout unlocking for instances that it is needed.

(issue #12400)
Reported by: ztel


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114083 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-11 22:32:51 +00:00
Jason Parker
6007dc7814 It's possible that a channel can have an async goto on the successful execution of an application as well.
Closes issue #12172.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-11 21:35:16 +00:00
Mark Michelson
7bce362fa7 Fix a race condition that may happen between a sip hangup
and a "core show channel" command. This patch adds locking
to prevent the resulting crash.

(closes issue #12155)
Reported by: tsearle
Patches:
      show_channels_crash2.patch uploaded by tsearle (license 373)
Tested by: tsearle



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-11 15:44:28 +00:00
Mark Michelson
1a9b7dc5c5 Fix 1.4 build when LOW_MEMORY is enabled.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-10 20:59:49 +00:00
Mark Michelson
98b06bace4 Be sure that we're not about to set bridgepvt NULL prior to dereferencing it.
(closes issue #11775)
Reported by: fujin



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-10 19:55:33 +00:00
Jason Parker
6d08d42e0e Only try to prefix language if we are not using an absolute path (suffix it otherwise).
en/var/lib/asterisk/sounds/blah.gsm is a very silly path.

(closes issue #12379)
Reported by: kuj
Patches:
      12379-absolutepath.diff uploaded by qwell (license 4)
Tested by: kuj, qwell


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114035 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-10 17:26:10 +00:00
Joshua Colp
da024e5196 Forgot the 1.4 branch for russian language fix.
(closes issue #12404)
Reported by: IgorG
Patches:
      voicemail_ru_hardcoded-v1.patch uploaded by IgorG (license 20)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-10 15:58:39 +00:00
Joshua Colp
fb51aa974e Create the directory where name recordings will go if it does not exist.
(closes issue #12311)
Reported by: rkeene
Patches:
      12311-mkdir.diff uploaded by qwell (license 4)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-10 15:09:04 +00:00
Joshua Colp
5cfba06089 Don't add custom URI options if they don't exist OR they are empty.
(closes issue #12407)
Reported by: homesick
Patches:
      uri_options-1.4.diff uploaded by homesick (license 91)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114021 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-10 13:27:11 +00:00
Mark Michelson
38e66ce8a2 We need to set the persistant_route [sic] parameter for the sip_pvt
during the initial INVITE, no matter if we're building the route set from
an INVITE request or response.

(closes issue #12391)
Reported by: benjaminbohlmann
Tested by: benjaminbohlmann


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113927 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-09 20:54:31 +00:00
Tilghman Lesher
6d2023b7fe If the [csv] section does not exist in cdr.conf, then an unload/load sequence
is needed to correct the problem.  Track whether the load succeeded with a
variable, so we can fix this with a simple reload event, instead.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113874 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-09 18:57:33 +00:00
Joshua Colp
800565fff8 If we receive an AUTHREQ from the remote server and we are unable to reply (for example they have a secret configured, but we do not) then queue a hangup frame on the Asterisk channel. This will cause the channel to hangup and a HANGUP to be sent via IAX2 to the remote side which is the proper thing to do in this scenario.
(closes issue #12385)
Reported by: viraptor


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113784 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-09 16:50:45 +00:00
Mark Michelson
784d1b7b3e If Asterisk receives a 488 on an INVITE (not a reinvite), then
we should not send a BYE.

(closes issue #12392)
Reported by: fnordian
Patches:
      chan_sip.patch uploaded by fnordian (license 110) with small modification from me



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113681 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-09 14:40:05 +00:00
Terry Wilson
346841ef05 Initialize fr->cacheable to make valgrind happy
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113596 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-09 01:34:25 +00:00
Mark Michelson
e1e05ad198 Fix potential buffer overflow that could happen if more than 100 announce files
were specified when calling ParkAndAnnounce. This overflow is not exploitable remotely
and so there is no need for a security advisory.

(closes issue #12386)
Reported by: davidw



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-08 19:07:38 +00:00
Jason Parker
55f577bc29 Add a little more that is required for previously added devices.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113504 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-08 18:48:55 +00:00
Jason Parker
40ff61ff52 Add support for several new(ish) devices - most notably, 7942/7945, 7962/7965, 7975.
Thanks to Greg Oliver for providing me the required information.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113454 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-08 18:07:49 +00:00
Jason Parker
6ba9909eda Work around some silliness caused by sys/capability.h - this should fix compile errors a number of users have been experiencing.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113402 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-08 16:56:52 +00:00
Tilghman Lesher
4e44f14c32 Add security note on astgenkey's manpage.
(closes issue #12373)
 Reported by: lmamane
 Patches: 
       20080406__bug12373.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113399 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-08 16:51:28 +00:00
Tilghman Lesher
3949ff32df Move check for still-bridged channels out a little further, to avoid possible
deadlocks.  (Closes issue #12252)
Reported by: callguy
 Patches: 
       20080319__bug12252.diff.txt uploaded by Corydon76 (license 14)
 Tested by: callguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-08 15:39:16 +00:00
Joshua Colp
8c03119ce5 If audio suddenly gets fed into one side of a channel after a lapse of frames flush the other factory so that old audio does not remain in the factory causing the sync code to not execute.
(closes issue #12296)
Reported by: jvandal


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-08 15:03:43 +00:00
Jeff Peeler
3296b7882e (closes issue #12362) [redo of 113012]
This fixes a for loop (in realtime_peer) to check all the ast_variables the loop was intending to test rather than just the first one. The change exposed the problem of calling memcpy on a NULL pointer, in this case the passed in sockaddr_in struct which is now checked. 



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-07 21:34:45 +00:00
Jason Parker
4c046cd2b7 Allow playback with noanswer (and add earlyrtp option).
(closes issue #9077)
Reported by: pj
Patches:
      earlyrtp.diff uploaded by wedhorn (license 30)
Tested by: pj, qwell, DEA, wedhorn


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-07 18:00:09 +00:00
Tilghman Lesher
dccfa36f8e Force ast_mktime() to check for DST, since strptime(3) does not.
(Closes issue #12374)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113117 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-07 17:51:49 +00:00
Mark Michelson
7892ddd9f5 This fix prevents a deadlock that was experienced in chan_local. There was
deadlock prevention in place in chan_local, but it would not work in a specific
case because the channel was recursively locked. By unlocking the channel prior
to calling the generator's generate callback in ast_read_generator_actions(), we
prevent the recursive locking, and therefore the deadlock.

(closes issue #12307)
Reported by: callguy
Patches:
      12307.patch uploaded by putnopvut (license 60)
Tested by: callguy



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-07 16:08:45 +00:00
Jeff Peeler
ca8d1cf992 (closes issue #12362)
(closes issue #12372)
Reported by: vinsik
Tested by: tecnoxarxa

This one line change makes an if inside a for loop (in realtime_peer) check all the ast_variables the loop was intending to test rather than just the first one.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@113012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-07 15:16:44 +00:00
Philippe Sultan
fbf0f7107e Free newly allocated channel before returning
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@112820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-04 19:26:15 +00:00
Philippe Sultan
5e5094f89e Prevent call connections when codecs don't match.
(closes issue #10604)
Reported by: keepitcool
Patches:
      branch-1.4-10604-2.diff uploaded by phsultan (license 73)
Tested by: phsultan

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@112766 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-04 17:16:59 +00:00
Joshua Colp
2cfae0a8f3 Pass in the path to Zaptel for systems that install Zaptel headers in a separate location.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@112711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-04 00:52:36 +00:00
Joshua Colp
27da06a930 One thing at a time... let's get 1.4 building.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@112709 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-04 00:48:01 +00:00
Dwayne M. Hubbard
0f7c06dc26 add a Zaptel timer check to verify the timer is responding when Zaptel support is compiled into Asterisk and Zaptel drivers are loaded. This will help people not waste their valuable time debugging side effects.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@112689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-03 23:57:44 +00:00
Mark Michelson
6df4e58654 Fix the testing of the "res" variable so that it is more logically correct and
makes the correct warning and debug messages print.

(closes issue #12361)
Reported by: one47
Patches:
      chan_zap_deferred_digit.patch uploaded by one47 (license 23)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@112599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-03 14:32:20 +00:00
Mark Michelson
b4cf033072 Fix a race condition in the manager. It is possible that a new manager event
could be appended during a brief time when the manager is not waiting for input.
If an event comes during this period, we need to set an indicator that there is an
event pending so that the manager doesn't attempt to wait forever for an event that
already happened.

(closes issue #12354)
Reported by: bamby
Patches:
      manager_race_condition.diff uploaded by bamby (license 430)
	  (comments added by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@112468 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-02 17:36:04 +00:00
Mark Michelson
63968e3d5d Ensure that there is no timeout if none is specified.
(closes issue #12349)
Reported by: johnlange



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@112393 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-02 14:32:00 +00:00
Joshua Colp
65767b4290 Disable Packet2Packet bridging when we need to feed DTMF frames into the core. Some implementations do not like how we switch between things.
(closes issue #12212)
Reported by: bamby


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@112209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-01 18:02:43 +00:00
Joshua Colp
dcad2163df Do not pass audio until the remote side has indicated they are providing early media, or if the channel has been answered.
(closes issue #11823)
Reported by: SDamm


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@112204 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-01 17:43:46 +00:00
Mark Michelson
f4c389df5c Initialize the __res_state structure used for dns purposes
to all 0's prior to using it. This is due to valgrind's complaints
on issue #12284 as well as an excerpt found in "Description" portion
of the online man page found here:

http://www.iti.cs.tu-bs.de/cgi-bin/UNIXhelp/man-cgi?res_nquery+3RESOLV

(pertains to issue #12284 but does not necessarily close it)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@112138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-01 17:21:21 +00:00
Joshua Colp
214973a574 Ensure that we do not exceed the hold's maximum size with a single frame.
(closes issue #12047)
Reported by: fabianoheringer
Tested by: fabianoheringer


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@112125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-01 16:45:14 +00:00
Jason Parker
9ae694024e Fix a silly infinite loop when choosing an invalid option.
(closes issue #12315)
Reported by: jmls


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@112068 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-31 21:48:05 +00:00
Jason Parker
831a7f2720 Allow gsm to compile correctly on x86 with gcc4 optimizations.
(closes issue #11243)
Reported by: whiskerp
Patches:
      11243-maybe-asm.diff uploaded by qwell (license 4)
Tested by: Seggy (IRC)

Note: While I did write this patch, I would not have found this if fossil
 had not reported and fixed issue #12253.  A huge thanks to him for helping
 to (indirectly) find the problem here.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-28 21:45:35 +00:00
Jason Parker
8f6e8e6711 Remove unimplemented softkeys. Prompted by issue #12325.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111720 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-28 17:55:05 +00:00
Jason Parker
871bc8ae0d The file size of WAV49 does not need to be an even number.
(closes issue #12128)
Reported by: mdu113
Patches:
      12128-noevenlength.diff uploaded by qwell (license 4)
Tested by: qwell, mdu113


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111658 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-28 16:19:56 +00:00
Tilghman Lesher
0e06f22752 Update debugging text, since Valgrind eliminated the --log-file-exactly option.
(Closes issue #12320)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-28 14:35:45 +00:00
Tilghman Lesher
cb67f98a5a For FreeBSD, at least, the ifa_addr element could be NULL.
(closes issue #12300)
 Reported by: festr
 Patches: 
       acl.c.patch uploaded by festr (license 443)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-27 19:23:12 +00:00
Steve Murphy
8a02ac6f79 These small documentation updates made in response to a query in
asterisk-users, where a user was using Playback, but needed the
features of Background, and had no idea that Background existed,
or that it might provide the features he needed. I thought the
best way to avert these kinds of queries was to provide "See Also"
references in all three of "Background", "Playback", "WaitExten".
Perhaps a project to do this with all related apps is in order.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-27 13:03:28 +00:00
Steve Murphy
0ce3eb0e2a (closes issue #12302)
Reported by: pj
Tested by: murf

These changes will set a channel variable ~~EXTEN~~ just before generating code
for a switch, with the value of ${EXTEN}. The exten is marked as having a switch, 
and ever after that, till the end of the exten, we substitute any ${EXTEN} 
with ${~~EXTEN~~} instead in application arguments; (and the ${EXTEN: also). 
The reason for this, is that because switches are coded using 
separate extensions to provide pattern matching, and
jumping to/from these switch extensions messes up the ${EXTEN} value, 
which blows the minds of users.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-27 03:21:05 +00:00
Jason Parker
7fbcd155c1 Put this flag back so we don't change the API.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111280 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-27 00:25:13 +00:00
Jason Parker
22078d33d4 Remove excessive smoother optimization that was causing audio glitches (small "pops")
after (about 200ms later) an "incorrectly" sized frame was received.

While it would be very nice to keep this as optimized as possible, it makes no sense
 for the smoother to be dropping random bits of audio like this.  Isn't that the
 whole point of a smoother?

Closes issue #12093.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111245 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26 23:26:33 +00:00
Joshua Colp
c5a9d50cea Update autosupport script.
(closes issue #12310)
Reported by: angler
Patches:
      autosupport.diff uploaded by angler (license 106)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26 19:55:08 +00:00
Kevin P. Fleming
bec5840491 Merged revisions 111125 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r111125 | kpfleming | 2008-03-26 14:49:30 -0500 (Wed, 26 Mar 2008) | 2 lines

update UPGRADE notes to document usage of the script

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26 19:51:24 +00:00
Mark Michelson
df37925e23 This code change is made just for clarification. It does exactly
the same thing as before. It just doesn't look as wrong.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26 19:37:36 +00:00
Mark Michelson
453209fd16 Add a lock to the vm_state structure and use the lock around mail_open calls
to prevent concurrent access of the same mailstream. This, along with trunk's
ability to configure TCP timeouts for IMAP storage will help to prevent
crashes and hangs when using voicemail with IMAP storage.

(closes issue #10487)
Reported by: ewilhelmsen



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26 19:22:16 +00:00
Kevin P. Fleming
e820d05d37 Merged revisions 111019 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r111019 | kpfleming | 2008-03-26 13:58:37 -0500 (Wed, 26 Mar 2008) | 2 lines

add a script to make getting the iLBC source code simple for end users

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26 19:06:56 +00:00
Joshua Colp
d2eef8c07e If we are requested to authenticate a reinvite make sure that it contains T38 SDP if need be.
(closes issue #11995)
Reported by: fall


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111020 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26 19:04:35 +00:00
Joshua Colp
af904bf602 Make sure that full video frames are sent whenever the 15 bit timestamp rolls over.
(closes issue #11923)
Reported by: mihai
Patches:
      asterisk-fullvideo.patch uploaded by mihai (license 94)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111014 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26 18:41:29 +00:00
Kevin P. Fleming
7bd42528de add note that the user will need to enable codec_ilbc to get it to build
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@110962 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26 17:43:02 +00:00
Kevin P. Fleming
bf1486e917 Merged revisions 110869 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r110869 | kpfleming | 2008-03-26 08:53:46 -0700 (Wed, 26 Mar 2008) | 2 lines

due to licensing restrictions, we cannot distribute the source code for iLBC encoding and decoding... so remove it, and add instructions on how the user can obtain it themselves

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@110880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-26 16:42:35 +00:00
Jason Parker
9b334daeb6 Make file access in cdr_custom similar to cdr_csv.
Fixes issue #12268.

Patch borrowed from r82344


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@110779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-25 22:51:17 +00:00
Jeff Peeler
e510971e20 This one line change makes an if inside a for loop (in realtime_peer) check all the ast_variables the loop was intending to test rather than just the first one.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@110727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-25 20:03:13 +00:00
Mark Michelson
baa405e8c3 When reverting a commit, I accidentally left in this bit which was an experiment
to see what would happen. It passed the compile test, and I didn't notice I had
left this change in too.

So this is a revert of a revert...sort of.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@110635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-25 15:40:33 +00:00
Joshua Colp
be84adc952 Add an option (transmit_silence) which transmits silence during both Record() and DTMF generation. The reason this is an option is that in order to transmit silence we have to setup a translation path. This may not be needed/wanted in all cases.
(closes issue #10058)
Reported by: tracinet


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@110628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-25 14:37:35 +00:00
Mark Michelson
6eed7ae503 This is a revert for revision 108288. The reason is that that revision
was not for an actual bug fix per se, and so it really should not have been in 1.4 in
the first place. Plus, people who compile with DO_CRASH are more likely
to encounter a crash due to this change. While I think the usage of DO_CRASH
in ast_sched_del is a bit absurd, this sort of change is beyond the scope of 1.4
and should be done instead in a developer branch based on trunk 
so that all scheduler functions are fixed at once.

I also am reverting the change to trunk and 1.6 since they also suffer from
the DO_CRASH potential.

(closes issue #12272)
Reported by: qq12345



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@110618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-24 19:17:41 +00:00
Russell Bryant
e34ecbfc92 Turn a NOTICE into a DEBUG message.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@110614 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-24 17:34:56 +00:00
Jason Parker
d85d47e343 Don't attempt to do optimizations of gsm on mips platforms either.
(closes issue #12270)
Reported by: zandbelt
Patches:
      026-gsm-mips.patch uploaded by zandbelt (license 33)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@110474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-21 14:32:52 +00:00
Russell Bryant
478de3ebb9 Shorten the ast_waitfor() timeout from 500 ms to 50 ms in the autoservice thread.
This really should not make a difference except in very rare cases.  That case would
be that all of the channels in autoservice are not generating any frames.  In that
case, this change reduces the potential amount of time that a thread waits in
ast_autoservice_stop() for the autoservice thread to wrap back around to the beginning
of its loop.

(closes issue #12266, reported by dimas)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@110395 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-20 23:13:56 +00:00
Russell Bryant
e653f8b232 Merged revisions 110335 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r110335 | russell | 2008-03-20 16:53:27 -0500 (Thu, 20 Mar 2008) | 6 lines

Fix some very broken code that was introduced in 1.2.26 as a part of the security
fix.  The dnsmgr is not appropriate here.  The dnsmgr takes a pointer to an address
structure that a background thread continuously updates.  However, in these cases,
a stack variable was passed.  That means that the dnsmgr thread would be continuously
writing to bogus memory.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@110336 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-20 21:54:58 +00:00
Russell Bryant
f3274be612 Fix a bug where when calls on the trunk side hang up while on hold, the state
is not properly reflected.

(closes issue #11990, reported by anakaoka, patched by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@110163 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19 22:57:59 +00:00
Mark Michelson
ebb67cf852 Add a missing unlock in the case that memory allocation fails in app_chanspy.
Thanks to Russell for confirming that this was an issue.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@110083 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19 20:33:03 +00:00
Joshua Colp
ba782ce5f9 Add sanity checking for position resuming. We *have* to make sure that the position does not exceed the total number of files present, and we have to make sure that the position's filename is the same as previous. These values can change if a music class is reloaded and give unpredictable behavior.
(closes issue #11663)
Reported by: junky


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@110035 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19 19:11:33 +00:00
Joshua Colp
996d3a1c2e Make sure that the mark bit does not incorrectly cause video frame timestamps to be calculated as if they are audio frames.
(closes issue #11429)
Reported by: sperreault
Patches:
      11429-frametype.diff uploaded by qwell (license 4)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@110019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19 18:20:28 +00:00
Jason Parker
5bc2c923e2 People report bugs about Asterisk crashing with DO_CRASH enabled was getting a little silly...
Now we only show certain cflags when you run configure with --enable-dev-mode
(corresponding menuselect change to follow)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19 17:12:52 +00:00
Steve Murphy
88b0da7c6c (closes issue #11442)
Reported by: tzafrir
Patches:
      11442.patch uploaded by murf (license 17)
Tested by: murf

I didn't give tzafrir very much time to test this, but if he does 
still have remaining issues, he is welcome to 
re-open this bug, and we'll do what is called for.

I reproduced the problem, and tested the fix, so I hope I
am not jumping by just going ahead and committing the fix.

The problem was with what file_save does with templates; 
firstly, it tended to print out multiple options:

[my_category](!)(templateref)

instead of 

[my_category](!,templateref)

which is fixed by this patch.


Nextly, the code to suppress output of duplicate declarations
that would occur because the reader copies inherited declarations
down the hierarchy, was not working. Thus:


 [master-template](!)
 mastervar = bar


 [template](!,master-template)
 tvar = value


 [cat](template)
 catvar = val


would be rewritten as:

 ;!
 ;! Automatically generated configuration file
 ;! Filename: experiment.conf (/etc/asterisk/experiment.conf)
 ;! Generator: Manager
 ;! Creation Date: Tue Mar 18 23:17:46 2008
 ;!
 
 [master-template](!)
 mastervar = bar

 
 [template](!,master-template)
 mastervar = bar
 tvar = value

 
 [cat](template)
 mastervar = bar
 tvar = value
 catvar = val

This has been fixed. Since the config reader 'explodes' inherited
vars into the category, users may, in certain circumstances, see
output different from what they originally entered, but it should
be both correct and equivalent.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109908 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19 15:41:13 +00:00
Russell Bryant
1dae97f2aa Tweak spacing in a recent change because I'm very picky.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19 04:06:05 +00:00
Russell Bryant
755933863f Fix one place where the chanspy datastore isn't removed from a channel.
(issue #12243, reported by atis, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109763 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-18 22:34:42 +00:00
Mark Michelson
89c3cd6842 This patch makes it so that all queue member status changes are handled through device state
code. This removes several problems people were seeing where their queue members would get into
an "unknown" state. Huge props go to atis on this one since he was the one who found the code
section that was causing the problem and proposed the solution. I just wrote what he suggested :)

(closes issue #12127)
Reported by: atis
Patches:
      12127v3.patch uploaded by putnopvut (license 60)
Tested by: atis, jvandal



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-18 20:52:15 +00:00
Jason Parker
b72a4686df Allow codecs that use log2comp (g726) to compile correctly on x86 with gcc4 optimizations.
(closes issue #12253)
Reported by: fossil
Patches:
      log2comp.patch uploaded by fossil (license 140)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109648 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-18 19:23:44 +00:00
Mark Michelson
87e9daf7d7 Make sure an agent doesn't try to send dtmf to a NULL channel
closes issue #12242
Reported by Yourname



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-18 17:58:11 +00:00
Terry Wilson
c7e067ecde Fix character string being treated ad format string
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109482 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-18 16:25:47 +00:00
Jason Parker
7f7e7d27e4 Merged revisions 109391 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r109391 | qwell | 2008-03-18 10:08:41 -0500 (Tue, 18 Mar 2008) | 3 lines

Do not return with a successful authentication if the From header ends up empty.
(AST-2008-003)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109393 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-18 15:10:16 +00:00
Joshua Colp
5fda7910c6 Put a maximum limit on the number of payloads accepted, and also make sure a given payload does not exceed our maximum value.
(AST-2008-002)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-18 14:58:39 +00:00
Steve Murphy
7f77c58ed5 (closes issue #11903)
Reported by: atis

Many thanks to atis for spotting this problem and reporting it.
The fix was to straighten out how items are placed on and removed
from the file stack. Regressions as well as the provided test case
helped to straighten out all code paths. valgrind was used to make
sure all memory allocated was freed.

Sorry for not solving this earlier. I got distracted.

Added the ntest23 regression test, which is mainly a copy of ntest22, 
but with a few juicy errors thrown in, to replicate the kind of 
error that atis spotted.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-18 06:37:15 +00:00
Mark Michelson
29a32cf040 Fix a logic flaw in the code that stores lock info which is displayed
via the "core show locks" command. The idea behind this section of code was
to remove the previous lock from the list if it was a trylock that had failed.
Unfortunately, instead of checking the status of the previous lock, we were referencing
the index immediately following the previous lock in the lock_info->locks array. 
The result of this problem, under the right circumstances, was that the lock which 
we currently in the process of attempting to acquire could "overwrite" the previous lock 
which was acquired. While this does not in any way affect typical operation, it *could*
lead to misleading "core show locks" output.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-17 22:05:49 +00:00
Michiel van Baak
4f2c87c1d1 Update the directory of placed calls on skinny phones
when dialing a channel that does not provide progress (analog ZAP lines)                                                                                                                                          
                                                                                                                                                                                                                  
The phone does handle the double update on calls to channels that do                                                                                                                                              
provide progress and wont insert duplicate items                                                                                                                                                                  
                                                                                                                                                                                                                  
(closes issue #12239)                                                                                                                                                                                             
Reported by: DEA                                                                                                                                                                                                  
Patches:                                                                                                                                                                                                          
      chan_skinny-call-log.txt uploaded by DEA (license 3)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-17 17:55:06 +00:00
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
Joshua Colp
cd703523db Add a control frame to indicate the source of media has changed. Depending on the underlying technology it may need to change some things.
(closes issue #12148)
Reported by: jcomellas


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@106235 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-05 22:32:10 +00:00
Michiel van Baak
ba6b7abe61 document var_metric so no bugreports will come in when it's actually a configuration issue.
(issue #12151)
Reported and patched by: caio1982
1.4 patch by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@106178 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-05 21:12:36 +00:00
Kevin P. Fleming
461e3fea79 when a PRI call must be moved to a different B channel at the request of the other endpoint, ensure that any DSP active on the original channel is moved to the new one
(closes issue #11917)
Reported by: mavetju
Tested by: mavetju



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@106038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-05 15:32:35 +00:00
Tilghman Lesher
b350a97937 Correctly initialize retransid in SIP, and ensure that the warning when failing to delete a schedule entry can actually hit the log.
(closes issue #12140)
 Reported by: slavon
 Patches: 
       sch2.patch uploaded by slavon (license 288)
(Patch slightly modified by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@106015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-05 15:17:16 +00:00
Russell Bryant
d564404d73 Fix a bug that I just noticed in the RTP code. The calculation for setting the
len field in an ast_frame of audio was wrong when G.722 is in use.  The len field
represents the number of ms of audio that the frame contains.  It would have
set the value to be twice what it should be.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-05 01:52:18 +00:00
Joshua Colp
be005c60d6 In addition to setting the marker bit let's change our ssrc so they know for sure it is a different source.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-04 18:10:34 +00:00
Joshua Colp
36bb1f9d46 When a new source of audio comes in (such as music on hold) make sure the marker bit gets set.
(closes issue #10355)
Reported by: wdecarne
Patches:
      10355.diff uploaded by file (license 11)
(closes issue #11491)
Reported by: kanderson


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-04 18:05:28 +00:00
Russell Bryant
40425a24bf Backport a minor bug fix from trunk that I found while doing random code
cleanup.  Properly break out of the loop when a context isn't found when
verify that includes are valid.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105591 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-04 04:31:29 +00:00
Jason Parker
47f33c87f4 Fix type for astNumChannels.
(closes issue #12114)
Reported by: jeffg
Patches:
      12114.patch uploaded by jeffg (license 192)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-03 18:06:52 +00:00
Russell Bryant
7f7dbcb11f In the case of an ast_channel allocation failure, take the local_pvt out of the
pvt list before destroying it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105570 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-03 17:16:53 +00:00
Russell Bryant
b3c0e042d4 Fix a potential memory leak of the local_pvt struct when ast_channel allocation
fails.  Also, in passing, centralize the code necessary to destroy a local_pvt.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-03 17:05:16 +00:00
Russell Bryant
9c5af082ca Update the copyright information for autoservice. Most of the code in this file
now is stuff that I have written recently ...


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-03 16:01:50 +00:00
Russell Bryant
547ac9f501 Merge in some changes from team/russell/autoservice-nochans-1.4
These changes fix up some dubious code that I came across while auditing what
happens in the autoservice thread when there are no channels currently in
autoservice.

1) Change it so that autoservice thread doesn't keep looping around calling
   ast_waitfor_n() on 0 channels twice a second.  Instead, use a thread condition
   so that the thread properly goes to sleep and does not wake up until a
   channel is put into autoservice.

   This actually fixes an interesting bug, as well.  If the autoservice thread
   is already running (almost always is the case), then when the thread goes
   from having 0 channels to have 1 channel to autoservice, that channel would
   have to wait for up to 1/2 of a second to have the first frame read from it.

2) Fix up the code in ast_waitfor_nandfds() for when it gets called with no
   channels and no fds to poll() on, such as was the case with the previous code
   for the autoservice thread.  In this case, the code would call alloca(0), and
   pass the result as the first argument to poll().  In this case, the 2nd
   argument to poll() specified that there were no fds, so this invalid pointer
   shouldn't actually get dereferenced, but, this code makes it explicit and
   ensures the pointers are NULL unless we have valid data to put there.

(related to issue #12116)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105563 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-03 15:50:43 +00:00
Joshua Colp
5bfdc9818d It is possible for no audio to pass between the current digit and next digit so expand logic that clears emulation to AST_FRAME_NULL.
(closes issue #11911)
Reported by: edgreenberg
Patches:
      v1-11911.patch uploaded by dimas (license 88)
Tested by: tbsky


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-03 15:28:59 +00:00
Joshua Colp
70d43ff1d2 Add a comment to describe some logic.
(closes issue #12120)
Reported by: flefoll
Patches:
      chan_sip.c.br14.patch-just-a-comment uploaded by flefoll (license 244)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-03 15:15:39 +00:00
Russell Bryant
679cc09b1d Fix a major bug in autoservice. There was a race condition in the handling of
the list of channels in autoservice.  The problem was that it was possible for
a channel to get removed from autoservice and destroyed, while the autoservice
thread was still messing with the channel.  This led to memory corruption, and
caused crashes.  This explains multiple backtraces I have seen that have
references to autoservice, but do to the nature of the issue (memory corruption),
could cause crashes in a number of areas.

(fixes the crash in BE-386)
(closes issue #11694)
(closes issue #11940)

The following issues could be related.  If you are the reporter of one of these,
please update to include this fix and try again.

(potentially fixes issue #11189)
(potentially fixes issue #12107)
(potentially fixes issue #11573)
(potentially fixes issue #12008)
(potentially fixes issue #11189)
(potentially fixes issue #11993)
(potentially fixes issue #11791)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-29 23:34:32 +00:00
Philippe Sultan
899ce48345 Fix a potential memory leak
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105326 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-29 14:47:10 +00:00
Tilghman Lesher
8bf705f519 If the message file does not exist, just return harmlessly, instead of crashing.
(Closes issue #12108)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-29 14:34:34 +00:00
Joshua Colp
837d4676dd Bump up the size of the uniqueid variable.
(closes issue #12107)
Reported by: asgaroth


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-29 13:48:13 +00:00
Philippe Sultan
5d1234fb4f Automatically create new buddy upon reception of a presence stanza of
type subscribed.

(closes issue #12066)
Reported by: ffadaie
Patches:
      branch-1.4-12066-1.diff uploaded by phsultan (license 73)
      trunk-12066-1.diff uploaded by phsultan (license 73)
Tested by: ffadaie, phsultan

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-29 13:05:15 +00:00
Russell Bryant
12e5fb358a Fix a bug in the lock tracking code that was discovered by mmichelson. The issue
is that if the lock history array was full, then the functions to mark a lock as
acquired or not would adjust the stats for whatever lock is at the end of the array,
which may not be itself.  So, do a sanity check to make sure that we're updating
lock info for the proper lock.

(This explains the bizarre stats on lock #63 in BE-396, thanks Mark!)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105116 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-28 22:23:05 +00:00
Tilghman Lesher
cdf21199a2 Update init script for LSB compat
(closes issue #9843)
 Reported by: ibc
 Patches: 
       rc.debian.asterisk.patch uploaded by ibc (license 211)
 Tested by: paravoid


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105113 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-28 21:56:54 +00:00
Mark Michelson
c6387c3540 When using autofill, members who are in use should be counted towards the
number of available members to call if ringinuse is set to yes.

Thanks to jmls who brought this issue up on IRC



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105059 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-28 20:11:57 +00:00
Jason Parker
6c3d62c1fa Make pbx_exec pass an empty string into applications, if we get NULL.
This protects against possible segfaults in applications that may try
 to use data before checking length (ast_strdupa'ing it, for example)

(closes issue #12100)
Reported by: foxfire
Patches:
      12100-nullappargs.diff uploaded by qwell (license 4)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@105005 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-28 19:20:10 +00:00
Jason Parker
70a45ef5b1 According to a video at www.cisco.com, the 7921G supports 6 line appearances.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104920 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-28 04:31:21 +00:00
Tilghman Lesher
a032456cb8 Compatibility fix for PPC64
(closes issue #12081)
 Reported by: jcollie
 Patches: 
       asterisk-1.4.18-funcdesc.patch uploaded by jcollie (license 412)
 Tested by: jcollie, Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-28 00:05:06 +00:00
Mark Michelson
55b49506fa Two fixes:
1. Make the list of ast_dial_channels a lockable list. This is because in some cases,
   the ast_dial may exist in multiple threads due to asynchronous execution of its application, and
   I found some cases where race conditions could exist.

2. Check in ast_dial_join to be sure that the channel still exists before attempting to lock it, since
   it could have gotten hung up but the is_running_app flag on the ast_dial_channel may not have been
   cleared yet.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27 21:49:20 +00:00
Joshua Colp
fdb44349e9 Don't loop around infinitely trying to spy on our own channel, and don't forget to free/detach the datastore upon hangup of the spy.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27 20:56:23 +00:00
Mark Michelson
45079917ec Bump a couple of more buffers up by 2 so that annoying warnings aren't generated
like crazy on every fileexists_core call.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27 20:36:26 +00:00
Tilghman Lesher
11550c7be6 Ensure the session ID can't be 0.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104704 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27 18:15:10 +00:00
Joshua Colp
451ee5b1d4 Bump up the buffer by 2.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104665 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27 17:41:40 +00:00
Russell Bryant
750067bd1a Fix a problem in ChanSpy where it could get stuck in an infinite loop without
being able to detect that the calling channel hung up.
(closes issue #12076, reported by junky, patched by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104625 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27 17:33:04 +00:00
Jason Parker
841283adfe Inherit language from the transfering channel on a blind transfer.
(closes issue #11682)
Reported by: caio1982
Patches:
      local_atxfer_lang3-1.4.diff uploaded by caio1982 (license 22)
Tested by: caio1982, victoryure


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27 17:26:55 +00:00
Joshua Colp
97869f4771 Use the lock (which already existed, it just wasn't used) on the updaters list to protect the contents instead of the overall module list lock.
(closes issue #12080)
Reported by: ChaseVenters


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104596 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27 17:07:33 +00:00
Kevin P. Fleming
8a9e7e213b fallback to standard English prompts properly when using new prompt directory layout
(closes issue #11831)
Reported by: IgorG
Patches:
      fallbacken.v1.diff uploaded by IgorG (license 20) (modified by me to improve code and conform rest of function to coding guidelines)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27 16:53:06 +00:00
Russell Bryant
54eaddd028 When we receive a known alarm, make sure that the unknown alarm flag is not still
set to make sure that when we come back out of alarm, it gets reported in the log
and manager interface (after discussion with tzafrir on the -dev list)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104591 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27 16:45:00 +00:00
Joshua Colp
bb7aa0e4bc Only stop the MWI monitor thread if it was actually started.
(closes issue #12086)
Reported by: francesco_r


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27 15:52:02 +00:00
Russell Bryant
c882e6da6f Avoid some recursion in the cleanup code for the chanspy datastore
(closes issue #12076, reported by junky, patched by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104334 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27 01:15:02 +00:00
Russell Bryant
37f0ad57a7 Zaptel 1.4 now exposes FXO battery state as an alarm. However, Asterisk 1.4
does not know what to do with these alarms.  Only Asterisk 1.6 cares about it.
So, if we get an unknown alarm in chan_zap, don't generate confusing log messages
about it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104332 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27 00:54:29 +00:00
Jason Parker
5996d4e4bb Add badshell to .PHONY target (thanks Kevin)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104141 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-26 18:26:12 +00:00
Jason Parker
3d6b98b1ca Since all shells aren't as awesome as bash, we have to fail if somebody tries to use a literal "~" in DESTDIR.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104139 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-26 18:09:13 +00:00
Jason Parker
c20a11eb43 Revert previous abspath change.
...abspath is new in GNU make 3.81.  I feel so...defeated.

Must find new fix!


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104135 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-26 16:35:06 +00:00
Jason Parker
be77a16d2d Fix a very bizarre issue we were seeing with our buildbot when using a DESTDIR that
wasn't an absolute path (such as DESTDIR=~/asterisk-1.4).

Apparently what was happening, was that some of the targets were being expanded to
 the full path, so $@ ended up being /root/asterisk-1.4/[...]/ rather than ~/asterisk-1.4/[...]/

It appears that this may be a new "feature" in GNU make.
(*cough* http://en.wikipedia.org/wiki/Principle_of_least_surprise *cough*)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-26 16:08:44 +00:00
Russell Bryant
bc56a84c58 Merge changes from team/russell/smdi-1.4
This commit brings in a significant set of changes to the SMDI support in Asterisk.
There were a number of bugs in the current implementation, most notably being that
it was very likely on busy systems to pop off the wrong message from the SMDI message
queue.  So, this set of changes fixes the issues discovered as well as introducing
some new ways to use the SMDI support which are required to avoid the bugs with
grabbing the wrong message off of the queue.

This code introduces a new interface to SMDI, with two dialplan functions.  First,
you get an SMDI message in the dialplan using SMDI_MSG_RETRIEVE() and then you access
details in the message using the SMDI_MSG() function.  A side benefit of this is that
it now supports more than just chan_zap.

For example, with this implementation, you can have some FXO lines being terminated 
on a SIP gateway, but the SMDI link in Asterisk.

Another issue with the current implementation is that it is quite common that the
station ID that comes in on the SMDI link is not necessarily the same as the Asterisk
voicemail box.  There are now additional directives in the smdi.conf configuration
file which let you map SMDI station IDs to Asterisk voicemail boxes.

Yet another issue with the current SMDI support was related to MWI reporting over
the SMDI link.  The current code could only report a MWI change when the change
was made by someone calling into voicemail.  If the change was made by some other
entity (such as with IMAP storage, or with a web interface of some kind), then the
MWI change would never be sent.  The SMDI module can now poll for MWI changes if
configured to do so.

This work was inspired by and primarily done for the University of Pennsylvania.

(also related to issue #9260)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104119 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-26 00:25:29 +00:00
Jason Parker
aba8d8d763 IPTOS_MINCOST is not defined on Solaris.
(closes issue #12050)
Reported by: asgaroth
Patches:
      12050.patch uploaded by putnopvut (license 60)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-26 00:03:30 +00:00
Russell Bryant
f64df49235 This patch fixes some pretty significant problems with how app_chanspy handles
pointers to channels that are being spied upon.  It was very likely that a
crash would occur if the channel being spied upon hung up.  This was because
the current ast_channel handling _requires_ that the object is locked or else
it could disappear at any time (except in the owning channel thread).  So, this
patch uses some channel datastore magic on the spied upon channel to be able to
detect if and when the channel goes away.
(closes issue #11877)
(patch written by me, but thanks to kpfleming for the idea, and to file for review)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-25 23:42:42 +00:00
Russell Bryant
ac15754e9a Improve the lock tracking code a bit so that a bunch of old locks that threads
failed to lock don't sit around in the history.  When a lock is first locked,
this checks to see if the last lock in the list was one that was failed to be
locked.  If it is, then that was a lock that we're no longer sitting in a trylock
loop trying to lock, so just remove it.
(inspired by issue #11712)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-25 23:19:05 +00:00
Joshua Colp
e6652d0a13 Make it so a users.conf user creates both a SIP peer and a SIP user. The user will be used for inbound authentication for the device, and peer will be used for placing calls to the device.
(closes issue #9044)
Reported by: queuetue
Patches:
      sip-gui-friend.diff uploaded by qwell (license 4)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-25 21:37:20 +00:00
Tilghman Lesher
5184be27ed If the destination folder is full, don't delete a message when exiting.
(closes issue #12065)
 Reported by: selsky
 Patch by: (myself)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104094 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-25 21:31:47 +00:00
Jason Parker
e1fb43d32a Allow the use of #include and #exec in situations where the max include depth was only 1.
Specifically, this fixes using #include and #exec in extconfig.conf.

This was basically caused because the config file itself raises the include level to 1.

I opted not to raise the include limit, because recursion here could cause very bizarre behavior.

Pointed out, and tested by jmls

(closes issue #12064)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-25 20:49:42 +00:00
Russell Bryant
c27732c38c Ensure that the channel doesn't disappear in agent_logoff(). If it does, it
could cause a crash.
(fixes the crash reported in BE-396)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-25 18:38:10 +00:00
Joshua Colp
9b32204204 If a resubscription comes in for a dialog we no longer know about tell the remote side that the dialog does not exist so they subscribe again using a new dialog.
(closes issue #10727)
Reported by: s0l4rb03
Patches:
      10727-2.diff uploaded by file (license 11)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104084 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-25 16:16:13 +00:00
Joshua Colp
2395b1a6f5 Due to recent changes tag will no longer be NULL if not present so we have to use ast_strlen_zero to see if it's actually blank.
(closes issue #12061)
Reported by: flefoll
Patches:
      chan_sip.c.br14.patch_pedantic_no_totag uploaded by flefoll (license 244)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-25 15:17:18 +00:00
Tilghman Lesher
638ca62698 Backwards debug message.
(closes issue #12052)
 Reported by: flefoll
 Patches: 
       chan_sip.c.br14.patch_found-notfound uploaded by flefoll (license 244)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104037 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-22 22:45:14 +00:00
Mark Michelson
2d8f502132 And as a followup to revision 104026, completely remove event-related
calls from a section of code where we know there was no event to handle or get.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104027 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-21 21:05:42 +00:00
Mark Michelson
b3dd064bcb Remove an incorrect debug message. It reported that it had received a specific event and tried to report
which event was received. What actually was happening was that it was reporting the number of bytes returned
from a call to read().

Thanks to Jared Smith for bringing the issue up on IRC



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104026 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-21 20:12:38 +00:00
Kevin P. Fleming
d105ba22fa reduce the likelihood that HTTP Manager session ids will consist of primarily '1' bits
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@104015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-21 14:33:51 +00:00
Mark Michelson
70b222e46f Clear up confusion when viewing the QUEUE_WAITING_COUNT of a
"dead" realtime queue. Since from the user's perspective, the queue
does exist, we shouldn't tell them we couldn't find the queue. Instead
since it is a dead queue, report a 0 waiting count

This issue was brought up on IRC by jmls



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103956 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-20 22:32:22 +00:00
Joshua Colp
11edc2ab8d Don't wait for additional digits when overlap dialing is enabled if the setup message contains the sending_complete information element.
(closes issue #11785)
Reported by: klaus3000
Patches:
      sending_complete_overlap_asterisk-1.4.17.patch.txt uploaded by klaus3000 (license 65)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-20 22:06:59 +00:00
Mark Michelson
6835ca7d03 Fix a crash if the channel becomes NULL while attempting to lock it.
(closes issue #12039)
Reported by: danpwi



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-20 21:40:08 +00:00
Tilghman Lesher
494aeb94ac Compat fix for Solaris
(closes issue #12022)
 Reported by: asgaroth
 Patches: 
       20080219__bug12022.diff.txt uploaded by Corydon76 (license 14)
 Tested by: asgaroth


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-20 17:53:00 +00:00
Joshua Colp
749f1e1963 Send CallerID Name in setup message.
(closes issue #11241)
Reported by: tusar
Patches:
      h323id_as_callerid_name.patch uploaded by tusar (license 344)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-19 20:28:08 +00:00
Russell Bryant
8c9a6024d9 Account for the fact that the "other" channel can disappear while the local pvt
is not locked.

(fixes a problem introduced in rev 100581)
(closes issue #12012)
Reported by: stevedavies
Patch by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103821 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-19 20:02:49 +00:00
Joshua Colp
4671e11a5c Don't look for launchd when cross compiling.
(closes issue #12029)
Reported by: ovi


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103812 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-19 17:31:32 +00:00
Joshua Colp
7b6d391b76 Fix building of chan_sip.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-19 15:01:42 +00:00
Olle Johansson
7b72c89fb9 Make sure we send error replies correctly by checking the via header.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-19 10:27:15 +00:00
Joshua Colp
0433ee65ae Ensure that emulated DTMFs do not get interrupted by another begin frame.
(closes issue #11740)
Reported by: gserra
Patches:
      v1-11740.patch uploaded by dimas (license 88)
(closes issue #11955)
Reported by: tsearle
(closes issue #10530)
Reported by: xmarksthespot


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103801 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-18 23:56:48 +00:00
Jason Parker
add30e2666 Fix previous commit so that we actually disable echocanbridged if echocancel is off.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103795 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-18 22:28:56 +00:00
Jason Parker
4ce44f1c28 Correct a message when echocancelwhenbridged is on, but echocancel is not.
Issue #12019


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-18 21:23:32 +00:00
Mark Michelson
1726d5ef4e There was an invalid assumption when calculating the duration of a file that the filestream in question
was created properly. Unfortunately this led to a segfault in the situation where an unknown format was
specified in voicemail.conf and a voicemail was recorded. Now, we first check to be sure that the stream
was written correctly or else assume a zero duration.

(closes issue #12021)
Reported by: jakep
Tested by: putnopvut



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-18 20:52:09 +00:00
Tilghman Lesher
4306df31b1 When a SIP channel is being auto-destroyed, it's possible for it to still be
in bridge code.  When that happens, we crash.  Delay the RTP destruction until
the bridge is ended.
(closes issue #11960)
 Reported by: norman
 Patches: 
       20080215__bug11960__2.diff.txt uploaded by Corydon76 (license 14)
 Tested by: norman


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103780 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-18 17:31:52 +00:00
Mark Michelson
a300034b08 Fix a linked list corruption that under the right circumstances
could lead to a looped list, meaning it will traverse forever.

(closes issue #11818)
Reported by: michael-fig
Patches:
      11818.patch uploaded by putnopvut (license 60)
	  Tested by: michael-fig



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-18 16:37:31 +00:00
Joshua Colp
ba72af8c11 Backport fix from issue #9325.
(closes issue #11980)
Reported by: rbrunka


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-18 16:11:51 +00:00
Joshua Colp
c8d5a65d35 Don't care if the extension given doesn't exist for subscription based MWI.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103763 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-18 15:33:14 +00:00
Russell Bryant
6bf909cd2e Fix a crash in chan_iax2 due to a race condition
(closes issue #11780)
Reported by: guillecabeza
Patches: 
      bug_iax2_jb_1.4.patch uploaded by guillecabeza (license 380)
      bug_iax2_jb_trunk.patch uploaded by guillecabeza (license 380)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-15 23:31:39 +00:00
Russell Bryant
468e53a6de In the case that you try to directly reload a module has returned
AST_MODULE_LOAD_DECLINE, log a message indicating that the module is not fully
initialized and must be initialized using "module load".


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103728 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-15 19:50:11 +00:00
Russell Bryant
97bf3c5ace Don't attempt to execute the reload callback for a module that returned
AST_MODULE_LOAD_DECLINE.  This fixes a crash that was reported against
chan_console in trunk.

(closes issue #11953, reported by junky, fixed by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-15 18:33:29 +00:00
Mark Michelson
5de5636aa9 Final round of changes for configure script logic for IMAP
Now if a directory is specified, then we will search that directory for
a source installation of the IMAP toolkit. If none is found, then we will
use that directory as the basis for detecting a package installation of
the IMAP c-client. If that check fails, then configure will fail.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-15 17:26:37 +00:00
Mark Michelson
dbc1aa9de2 Fix a bit of wrong logic in the configure script that caused problems when trying to configure
without IMAP. Patch suggestion from phsultan, but I modified it slightly.

(closes issue #12003)
Reported by: pj
Tested by: putnopvut



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-15 15:05:49 +00:00
Mark Michelson
2ee7626928 I apparently misunderstood one of the requirements of this configure change.
Now, if a source directory is specified with the --with-imap option, and a valid
source installation is not detected there, then configure will fail and will not
check for a package installation.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103709 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-15 00:50:49 +00:00
Mark Michelson
2bd91c05b5 Make a small clarification in the documentation
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103703 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-14 23:49:24 +00:00
Mark Michelson
35803472e2 Update documentation regarding configuration of IMAP
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-14 23:44:17 +00:00
Mark Michelson
638ef8c5d2 Change to the configure logic regarding IMAP. Prior to this commit, if you wished to configure
Asterisk with IMAP support, you would use the --with-imap configure switch in one of the following
two ways:
--with-imap=/some/directory would look in the directory specified for a UW IMAP source installation
--with-imap would assume that you had imap-2004g installed in .. relative to the Asterisk source

With this set of changes the two above options still work the same, but there are two new behaviors, too.
--with-imap=system will assume that you have -libc-client.so where you store your shared objects and will
            attempt to find c-client headers in your include path either in the imap or c-client directory.
If either of the two original methods of specifying the imap option should fail, then the check for --with-imap
=system will be performed in addition. It is only after this "system" check that failure can happen.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103698 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-14 23:30:17 +00:00
Mark Michelson
0d470a0525 Fix build for non-IMAP builds
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-14 21:03:02 +00:00
Mark Michelson
e70abb4a9e Fix the new message count if delete=yes when using IMAP storage.
(closes issue #11406)
Reported by: jaroth
Patches:
      deleteflag_v2.patch uploaded by jaroth (license 50)
	  Tested by: jaroth



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-14 20:55:48 +00:00
Jason Parker
f29e9e72ba swap location for this..
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-14 19:51:39 +00:00
Jason Parker
01b6eae2e5 Document the 'l' option to the CDR() function.
(Thanks voipgate for pointing out the option, and Leif for providing text for it.)

Closes issue #11695.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-14 19:51:10 +00:00
Tilghman Lesher
e049bdfcfa We aren't talking to ourselves; we're talking to someone else.
(closes issue #11771)
 Reported by: msetim
 Patches: 
       ami_agent_talkingto-1.4.diff uploaded by caio1982 (license 22)
 Tested by: caio1982, msetim


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103607 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-13 06:25:03 +00:00
Tilghman Lesher
3e014ecd0b Refuse to load app_voicemail if res_adsi is not loaded (which is a symbol dependency)
(closes issue #11760)
 Reported by: non-poster
 Patches: 
       20080114__bug11760.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76, non-poster, jamesgolovich


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-13 00:26:57 +00:00
Jason Parker
335e583040 revert accidental change from last commit. oops
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103504 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-12 22:24:03 +00:00
Jason Parker
3bc94a27ca Remove condition that was impossible.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103503 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-12 22:22:54 +00:00
Joshua Colp
f3f663d6fd Even if no CallerID name or number has been provided by the remote party still use the configured sip.conf ones.
(closes issue #11977)
Reported by: pj


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-12 15:09:24 +00:00
Joshua Colp
0b110bb5e8 If entering a conference with the 'w' option ensure that we can't listen or speak until the marked user appears.
(closes issue #11835)
Reported by: alanmcmillan


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103324 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-11 22:09:07 +00:00
Kevin P. Fleming
3071e378bd improve 2BCT documentation a bit (thanks Jared)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103315 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-11 17:05:22 +00:00
Tilghman Lesher
42463c4bb2 Commit fix for being unable to send voicemail from VoiceMailMain
Reported by: William F Acker (via the -users mailing list)
 Patch by: Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-09 06:23:49 +00:00
Mark Michelson
cb8ffc789e Prevent a potential three-thread deadlock. Also added a comment block
to explicitly state the locking order necessary inside app_queue.

(closes issue #11862)
Reported by: flujan
Patches:
      11862.patch uploaded by putnopvut (license 60)
	  Tested by: flujan



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-08 18:48:17 +00:00
Mark Michelson
19f5074cd8 Yield the thread and return -1 if the ioctl fails for Zaptel timing device.
(closes issue #11891)
Reported by: tzafrir



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@103070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-08 18:00:38 +00:00
Joshua Colp
5e3cbd6f92 Make sure the presence of dbsecret is factored into user scoring.
(closes issue #11952)
Reported by: bbhoss


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@102968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-08 15:08:20 +00:00
Jason Parker
caa961fbcf Specify which digit string was matched in debug message.
(closes issue #11949)
Reported by: dimas
Patches:
      v1-feature-debug.patch uploaded by dimas (license 88)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@102858 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-07 19:53:55 +00:00
Kevin P. Fleming
ab0a5f3361 document usage of 'transfer' configuration option for ISDN PRI switch-side transfers
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@102807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-07 16:41:55 +00:00
Joshua Colp
f26bac62e6 Only consider a T.38-only INVITE compatible if we have both a joint capability between us and them and if they provided T.38.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@102725 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-06 17:59:23 +00:00
Joshua Colp
82db5adb94 Add missing header file and ASTERISK_FILE_VERSION usage.
(closes issue #11936)
Reported by: snuffy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@102653 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-06 15:43:38 +00:00
Russell Bryant
c02a439e3b Clarify setting DYNAMIC_FEATURES so that it gets inherited by outbound channels.
(due to a discussion between me and a user via email)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@102651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-06 15:19:41 +00:00
Kevin P. Fleming
5b8cef7ecb ensure that all remaining multi-object modules are built using their proper CFLAGS and include directory paths
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@102627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-06 11:48:48 +00:00
Tilghman Lesher
c9bb4fc12a Move around some defines to unbreak ODBC storage.
(closes issue #11932)
 Reported by: snuffy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@102576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-06 00:26:02 +00:00
Mark Michelson
748609f25e Clear the DTMF buffer on hangup.
(closes issue #11919)
Reported by: eferro
Patches:
      mgcp_dtmfclean_on_hangup.diff uploaded by eferro (license 337)
	  Tested by: eferro


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@102453 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-05 20:02:44 +00:00
Joshua Colp
e9c59d95eb If a REGISTER attempt comes in that is a retransmission of a previous REGISTER do not create a new nonce value.
(issue #BE-381)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@102450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-05 19:52:30 +00:00
Kevin P. Fleming
8a2fd8fdbd ensure that components of chan_misdn.so are built using any special build options that the configure script generated (reported by Philipp Kempgen on asterisk-dev)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@102425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-05 17:15:36 +00:00
Joshua Colp
8dad56f666 Perform dialing asynchronously when using the originate CLI command so the CLI does not appear to block.
(closes issue #11927)
Reported by: bbhoss


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@102378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-05 15:09:29 +00:00
Tilghman Lesher
0dafcac660 Cross-platform fix: OS X now deprecates the use of the daemon(3) API.
(closes issue #11908)
 Reported by: oej
 Patches: 
       20080204__bug11908.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@102323 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-04 21:06:09 +00:00
Tilghman Lesher
1dde474916 Missing braces.
(closes issue #11912)
 Reported by: dimas
 Patches: 
       sprintf.patch uploaded by dimas (license 88)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@102214 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-04 05:10:02 +00:00
Olle Johansson
649a083adb Use the same CSEQ on CANCEL as on INVITE (according to RFC 3261)
(closes issue #9492)
Reported by: kryptolus
Patches: 
      bug9492.txt uploaded by oej (license 306)
Tested by: oej


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@102142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-03 16:38:12 +00:00
Olle Johansson
9a5d78c2c7 Handle ACK and CANCEL in an invite transaction - even if we get INFO transactions during the actual call setup.
(closes issue #10567)
Reported by: jacksch
Tested by: oej
Patch by: oej inspired by suggestions from neutrino88 in the bug tracker



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@102090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-03 10:37:32 +00:00
Russell Bryant
26365fdeca Change the SDP_SAMPLE_RATE macro. It turns out that even though G.722 is 16 kHz,
it is supposed to specified as 8 kHz in the RTP, and RTP timestamps are supposed
to be calculated based on 8 kHz.  (Apparently this is due to a bug in a spec, but
people follow it anyway, because it's the spec ...)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-01 23:06:32 +00:00
Tilghman Lesher
5f7afc8678 Fix the VM_DUR variable for forwarded voicemail, and fixed several other bugs
while I'm in the area.
(closes issue #11615)
 Reported by: jamessan
 Patches: 
       20071226__bug11615__2.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76, jamessan


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101942 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-01 21:54:28 +00:00
Tilghman Lesher
1191559147 Change detection of getifaddrs to use AST_C_COMPILE_CHECK, backported from trunk (as suggested by kpfleming)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-01 19:36:12 +00:00
Jason Parker
d80ecba23f Remove a needless (and incorrect) call to feof() after fgets().
This would have exited the loop early if you had an authentication file with no newline at the end.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101822 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-01 17:41:40 +00:00
Russell Bryant
aa58033acb off by one error
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-01 17:27:02 +00:00
Russell Bryant
552f2e1b4c Don't overwrite the last character of a line if it's not a newline. This would
happen if the last line in the file doesn't have a newline.
(pointed out by Qwell)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-01 17:23:47 +00:00
Tilghman Lesher
df1dc7741d Compatibility fix for OpenWRT (reported by Brian Capouch via the mailing list)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-01 15:55:58 +00:00
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
Mark Michelson
a4c24a807c From bugtracker: "fix totalAnalysisTime to handle periods of no channel activity"
(closes issue #9256)
Reported by: cmaj
Patches:
      amd-dont-wait-too-long-for-frames-take3.diff.txt uploaded by cmaj (license 111)
Tested by: cmaj, skygreg, ZX81, rjain



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-01 00:06:37 +00:00
Russell Bryant
e4ee2274a1 Fix a couple of places where ast_frfree() was not called on a frame that came
from a translator.  This showed itself by g729 decoders not getting released.
Since the flag inside the translator frame never got unset by freeing the frame
to indicate it was no longer in use, the translators never got destroyed, and
thus the g729 licenses were not released.

(closes issue #11892)
Reported by: xrg
Patches:
      11892.diff uploaded by russell (license 2)
Tested by: xrg, russell


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101601 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-31 23:10:06 +00:00
Mark Michelson
bd9a40f98a 1. Prevent the addition of an extra '/' to the beginning of an absolute pathname.
2. If ast_monitor_change_fname is called and the new filename is the same as the old, then exit early and don't set the
   filename_changed field in the monitor structure. Setting it in this case was causing ast_monitor_stop to erroneously
   delete them.

(closes issue #11741)
Reported by: garlew
Tested by: putnopvut



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101531 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-31 21:00:24 +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
Steve Murphy
595ab7340d closes issue #11845; that's the one where there's a 1004 byte cdr leak with every AMI Redirect to a zap channel
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101480 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-31 19:30:37 +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
Joshua Colp
7b31f51cf9 Fix an issue where if a frame of higher sample size preceeded a frame of lower sample size and ast_slinfactory_read was called with a sample size of the combined values or higher a crash would happen.
(closes issue #11878)
Reported by: stuarth


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101222 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-30 15:41:04 +00:00
Jason Parker
ebbc70daab Change default config to use descending channel order of groups, rather than ascending.
Fixes a potential source of confusion in glare-type situations.

Issue 11875, reported by JimVanM.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101219 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-30 15:34:37 +00:00
Mark Michelson
2e4650c242 Fix a logic error with regards to autofill. Prior to this change, it was possible
for a caller to go out of turn if autofill were enabled and callers ahead in the queue were attempting
to call a member. This change fixes this.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-30 15:23:00 +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
Dwayne M. Hubbard
68a44cc066 updated build_tools to handle the autotag directory structure changes; changes related to BE-353. Patch by Russell and reviewed by Me.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-29 23:50:42 +00:00
Mark Michelson
da3e5f571a Remove a memory leak from updating realtime queues
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@101035 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-29 23:02:03 +00:00
Mark Michelson
ad19e1c4b6 Fixing an erroneous return value returned when attempting to pause or unpause a queue member
fails.

Fixes BE-366, thanks to John Bigelow for writing the patch.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-29 19:39:00 +00:00
Joshua Colp
f665fa0556 Don't forget to record the channel so we know whether it is bridged or not later.
(closes issue #11811)
Reported by: slavon


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-29 17:57:05 +00:00
Russell Bryant
f8c69c7d92 Fix the last couple of issues related to building from a path that contains spaces.
(closes issue #11834)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-29 17:43:41 +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
Russell Bryant
2f4510988c Use GNU make magic instead of shell magic to escape spaces in the working directory.
(related to issue #11834)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-29 17:21:33 +00:00
Russell Bryant
c8b0628cc7 Fix building Asterisk when the working path has spaces in it.
(closes issue #11834)
Reported by: spendergrass
Patched by: me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-29 17:06: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
Tilghman Lesher
44cdbc7d00 WaitExten didn't handle AbsoluteTimeout properly (went to 't' instead of 'T')
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100675 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-28 21:02:02 +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
Jason Parker
cec60d345d When using ODBC_STORAGE, make sure we put greeting files into the database like we do with the others.
Issue #11795
Reported by: dimas
Patches:
      vmgreet.patch uploaded by dimas (license 88)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100672 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-28 20:42:43 +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
Russell Bryant
9b53acdbf5 Fix a crash in ast_masq_park_call()
(issue #11342)
Reported by: DEA
Patches:
      res_features-park.txt uploaded by DEA (license 3)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-28 18:26:31 +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
Kevin P. Fleming
cc750dc9ce make these macros not assume that the only other field in the structure is 'argc'... this is true when someone uses AST_DECLARE_APP_ARGS, but it's perfectly reasonable to define your own structure as long as it has the right fields
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-24 21:57:41 +00:00
Russell Bryant
8f27d3ce7c Update main Asterisk copyright info to 2008
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-24 17:22:09 +00:00
Jason Parker
9bc4c3e533 Fix compilation on Solaris.
(closes issue #11832)
Patches:
      bug-11832.diff uploaded by snuffy (license 35)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-24 16:41:29 +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
1d9576115c Fixing a typo.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-23 20:25:00 +00:00
Russell Bryant
ece4c9c40c ChanSpy issues a beep when it starts at the beginning of a list of channels to
potentially spy on.  However, if there were no matching channels, it would beep
at you over and over, which is pretty annoying.  Now, it will only beep once in
the case that there are no channels to spy on, but it will still beep again once
it reaches the beginning of the channel list again.

(closes issue #11738, patched by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99923 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-23 17:46:55 +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
Tilghman Lesher
60c9fba58f When we reset the password via an external command, we should also reset the
password stored in the in-memory list, too (otherwise it doesn't really take
effect).
(closes issue #11809)
 Reported by: davetroy
 Patches: 
       fix_externpass.diff uploaded by davetroy (license 384)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-23 04:31:51 +00:00
Tilghman Lesher
d97a51a50b Oops, should have checked for a NULL obj, here, too
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-23 04:20:15 +00:00
Tilghman Lesher
d9f3861f72 Just confirmed that all current platforms need this header file
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99718 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-23 00:56:06 +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
Tilghman Lesher
fa20a738d7 Fix the defines for OS X (and Solaris, too)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99643 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-22 20:34:55 +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
3d434f14c3 Add dependency on chan_local to app_dial.
Dial still runs without chan_local, but will be missing forwarding functionality.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-22 17:31:17 +00:00
Tilghman Lesher
a0608084a9 Ensure that we can get an address even when we don't have a default route.
(closes issue #9225)
 Reported by: junky
 Patches: 
       20080122__bug9225.diff.txt uploaded by Corydon76 (license 14)
 Tested by: oej, loloski, sergee


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-22 16:54:06 +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
Tilghman Lesher
cae4280341 Permit the user to specify number of seconds that a connection may remain idle,
which fixes a crash on reconnect with the MyODBC driver.
(closes issue #11798)
 Reported by: Corydon76
 Patches: 
       20080119__res_odbc__idlecheck.diff.txt uploaded by Corydon76 (license 14)
 Tested by: mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-21 18:11:07 +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
a6b9a0e774 Fix a couple of memory leaks with frame handling. Specifically,
ast_frame_free() needed to be called on the frame that came from the translator
to signed linear.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-19 10:05:27 +00:00
Joshua Colp
d0d93be4f4 Remove the __ in front of the unused variable. This causes some compilers to freak out.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-18 22:57:15 +00:00
Russell Bryant
06d3c61a2e Revert adding the packed attribute, as it really doesn't make sense why that
would do any good.  Fix the real bug, which is to do the check to see if the
frame came from a translator at the beginning of ast_frame_free(), instead of
at the end.  This ensures that it always gets checked, even if none of the
parts of the frame are malloc'd, and also ensures that we aren't looking at
free'd memory in the case that it is a malloc'd frame.

(closes issue #11792, reported by explidous, patched by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99081 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-18 21:37:21 +00:00
Russell Bryant
f0001ecf66 Since we're relying on the offset between the frame and the beginning of the translator
pvt struct, set the packed attribute to make sure we get to the right place.
(potential fix for issue #11792)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-18 21:22:21 +00:00
Terry Wilson
eab2f166c3 This should at least temporarily fix a problem where the 't' Dial
option is incorrectly passed to the transferee when built-in
attended transfers are used.  There is still a problem with 'T',
but better to fix some problems than no problems while we work
on it.

(closes issue #7904)
Reported by: k-egg
Patches: 
      transfer-fix-b14-r97657.diff uploaded by sergee (license 138)
Tested by: sergee, otherwiseguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-18 17:13:00 +00:00
Pari Nannapaneni
78e4746837 doh! revert a revert of a revert (changed by mistake in 99010)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99014 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-17 23:42:45 +00:00
Pari Nannapaneni
f7eae72a2e missed that one while reverting
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-17 23:23:25 +00:00
Pari Nannapaneni
0fed0a955f reverting 99001 - We need the Max-Age for extending the life of cookie mansession_id
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-17 23:09:53 +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
Kevin P. Fleming
af7670bca8 we should only send the Set-Cookie header to the browser on the first response after creating a manager session, not on every response (doing so causes the browser to clear any local cookies it may have associated with the session)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@99001 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-17 21:31:56 +00:00
Jason Parker
fec33edd9d Add a clarification about the immediate= option of zapata.conf
Issue 11784, patch by klaus3000.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-17 16:19:46 +00:00
Russell Bryant
904f38a40a Add an unused pointer to the ast_channel struct. This makes the ast_channel structure
retain the same size as it had in previous 1.4 releases.  Also, all of the offsets for
members in the structure are still the same (except for the two pointers that got replaced
for the new spy/whisper architecture.)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98982 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-16 22:36:24 +00:00
Joshua Colp
ed51a4bce9 Bump up cleancount due to previous commit that changed the channel structure.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-16 20:34:30 +00:00
Joshua Colp
fa640604de Replace current spy architecture with backport of audiohooks. This should take care of current known spy issues.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98972 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-16 20:33:47 +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
a93c14cbfe Introduce a lock into the dialing API that protects it when destroying the structure.
(closes issue #11687)
Reported by: callguy
Patches:
      11687.diff uploaded by file (license 11)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98960 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-16 15:08:24 +00:00
Joshua Colp
1379764f4c Add two more SDP names for ulaw and alaw.
(closes issue #11777)
Reported by: tootai


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-16 15:03:14 +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
Joshua Colp
a0c14dbda3 Add autoconf logic for speexdsp. Later versions use a separate library for some things so we need to use it if present in codec_speex.
(closes issue #11693)
Reported by: yzg


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-16 01:13:27 +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
Mark Michelson
d186a861cf Adding in appropriate unlocks for the locks I added. Thanks to joetester on IRC
for pointing this out.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-14 20:59:26 +00:00
Russell Bryant
9a241dd2b9 Revert a change that introduces an unacceptable performance hit and is causing
memory leaks ... (from rev 97973)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-14 17:38:38 +00:00
Mark Michelson
8e3c058e44 Fixing another compilation error. I'm a bit off today :(
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98737 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-14 16:35:12 +00:00
Mark Michelson
1a95cfaf45 Oops. Last commit had compilation error.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-14 16:30:33 +00:00
Mark Michelson
aa320d23a9 Adding explicit defaults for missing options to init_queue. This is necessary because
if a user either removes or comments one of these options and reloads their queues, the
option will not reset to its default, instead maintaining the value from prior to the 
reload. 

Thanks to John Bigelow for pointing this error out to me.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-14 16:21:28 +00:00
Tilghman Lesher
6efee0907d Add a connection timeout attribute, as that was what was intended with the
login timeout, but ODBC divides it up into 2 different timeouts.
(Closes issue #11745)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98467 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-12 00:05:08 +00:00
Russell Bryant
665c498c52 Fix up setting the EID on BSD based systems.
(closes issue #11646)
Reported by: caio1982
Patches:
      dundi_osx_eid6.diff.txt uploaded by caio1982 (license 22)
      dundi_osx_eid6-1.4.diff uploaded by caio1982 (license 22)
Tested by: caio1982, mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98390 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-11 22:46:21 +00:00
Pari Nannapaneni
ee32b1246d Comment explaining how to force browser to always read some html files from server.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98372 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-11 21:28:48 +00:00
Joshua Colp
aa95b890ea If the incoming RTP stream changes codec force the bridge to break if the other side does not support it.
(closes issue #11729)
Reported by: tsearle
Patches:
      new_codec_patch_udiff.patch uploaded by tsearle (license 373)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98325 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-11 19:51:10 +00:00
Joshua Colp
ebdf2940b8 If the channel is hungup during RECORD FILE send a result code of -1 to be uniform with everything else.
(closes issue #11743)
Reported by: davevg
Patches:
      res_agi.diff uploaded by davevg (license 209)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-11 19:28:30 +00:00
Mark Michelson
d97e842d55 Properly report the hangup cause as no answer when someone does not answer
(closes issue #10574, reported by boch, patched by moy)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98315 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-11 19:10:57 +00:00
Tilghman Lesher
42d3e979f6 Add another exception (which doesn't work) for -march optimization flag.
Reported by: thomasmebes
Patch by: tilghman
(Closes issue #11563)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-11 18:25:44 +00:00
Russell Bryant
45f3890926 Backport the ability to set the ToS bits on Linux when not running as root.
Normally, we would not backport features into 1.4, but, I was convinced by the
justification supplied by the supplier of this patch.  He pointed out that this
patch removes a requirement for running as root, thus reducing the potential
impacts of security issues.

(closes issue #11742)
Reported by: paravoid
Patches:
      libcap.diff uploaded by paravoid (license 200)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-11 18:25:30 +00:00
Joshua Colp
441b809159 Ensure the return value of ast_bridge_call is passed back up as the application return value. This is needed for transfers to function so the PBX core knows to continue execution.
(closes issue #10327)
Reported by: kkiely


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98219 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-11 17:22:53 +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
Russell Bryant
f826e84059 Fix samples vs. length calculations for g722
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-11 03:39:33 +00:00
Russell Bryant
97ac0d3d1c Simplify this code with a suggestion from Luigi on the asterisk-dev list.
Instead of using is16kHz(), implement a format_rate() function.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98025 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-11 00:14:59 +00:00
Russell Bryant
8fd3d8a51b Fix various timing calculations that made assumptions that the audio being
processed was at a sample rate of 8 kHz.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 23:30:40 +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
Mark Michelson
87a55d5882 Let us leave a voicemail for ourself if we have logged into VoiceMailMain and chosen
to leave a message.

(closes issue #11735, reported and patched by jamessan)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 21:57:06 +00:00
Steve Murphy
b04af32888 Applied the same fixes for ael.flex as was done in 97849 for ast_expr2.fl; overrode the normally generate yyfree func with our own version that checks the pointer for non-null before passing to free(). Also takes care of a little problem with 2.5.33 and the use of the __STDC_VERSION__ macro.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97889 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 21:37:10 +00:00
Steve Murphy
9eeca94298 This is a fix for 2 things: a problem Terry was having in OSX with null pointers, which was my fault, as I probably forgot to run the sed script last time I made mods. So, I moved the fix into the flex input itself. Then, I found when I used flex 2.5.33, that it was using __STDC_VERSION__, and that's not real good; so I added back in a DIFFERENT sed script to fix that little mess. Tested everything, a couple different ways. Hope I did no harm, at the least.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 20:21:27 +00:00
Jason Parker
00b8f86349 Fix a comment that is no longer true.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 20:12:37 +00:00
Russell Bryant
142e5dd457 Remove other remnants of pbx_kdeconsole
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97753 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 16:19:47 +00:00
Russell Bryant
742fd8127c Remove pbx_kdeconsole from the tree. It hasn't worked in ages, and nobody has
complained.
(closes issue #11706, reported by caio1982)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 16:10:09 +00:00
Joshua Colp
91762636b9 Don't try to copy the category from the group if no category exists.
(closes issue #11724)
Reported by: IgorG
Patches:
      group_count.v1.patch uploaded by IgorG (license 20)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97697 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 15:07:12 +00:00
Russell Bryant
3378ef39fd Strip terminal sequences from the verbose messages
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97645 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 23:01:48 +00:00
Russell Bryant
d8004449d5 Make pbx_gtkconsole build ... but doesn't actually load on my system still
(related to issue #11706)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 22:26:33 +00:00
Jason Parker
3b966ed04e Correctly display a message if a command could not be found.
Also fix a comment which may have led to this happening.

Issue 11718, reported by kshumard.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 20:28:43 +00:00
Jason Parker
5583996b22 Fix some locking and return value funkiness. We really shouldn't be unlocking this lock inside of a function, unless we locked it there too.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 20:05:45 +00:00
Mark Michelson
2da89b6120 Part 2 of app_queue doxygen improvements. Some smaller functions this time
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 18:48:15 +00:00
Russell Bryant
eebd74ee97 Fix saying the parking space number to the caller doing the parking ...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 18:02:08 +00:00
Kevin P. Fleming
ce81b232e3 report the same message whether Zaptel does not have transcoder support loaded or no transcoders were found
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97491 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 17:21:14 +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
Joshua Colp
7a3ee5a7fc Don't do conferencing totally in Zaptel if Monitor is running on the channel.
(closes issue #11709)
Reported by: BigJimmy
Patches:
      patch-meetmerec uploaded by BigJimmy (license 371)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 16:11:17 +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
Tilghman Lesher
1f14e0cf39 Allow filename completion on zero-length modules, remove a memory leak, remove
a file descriptor leak, and make filename completion thread-safe.
Patched and tested by tilghman.
(Closes issue #11681)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 00:44:14 +00:00
Mark Michelson
34f994f017 use the \retval doxygen command properly
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 00:17:40 +00:00
Mark Michelson
2a0748b0fe Part 1 of N of adding doxygen comments to app_queue. I picked some of the most common functions
used (which also happen to be some the biggest/ugliest functions too) to document first. I'm pretty
new to doxygen so criticism is welcome.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-08 23:49:11 +00:00
Mark Michelson
fdd5c25103 Some coding guidelines-related cleanup
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-08 21:24:48 +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
3acbb032f8 Increase constants to where we're less likely to hit them while debugging.
(Closes issue #11694)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-08 20:47:07 +00:00
Mark Michelson
b5ea488a1d Making some changes designed to not allow for a corrupted mailstream for a vm_state.
1. Add locking to the vm_state retrieval functions so that no linked list corruption occurs.
2. Make sure to always grab the persistent vm_state when mailstream access is necessary.
3. Correct an incorrect return value in the init_mailstream function.

(closes issue #11304, reported by dwhite)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97192 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-08 20:42:07 +00:00
Joshua Colp
edfb14d0f6 If no group has been provided to the GROUP_COUNT dialplan function then use the first one specific to the channel.
(closes issue #11077)
Reported by: m4him


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-08 19:53:52 +00:00
Joshua Colp
be83b74be9 Make app_queue calls work with directed pickup.
(closes issue #11700)
Reported by: jbauer


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-08 18:36:40 +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
Russell Bryant
9aa3d2dd7f Merged revisions 96931 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r96931 | russell | 2008-01-07 14:46:22 -0600 (Mon, 07 Jan 2008) | 2 lines

Change misery.digium.com to pbx.digium.com

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-07 20:47:52 +00:00
Russell Bryant
61a1ce95a5 Don't crash if something happens when setting up an SMDI interface and it gets
destroyed before the SMDI port handling thread gets created.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96884 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-07 16:39:23 +00:00
Philippe Sultan
ee7978e96e Indentation fix, makes the code easier to read
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96815 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-07 14:34:36 +00:00
Philippe Sultan
e531dcb1af Compute the base64 value over the [authzid]\0authcid\0password string,
thus excluding the trailing NULL byte.

This change has already been committed to trunk, see #11644.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96797 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-07 14:25:29 +00:00
Russell Bryant
b11422fe8f Don't pass an empty string as the device name.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-05 02:09:19 +00:00
Tilghman Lesher
8770045be8 Fix the problem of notification of a device state change to a device with a '-'
in the name.  Could probably do with a better fix in trunk, but this bug has
been open way too long without a better solution.
Reported by: stevedavies
Patch by: tilghman
(Closes issue #9668)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-04 23:03:40 +00:00
Jason Parker
6cc0887f56 Properly continue in the dialplan if using PARKINGEXTEN and the slot is full.
Issue 11237, patch by me.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-04 22:55:56 +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
Tilghman Lesher
6d96102150 Missed initialization caused crash.
Reported and fixed by: tiziano
(Closes issue #11671)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-03 21:37:02 +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
Mark Michelson
068e1d8208 We need to reset the membername to NULL on each iteration of this loop, otherwise the result is that
multiple members can have the same name, since the variable was not reset on each iteration of the loop.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-02 23:46:02 +00:00
Russell Bryant
ec8a896935 Convert locks of the contexts list in pbx_config to the appropriate rdlock or wrlock
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-02 22:14:28 +00:00
Russell Bryant
93748ccb9c pbx_dundi only needs a rdlock on the contexts list.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-02 22:04:47 +00:00
Russell Bryant
4ee7457343 app_macro only needs a rdlock on the contexts list.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96020 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-02 22:00:21 +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
Mark Michelson
60c6826c1c A change to improve the accuracy of queue logging in the case where a member does not
answer during the specified timeout period. Prior to this change, there was a small chance
that the member name recorded in this case would be blank. Also prior to this change, if using
the ringall strategy, if no one answered the call during the specified timeout, the member name
listed in the queue log would randomly be one of the members that was rung.

(closes issue #11498, reported and tested by hloubser, patched by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@95890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-02 17:51:22 +00:00
Mark Michelson
8fded490ce Avoiding a potentially bad locking situation. ast_merge_contexts_and_delete writelocks the conlock, then
calls ast_hint_extension, which attempts to readlock the same lock. Recursion with read-write locks is 
dangerous, so the inner lock needs to be removed. I did this by copying the "guts" of ast_hint_extension
into ast_merge_contexts_and_delete (sans the extra lock).

(this change is inspired by the locking problems seen in issue #11080, but I have no idea if this is the
problematic area experienced by the reporters of that issue)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@95577 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-31 23:43:13 +00:00
Tilghman Lesher
3d142f0271 Allow the default "0" to be returned if the STAT fails
(Closes issue #11659)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@95470 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-31 20:27:26 +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
Mark Michelson
a7dee30a8d I found a bug while browsing the queue code and managed to reproduce it in a small setup.
If a queue uses the ringall strategy, it was possible through unfortunate coincidence for a single member at a given penalty level to
make app_queue think that all members at that penalty level were unavailable and cause the members at the
next penalty level to be rung. With this patch, we will only move to the next penalty level if ALL the members
at a given penalty level are unreachable.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@95095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-28 00:16:15 +00:00
Russell Bryant
8b3f41409e Don't report a syntax error when an empty string is passed to ast_get_group.
Just return 0.

(closes issue #11540)
Reported by: tzafrir
Patches: 
      group_empty.diff uploaded by tzafrir (license 46)
	   -- slightly changed by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@95024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-27 21:40:02 +00:00
Mark Michelson
5dc1371bf2 Fixing a typo in a comment.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-27 20:09:06 +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
Russell Bryant
c03ccc41f2 Now that the contexts lock is a read/write lock, it should not be locked here
in ast_hint_state_changed().  This makes it get locked recursively which now
causes a deadlock.
(closes issue #11080, thanks to callguy for the access to a deadlocked machine)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94831 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-27 15:16:56 +00:00
Russell Bryant
67df6e008d Use the constant that I really meant to use here ...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-27 14:44:29 +00:00
Russell Bryant
c792659cc7 Change ast_translator_best_choice() to only pay attention to audio formats.
This fixes a problem where Asterisk claims that a translation path can not be
found for channels involving video.

(closes issue #11638)
Reported by: cwhuang
Tested by: cwhuang
Patch suggested by cwhuang, with some additional changes by me.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-27 14:33:21 +00:00
Kevin P. Fleming
eb4d447b78 make this comment explain the situation in an even more explicit fashion
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94824 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-27 01:01:47 +00:00
Tilghman Lesher
3c3eb75062 Workaround for what is probably a glibc bug (but we'll see this crop up again
and again, if we don't add the workaround).
Reported by: rolek
Patch by: tilghman
(Closes issue #11601, closes issue #11426)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-26 20:43:38 +00:00
Russell Bryant
e6a8750fe7 Just in case the AST_FLAG_END_DTMF_ONLY flag was already set before starting
autoservice, remember it and ensure that the channel has the same setting when
autoservice gets stopped.  (pointed out by d1mas, patched up by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94801 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-26 19:04:31 +00:00
Russell Bryant
52df524ba0 When a channel is in autoservice, mark a flag on the channel that says that
we only care about the END of a digit.  That way, no magic digit emulation stuff
will happen when all we're doing is queueing up END frames.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94797 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-26 18:46:39 +00:00
Russell Bryant
39c5c66235 Don't try to send a parked call back to itself.
(closes issue #11622, reported by djrodman, patched by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94793 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-26 17:24:17 +00:00
Russell Bryant
1deba2c9ed Don't store DTMF BEGIN frames while a channel is in autoservice. It's just
going to make ast_read() do a lot of extra work when the channel comes back
out of autoservice.
(closes issue #11628, patched by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-26 17:06:26 +00:00
Russell Bryant
a4523fcd83 List include/asterisk/version.h as a .PHONY target because we want the commands
listed for this target to be executed regardless of whether the file exists or
not.  This fixes having the version not up to date when running from svn.
(closes issue #11619, reported by plack, fixed by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-26 17:00:03 +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
Tilghman Lesher
540077b7b1 Race: we need to wait to queue a NewChannel event until after the channel is
inserted into the channel list.  The reason is because some manager users
immediately queue requests from the channel when they see that event and are
confused when Asterisk reports no such channel. (Closes issue #11632)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94767 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-24 19:36:59 +00:00
Tilghman Lesher
9dbd385de7 More deadlock avoidance code (this time between sip_monitor and sip_hangup)
Reported by: apsaras
Patch by: tilghman
(Closes issue #11413)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94765 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-24 16:17:01 +00:00
Tilghman Lesher
f26935218f Another bit of bad logic in realtime_peer
Reported by: dimas
Patch by: dimas
(Closes issue #11631)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94763 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-24 15:39:56 +00:00
Tilghman Lesher
1e5463be20 Argh... I suppose third time's the charm.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94660 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-23 01:21:03 +00:00
Mark Michelson
54215d94f1 Bunch of coding guidelines cleanup
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-21 20:21:59 +00:00
Mark Michelson
f4663e4f22 Better quota support for using IMAP storage voicemail
(closes issue #11415, reported by jaroth)
(closes issue #11152, reported by selsky)

Patch provided by jaroth



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-21 20:11:34 +00:00
Mark Michelson
c30bab877c The mail_copy c-client function does not expect a full imap mailbox string, just the name of the mailbox.
(closes issue #11419, reported and patched by jaroth, with additional patchwork from me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-21 19:59:45 +00:00
Mark Michelson
8c7948fd44 Since we are freeing list elements within a list traversal, we need to use the safe
traversal and remove the item from the list before freeing it.

(closes issue 11612, reported by dtyoo)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94468 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-21 16:49:35 +00:00
Russell Bryant
5977f8d5be Convert the contexts lock to a read/write lock to resolve a deadlock. This
has a nice side benefit of improving performance.  :)

(closes issue #11609)
(closes issue #11080)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-21 16:37:47 +00:00
Mark Michelson
ad89849308 Removing a debug message I accidentally just committed
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94464 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-21 16:11:44 +00:00
Mark Michelson
eac09a0cd0 Fixing Portuguese syntax for saying dates and times. Also some coding guidelines cleanup.
(closes issue #11599, reported and patched by caio1982, coding guidelines cleanup by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94420 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-21 15:45:14 +00:00
Tilghman Lesher
2f24e1b1bf Fix for restart-as-user problem reported via the -dev list
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-21 15:07:42 +00:00
Russell Bryant
32c8a851c7 Merged revisions 94255 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r94255 | russell | 2007-12-20 14:21:41 -0600 (Thu, 20 Dec 2007) | 5 lines

Fix another potential seg fault ...

(closes issue #11606)
Reported by: dimas

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94256 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-20 20:22:22 +00:00
Russell Bryant
b80002cc9f Fix a deadlock in d-channel handling in chan_zap.
This deadlock was introduced by the fix to ensure that channels are properly
locked when handling channel variables.  There were sections of this code where
the channel pvt was locked before the channel lock, when in fact it _must_ be
the other way around.

(closes issue #11582)
Reported by: bugi


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94251 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-20 20:08:42 +00:00
Russell Bryant
2fc3d3e903 Blocked revisions 94214 via svnmerge
........
r94214 | russell | 2007-12-20 11:29:11 -0600 (Thu, 20 Dec 2007) | 2 lines

Fix a couple of places where it's possible to dereference a NULL pointer.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94215 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-20 17:30:29 +00:00
Mark Michelson
b0dd0e2a68 Sox versions 13.0.0 and newer do not have "soxmix" and instead use sox -m. res_monitor
needs to use this if the user does not have soxmix.

(closes issue #11589, reported by amessina, patch inspired by amessina but with a flourish from me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-19 23:02:22 +00:00
Russell Bryant
612d0b8f45 Check for the existence of the soxmix application on the target platform and have
the result available in autoconfig.h.
(part of issue #11589)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94077 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-19 22:48:48 +00:00
Joshua Colp
52527facc4 Make the 1.4 builders happy, ensure var is NULL.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-19 17:29:20 +00:00
Tilghman Lesher
d1a1f4599b Avoid segfault in chan_iax when peer isn't defined
(Closes issue #11602)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-19 17:04:13 +00:00
Jason Parker
ff5ffd02cf FreeBSD also does not have byte swap functions.
Issue 11586, patch by sobomax.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-18 22:42:41 +00:00
Tilghman Lesher
28d4f2f5eb Blocked revisions 93675 via svnmerge
........
r93675 | tilghman | 2007-12-18 12:44:41 -0600 (Tue, 18 Dec 2007) | 2 lines

Oops, missed this one case

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-18 18:45:37 +00:00
Tilghman Lesher
be17d99712 Merged revisions 93667 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r93667 | tilghman | 2007-12-18 12:23:06 -0600 (Tue, 18 Dec 2007) | 2 lines

Fixing AST-2007-027 (Closes issue #11119)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93668 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-18 18:29:39 +00:00
Mark Michelson
62fa8dfbfa Rework deadlock avoidance used in ast_write, since it meant that agent channels which were being monitored
had one audio file recorded and one empty audio file saved.

(closes issue #11529, reported by atis patched by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93625 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-18 17:02:48 +00:00
Jason Parker
6fa23de8ac Missed a spot..
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93420 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 22:56:58 +00:00
Jason Parker
7e7db434e4 What was I thinking when I wrote this masterpiece?
-1 + 1 = 0..  who woulda thunk it?.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 22:45:57 +00:00
Joshua Colp
0a584613d6 Do not try to access information about a lock when printing out a trylock attempt. It is possible for the lock that it references to no longer be valid. This would have caused segfaults or deadlocks.
(issue #BE-263)
(closes issue #11080)
Reported by: callguy
(closes issue #11100)
Reported by: callguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 22:28:09 +00:00
Tilghman Lesher
8057fb41cb Today is tomorrow's yesterday, and yesterday's tomorrow is today, and
tomorrow's tomorrow is the day after tomorrow, so who cares if you
recycle anyway?

If this confuses you, that's nothing compared to what this fixes. ;-)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93336 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 21:12:42 +00:00
Mark Michelson
2fa91746e3 We need to create the directory for a voicemail user even if they are using IMAP storage
since greetings are stored in the filesystem.

(closes issue #11388, reported by spditner, patch by me inspired by a patch by spditner)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93291 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 19:53:48 +00:00
Joshua Colp
48ae6172da If a call is received with a called number IE containing nothing go to the 's' extension.
(closes issue #9099)
Reported by: kb1_kanobe2
Patches:
      20070906__9099.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93250 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 18:05:55 +00:00
Kevin P. Fleming
fd1e942f53 fix some copy-and-paste leftovers
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 07:21:08 +00:00
Olle Johansson
517dacce70 Issue 11574: Add dependencies on res_monitor and res_features.
I wonder if Asterisk can run at all without res_features. My guess is that 
there's propably a lot of more modules and the core that depends on it.

Reported by: caio1982
(closes issue #11574)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 07:15:13 +00:00
Kevin P. Fleming
627f595c58 In http://lists.digium.com/pipermail/asterisk-dev/2007-December/031145.html,
rizzo brought up some issues related to the way that the metadata required
for menuselect and the rest of the build system is extracted from the source
files. Since I had a few hours to kill on an airplane today, I decided to
improve this situation... so now the system caches the extracted metadata
and uses it to build the menuselect 'tree' as much as it can. The result
of this is that when a single source file is changed, only the metadata for
that file needs to be extracted again, and the rest is used from the cache
files. I also reduced the number of forked processes required to do the
metadata extraction; it was actually possible to do most of what we needed
in the Makefiles themselves without using any shell scripts at all! On my
laptop, these changes resulted in an 80% decrease in the time required
for the 'menuselect.makeopts' automatic check to occur after editing a single
source file.

While doing this work I also cleaned up a few minor things in the Makefiles,
adding a check for 'awk' to the configure script and changed all remaining
places we use 'grep' or 'awk' to use the ones found by the configure script,
and changed the 'prep_tarball' script to build the menuselect metadata so
that tarballs of Asterisk will include it and won't require the user to
wait while it is extracted after unpacking.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 06:44:51 +00:00
Russell Bryant
4965b39719 There are a lot of existing systems that #include non-existent files. So, to
make the transition to treating this as an error a bit less painless, just issue
a huge error message for now.  Then, later, we can reinstate the code that treats
it as a failure.

(Thanks to philippel for the feedback)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-14 17:36:08 +00:00
Joshua Colp
6a2c388e18 Up the length of the format on the SIP channel since it can now be rather long.
(closes issue #11552)
Reported by: francesco_r


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92937 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-14 15:16:15 +00:00
Christian Richter
876afa76de fixed the sequencing of WAITING_4DIGS state setting and overlap_task thread starting.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-14 15:05:28 +00:00
Tilghman Lesher
804d837c7d Change help documentation to match actual behavior (FAILURE vs FAILED).
Reported by: angeloxx-sir
Patch by: tilghman
(Closes issue #11548)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-14 15:01:10 +00:00
Mark Michelson
c9f389a45d When compiling with DETECT_DEADLOCKS, don't spam the CLI with messages
about possible deadlocks. Instead just print the intended single message every
five seconds.

(closes issue 11537, reported and patched by dimas)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92875 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-14 01:24:06 +00:00
Tilghman Lesher
9d70e52611 Properly initialize polarity statuses, so that they are detected properly.
Reported by: julianjm
Patch by: julianjm
(Closes issue #10238)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92815 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-13 21:28:39 +00:00
Jason Parker
65cbfa5d0d Make application help text a little more clear about the use of extensions in a filename.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-13 20:13:48 +00:00
Mark Michelson
7f7cbe7f69 Prevent another potential fd leak
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-13 20:03:20 +00:00
Mark Michelson
fb077e33cb Prevent a possible fd leak.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-13 19:49:55 +00:00
Jason Parker
8771f23fff If a typo is found in a config file, we previous continued on with what was already loaded.
We do not want to do this (see bug below for details).

This makes it so that if a [ is found without a ], the entire config will fail, and nothing in it will be loaded.

Isue #10690.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-13 00:11:09 +00:00
Kevin P. Fleming
1209386fe7 emit a warning message when we drop a G.729B CNG frame destined for the transcoder
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-12 22:00:39 +00:00
Jason Parker
4a869fa0c3 Don't increment user count until after name has been recorded (if enabled).
Issue 11048, tested by pep.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92617 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-12 21:15:45 +00:00
Russell Bryant
f4bb168b66 resolve compiler warning
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-12 19:40:02 +00:00
Mark Michelson
097b9dc2cf Correctly detect where a dynamic feature was activated. Before this patch,
the channel which initiated the bridge was always assumed to have been the one
which activated the dynamic feature. This patch corrects this.

(closes issue #11529, reported and patched by nic_bellamy)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92510 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-12 17:46:14 +00:00
Tilghman Lesher
b4b34f080d Test directly for the API that fixed AST-2007-026, to ensure that older
versions of PostgreSQL are no longer acceptable.
(Closes issue #11526)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-12 16:52:56 +00:00
Mark Michelson
ef5f25b6c1 Removing an unused variable.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92443 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-12 16:08:55 +00:00
Joshua Colp
7a1b94082c Fix potential memory leak with the dialed interfaces list if another memory allocation fails.
(closes issue #11507)
Reported by: eliel
Patches:
      global_datastores.c.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-11 19:51:40 +00:00
Mark Michelson
c8b5d2ea03 Fixing autofill to be more accurate. Specifically, if calls ahead of the current
caller were ringing members (but not yet bridged) there could be available members
and waiting callers who would not get matched up. The member availability checker
was correctly determining the number of available members in this scenario, but
the queue itself did not parallelly reflect this status on the pending calls. This
commit corrects the issue.

(closes issue #11459, reported by equissoftware, patched by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92323 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-11 17:42:25 +00:00
Joshua Colp
bff4a0aa3c Add G729A as another possible payload name for G729. Some devices use this instead of G729, which is perfectly normal since the payload number itself is defined and can't be used by anything else so the name doesn't matter that much.
(closes issue #11483)
Reported by: revolution
Patches:
      rtp.diff uploaded by revolution (license 346)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92204 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-10 16:36:15 +00:00
Mark Michelson
626053ac64 If there are no members in a queue, then the loop where the datastore for detecting
duplicate dialed numbers will be skipped, meaning the datastore isn't created. This means
that when we try to free it, there's a crash. This stops that crash from occurring.

(closes issue #11499, reported by slavon, patched by eliel)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92202 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-10 16:29:44 +00:00
Joshua Colp
6fcaf2bb4b It is possible for nativeformats to contain more then one codec, so print out multiple ones.
(closes issue #11366)
Reported by: ovi


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-10 16:13:43 +00:00
Olle Johansson
7efa6b1fe0 Avoid reinvite race situations with two Asterisks trying
to reinvite each other in 1.4 and trunk. 

This patch implements support for the 491 error code that
Asterisk 1.4 generates on situations where we get an 
incoming INVITE and already has one in progress.

Thanks to mavetju for reporting and to Raj Jain for an
excellent explanation of the problem.

Patch by myself. Tested with 8 Asterisk servers connected
to each other in a training network.

Closes issue #10481



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@92158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-10 14:04:44 +00:00
Jason Parker
16a03298e9 We need to make sure we free the input frame if we return a different frame in ast_dsp_process.
Issue 11273, pointed out by dimas, with a patch by eliel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 23:29:01 +00:00
Kevin P. Fleming
bcedcf5f8a even though Asterisk explicitly requests that endpoints using G.729 do *not* use Annex B (silence detection and comfort noise generation) some do anyway; the transcoder card interface does not currently work properly with CNG frames, so trim off the CNG before sending the data
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91870 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 22:30:59 +00:00
Russell Bryant
b5463cd8d3 Make the lock protecting each thread's list of locks it currently holds
recursive.  I think that this will fix the situation where some people have
said that "core show locks" locks up the CLI.
(related to issue #11080)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91830 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 21:24:33 +00:00
Russell Bryant
7be75dbbc9 Fix another bug in the DEBUG_THREADS code. The ast_mutex_init() function had
the mutex attribute object marked as static.  This means that multiple threads
initializing locks at the same time could step on each other and end up with
improperly initialized locks.
(found when tracking down locking issues related to issue #11080)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 21:17:24 +00:00
Russell Bryant
168a6bed5a I love fixing lock related errors in the lock debugging code. That's about as
ironic as it gets in Asterisk programming land.  Anyway, I spotted this bug while
trying to track down why systems are locking up and acting weird in issue #11080.
The mutex attribute object was marked as static in this function when it should
not have been.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91826 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 21:11:08 +00:00
Russell Bryant
3e913c706f * Add channel locking around datastore operations that expect the channel
to be locked.
* Document why we don't record Local channels in the dialed interfaces list.
* Remove the dialed variable as it isn't needed.
* Restructure some code for clarity and coding guidelines stuff


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 16:38:48 +00:00
Russell Bryant
d1f1b3c4d6 * Add channel locking around datastore operations that expect the channel
to be locked.
* Document why we don't record Local channels in the dialed interfaces list.
* Handle memory allocation failure.
* Remove the dialed variable, as it wasn't actually needed.
* Tweak some formatting to conform to coding guidelines.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91780 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 16:25:25 +00:00
Russell Bryant
ab117fecaa * Add a bit more of a verbose comment as to why a hangup frame needs to be
queued up if autoservice gets a NULL return from ast_read().
* Make the process of queueing the hangup frame more efficient by putting the
  frame where it is going to end up and avoiding some locking and extra memory
  allocations and freeing.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 16:08:35 +00:00
Mark Michelson
9dbdc103b0 Hangups that happen during autoservice were not processed appropriately. This is
because a hangup actually causes a NULL frame to be received, not a hangup frame.
Queueing a hangup if we receive a NULL frame during autoservice corrects this problem

(closes issue #11467, reported  by jmls, patched by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91737 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 15:39:58 +00:00
Russell Bryant
c13539cb13 Don't unlock the dialed_interfaces list until we're done messing with the iterator.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 02:51:22 +00:00
Russell Bryant
85e0e1919d Allow dialing local channels from Queue() and Dial() again. There was a slight
flaw in the code to prevent call forwards from looping that caused this problem.
(related to issue #11486)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 02:38:40 +00:00
Russell Bryant
079b4a2b18 Fix in an issue in the call forwarding handling code that was causing crashes
on every call into a queue.  I'm not entirely sure about the logic in this part
of the code, so I want to look at it some more tomorrow.  However, this makes
it safe and keeps it from crashing.

(closes issue #11486, reported by adamg, patched by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91675 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 02:19:45 +00:00
Tilghman Lesher
af01697791 At the end of a call, when we're reporting, RTCP may already be partially torn down, so check for NULL dereference
Reported by: blitzrage
Patch by: tilghman
(Closes issue #11450)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 00:52:17 +00:00
Mark Michelson
ad820243bd IMAP storage did not honor the maxmsg setting in voicemail.conf, and it also had the possibility
of crashing if a user had more than 256 messages in their voicemail. This patch kills two birds with
one stone by adding maxmsg support and also setting a hard limit on the number of messages at 255 so
that the crashes cannot happen.

(closes issue #11101, reported by Skavin, patched by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-06 20:25:11 +00:00
Russell Bryant
0522e3d872 Add a new module flag to indicate that a build sum is present. Modules built
against older Asterisk 1.4 headers will now load properly with just a warning
indicating that they are old and may cause problems.
(patch by paravoid)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91501 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-06 19:11:35 +00:00
Joshua Colp
6af6d06e75 Fix various in the udptl implementation. It could return empty modem frames, have an incorrect sequence number on packets, and display the wrong sequence number in the debug messages.
(closes issue #11228)
Reported by: Cache
Patches:
      udptl-4.patch uploaded by dimas (license 88)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-06 16:49:42 +00:00
Joshua Colp
4edfc25a1f Add support for accepting and sending T.38 in the initial INVITE.
(closes issue #9402)
Reported by: thdei


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91439 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-06 16:14:26 +00:00
Olle Johansson
95dce3bbba Make sure logger is reloaded at general reload in the cli.
(Discovered during Asterisk training in Portugal)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91366 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-06 12:54:11 +00:00
Mark Michelson
41661777a4 Reverting extra stuff I didn't mean to commit
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91292 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-05 22:57:13 +00:00
Mark Michelson
a1a592f3f0 The 'G' option for Dial() did not properly handle the case where only a label was
provided. This was due to the fact that the answering channel did not have an extension
set, so ast_parseable_goto would fail. This fix eliminates the call to ast_parseable_goto
on the answering channel since it is a wasteful call. The answering channel and the calling
channel are both directed to the same extension and context, just different priorities, so
we can just copy the values from the calling channel to the answering channel and increment
the answering channel's priority.

(closes issue #11382, reported by jon, patch by me with correction by jon)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-05 22:35:52 +00:00
Tilghman Lesher
7f7029e090 Upgrade to the latest version of extra sounds
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-05 21:38:13 +00:00
Russell Bryant
a4137c3fbe Make the lock in the threadstorage debugging code untracked to avoid a deadlock
on thread destruction.

(closes issue #11207)
Reported by: ys
Patches:
      threadstorage.c.diff uploaded by ys (license 281)

Also fixes an open bug report: (closes issue #11446)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91192 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-05 17:31:42 +00:00
Russell Bryant
82257a7e33 When DEBUG_THREADS is enabled, we only have the details about who is holding
a lock that we are waiting on for a mutex, not rwlocks.  This should fix the
problem where people have reported "core show locks" crashing sometimes.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91074 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-05 00:48:47 +00:00
Russell Bryant
eccfefae2c Fix some crashes in chan_iax2 that were reported as happening on Mac systems.
It turns out that the problem was the Mac version of the ast_atomic_fetchadd_int()
function.  The Mac atomic add function returns the _new_ value, while this function
is supposed to return the old value.  So, the crashes happened on unreferencing
objects.  If the reference count was decreased to 1, ao2_ref() thought that it
had been decreased to zero, and called the destructor.  However, there was still
an outstanding reference around.

(closes issue #11176)
(closes issue #11289)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-05 00:35:31 +00:00
Russell Bryant
fc232a9a27 Modify file.h to maintain API compatibility with earlier versions. If a recent
compiler is being used, then a warning will show up for any modules still using
the old name "private" instead of "_private".
(patch suggested by paravoid)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@91032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-04 23:46:40 +00:00
Russell Bryant
644c7a89e7 Make some changes to some additions I made recently for doing channel autoservice
when looking up extensions.  This code was added to handle the case where a
dialplan switch was in use that could block for a long time.  However, the way
that I added it, it did this for all extension lookups.  However, lookups in the
in-memory tree of extensions should _not_ take long enough to matter.  So, move
the autoservice stuff to be only around executing a switch.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90967 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-04 19:57:39 +00:00
Jason Parker
5376122015 If we fail to create a channel after allocating a timing fd, we need to make sure to close it.
Issue 11454, patch by eliel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90876 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-04 17:28:08 +00:00
Joshua Colp
335d271dda Fix build issue on the build cluster.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-04 05:29:33 +00:00
Tilghman Lesher
b8c8dee621 Solaris requires the inclusion of sys/loadavg.h for getloadavg().
Reported by: snuffy
Patch by: snuffy,tilghman
(Closes issue #11430)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90753 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-03 23:50:51 +00:00
Tilghman Lesher
2c651fc500 If both dbhost and dbsock were not set, a NULL deref could result
Reported by: xrg
Patch by: tilghman
(Closes issue #11387)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90736 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-03 23:23:55 +00:00
Mark Michelson
7b052b78e1 A big one...
This is the merge of the forward-loop branch. The main change here is that call-forwards can no longer loop.
This is accomplished by creating a datastore on the calling channel which has a linked list of all devices
dialed. If a forward happens, then the local channel which is created inherits the datastore. If, through this
progression of forwards and datastore inheritance, a device is attempted to be dialed a second time, it will simply
be skipped and a warning message will be printed to the CLI. After the dialing has been completed, the datastore
is detached from the channel and destroyed.

This change also introduces some side effects to the code which I shall enumerate here:

1. Datastore inheritance has been backported from trunk into 1.4
2. A large chunk of code has been removed from app_dial. This chunk is the section of code
   which handles the call forward case after the channel has been requested but before it has
   been called. This was removed because call-forwarding still works fine without it, it makes the
   code less error-prone should it need changing, and it made this set of changes much less painful
   to just have the forwarding handled in one place in each module.
3. Two new files, global_datastores.h and .c have been added. These are necessary since the datastore
   which is attached to the channel may be created and attached in either app_dial or app_queue, so they
   need a common place to find the datastore info. This approach was taken in case similar datastores are
   needed in the future, there will be a common place to add them.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-03 23:12:17 +00:00
Jason Parker
8315785663 Make sure we always close the conference fd if we have an open one.
Issue 11383, reported by markmhy, patch by eliel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-03 22:06:36 +00:00
Mark Michelson
d2d88e0f3d Changing some bad logic when calculating the interdigit timeout.
(closes issue #11402, reported and patched by eferro)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-03 20:59:51 +00:00
Jason Parker
8579b0ff93 Fix crash in ParkAndAnnounce application.
Issue #11436, reported by lytledd, patch by eliel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90607 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-03 20:51:17 +00:00
Joshua Colp
bae731053f Do not create a smoother for G723.1 frames, they need to be left alone to their native 20/24 byte size.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-03 20:05:42 +00:00
Joshua Colp
b18d1bdd1a Preserve the indication currently playing on a channel when a masquerade operation happens. (issue #BE-88)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90548 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-03 18:40:56 +00:00
Jason Parker
90edaee7dd Only log debug messages if debug is enabled.
Closes issue #11416, patch by casper.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-03 18:20:49 +00:00
Russell Bryant
d208d0fc37 The other day when I went through making changes as a result of the ao2_link()
change, I added some code to set pointers to NULL after they were unreferenced.
This pointed out that in this place, the object was unreferenced before the
code was done using it.  So, move the unref down a little bit.
(crash reported by jmls on IRC)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90470 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-02 18:18:52 +00:00
Tilghman Lesher
763b1ccecc Clarify the return value on autoservice. Specifically, if you started
autoservice and autoservice was already on, it would erroneously return an
error.
Reported by: adiemus
Patch by: dimas
(Closes issue #11433)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90432 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-02 09:34:23 +00:00
Russell Bryant
1f8caa100d Change the behavior of ao2_link(). Previously, in inherited a reference.
Now, it automatically increases the reference count to reflect the reference
that is now held by the container.

This was done to be more consistent with ao2_unlink(), which automatically
releases the reference held by the container.  It also makes it so it is
no longer possible for a pointer to be invalid after ao2_link() returns.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-30 19:26:04 +00:00
Russell Bryant
82757dfaa1 Add some notes on the behavior of ao2_unlink() after a discussion with Tilghman
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90310 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-30 18:46:46 +00:00
Joshua Colp
daf94226d5 Fix locking issues under one legged replaces scenarios.
(closes issue #11420)
Reported by: irroot
Patches:
      chan_sip_oneleg.patch uploaded by irroot (license 52)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-30 14:43:15 +00:00
Mark Michelson
a53959d666 Clear the DTMF buffer if the call times out.
(closes issue #11418, reported and patched by eferro)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90231 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-30 00:16:04 +00:00
Tilghman Lesher
f82f12d6b2 Properly escape cdr->src and cdr->dst and ensure we use thread-safe escaping
(Fixes AST-2007-026)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-29 19:48:10 +00:00
Mark Michelson
aafa661ed7 This patch handles the case where a queue member with a negative penalty is added
via the manager. If a negative value is submitted for a member penalty, we set it to 0.

(closes issue #11411, reported and patched by Laureano)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90163 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-29 19:38:39 +00:00
Tilghman Lesher
817da97389 Properly escape input buffers (Fixes AST-2007-025)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-29 19:24:11 +00:00
Tilghman Lesher
2c11f7d18e Use of "private" as a field name in a header file messes with C++ projects
Reported by: chewbacca
Patch by: casper
(Closes issue #11401)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90155 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-29 17:29:59 +00:00
Tilghman Lesher
e356cd95f3 Upgrade the core sounds release version
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-29 17:18:09 +00:00
Russell Bryant
c1556baa9f fix some formatting i accidentally changed
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90147 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-29 00:36:59 +00:00
Russell Bryant
2fc83c3db1 This set of changes is to make some callerID handling thread-safe.
The ast_set_callerid() function needed to lock the channel.  Also, the handlers
for the CALLERID() dialplan function needed to lock the channel when reading
or writing callerid values directly on the channel structure.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90145 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-29 00:20:34 +00:00
Russell Bryant
1380790b60 Merge a change from team/russell/chan_refcount ...
This makes ast_stopstream() thread-safe.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-29 00:06:08 +00:00
Joshua Colp
c24b0e152a Fix a few memory leaks.
(closes issue #11405)
Reported by: eliel
Patches:
      load_realtime.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-28 22:59:28 +00:00
Kevin P. Fleming
fc5429da7c it is impossible to set permissions for manager accounts created by users.conf (reported internally, patched by me)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-28 22:30:46 +00:00
Mark Michelson
815d77f1f6 Removing some seemingly pointless code. This sets a channel variable for every priority
executed in the dialplan if you have debug set to anything non-zero. This seems pointless
due to the fact that these channel variables are not referenced anywhere else in the code and
their names are esoteric enough that they would not be practical to reference in the dialplan. Plus
the fact that this behavior isn't documented anywhere means that the change is not likely to cause
any disruption. If anything, this may actually cause a slight performance increase if running with
debug on.

The motivating influence for this code change is the eventwhencalled option for queues. If set to
vars, all channel variables will be output to the manager. These unnecessary channel variables make
the output a lot more difficult to deal with.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90059 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-28 22:08:50 +00:00
Mark Michelson
f1d612adb9 Recording greetings when using IMAP storage was causing zero-length files to be stored.
Since greetings are not retrieved from IMAP anyway, it is pointless to attempt storing them there.

(closes issue #11359, reported by spditner, patched by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89999 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-28 17:30:47 +00:00
Russell Bryant
d0cd120d47 - update documentation for some of the goto functions to note that they
handle locking the channel as needed
 - update ast_explicit_goto() to lock the channel as needed


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-28 00:20:13 +00:00
Russell Bryant
1a6a5e1867 Don't do frame processing if ast_read() returned NULL.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 23:47:28 +00:00
Russell Bryant
a5c9a71b4e Instead of depending on the return value of ast_true(), explicitly set the
eventwhencalled variable to 1.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89844 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 23:21:13 +00:00
Russell Bryant
3df74ed9ac Don't start/stop autoservice in pbx_extension_helper() unless a channel exists
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 23:16:00 +00:00
Mark Michelson
a5db0a6103 Two changes with regards to the 'eventwhencalled' option of queues.conf
1) Due to some signed vs. unsigned silliness, setting 'eventwhencalled' to 
   'vars' or 'yes' did exactly the same thing. Thus the sign change of the
   ast_true call.

2) The vars2manager function overwrote a \n for every channel variable it parsed, resulting
   in bizarre output for the channel variables. This patch remedies this.

(related to issue #11385, however I'm not sure if this will actually be enough to close it)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89837 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 23:10:05 +00:00
Russell Bryant
80c81b8e8c Merge changes from team/russell/autoservice_1.4
This set of changes fixes an issue that was reported to me on IRC yesterday.
The user, d1mas, was using chan_zap for incoming calls and was having DTMF
recognition issues in some situations.  Specifically, he noticed that the 
problem occurred when using DISA or WaitExten.  He also noticed that when 
using Read, the problem did not occur.  His system also used DUNDi for 
dialplan lookups.

So, he theorized that if the DUNDi lookups blocked for some period of time,
that audio from the zap channel could get lost.  If the audio got lost, then
it wouldn't be run through the DTMF detector, and digits could get lost.
He was correct, and the following set of changes fixes the problem.  However,
the changes go a little bit further than what was necessary to fix this exact
problem.

1) I updated pbx_extension_helper() to autoservice the associated channel to
   handle cases where extension lookups may take a long time.  This would
   normally be a dialplan switch that does some lookup over the network, such
   as the DUNDi or IAX2 switches.

   This ensures that even while a DUNDi lookup is blocking, the channel will be
   continuously serviced.

2) I made a change to the autoservice code.  This is actually something that
   has bothered me for a long time.  When a channel is in autoservice, _all_
   frames get thrown away.  However, some frames really shouldn't be thrown
   away.  The most notable examples are signalling (CONTROL) frames, and DTMF.

   So, this patch queues up important frames while a channel is in autoservice.
   When autoservice is stopped on the channel, the queued up frames get stuck
   back on the channel so that they can get processed instead of thrown away.

3) I made another change to the autoservice code to handle the case where
   autoservice is started on channels recursively.

   Previously, you could call ast_autoservice_start() multiple times on a
   channel, and it would stop the first time ast_autoservice_stop() gets
   called.  Now, it will ensure that autoservice doesn't actually stop until
   the final call to ast_autoservice_stop().


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 21:45:51 +00:00
Mark Michelson
601df8f699 Changing some calls from free() to ast_free() since they were allocated with
ast_calloc().

(closes issue #11390, reported and patched by Laureano)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 20:22:59 +00:00
Kevin P. Fleming
2fa2fea3f5 on second thought... revert all the other changes i've made in app options parsing leaving only one: if an empty argument is supplied for an option, set that argument pointer to point to an empty string rather than NULL, so that the application can do normal checks on it without worrying about it being NULL
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89709 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 20:16:56 +00:00
Kevin P. Fleming
e31c1b0441 generate a warning when an application option that requires an argument is ignored due to lack of an argument
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 19:36:55 +00:00
Russell Bryant
d96a341228 Add a note to the sample voicemail config noting that when using IMAP storage,
only the first format specified will be attached to the message.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89634 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 16:12:33 +00:00
Tilghman Lesher
1d33d680b9 Default result of STAT should be "0" not "".
Reported via the -users mailing list, fixed by me.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 15:38:03 +00:00
Olle Johansson
0c3ec937ce If we get a codec offer using a well-known payload type, but using it for another
codec that we don't know, Asterisk did not remove that codec from the list.

With this patch, we remove the codec from audio and video rtp objects and
deny it ever existed. Thanks to lasse for testing.

(closes issue #11376)
Reported by: lasse
Patches: 
      bug11376.txt uploaded by oej (license 306)
Tested by: lasse


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89630 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 15:23:17 +00:00
Olle Johansson
8b650ee007 Clarify limitonpeers=yes
(closes issue #11304)
Reported by: pj



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89624 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 07:34:19 +00:00
Steve Murphy
1975b6e753 closes issue #11379; OK, this is an attempt to make both sides happy. To the cdr.conf file, I added the option 'unanswered', which defaults to 'no'. In this mode, you will see a cdr for a call, whether it was answered or not. The disposition will be NO ANSWER or ANSWERED, as appropriate. The src is as you'd expect, the destination channel will be one of the channels from the Dial() call, usually the last in the list if more than one chan was specified. With unanswered set to 'yes', you will still see this cdr entry in both cases. But in the case where the dial timed out, you will also see a cdr for each line attempted, marked NO ANSWER, with no destination channel name. The new option defaults to 'no', so you don't see the pesky extra cdr's by default, and you will not see the irritating 'not posted' messages.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 06:24:02 +00:00
Mark Michelson
7166081028 After issuing a "say load new", if a caller hangs up during the middle of playback of a number,
app_playback will continue to try to play the remaining files. With this change, no more files will
be played back upon hangup.

(closes issue #11345, reported and patched by IgorG)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-26 23:10:49 +00:00
Mark Michelson
f669a1c661 After issuing a "say load new" tons of warning messages are printed
out to the CLI every time do_say in app_playback is called. Removing these
warnings



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-26 23:02:30 +00:00
Joshua Colp
aeed294b7b Fix issues with async dialing with an application executing. The application has to be terminated and control returned to the thread before hanging things up. (issue #BE-252)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-26 21:10:29 +00:00
Joshua Colp
4ac8f69d0a Add module counting removal for error conditions.
(closes issue #11333)
Reported by: Laureano
Patches:
      res_features_v2.c.patch uploaded by Laureano (license 265)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-26 18:02:56 +00:00
Russell Bryant
a17edf7d99 Add channel locking to a function that needed to be doing it. This is just a
little something I noticed while working on a completely unrelated issue.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89594 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-26 17:41:04 +00:00
Joshua Colp
107209927a Use ast_free to free memory, or else we shall implode if MALLOC_DEBUG is enabled.
(closes issue #11347)
Reported by: ys
Patches:
      pbx.pbx_config.c.diff uploaded by ys (license 281)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-26 17:36:45 +00:00
Joshua Colp
19fc56c14d Close the audio file before sending it to the post processing application.
(closes issue #11357)
Reported by: reformed
Patches:
      mixmonitor.patch uploaded by reformed (license 330)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89587 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-26 17:20:58 +00:00
Kevin P. Fleming
daea9fd8e8 when parsing application options that take arguments, don't indicate that the option was supplied unless a non-zero-length argument was found for it
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89586 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-26 17:20:36 +00:00
Mark Michelson
5efa50746e Revert vmu->email back to an empty string if it was empty when imap_store_file
was called. This prevents sending a duplicate e-mail. 

(closes issue #11204, reported by spditner, patched by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-26 15:48:06 +00:00
Joshua Colp
c93621d1ec If channel allocation fails because the alert pipe could not be created also free the scheduler context.
(closes issue #11355)
Reported by: eliel
Patches:
      main.channel.c.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89577 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-26 15:34:38 +00:00
Joshua Colp
1884c603d6 When unloading app_meetme destroy any auto created contexts created by SLA.
(closes issue #11367)
Reported by: eliel


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-26 14:41:03 +00:00
Tilghman Lesher
095108273b We previously attempted to use the ESCAPE clause to set the escape delimiter to
a backslash.  Unfortunately, this does not universally work on all databases,
since on databases which natively use the backslash as a delimiter, the
backslash itself needs to be delimited, but on other databases that have no
delimiter, backslashing the backslash causes an error.

So the only solution that I can come up with is to create an option in res_odbc
that explicitly specifies whether or not backslash is a native delimiter.  If
it is, we use it natively; if not, we use the ESCAPE clause to make it one.

Reported by: elguero
Patch by: tilghman
(Closes issue #11364)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-25 17:17:10 +00:00
Tilghman Lesher
7808fb44f1 Free some frames that would otherwise leak on error.
Reported by: Laureano
Patch by: Laureano,tilghman
(Closes issue #11351)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-24 16:59:59 +00:00
Tilghman Lesher
e671cb909d Currently, zero-length voicemail messages cause a hangup in VoicemailMain.
This change fixes the problem, with a multi-faceted approach.  First, we
do our best to avoid these messages from being created in the first place,
and second, if that fails, we detect when the voicemail message is
zero-length and avoid exiting at that point.
Reported by: dtyoo
Patch by: gkloepfer,tilghman
(Closes issue #11083)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-24 06:19:23 +00:00
Tilghman Lesher
540a2c7098 Up until this point, the XML output of the manager has been technically
invalid, due to the repetition of certain parameters in a single event.
This caused various issues for XML parsers, some of which refused to parse
at all, given the invalidity of the rendered XML.  So this commit fixes
the XML output, ensuring that each entity parameter has a unique name, thus
ensuring valid XML.
Reported by: msetim
Patch by: tilghman
(Closes issue #10220)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-23 17:18:26 +00:00
Tilghman Lesher
528dd04ecb Use ESCAPE clause for the first parameter, not just 2nd-Nth parameters.
Reported by: apsaras
Patch by: tilghman
(Closes issue #11353)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89534 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-23 17:05:10 +00:00
Russell Bryant
53c77e38f4 mvanbaak pointed out a spelling error in this sample configuration file. While
I was at it, I went ahead and tweaked it a little bit more.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-22 17:29:41 +00:00
Mark Michelson
ddc5bf5b47 Fix a small error I made in my previous commit
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89495 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 19:27:51 +00:00
Mark Michelson
d105c24a57 Changing an inaccurate debug message to be less inaccurate. Under the circumstances, this
message would always report that there were 0 members available, even though that may not be true.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 19:24:22 +00:00
Terry Wilson
9c29d80d70 If a channel gets masqueraded in the middle of a park, don't play the
announcement to the masqueraded channel, and dial back to the original
channel on timeout.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89491 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 18:59:27 +00:00
Kevin P. Fleming
a90e90384c re-doxygen some comments
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 19:16:24 +00:00
Kevin P. Fleming
337fb0c37f bring back compile-option checking when loading modules, only this time use a string-based storage and comparison mechanism because it is easier to support on other platforms
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 19:12:52 +00:00
Mark Michelson
da4933e657 According to comments in main/pbx.c, it is essential that if we are going to lock
the conlock as well as the hints lock, it must be locked in that respective order.
In order to prevent a potential deadlock, we need to lock the conlock prior to 
locking the hints lock in ast_hint_state_changed (see the call stack example on
issue #11323 for how this can happen).

(closes issue #11323, reported  by eelcob, suggestion for patch by eelcob, patch by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89457 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 17:50:31 +00:00
Steve Murphy
8a1f941a17 closes issue #11324; break statements missing in switch cases.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 15:22:08 +00:00
Christian Richter
be20960013 added RR patch from iroot #10908, thanks.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 13:40:55 +00:00
Joshua Colp
34a3095877 Print out the correct filename (features.conf) in the log message when parkpos options are incorrect.
(closes issue #11295)
Reported by: Laureano
Patches:
      res_features.c.patch uploaded by Laureano (license 265)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89419 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19 15:53:32 +00:00
Joshua Colp
1bd082719f Clarify documentation a bit, include that a frame has to pass through the core in order for the Local channel optimization to happen.
(closes issue #11246)
Reported by: jon


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19 15:24:12 +00:00
Russell Bryant
12d60508f3 Temporarily revert revision 89325, which added md5 magic for keeping track of
what build options were used.  We agreed that we should remove this before
making a 1.4 release, and then we can put it back in.  Then, we can take a
month or so to play around with it to get it how we want it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 22:26:44 +00:00
Kevin P. Fleming
22b119d188 To help combat problems where people build external modules (asterisk-addons or others) and then change the build options of the Asterisk build in a way that makes the incompatible without warning, this commit introduces an MD5 signature of the important build-time options and includes that signature into modules when they are built. When the loader loads one of these modules and notices the problem, it will emit a warning to console and refuse to initialize the module, as doing so could cause the system to be unstable or even crash.
If you upgrade to this version of Asterisk, you must rebuild *all* of your modules that came from other sources before trying to run this version. If you are using Digium's G.729 binary codec module, you will need v33 or newer.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89325 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 16:47:46 +00:00
Mark Michelson
891b3bab2a Make realtime queues accessible from the QUEUE_MEMBER_COUNT function.
(closes issue #11271, reported and patched by atis, with small modifications from me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89323 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 15:28:22 +00:00
Tilghman Lesher
92d1018c2a Start Asterisk in Debian at a more reasonable time (since zaptel is at level 20)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15 18:37:38 +00:00
Tilghman Lesher
245abfa1c2 Fix an uninitialized memory read found by valgrind
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89301 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15 18:23:14 +00:00
Tilghman Lesher
f39db73930 Yet another memory corruption issue.
Reported by: atis
Patch by: tilghman
Fixes issue #10923


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15 18:05:56 +00:00
Russell Bryant
bd5b8a4014 Update the SLAStation application to account for the case where the SLA thread
has a call out to the station,  but the user has pressed a line button to answer
the call instead of picking up the handset.  If they do, the phone sends out a
new INVITE.  So, the SLAStation app must check to see if it is picking up a
ringing trunk, and ensure that the other stations stop ringing.

(reported internally, patched by me, tested by mogorman)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15 17:19:28 +00:00
Mark Michelson
1fece3bb67 Undoing previous commit since I realize it was wrong
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89288 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15 14:57:28 +00:00
Mark Michelson
88f847869d Adding a missing mutex unlock.
(closes issue 11256, reported and patched by ys)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15 14:54:10 +00:00
Olle Johansson
9d3be20a0d Don't send re-invites during pending INVITE transactions.
Patch by one47 - thanks!

Closes issue #9305


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89281 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15 11:26:22 +00:00
Olle Johansson
fc49ddab3a Improve support for multipart messages. Code by gasparz, changes
by me (mostly formatting). Thanks, gasparz!

Closes issue #10947


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89280 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15 11:15:09 +00:00
Tilghman Lesher
1af09c5f9d When a recording ends with '#', we are improperly trimming an extra 200ms from the recording.
Reported by: sim
Patch by: tilghman
Closes issue #11247


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14 23:23:58 +00:00
Joshua Colp
f3f12761ba Return the proper value when the srv_callback function executes properly.
(closes issue #11240)
Reported by: jtodd


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14 01:15:12 +00:00
Jason Parker
fb0bb38fc4 Fix building on newer systems which require a third arg to open() when using O_CREAT.
Issue 11238, reported by puzzled.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89254 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-13 21:07:08 +00:00
Jason Parker
b0e9d400ff Revert change from revision 67064.
It is documented behavior that if a parking extension already exists while using PARKINGEXTEN,
 dialplan execution will continue.  If blind transferring to a Park with PARKINGEXTEN, you
 must keep this in mind, and handle the failure yourself.

Issue 11237, reported by jon.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89248 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-13 19:47:45 +00:00
Tilghman Lesher
4332b72082 If we set a value for qualify, we should actually pay attention to it, instead of overriding the value
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-13 17:34:11 +00:00
Mark Michelson
dc6e3e9d5d Reverting commit made in revision 89205 since it is unnecessary.
Thanks to Kevin for pointing this out



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-13 16:02:02 +00:00
Tilghman Lesher
feed493993 Debugging is running into the 16-lock limit. Increase to avoid.
(This define is only effective when debugging is turned on, so there's
no effect for most installations.)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89239 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-13 13:51:53 +00:00
Mark Michelson
4155b5f984 Some sanity checking for MixMonitor. If only 1 argument is given, then the args.options
and args.post_process strings are uninitialized and could contain garbage. This change
handles this situation properly by only using arguments that we have parsed.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89205 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-13 00:56:46 +00:00
Jason Parker
05df1092da Fix a typo pointed out by De_Mon on #asterisk-dev
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-12 20:46:52 +00:00
Tilghman Lesher
472eb33648 If two config writes collide, file corruption could result. Use a mkstemp() file, instead.
Reported by: paravoid
Patch by: tilghman
Closes issue #10781


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89191 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-12 20:16:18 +00:00
Tilghman Lesher
1a052e0498 Fix two cases of memory corruption caused by background threads.
Reported by: atis
Patch by: tilghman
Fixes issue #10923


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-12 17:29:17 +00:00
Christian Richter
c2c1e68238 if we're NT and no number was dialed and overlapdial is set, we wait for the ISDN timeout instead of starting our own timer. added a comment for the misdn.conf.sample for the overlapdial config option.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-12 11:26:48 +00:00
Christian Richter
4e52dc67dc added restart all interfaces Restart_Indicator, to automatically send a RESTART after the L2 of a PTP Port comes up. Also fixed some places where we have send a RELEASE without need for it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89172 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-12 11:23:57 +00:00
Christian Richter
472f7a471c fixed a state/event issue with overlapdial=yes when no extension matched. removed the general sending of a RELEASE_COMPLETE when we receive a RELEASE, this is done by mISDNuser/mISDN. This makes it possible to use asterisk-1.4 with mISDN trunk, but requires users of mISDN/mISDNuser-1.1.X to upgrade to at least mISDNuser-1.1.6 (when using the NT mode at all)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-12 11:13:13 +00:00
Christian Richter
ad50f139c4 fixed the support for CW and therefore for the reject_cause option.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89170 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-12 09:57:23 +00:00
Christian Richter
57ccb76df1 aded ntkeepcalls option, to avoid droÃpping calls when the L2 goes down on a PTP link. There are some pbx which do turn off the L1 for a very short while and restart it immediately. normally T310 should be started and after 10 seconds or so the calls should be dropped, this is a simple fix wihtout this timer.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-12 09:45:36 +00:00
Jason Parker
76aa7c3767 Properly say the seconds here..
Issue 11203, fix described by vma.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08 23:52:35 +00:00
Mark Michelson
3b75ff9010 Rework of the commit I made yesterday to use the already built-in
ast_uri_decode function as opposed to my home-rolled one. Also added
comments.

Thanks to oej for pointing me in the right direction



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89119 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08 21:00:08 +00:00
Jason Parker
c170f694e7 Avoid warnings on load when using sample configuration files.
Issue 11195, patch by eliel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08 18:45:15 +00:00
Mark Michelson
9f5cf47a6f I made this same adjustment in trunk to fix a bug, and it makes sense to do it in 1.4 as
well. If an imapfolder is specified in voicemail.conf, don't ever explicitly connect to 
INBOX since it may not exist.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08 16:47:23 +00:00
Kevin P. Fleming
30cb593fd2 fix a glaring bug in the new SRV record handling that would cause incorrect weight sorting
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08 05:26:47 +00:00
Tilghman Lesher
7e81a39a81 Typo
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08 04:55:19 +00:00
Joshua Colp
3aea241b63 Do not add a sip: to the beginning of the To URI unless needed.
(closes issue #10756)
Reported by: goestelecom


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08 02:26:48 +00:00
Joshua Colp
0f1ef85f9a Improve the devicestate logic for multiple devices. If any are available then the extension is considered available.
(closes issue #10164)
Reported by: nic_bellamy
Patches:
      sip-hinting-svn-branch-1.4.patch uploaded by nic (license 299)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08 01:28:56 +00:00
Joshua Colp
53fd91490e Add support for allowing one outgoing transaction. This means if a response comes back out of order chan_sip will still handle it. I dream of a chan_sip with real transaction support.
(closes issue #10946)
Reported by: flefoll
(closes issue #10915)
Reported by: ramonpeek
(closes issue #9567)
Reported by: atca_pres


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89097 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08 01:11:25 +00:00
Joshua Colp
f1309f2c3f If callerid is configured in sip.conf use that for checking the presence of an extension in the dialplan.
(closes issue #11185)
Reported by: spditner


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-07 23:53:25 +00:00
Tilghman Lesher
45c16cc29b The member refcount must be incremented, to avoid using it after deallocation.
A huge thanks go to lvl- for patiently providing the necessary valgrind output
that was necessary to finding this problem of memory corruption.
Reported by: lvl-
Patch by: tilghman
Closes issue #11174


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-07 23:39:37 +00:00
Mark Michelson
0d76379f54 This patch makes it possible for SIP phones to dial extensions defined with '#' characters
in extensions.conf AND maintain their escaped characters when forming URI's

(closes issue #10681, reported by cahen, patched by me, code review by file)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-07 22:40:35 +00:00
Steve Murphy
164d8a5e61 In response to 10578, I just ran 1.4 thru valgrind; some of the config leakage I've already fixed, but it doesn't hurt to double check. I found and fixed leaks in res_jabber, cdr_tds, pbx_ael. Nothing major, tho.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-07 21:40:28 +00:00
Mark Michelson
63f6e6b023 Fixing a segfault in the manager "core show channels concise" command.
(closes issue #11183, reported by arnd and patched by ys)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89085 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-07 15:56:49 +00:00
Tilghman Lesher
645af85225 Suppress AEL warnings on load.
Reported by: eliel
Patch by: eliel
Closes issue #11178


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-07 04:07:49 +00:00
Russell Bryant
6e74f69b51 Fix init_classes() so that classes that actually do have files loaded aren't
treated as empty, and immediately destroyed ...


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 20:18:49 +00:00
Jason Parker
a0edd3f3f3 Correctly set the total number of channels from a zaptel transcoder board.
SPD-49, patch by Matthew Nicholson.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 19:09:30 +00:00
Tilghman Lesher
f75916e7be We went to the trouble of creating a method of tracking failed trylocks, then never turned it on (oops).
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 19:09:06 +00:00
Olle Johansson
044aa79799 Bug fixes to tdd support in zaptel.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 18:53:37 +00:00
Russell Bryant
3946288786 If someone were to delete the files used by an existing MOH class, and then
issue a reload, further use of that class could result in a crash due to
dividing by zero.  This set of changes fixes up some places to prevent this
from happening.

(closes issue #10948)
Reported by: jcomellas
Patches:
      res_musiconhold_division_by_zero.patch uploaded by jcomellas (license 282)
	  Additional changes added by me.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89037 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 18:20:07 +00:00
Steve Murphy
712b337863 closes issue #8786 - where the [catname](!) and [catname](othercat1,othercat2,...) notation gets dropped across a ConfigUpdate (or any other thing that would cause a config file to be written). While I was at it, I also cleaned up some of the destroy routines to free up comments, which was not being done. Made sure the new struct I introduced is also cleaned up properly at destruction time. My code handles multiple template inclusions. Many thanks to ssokol for his patch, which, while not literally used in the final merge, served as a foundation for the fix.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89036 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 17:52:50 +00:00
Joshua Colp
cac21aa19b Make it so that if a peer is determined to be unreachable using qualify their devicestate will report back unavailable.
(closes issue #11006)
Reported by: pj


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 17:08:05 +00:00
Joshua Colp
8b309c7bb9 Fix improbable but possible memory leaks in chan_zap.
(closes issue #11166)
Reported by: eliel
Patches:
      chan_zap.c.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88994 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 16:24:56 +00:00
Russell Bryant
c60344fd8e Remove some checks to see if locks are initialized from the non-DEBUG_THREADS
versions of the lock routines.  These are incorrect for a number of reasons:
 - It breaks the build on mac.
 - If there is a problem with locks not getting initialized, then the proper
   fix is to find that place and fix the code so that it does get initialized.
 - If additional debug code is needed to help find the problem areas, then this
   type of things should _only_ be put in the DEBUG_THREADS wrappers.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88931 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 13:50:15 +00:00
Kevin P. Fleming
2c76da2828 update comment to match the state of the code
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88862 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 02:52:05 +00:00
Mark Michelson
7b59a194a5 Reworked deadlock avoidance in __ast_read. Restored audio to
callback agents.

(closes issue #11071, reported by callguy, patched by me, tested by callguy and Ted Brown)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88826 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-05 23:29:29 +00:00
Russell Bryant
34002d567b After seeing crashes related to channel variables, I went looking around at the
ways that channel variables are handled.  In general, they were not handled in
a thread-safe way.  The channel _must_ be locked when reading or writing from/to
the channel variable list.

What I have done to improve this situation is to make pbx_builtin_setvar_helper()
and friends lock the channel when doing their thing.  Asterisk API calls almost 
all lock the channel for you as necessary, but this family of functions did not.

(closes issue #10923, reported by atis)
(closes issue #11159, reported by 850t)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-05 22:07:54 +00:00
Russell Bryant
ea00780d49 When traversing the list of channel variables here in transmit_invite(), the
asterisk channel must be locked, as this data may change at any time.

(I have seen numerous reports of crashes related to the handling of channel
variables.  There are a couple of issues on the bug tracker related to it,
but it has also been noted on IRC and mailing lists.  So, I am finding and
fixing some places where channel variables are handled improperly.) 


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-05 21:33:56 +00:00
Russell Bryant
69e42e6096 Fix up some indentation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88765 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-05 21:21:39 +00:00
Russell Bryant
5d140cb9c2 Merge changes from asterisk/team/kpfleming/SRV-priority-handling
Previously, the SRV record support in Asterisk was broken.  There was no
guarantee on what record Asterisk would choose to actually use.  This set of
changes improves the situation by ensuring that Asterisk will choose the
highest priority record.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-05 20:40:01 +00:00
Russell Bryant
9cb94c7cde Merge the last bit of changes from asterisk/team/russell/readq-1.4
The issue here is that the channel frame readq handling got broken when the
code was converted to use the linked list macros.  It caused corruption of the
list head and tail pointers.  So, I fixed up the usage of the linked list
macros and in passing, simplified the code.  I also documented what the code
is doing, as it was a bit difficult to figure out at first.

This bug showed itself with crashes showing messed up head/tail pointers for
the readq.  However, there are a couple of crashes that aren't quite as obvious,
but I think may be related.  So, if your bug gets closed by this commit, but
you still have a problem, please reopen or create a new bug report.

(closes issue #10936)
(closes issue #10595)
(closes issue #10368)
(closes issue #11084)
(closes issue #10040)
(closes issue #10840)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88709 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-05 20:11:04 +00:00
Joshua Colp
10c172eb00 If a SIP channel is put on hold multiple times do not keep incrementing the onHold value.
(closes issue #11085)
Reported by: francesco_r
Tested by: blitzrage
(closes issue #10474)
Reported by: acennami


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88671 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-05 18:47:13 +00:00
Russell Bryant
a3af50b67d Fix up datastore handling in ast_do_masquerade(). The code is intended to move
any channel datastores from the old channel to the new one.  However, it did
not use the linked list macros properly to accomplish the task.  The existing
code would only work if there was only a single datastore on the old channel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88624 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-05 17:46:02 +00:00
Jason Parker
7fa3a53ec2 Make sure we destroy the config structure on configuration failure.
Issue 11163, patch by eliel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-05 17:19:41 +00:00
Tilghman Lesher
1d5bf38048 Don't check used pooled connections for connection status, as it will cause issues for prepared queries.
Reported by: Nick Gorham (via -dev list)
Patch by: tilghman


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-05 16:20:13 +00:00
Luigi Rizzo
a0edff2477 Rename ast_string_field_free_pool to ast_string_field_free_memory,
and ast_string_field_free_all to ast_string_field_reset_all
to avoid misuse (due to too similar names and an error in
documentation). Fix two related memory leaks in app_meetme.

No need to merge to trunk, different fix already applied there.
Not applicable to 1.2



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-04 22:38:13 +00:00
Joshua Colp
986e8a3ae8 Make subscribecontext behave as advertised. It will now look for the presence of a hint in the given context (be it subscribecontext or context).
(closes issue #10702)
Reported by: slavon


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88366 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-02 20:49:45 +00:00
Joshua Colp
e49faa404a If an INFO request within a dialog is received with a content length of 0 simply send back a 200 OK. It is valid to do this and the remote side is probably using it to make sure the signalling is still alive.
(closes issue #5747)
Reported by: chandi
Patches:
      infofix-81430-1.patch uploaded by IgorG (license 20)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88328 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-02 20:20:21 +00:00
Jason Parker
fc0439dde4 We need to make sure to specify a language to ast_fileexists, otherwise it may fail for anything besides en
Issue 11147, fix discovered by both citats and myself (independently), with input from Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88283 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-02 16:51:08 +00:00
Tilghman Lesher
014b83fad6 Fix build on Solaris
Reported by: snuffy
Patch by: ys
Closes issue #11143


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-02 13:03:03 +00:00
Tilghman Lesher
9c6615d585 Add some notes on using valgrind
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88116 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-01 17:17:56 +00:00
Jason Parker
ac6218741f Make sure we set the poll fds to NULL after free()ing it.
Part of issue 11017, patch by tzafrir.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-01 16:21:22 +00:00
Joshua Colp
f66e8c91ea Fix up commit for my Zap channel with spies in Meetme fix. (thanks Tony Mountifield!)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@88026 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-01 13:27:37 +00:00
Joshua Colp
7ee6cdf0c7 If a Zap channel contains a spy or a spy is added take it out of the conference in kernel space and make it go through Asterisk so the spy gets audio from both sides.
(closes issue #10060)
Reported by: mparker


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-01 01:53:55 +00:00
Jason Parker
f43de2908a Make sure we free some allocated memory before returning.
Issue 11131, patch by eliel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87908 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-31 21:23:11 +00:00
Jason Parker
40cd95fc27 Don't try to allocate memory that we're just going to re-allocate later anyways.
Issue 11130, patch by eliel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-31 21:16:20 +00:00
Tilghman Lesher
ad17919cd8 Create samples for ALL of the available options in asterisk.conf
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-31 18:03:53 +00:00
Steve Murphy
3176ba94c3 closes issue #11108 -- where the 'dialplan save' cli command saves a file where the semicolon is not escaped. Fixed this; User also wanted comments to be preserved across dialplan save, but this is impossible at this point in time, because comments are not stored in the dialplan. They are 'compiled' out of extensions.conf. The only way to preserve those comments is to use the config file reader/writer that the GUI uses to allow online user edits. extensions.conf is first and foremost, a config file, and is read in by the normal config-file reading routines. Then, it is processed into a dialplan (context/exten structs).
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-31 17:49:39 +00:00
Steve Murphy
6addd141d9 Included some verbage in the check_includes func, to inform the user that included contexts that have no match in the AEL, might be OK, as AEL cannot check in the extensions.conf or the in-memory contexts, as they may not be there at the time of the check.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-31 03:51:52 +00:00
Tilghman Lesher
1d34377a9c Fix for uninitialized mutexes on *BSD
Reported by: ys
Fixed by: ys
Closes issue #11116


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87739 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-30 23:02:22 +00:00
Russell Bryant
1561187fc4 Merge the changes from team/russell/iax2_poke_fix and iax2-poke-fix-trunk
There was a race condition related to the handling of POKEing peers.  Essentially, 
a reference to a peer is held by the scheduler when there are pending callbacks, 
but the reference count didn't reflect it.  So, it was possible for a peer to hit
a reference count of zero and have its destructor begin to be called at the same
time that the scheduler thread ran a POKE related callback.  If that happened,
a crash would likely occur.

(closes issue #11082, closes issue #11094)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87686 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-30 21:19:09 +00:00
Jason Parker
fc51acbc73 Only try to clean out h323/ if the h323/Makefile exists.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87650 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-30 20:29:41 +00:00
Joshua Colp
8f4659cc89 Add two more checks before printing out a warning message about bridging. If either channel has hungup of course the bridge will have failed.
(closes issue #10009)
Reported by: dimas


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-30 16:13:39 +00:00
Jason Parker
4df0c83be7 Fix build of editline on Solaris.
Issue 11113, patch by snuffy.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-30 15:45:35 +00:00
Joshua Colp
06e768e60d Return 1.4 to a state where it builds. Changing the arguments to a function and not changing where they are used is bad, mmmk?
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87534 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-30 15:10:13 +00:00
BJ Weschke
c0d2b5b16d Fix issue where the recorded name wasn't getting removed correctly.
(closes issue #11115) 
 Reported by: davevg
 Patches:
    followme-v3.diff


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87514 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-30 14:31:45 +00:00
Kevin P. Fleming
8fc2e21cb9 missed one directory
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-29 22:13:51 +00:00
Kevin P. Fleming
f0c0dfe1f1 clean up (and ignore) assembler and preprocessor intermediate files if any are created during the build
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-29 22:12:16 +00:00
Kevin P. Fleming
bb778cb3b9 don't put '-pipe' into ASTCFLAGS if '-save-temps' is already there (used when debugging preprocessor issues) because the compiler will whine about each compile command
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87460 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-29 22:04:29 +00:00
Mark Michelson
a4c50fdd7b Removing a completely unnecessary quota check from IMAP code.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-29 21:06:31 +00:00
Russell Bryant
b2382349dc Add some more details to the output of "core show locks". When a thread
is waiting for a lock, this will now show the details about who currently
has it locked.
(inspired by issue #11100)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87396 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-29 20:22:07 +00:00
Russell Bryant
fd7bc75ce9 Remove a lock that doesn't make any sense. The regions lock needs to be held
when traversing the list of allocated chunks so that they can be printed out
to the CLI.
(Thanks to eliel on #asterisk-dev for pointing this out!)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-29 19:21:06 +00:00
Joshua Colp
143536912e Fix issue where if both sides of the dialog cancelled the dialog at the same time chan_sip could kepe retransmitting a response for no reason.
(closes issue #9566)
Reported by: atca_pres
Patches:
      bug9566.patch uploaded by oej


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87342 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-29 17:20:28 +00:00
Jason Parker
71319ccaa9 Allow some function modules to compile under dev mode.
Issue 11104, patch by andrew.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87340 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-29 17:13:04 +00:00
Joshua Colp
7fc2c32a92 Fix issue with ast_unescape_semicolon going into an endless loop.
(closes issue #10550)
Reported by: ramonpeek
Patches:
      unescape-85177-1.patch uploaded by IgorG (license 20)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-29 14:23:49 +00:00
Tilghman Lesher
18eafd3074 Add autoservice to several more functions which might delay in their responses.
Also, make sure that func_odbc functions have a channel on which to set
variables.
Reported by russell
Fixed by tilghman
Closes issue #11099


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-28 13:46:55 +00:00
Steve Murphy
4c7393a6a4 closes issue #11086 where a user complains that references to following contexts report a problem; The problem was REALLy that he was referring to empty contexts, which were being ignored. Reporter stated that empty contexts should be OK. I checked it out against extensions.conf, and sure enough, empty contexts ARE ok. So, I removed the restriction from AEL. This, though, highlighted a problem with multiple contexts of the same name. This should be OK, also. So, I added the extend keyword to AEL, and it can preceed the 'context' keyword (mixed with 'abstract', if nec.). This will turn off the warnings in AEL if the same context name is used 2 or more times. Also, I now call ast_context_find_or_create for contexts now, instead of just ast_context_create; I did this because pbx_config does this. The 'extend' keyword thus becomes a statement of intent. AEL can now duplicate the behavior of pbx_config,
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-26 16:34:02 +00:00
Tilghman Lesher
aa7f0bf1b2 The addition of autoservice to func_curl additionally made func_curl dependent
on the existence of a channel, with no real reason.  This should make func_curl
once again work without a channel.
Reported by jmls.
Fixed by tilghman.
Closes issue #11090


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-26 13:54:30 +00:00
Kevin P. Fleming
214a5ca25e appending one list to another should leave the first list empty, and not require the user to do that
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-25 23:03:11 +00:00
Tilghman Lesher
5ee24bef92 Backport alternate encoding of newline delimiters from trunk to 1.4, as approved by Russell
Reported by blitzrage
Closes issue #10903


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-25 22:53:06 +00:00
Jason Parker
1b7b80da3a Correctly respect hidecalleridname configuration option.
Simplify code slightly in the process.

Issue 11079, reported by ddv2005


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86982 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-24 20:56:47 +00:00
Steve Murphy
94aabf9844 closes issue #11037 -- unable to specify app:spec in hint arguments
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-24 04:14:28 +00:00
Steve Murphy
9ecad31855 closes issue #11052 -- where nothing after the ? will allow un-initialized variable values to corrupt and crash asterisk on 64-bit platforms
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-23 21:18:08 +00:00
Steve Murphy
ea4525e780 this update to Makefile corrects how ast_expr2f.c should be generated
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-23 20:22:25 +00:00
Steve Murphy
0f7198f227 This should get rid of a really, really irritating warning generated by some 64-bit platforms from libc, where free(0) is frowned upon
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-23 20:20:54 +00:00
Russell Bryant
d18ac4dcca If lock tracking is not enabled, then we can not attempt to log any mutex
failures.  If so, we could end up in infinite recursion.  The only lock that
is affected by this is a mutex in astmm.c used when MALLOC_DEBUG is enabled.

(closes issue #11044)
Reported by: ys
Patches:
      lock.h.diff uploaded by ys (license 281)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86836 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 21:36:12 +00:00
Tilghman Lesher
992f4d1aeb Minor FreeBSD build fix
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 17:38:13 +00:00
Joshua Colp
d6d7384355 After reading online I have confirmed that Record-Route headers should be copied to 1xx responses as well.
(closes issue #10113)
Reported by: makoto


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86756 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 16:35:22 +00:00
Joshua Colp
27ab9bdd82 Make sure res is a positive value before performing the check to determine whether the user stopped it or not.
(closes issue #11023)
Reported by: cfc


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86754 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 16:15:18 +00:00
Russell Bryant
20ce142d01 Don't leak a frame in the case that an END frame is received and the time since
the BEGIN is less than that of the defined minimum DTMF duration.

(closes issue #11051)
Reported by: casper
Patches:
      channel.c.86664.diff uploaded by casper (license 55)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 15:52:48 +00:00
Russell Bryant
6f9f535896 Update the static mutex initializer to include the initialization of
the internal mutex used to protect the lock debugging data.
(closes issue #11044, patch suggested by Ivan)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 15:43:30 +00:00
Mark Michelson
222302c0a2 Account for the fact that sometimes headers may be terminated with \r\n instead of just \n
(closes issue #11043, reported by yehavi)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86694 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 14:48:46 +00:00
Joshua Colp
0e9071a2e3 Move log message to before the frame it references is freed.
(closes issue #11050)
Reported by: slavon
Patches:
      channel.c.86662.diff uploaded by casper (license 55)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 14:27:03 +00:00
Joshua Colp
796cc69527 Fix tab completion for dundi show peer.
(closes issue #11041)
Reported by: jsmith
Patches:
      asterisk-dundicomplete.diff.txt uploaded by jamesgolovich (license 176)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86661 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 14:05:26 +00:00
Joshua Colp
fb53e2a7f5 Fixes for building under OpenSolaris.
(closes issue #11047)
Reported by: snuffy
Patches:
      11047-fixes.diff uploaded by snuffy (license 35)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86630 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 13:33:23 +00:00
Christian Richter
e4df4c58ec we send DISCONNECT instead of RELEASE/RELEASE_COMPLETE if the dialplan does not match after an overlap call. Also added out_cause=1
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 09:21:15 +00:00
Joshua Colp
e2dcbeda0c When returning a DTMF digit from ast_control_streamfile cast it as a char so that 0 does not overlap with the success return code.
(closes issue #11023)
Reported by: cfc


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86502 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-19 16:38:29 +00:00
Joshua Colp
a5b69b3583 Fix two issues with domains and transfers. If a port was given in the hostname it was treated as part of the hostname. If domains were configured but external domains were not enabled all transfers would be considered remote.
(closes issue #11027)
Reported by: ramonpeek
Patches:
      11027-1.diff uploaded by ramonpeek (license 266)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-19 15:33:49 +00:00
Joshua Colp
918ee9ae5b Set port number in received as information for registrations as well.
(closes issue #11028)
Reported by: brad-x


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-19 15:08:12 +00:00
TransNexus OSP Development
36ffd8e75b Fixed OSP module did not report source/devinfo IP in correct format.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86438 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-19 01:45:53 +00:00
Jason Parker
1e9e35c081 Correct documentation. I removed the wrong line..
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-18 22:01:02 +00:00
Jason Parker
7c84082d13 Add documentation for options in asterisk.conf
Issue 11029, patch by eserra


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-18 21:58:44 +00:00
Russell Bryant
74450c6eff Revert erroneous commit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86372 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-18 21:16:47 +00:00
Russell Bryant
236872e7c4 Add support for setting the maximum trunk size for IAX2 trunking
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86371 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-18 21:14:15 +00:00
Russell Bryant
9df6ebe9b9 The channel needs to stay locked while running timer callbacks, as they access
and modify channel data that may change elsewhere.  I went through every timer
callback in the source tree to make sure that none of them did any additional
locking that could introduce deadlocks, and all is well.

(closes issue #10765)
Reported by: Ivan
Patches:
      ast_1_4_11_svn_patch_channel_rc.diff uploaded by Ivan (license 229)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-18 18:03:10 +00:00
Mark Michelson
c9935ba132 If a non-existent file is specified to be played either as a periodic announcement
or as a hold/position announcement, the caller would be kicked out of the queue.
No longer does this happen.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86328 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-18 17:38:26 +00:00
Russell Bryant
f5fd6e1cb1 Execute the RELEASE operation on transcoder channels in the destroy callback.
(patch from jsloan)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-18 15:45:55 +00:00
Russell Bryant
9fcc010cce Revert a change that I made for issue #10979 which, as has been pointed out to
me in issue #11018, doesn't really make sense.  There is no reason to have
the base64 decode function force a '\0' terminated buffer, when the result is
almost always binary, anyway.  In fact, this caused some breakage, as some code
in res_crypto passed in a buffer exactly the right size to get its binary
result, which got stomped on by this patch.

(closes issue #11018, reported by dimas)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-18 04:40:52 +00:00
Mark Michelson
cb55155ef1 Changing the strategy field of the call_queue struct to be signed instead of unsigned,
since the code attempts to set the strategy to -1 if you specify a bogus strategy.
While this isn't a huge issue in 1.4, it could be a problem for someone who, say, tries
to use the roundrobin strategy in trunk (despite all the deprecation warnings in 1.4).



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86202 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-17 21:39:05 +00:00
Russell Bryant
ed426a7165 If Asterisk is in the middle of shutting down, respond to OPTIONS
with 503 Unavailable.

(closes issue #10994)
Reported by: eserra
Patches:
      sip-options-503.patch uploaded by eserra (license 45)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86149 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-17 17:57:45 +00:00
Joshua Colp
faf4b212eb Whoops, forgot to remove the original sip_scheddestroy.
(closes issue #11010)
Reported by: vadim


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86117 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-17 16:58:03 +00:00
Tilghman Lesher
d2c10c49fa When runuser/rungroup is specified, a remote console could only be attained by root
(Closes issue #9999)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-17 15:23:51 +00:00
Joshua Colp
c9638888aa Don't schedule dialog destruction if a MESSAGE is received using an existing dialog.
(closes issue #11010)
Reported by: vadim


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-17 15:06:36 +00:00
Mark Michelson
098d0142fd Since monitor-join is deprecated now, remove the example from the sample queues.conf file
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16 23:35:31 +00:00
Mark Michelson
c3e4d3d02d Updating UPGRADE.txt to reflect the deprecation of the monitor-join
queue option



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86031 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16 23:16:08 +00:00
Mark Michelson
1ced2ef939 Adding deprecated warning to monitor-join option, since the plan is to
no longer support this in favor of monitor-type = mixmonitor

(related to issue #10885)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16 22:49:10 +00:00
Russell Bryant
6f38c9d211 really picky formatting tweak ...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16 22:36:16 +00:00
Russell Bryant
7cd8afd1ea Some locking errors exposed the fact that the lock debugging code itself was
not thread safe.  How ironic!  Anyway, these changes ensure that the code that
is accessing the lock debugging data is thread-safe.  

Many thanks to Ivan for finding and fixing the core issue here, and also 
thanks to those that tested the patch and provided test results.

(closes issue #10571)
(closes issue #10886)
(closes issue #10875)
(might close some others, as well ...)

Patches: (from issue #10571)
      ivan_ast_1_4_12_rel_patch_lock.h.diff uploaded by Ivan (license 229)
       - a few small changes by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85994 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16 22:14:36 +00:00
Mark Michelson
eb154e963c Trying to remove a non-dynamic queue member via dynamic means can lead to some
interesting (read nasty) situations. This patch clears up the issue by making
only dynamic queue members removable via dynamic methods.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16 21:14:34 +00:00
Tilghman Lesher
17ee21bf18 Also set up gmtoff (this is used in the %z gnu extension to strftime)
Reported and fixed by jcmoore
Closes issue #11002


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16 19:41:40 +00:00
Russell Bryant
f192689840 Remove a pointless lock.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16 19:10:01 +00:00
Mark Michelson
661aa4ba35 Fixing a double free which happens in the statechange thread.
(closes issue #10987, reported by andrew)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16 15:21:58 +00:00
Joshua Colp
ed25613860 Check to make sure a value has been given to the VMCOUNT dialplan function.
(closes issue #10996)
Reported by: marsosa


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16 14:52:22 +00:00
Joshua Colp
3a935a35a0 Fix memory allocation issue in threadstorage.
(closes issue #10995)
Reported by: snuffy
Patches:
      new-patch.diff uploaded by snuffy (license 35)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16 14:19:39 +00:00
Philippe Sultan
ab36dd5843 Fix the output for this channel help CLI command
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85800 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16 10:46:13 +00:00
Russell Bryant
d63883be92 Ensure that no pending state changes are leaked when the device state change
thread gets stopped on module unload.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85720 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 21:10:02 +00:00
Russell Bryant
87dc20fc03 Previously, app_queue created a thread to handle every single device state
change.  I changed this a while ago in trunk for performance reasons.  However,
bug 8407 points out that it is actually a race condition, causing device state
changes to get processed in random order.  So, I backported my changes from
trunk to 1.4.
(closes issue #8407, patch provided by tim_ringenbach, committed patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 20:59:27 +00:00
Tilghman Lesher
47b21bae6e Don't execute a gosub if the arguments is zero-len (not just NULL)
Reported by davevg
Fixed by me
Closes issue #10985


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 20:29:35 +00:00
Russell Bryant
d47ebb492f Add a small fix for the tw version of saying dates.
(closes issue #7827)
Reported by: sharkey
Patches: 
      say.nits.patch uploaded by sharkey (license 172)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85686 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 20:21:27 +00:00
Jason Parker
eb9c632b90 Properly use DESTDIR in 'config' target.
Do not try to run chkconfig or similar if using DESTDIR.

Issue 10938, patch by cabal95.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 20:15:51 +00:00
Russell Bryant
02bb2bcbaa Be pedantic about handling memory allocation failure.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 19:22:45 +00:00
Russell Bryant
9c47228dff The loop in the handler for the "core show locks" could potentially block for
some amount of time.  Be a little bit more careful and prepare all of the
output in an intermediary buffer while holding a global resource.  Then, after
releasing it, send the output to ast_cli().


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 19:11:38 +00:00
Russell Bryant
3ba62c30b9 Make the default for the srvlookup option to be yes. It doesn't really make
sense for it to default to off.  The default configuration file has it on, and
proper RFC behavior, as indicated by a comment in the code, is for it to be on.
So, let's have it on by default to make lives easier.
(closes issue #10954, suggested by jtodd)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85604 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 16:54:57 +00:00
Joshua Colp
0912ca3c07 Document that DTMF based features only work when two channels are bridged together.
(closes issue #10773)
Reported by: pbayley


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 16:39:59 +00:00
Russell Bryant
6b9addb181 Make a few changes so that characters in the upper half of the ISO-8859-1
character set don't get stripped when reading configuration.
(closes issue #10982, dandre)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 16:34:13 +00:00
Joshua Colp
0f3e461074 Bring both DTMF begin and end frames up through to the core for DTMF feature handling.
(closes issue #10826)
Reported by: dimas


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 16:22:02 +00:00
Russell Bryant
ca69081253 Ensure the buffer passed to ast_canmatch_extension() is properly initialized so
that it is null terminated.

(issue #10977)
Reported by: dimas
Patches: 
      pbxdundi.patch uploaded by dimas (license 88)
	    - small mods by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 15:40:45 +00:00
Joshua Colp
3cc997694d If Monitor or a spy was added to a P2P or native bridged channel bring the channel back to the generic bridging core so the monitor or spy operations work.
(closes issue #10943)
Reported by: julianjm


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 14:55:04 +00:00
Russell Bryant
b5addcd9a5 Suppress a LOG_DEBUG message if debug is not enabled.
(closes issue #10980)
Reported by: casper
Patches: 
      db.c.84633.diff uploaded by casper (license 55)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85548 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 13:16:23 +00:00
Russell Bryant
39f5611898 Make sure remote consoles unmute themselves again after reconnecting.
(closes issue #10847)
Reported by: atis
Patches: 
      console_unmute_on_reconnect.patch uploaded by atis (license 242)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 13:05:45 +00:00
Russell Bryant
9b382ca76f Make sure that the base64 decoder returns a terminated string.
(closes issue #10979)
Reported by: ys
Patches: 
      util.c.diff uploaded by ys (license 281)
	    - small mods by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 12:48:10 +00:00
Russell Bryant
91bfacc3ed Don't create the context for users in users.conf until we know at least one user exists.
(closes issue #10971)
Reported by: dimas
Patches: 
      pbxconfig.patch uploaded by dimas (license 88)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-14 15:24:52 +00:00
Tilghman Lesher
81a5da0ada Remove deprecated syntax from sample ael file
Reported and patched by: dimas
Closes issue #10967


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-13 15:26:01 +00:00
Russell Bryant
bad30446a6 Fix an issue with console verbosity when running asterisk -rx to execute a command
and retrieve its output.  The issue was that there was no way for the main Asterisk
process to know that the remote console was connecting in the -rx mode.  The way that
James has fixed this is to have all remote consoles muted by default.  Then, regular
remote consoles automatically execute a CLI command to unmute themselves when they
first start up.

(closes issue #10847)
Reported by: atis
Patches: 
      asterisk-consolemute.diff.txt uploaded by jamesgolovich (license 176)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-13 05:48:10 +00:00
Russell Bryant
6c18b111b9 Properly handle the case where read() may return the text for more than one
CLI command at once for a remote console.

(closes issue #10888)
Reported by: jamesgolovich
Patches: 
      asterisk-climultiple.diff.txt uploaded by jamesgolovich (license 176)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85532 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-13 05:24:33 +00:00
Tilghman Lesher
1e95206c51 Change Digium address
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-12 18:30:55 +00:00
Russell Bryant
9723b7d878 Fix a spelling error in a log message. SMDI, not SDMI.
(closes issue #10959)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-12 15:45:09 +00:00
Russell Bryant
c27db984f9 Fix the potential use of an uninitialized buffer in a log message.
(closes issue #10958)
Reported by: dimas
Patches: 
      realtime.patch uploaded by dimas (license 88)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85515 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-12 15:40:35 +00:00
Joshua Colp
437a6ffcd3 When creating a new packet don't try to stop retransmission of it. It was just allocated/created so it's impossible for it to have already been scheduled.
(closes issue #10945)
Reported by: flefoll
Patches:
      chan_sip.c.br14.85280.xmit_reliable-patch uploaded by flefoll (license 244)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85397 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-11 15:26:20 +00:00
Tilghman Lesher
18fa561af4 A dollar sign by itself, not indicating a start of a variable or expression prematurely ends substitution (closes issue #10939)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85356 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-11 04:35:33 +00:00
Russell Bryant
863ae211da I introduced a new member to the ast_filestream struct in 1.4.12, but put it
in the middle of the struct, instead of at the end.  One of the Debian folks,
paravoid, pointed out that this breaks binary compatability with modules
compiled against older headers.  So, I'm moving the new member to the end
of the struct to resolve the situation.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-10 15:56:23 +00:00
Mark Michelson
30b6db4bcf The thread ID should be unsigned.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85315 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-10 15:51:56 +00:00
Joshua Colp
3b9fafc1e0 If devicestate is passed a port number strip it out.
(closes issue #10930)
Reported by: ibc


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85280 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-10 14:42:00 +00:00
Joshua Colp
e568fc66d9 Add support for handling a 182 Queued response.
(closes issue #10924)
Reported by: ramonpeek
Patches:
      queued-182.diff uploaded by ramonpeek (license 266)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-10 14:28:18 +00:00
Mark Michelson
deb480f124 A bunch of changes from sprintf to snprintf.
See security advisory AST-2002-022



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-10 14:26:31 +00:00
Joshua Colp
3151af0015 Close voicemail message description file if duration did not meet the minimum, or else we will eventually run out of file descriptors.
(closes issue #10918)
Reported by: brak2718
Patches:
      vm1.4.12.1.patch uploaded by brak2718 (license 279)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85242 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-10 14:14:56 +00:00
Kevin P. Fleming
9cdda4fc78 use a macro instead of an inline function, so that backtraces will report the caller of ast_frame_free() properly
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85195 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-10 06:24:41 +00:00
Tilghman Lesher
96d11d3e02 This commit fixes the following issues:
- Deadlock in ast_write (issue #10406)
- Deadlock in ast_read (issue #10406)
- Possible mutex initialization error in lock.h (issue #10571)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-09 21:55:06 +00:00
Joshua Colp
474e0e8d12 Don't perform a reinvite if a transfer is in progress.
(issue #10915)
Reported by: ramonpeek


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-09 14:30:16 +00:00
Joshua Colp
ba0bb743e6 Only update codec information if the channel has a technology private structure.
(issue #10915)
Reported by: ramonpeek


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-08 20:06:33 +00:00
Joshua Colp
3dcf938f73 Update codec information as well as address when doing hold reinvites.
(issue #10868)
Reported by: mavince


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85023 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-08 15:37:46 +00:00
Joshua Colp
2baeb29ae4 Don't keep trying to native bridge if either of the channels are involved in a masquerade operation to be done.
(closes issue #10696)
Reported by: tbelder


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-08 15:03:07 +00:00
Russell Bryant
a914cb6654 Enable file dependency tracking for _all_ builds, and not just for builds with
dev-mode enabled.  I have seen enough problems caused by this that I don't think
it's worth keeping.  I want to continue to encourage anybody that is interested
to continue to run Asterisk from svn.  Furthermore, I do not want their systems
to break when we change a structure definition in a header file.  :)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-08 03:28:34 +00:00
Philippe Sultan
95e24c44c1 Presence packets from a client who's connected with our Jabber ID are
valid, therefore, those clients must be considered as buddies. The resource
string helps us make the distinction between clients.

Closes issue #10707, reported by yusufmotiwala.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-07 16:15:39 +00:00
Philippe Sultan
c7e7a27bac Prevent Asterisk from crashing when receiving a presence packet
without resource from a buddy that is known to have a resource list.

Revert a change I previously made, where Asterisk could point to a
freed memory location.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-07 15:52:44 +00:00
Tilghman Lesher
9ae23cba31 Log exactly why we can't open the database, if we fail (closes issue #10887)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84851 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-05 19:42:21 +00:00
Joshua Colp
35ed1f7148 Update the remembered RTP peer information when putting an endpoint on hold or taking it off hold so that the RTP stack does not initiate a needless reinvite.
(closes issue #10868)
Reported by: mavince


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-05 18:55:36 +00:00
Russell Bryant
21d9b7996b Do deadlock avoidance in a couple more places. You can't lock two channels
at the same time without doing extra work to make sure it succeeds.
(closes issue #10895, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-05 16:44:21 +00:00
Russell Bryant
2c757f0747 Fix a copy/paste error in the description of UpdateConfig that was pointed
out by JerJer on #asterisk-dev


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84742 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-05 01:39:07 +00:00
Mark Michelson
74cc6754af Don't allocate space for queue members unless it's needed. You end up deleting dynamic members on a reload. Not good.
closes issue (#10879, reported by dazza76, patched by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84692 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-04 21:57:03 +00:00
Kevin P. Fleming
544904070f callers of sig2str already add the word 'signalling' in the appropriate place, so don't duplicate it
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-04 21:36:56 +00:00
Joshua Colp
03a7b06959 Create a duplicate of the channel's member name as the tab completion stuff will free it.
(closes issue #10884)
Reported by: adamg


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-04 14:51:57 +00:00
Tilghman Lesher
1e9edf1338 When an RFC 2833 event is sent that we don't recognize, ignore it, don't queue a NULL digit (closes issue #10877)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-03 22:59:17 +00:00
Steve Murphy
563c9e74a2 closes issue #10870 ; where a CUT() function call in a switch expr doesn't execute correctly, because the commas in the function args are not converted to vertbars before the func is called. I modified just the switch code to convert the commas to vertbars if there, but if more of these sort of probs are found, I may have to resort to something a little more fundamental. We'll see, I guess.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84544 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-03 18:20:07 +00:00
Steve Murphy
ed75fa38e9 closes issue #10834 ; where a null input to a switch statement results in a hangup; since switch is implemented with extensions, and the default case is implemented with a '.', and the '.' matches 1 or more remaining characters, the case where 0 characters exist isn't matched, and the extension isn't matched, and the goto fails, and a hangup occurs. Now, when a default case is generated, it also generates a single fixed extension that will match a null input. That extension just does a goto to the default extension for that switch. I played with an alternate solution, where I just tack an extra char onto all the patterns and the goto, but not the default case's pattern. Then even a null input will still have at least one char in it. But it made me nervous, having that extra char in , even if that's a pretty secret and low-level issue.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-03 14:23:00 +00:00
Russell Bryant
d3beef4b59 * Don't build the menuselect-tree for the tarball, as it requires running the
configure script first
* Change the Makefile to note that menuselect-tree depends on the configure
  script.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-02 20:06:07 +00:00
Jason Parker
ede010d0d0 Fix some odd formatting I missed..
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-02 19:01:59 +00:00
Jason Parker
01480eb1fb Finish up on transferee channel before return on failure.
Issue 10821, patch by Ivan


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-02 18:52:55 +00:00
Russell Bryant
f741decf40 Use snprintf instead of sprintf in one place. There is no vulnerability here
due to various buffer sizes around the code, but I still didn't like seeing a
non length-limited copy of data coming off of the wire into a stack buffer, as
this would be a problem in the future if buffer sizes elsewhere got changed or
size limitations removed ...


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-02 14:12:35 +00:00
Christian Richter
e6b3384b48 terminate USERUSER String with 0
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84345 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-02 09:48:09 +00:00
Jason Parker
cf8f092d98 Add dist-clean support for subdirs.
Change h323 to only remove the Makefile on a dist-clean, rather than a clean.

This fixes a bug I found with trying to run make after a make clean


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84291 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 21:52:45 +00:00
Dwayne M. Hubbard
bae4135759 moved get_base_channel() code from action_redirect to ast_channel_masquerade() for issue 7706 and BE-160
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 21:25:37 +00:00
Steve Murphy
8bf81e2bac Anything to keep gcc 4.2 happy...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 21:18:40 +00:00
Russell Bryant
5fdc354155 Fulfull a feature request from Qwell on the "core show locks" output. It will
now note the lock type for each lock that a thread holds.
(mutex, rdlock, or wrlock)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84271 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 21:07:06 +00:00
Steve Murphy
b7f66e48e8 closes issue #10777 -- by returning a null for the parse tree when there's really nothing there, and making sure we don't try to do checking on a null tree.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84239 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 20:27:52 +00:00
Russell Bryant
63217678cb Add another sanity check in the AGI read loop. We really don't care about
EAGAIN unless we didn't read an entire line.  If there is a newline at the
end if the read buffer, break, because we got the whole thing.
(reported and patched by bmd)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84236 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 19:56:28 +00:00
Russell Bryant
2cc21a3e83 Show rwlocks in the "core show locks" output. Before, it only showed mutexes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 19:34:12 +00:00
Russell Bryant
b34251422c Remove another file in "make clean".
(closes issue #10814, paravoid)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84170 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 15:00:56 +00:00
Russell Bryant
db1ab4db58 Simplify the CAN_EARLY_BRIDGE macro a bit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 14:24:49 +00:00
Joshua Colp
40b0f97a6c Remove chan_usbradio config file from tree, it is not present in here.
(closes issue #10839)
Reported by: casper


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84163 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 14:10:47 +00:00
Joshua Colp
27a869e423 Fix randomness. save_pos was being set to 0 initially instead of -1, causing it to jump to position 0 when moh started.
(closes issue #10859)
Reported by: jamesgolovich
Patches:
      asterisk-mohpos2.diff.txt uploaded by jamesgolovich (license 176)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 13:57:42 +00:00
Joshua Colp
e7f6101587 Only attempt early bridging if the options given to Dial() permit it.
(closes issue #10861)
Reported by: peekyb


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 13:49:36 +00:00
Russell Bryant
2ef9410363 Fix the AST_MODULE_INFO macro for C++ modules. The load and reload parameters
were in the wrong place.
(closes issue #10846, alebm)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-30 20:02:16 +00:00
Steve Murphy
fce1741a01 This is a regression update that matches what I did in 84134 for AEL regressions.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84135 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-29 23:00:37 +00:00
Steve Murphy
0ffda2d201 This issue sort of closes 10786; All config files support #include with globbing (you know, *,[chars],?,{list,list},etc), so I've updated the AEL system to support this also.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84133 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-29 21:47:53 +00:00
Tilghman Lesher
b1f26cfcdf Correct pronunciations of numbers for .nl (Closes issue #10837)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-28 14:13:47 +00:00
Tilghman Lesher
253a34b756 Avoid a deadlock with ALL of the locks in the masquerade function, not just the
pairs of channels.  (Closes issue #10406)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-28 05:30:22 +00:00
Dwayne M. Hubbard
7c4e477fde if an Agent is redirected, the base channel should actually be redirected. This was causing multiple issues, especially issue 7706 and BE-160
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-27 23:12:25 +00:00
Russell Bryant
a4dcd03dcb remove a todo item that has been completed
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-27 00:01:29 +00:00
Kevin P. Fleming
e690ff69da avoid the weird usage of assert() in the ALSA header files that gcc 4.2 wants to complain about
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-26 23:53:03 +00:00
Russell Bryant
a8ec2e2356 I changed my mind ... I think this should be a LOG_NOTICE.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-26 21:35:23 +00:00
Russell Bryant
f77e615e9f Add a log message that was requested by the masses in the developer tutorial
session at Astricon.  chan_sip did not output any message when a call was
rejected because the extension was not found.  This adds a verbose message
(at verbose level 3) to note when this happens.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83941 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-26 21:15:15 +00:00
Russell Bryant
d2186a55c0 Fix building chan_misdn under dev-mode. (please run the configure script
with --enable-dev-mode so this doesn't happen again ...)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83910 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-26 20:50:09 +00:00
Tilghman Lesher
51601e2e1f Remove unused 4k of memory on the program stack (closes issue #10827)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83879 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-26 18:35:56 +00:00
Tilghman Lesher
20e50a731b jmls pointed out that unsetting the group and setting the group to the blank string aren't quite the same.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83773 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-25 14:13:25 +00:00
Tilghman Lesher
596cc77c99 In the source, keys are relative to the datadir, not varlib (which is the same
in most cases, but it's good to be accurate).
Closes issue #10811


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83695 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-24 17:22:08 +00:00
Tilghman Lesher
3c16b38d0e Oops. Removed the unworkable workaround. This note should never have been in the release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83653 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-24 16:37:52 +00:00
Tilghman Lesher
8c95942b7f Making change to group splitting, as discussed on the -dev list. The main
effect of this will be to permit Set(GROUP([cat])=), i.e. unsetting a group.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-24 15:17:06 +00:00
Christian Richter
b0012671db fixed round_robin group dial method, this never worked well on BRI Ports (2 channels)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-24 07:54:18 +00:00
Steve Murphy
4cd59ff447 This closes issue #10788 -- The exact same fixes are made here for the first arg in the for(arg1; arg2; arg3) {} statement, as were done for the 3rd arg. It can now be an assignment that will embedded in a Set() app, or a macro call, or an app call.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-22 19:39:16 +00:00
Steve Murphy
eef551c063 This closes issue #10788 -- the 3rd arg in the for statement is now wrapped in Set() only if there's an '=' in that string. Otherwise, if it begins with '&', then a Macro call is generated; otherwise it is made into an app call. A bit more accomodating, keeps the new guys happy, and the guys with ael-1 code should be happy, too
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-22 16:41:43 +00:00
Russell Bryant
d6b8fb4dc0 gcc 4.2 has a new set of warnings dealing with cosnt pointers. This set of
changes gets all of Asterisk (minus chan_alsa for now) to compile with gcc 4.2.
(closes issue #10774, patch from qwell)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83432 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-21 14:37:20 +00:00
Joshua Colp
9ffb2fe0cf Fix video under certain circumstances. It would have been possible for the formats on the channel to not contain the video format.
(closes issue #10782)
Reported by: cwhuang


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-21 13:34:32 +00:00
Russell Bryant
578c1d0c8a When daemonizing, don't change working directory to "/". It makes it not be
able to do a core dump when not running as uid=root.
(closes issue #10766, xrg)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-20 21:16:48 +00:00
Russell Bryant
3a561b499a Change safe_asterisk to explicitly ask for /bin/bash, as it uses bashisms.
(closes issue #10772, reported by culrich)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-20 21:01:20 +00:00
Jason Parker
f1467addf7 If # is pressed after dialing an extension in DISA, stop trying to collect more digits.
(issue #10754)
Reported by: atis
Patches:
      app_disa.c.branch.patch uploaded by atis (license 242)
      app_disa.c.trunk.patch uploaded by atis (license 242)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-20 17:09:14 +00:00
Joshua Colp
00000995f3 Make sure the minimum T1 timer value is obeyed in all cases.
(closes issue #10768)
Reported by: flefoll
Patches:
      chan_sip.c.trunk.83071.retrans-patch uploaded by flefoll (license 244)
      chan_sip.c.br14.83070.retrans-patch uploaded by flefoll (license 244)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83232 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-20 16:25:30 +00:00
Joshua Colp
a39ed78af6 Fix a minor spelling error.
(closes issue #10769)
Reported by: flefoll
Patches:
      chan_sip.c.trunk.83071.inita-patch uploaded by flefoll (license 244)
      chan_sip.c.br14.83070.inita-patch uploaded by flefoll (license 244)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83230 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-20 16:17:24 +00:00
Russell Bryant
47dc1101eb The System() and TrySystem() applications can take a substantial amount of
time to execute while not servicing the channel.  So, put the channel in
autoservice while the command is being executed.
(closes issue #10726, reported by mnicholson)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83179 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-19 19:50:48 +00:00
Russell Bryant
f59ad2a3ed Using curl can take a substantial amount of time, so the channel should be
autoserviced while waiting for it to complete.
(closes issue #10725, reported by mnicholson)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83177 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-19 19:34:25 +00:00
Russell Bryant
1b242b87ff When handling a reload of chan_iax2, don't use an ao2_callback() to POKE all
peers.  Instead, use an iterator.  By using an iterator, the peers container
is not locked while the POKE is being done.  It can cause a deadlock if the
peers container is locked because poking a peer will try to lock pvt structs,
while there is a lot of other code that will hold a pvt lock when trying to
go lock the peers container.
(reported to me directly by Loic Didelot.  Thank you for the debug info!)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-19 19:13:29 +00:00
Russell Bryant
df5599d598 Fix up another potential race condition. Do the loop decrementing use count
on events with the eventq protected from being changed.
(reported on IRC by Ivan)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-19 15:10:14 +00:00
Joshua Colp
2187f79e54 Protect the CDR record from modification by pbx_exec so that the application data contains the Queue data.
(closes issue #10761)
Reported by: snar
Patches:
      app-queue-mixmonitor.patch uploaded by snar (license 245)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83074 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-19 13:47:59 +00:00
Joshua Colp
4be09d967e (closes issue #10760)
Reported by: dimas
Patches:
      chan_sip.patch uploaded by dimas (license 88)
Read in subscribecontext option in general to be the default.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-19 13:18:22 +00:00
Christian Richter
a779f3cbf5 removed comment which violates the coding guidelines.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-19 09:32:42 +00:00
Christian Richter
63122bb677 added 'astdtmf' option to allow configuring the asterisk dtmf detector instead of the mISDN_dsp ones. also added the patch from irroot #10190, so that dtmf tones detected by the asterisk detector are passed outofband to asterisk, to make any use of dtmf tones at all.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83023 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-19 09:31:55 +00:00
Russell Bryant
0728297127 Change the description of app_flash to note how it can be a useful tool instead
of just saying that it is generally a worthless feature.
(Thanks to Jim Van Meggelen for pointing it out and providing the proposed text)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-19 00:19:49 +00:00
Joshua Colp
88cfb003df Initialize a variable to NULL to make the world happy.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82961 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18 23:41:02 +00:00
Russell Bryant
0f23b76a39 Add a new patch to handle interrupting the fgets() call when using FastAGI.
This version of the patch maintains the original behavior of the code when
not using FastAGI.
(closes issue #10553)
Reported by: juggie
Patches:
      res_agi_fgets-4.patch uploaded by juggie (license 24)
      res_agi_fgets_1.4svn.patch uploaded by juggie (license 24)
	  Slight mods by me
Tested by: juggie, festr


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82929 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18 22:42:27 +00:00
Doug Bailey
8ac8d79a5d Corrected patch applied in revision r82887.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18 21:49:32 +00:00
Doug Bailey
33a1011c51 Fixed a bug where http manager sessions prevented the eventq from being cleaned out because http manager sessions do not have a valid file descriptor.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18 21:10:14 +00:00
Russell Bryant
4668601f9c Fix a memory leak that can occur on systems under higher load. The issue is
that when events are appended to the master event queue, they use the number
of active sessions as a use count so it will know when all active sessions
at the time the event happened have consumed it.  However, the handling of
the number of sessions was not properly synchronized, so the use count was
not always correct, causing an event to disappear early, or get stuck in
the event queue for forever.

(closes issue #9238, reported by bweschke, patch from Ivan, modified by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18 20:56:43 +00:00
Mark Michelson
3d1a567df0 Moving the logic for handling an empty membername to the create_member function so that there is a common place
where this occurs instead of being spread out to several different places.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82865 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18 20:09:02 +00:00
Kevin P. Fleming
a809a030d9 there is no need for conditional logic to select ->interface or ->membername, snince ->membername will always be populated
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18 18:59:52 +00:00
Russell Bryant
885a35488a When copying the contents from the wildcard peer, do a deep copy instead of
shallow copy so that it doesn't crash when beging destroyed.
(closes issue #10546, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18 16:31:01 +00:00
Jason Parker
070bcf111e Correct the allowexternaldomains option in SIP sample config.
Issue 10753


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18 15:28:21 +00:00
Russell Bryant
82a6309168 Put a memset in ast_localtime() instead of a couple places in app_voicemail
to prevent the problem everywhere instead of just a couple of places.
(related to issue #10746)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-17 20:16:25 +00:00
Russell Bryant
a67e593e66 Initialize some memory to fix crashes when leaving voicemail. This problem
was fixed by running Asterisk under valgrind.
(closes issue #10746, reported by arcivanov, patched by me)

*** IMPORTANT NOTE:  We need to check to see if this same bug exists elsewhere.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-17 20:00:32 +00:00
Russell Bryant
db99815a6a Handle the case where there are multiple dynamic features with the same digit
mapping, but won't always match the activated on/by access controls.  In that
case, the code needs to keep trying features for a match.
(reported by Atis on the asterisk-dev list, patched by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82594 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-17 16:46:59 +00:00
Kevin P. Fleming
d2aa701b73 revert a change that wasn't supposed to be committed... doh!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-17 16:40:12 +00:00
Kevin P. Fleming
43c2cf7938 fix a couple of places where a logical member name (if specified) was not used, but instead the direct interface was listed
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82590 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-17 16:33:30 +00:00
Joshua Colp
5bf3facef0 (closes issue #10734)
Reported by: asgaroth
Instead of passing a NULL pointer into snprintf pass "". It makes Solaris much happier.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82514 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-17 02:00:59 +00:00
Steve Murphy
3dd879bb13 closes issue #10668; thanks to arkadia for his patch; had to leave out the bit about ending the previous cdr in the fork; it would destroy current implementations.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82444 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-14 21:19:27 +00:00
Russell Bryant
6389764c5e Add a note to help clarify the value set with the echocancel option.
(inspired by Malcolm's blog post on blogs.digium.com about HPEC)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-14 21:17:08 +00:00
Mark Michelson
e53d7231dd Crap, I broke the build. Fixed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82398 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-14 18:35:48 +00:00
Mark Michelson
c7b6c42ef5 Adding member name field to manager events where they were missing before
(closes issue #10721, reported by snar)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82396 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-14 18:28:36 +00:00
Jason Parker
2eff5e9334 If a channel does not have an owner, do not try to set a channel variable.
This will end up making the channel variable global, which is not right.

Closes issue #10720, patch by flefoll.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82394 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-14 17:48:05 +00:00
Russell Bryant
5213f548f5 Add checking for libusb here, so nobody has to deal with conflicts in the
chan_usbradio-1.4 branch every time the configure script gets changed


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-14 15:50:49 +00:00
Russell Bryant
5eb2113c50 Remove chan_usbradio from the main 1.4 branch. It can't live here because we
have a strict policy to not include new features in release branches.  However,
I'm going to merge it into trunk, and I also have a special 1.4 based branch that
includes this module.

svn co http://svn.digium.com/svn/asterisk/team/jdixon/chan_usbradio-1.4


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-14 15:42:42 +00:00
Mark Michelson
b9a924c3d3 Fixing a typo in the coding guidelines
(closes issue #10717, reported and patched by leedm777)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82376 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-14 14:42:29 +00:00
Jim Dixon
903fba1b1d Fixed problem with changes made to cdr functionality
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-14 01:24:07 +00:00
Kevin P. Fleming
9ceb6b974f this new driver may not live in this branch for long (since it is a new feature), but it definitely should not be built by default
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-14 00:52:57 +00:00
Jim Dixon
1a9fc13dbe Added channel driver for USB Radio device and
support thereof.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82366 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-14 00:34:13 +00:00
Jason Parker
6da68a5f0a Fix a small typo.
retrytime > waittime


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-13 23:11:27 +00:00
Mark Michelson
d6b1a0bfd6 Preemptively fixing a possible segfault. It is possible that queuename is NULL
(meaning pause ALL queues), so use q->name instead.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-13 20:16:37 +00:00
Jason Parker
bc21189921 Fix a crash that could occur in cdr_csv when mutliple threads tried to close the same file.
Do we actually need the locking here?  What happens if you open the same file twice, and
 two threads try to write to it at the same time?  Is fputs() going to write out the entire
 line at once?  I suspect that it could be possible for the second fopen to run during the
 first fputs, so the position could be in the middle of the previously written line...

Issue 10347, initial patch by explidous (but I removed all of the paranoia stuff..)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-13 20:11:40 +00:00
Russell Bryant
8138003de7 resolve a warning when not building under dev mode
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-13 18:57:08 +00:00
Russell Bryant
c8dd4e7430 Only compile in tracking astobj2 statistics if dev-mode is enabled. Also, when
dev mode is enabled, register the CLI command that can be used to run the astobj2
test and print out statistics.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82337 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-13 18:45:59 +00:00
Kevin P. Fleming
1a2176da3e Merged revisions 82334 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r82334 | kpfleming | 2007-09-13 11:10:12 -0700 (Thu, 13 Sep 2007) | 2 lines

clarify the OpenSSL and OpenH323 license exceptions

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-13 18:12:00 +00:00
Mark Michelson
1cf6ee98e0 Added logic to handle the unlikely case that someone has two queues with the same name.
Asterisk will log a warning message letting the user know that one was already defined with that
name and is it skipping all further instances. This also will work for realtime queues but in order
for that to happen, the user would have to trigger a perfectly timed reload as a realtime queue is being
looked up, which is highly unlikely (but taken care of nonetheless).



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82326 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-13 16:25:59 +00:00
Philippe Sultan
b558ac3acf Closes issue #9401, reported and patched by irrot, with slight
modifications by me.

Handle DTMF sent by Asterisk properly.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-13 11:47:14 +00:00
Russell Bryant
4b6653a436 Fix a check of the wrong pointer, as pointed out by an XXX comment left in
the code.  The problem was harmless, however.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12 21:56:32 +00:00
Tilghman Lesher
4f1183bd27 Oops, wrong location for FreeBSD zone files
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82291 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12 21:28:33 +00:00
Dwayne M. Hubbard
e2611d2f54 remove a race condition for the creation of recordthread's, and fix a small memory leak. This closes issue# 10636
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12 20:24:24 +00:00
Tilghman Lesher
e28d1357de Working on issue #10531 exposed a rather nasty 64-bit issue on ast_mktime, so we
updated the localtime.c file from source.  Next we'll have to write ast_strptime
to match.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82285 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12 20:12:06 +00:00
Russell Bryant
ef740deceb Clean up the output of "asterisk -h". This tweaks the wording and wraps lines
at 80 characters.
(closes issue #10699, seanbright)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82280 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12 15:16:49 +00:00
Russell Bryant
347dce5c71 revert patch from issue #10553, as someone not using fastagi reported that this
broke their system.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12 15:11:11 +00:00
Mark Michelson
39d628adcf Accidentally committed changes to app_voicemail which do NOT need to be in the 1.4 branch yet. reverting...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12 14:30:13 +00:00
Mark Michelson
da18cece2c We should only initialize a realtime queue when it is allocated, not every time we access it. This prevents the members ao2_container
from being reallocated every time the queue is accessed.

I also removed a debug message I had accidentally left in on a previous commit.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12 14:24:53 +00:00
Russell Bryant
3e11102ef8 Fix incorrect uses of ao2_find(). Every one of these calls was reading bogus
memory ...


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82267 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-11 22:37:17 +00:00
Joshua Colp
26623e4e1c (closes issue #10679)
Reported by: andrew
Build under dev mode when K6OPTS is enabled.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-11 21:41:49 +00:00
Russell Bryant
56b7a100bc Fix another missing unref of member objects. This one was pointed out by Marta.
When building the outgoing list in try_calling(), a member reference is stored
in each outgoing entry.  However, when this list got destroyed, the reference
was not released.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-11 20:49:34 +00:00
Steve Murphy
e84f98ea4f this change should fix issue # 10659 -- what I worry about is how many other bug reports it may generate. Hopefully, we can please the/a majority. Hopefully. We shall see. Calls not marked ANSWERED and with only one channel name will not be posted. This should eliminate the double CDR's.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-11 20:36:15 +00:00
Mark Michelson
4f36c859ad All instances of ao2_iterators which were just named 'i' have been renamed
to 'mem_iter' so that when refcounted queues are merged into trunk, there will be
little confusion regarding iterator names, especially when a queue and member iterator
are used in the same function.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82252 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-11 16:05:56 +00:00
Russell Bryant
057505c5a3 The sample dundi.conf claims support for a wildcard peer entry - [*], but the
code did not support it.  This patch makes it work.
(closes issue #10546, patch by dds, with some changes by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82250 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-11 16:03:42 +00:00
Christian Richter
370b3437ee fixed a hold/retrieve issue.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82249 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-11 16:01:27 +00:00
Russell Bryant
faad24c675 (closes issue #10553)
Reported by: juggie
Patches:
      res_agi_fgets-2.patch uploaded by juggie (license 24)
Tested by: juggie

When using fastagi, fgets() can return before a full line is read.  Add explicit
handling for the case where it gets interrupted.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82245 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-11 15:26:51 +00:00
Joshua Colp
f2ba32f8e9 (closes issue #10577)
Reported by: jamesgolovich
Patches:
      asterisk-dundifree.diff.txt uploaded by jamesgolovich (license 176)
Don't leak memory when unloading DUNDi.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82243 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-11 14:56:39 +00:00
Russell Bryant
808ed0e44e Add a couple more missing unrefs of queue member objects
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-11 14:34:12 +00:00
Russell Bryant
aa3a71d3bf Add a missing unref of a queue member in an error handling block
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82238 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-11 14:21:17 +00:00
Russell Bryant
ffa6e7123b Document why membercount can not simply be replaced by ao2_container_count()
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82236 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-11 14:09:43 +00:00
Russell Bryant
b8261abd0b backport astobj2 race condition fix. This function is the exact same as trunk
so it applies here as well.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82198 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-10 19:53:17 +00:00
Tilghman Lesher
4913548485 Convert struct member to use refcounts (closes issue #10199)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82155 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-10 18:02:02 +00:00
Mark Michelson
a13b91f49b Removing non-existent options from misdn configuration sample.
(closes issue #10678, reported and patched by IgorG)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-10 15:02:12 +00:00
Tilghman Lesher
2fc5a853d4 Fix inline compiles on really old compilers (who uses gcc 2.7 anymore, really?)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-09 02:35:18 +00:00
Russell Bryant
827ca97872 Fix a small memory leak. ast_unregister_atexit() did not free the entry it removed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-08 18:41:32 +00:00
Russell Bryant
fab2578b02 (closes issue #10672)
Bump the cleancount so that a "make clean" will be forced.  This is needed
because my fix in revision 81599 made a change to a data structure in file.h,
and since file dependency tracking is only on with dev-mode enabled, file
format modules that don't get rebuilt may crash, as is the case with this issue.

This makes me wonder - how much faster does the code build without the file
dependency tracking enabled?  If it doesn't make much of a difference, then it
may be worth just keeping it on all of the time, or perhaps just not in release
tarballs, so that this type of issue is avoided.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81952 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-08 13:42:26 +00:00
Jason Parker
d73c04d892 Allow the MEMBERINTERFACE variable to be used as the mixmonitor filename.
This moves the setting of the MEMBERINTERFACE variable to before mixmonitor.

Issue 10671, patch by sim.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81923 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-07 19:48:00 +00:00
Mark Michelson
a9b17b231c Moving the explanation for joinempty to a more appropriate place
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-07 15:25:19 +00:00
Russell Bryant
f6212e48cb (closes issue #9724, closes issue #10374)
Reported by: kenw
Patches:
      9724.txt uploaded by russell (license 2)
Tested by: kenw, russell

Resolve a deadlock that occurs when doing a SIP transfer to parking.  

I come across this type of deadlock fairly often it seems.  It is very important
to mind the boundary between the channel driver and the core in respect to the
channel lock and the channel-pvt lock.  Channel drivers lock to lock the
pvt and then the channel once it calls into the core, while the core will do
it in the opposite order.  The way this is avoided is by having channel drivers
either release their pvt lock while calling into the core, or such as in this
case, unlocking the pvt just long enough to acquire the channel lock.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-06 22:28:57 +00:00
Jason Parker
cd304a0a76 We added COPTS for ASTCFLAGS additions, but not LDOPTS for ASTLDFLAGS. This adds LDOPTS
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81826 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-06 22:05:02 +00:00
Jason Parker
82c701b0eb This should fix a build issue that people building against uClibc were seeing with the addition of astobj2
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-06 19:59:07 +00:00
Joshua Colp
e73fa2ba6f (closes issue #10122)
Reported by: stevefeinstein
Patches:
      meetme-unmute-manager.diff uploaded by qwell (license 4)
Tested by: stevefeinstein
After looking over the code I agree with Qwell. Setting the file descriptor to conference each time just causes a fight back and forth.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81776 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-06 19:40:37 +00:00
Philippe Sultan
8e10babcbd Various string length fixes. Removed an unused variable in aji_client structure (context)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81743 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-06 16:56:29 +00:00
Mark Michelson
76ffc54255 Fixes an issue where valid DTMF had to be pressed twice to exit a queue if a member's phone
was ringing.

(closes issue #10655, reported by strider2k, patched by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-06 16:25:40 +00:00
Mark Michelson
2a3b64bf70 Fixes a memory leak
(closes issue #10658, reported and patched by Ivan)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-06 15:20:36 +00:00
Philippe Sultan
022b5c1696 According to both RFC 3920 - section 9.1.2 - and Google's XMPP server
complaint, if set, the 'from' attribute must be set to the user's full
JID.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81650 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-06 14:20:54 +00:00
Russell Bryant
aa3b7e22f5 Fix an issue that can occur when you do an attended transfer to parking. If
you complete the transfer before the announcement of the parking spot finishes,
then the channel being parked will hear the remainder of the announcement.
These changes make it so that will not happen anymore.

Basically, res_features sets a flag on the channel is playing the announcement
to so that the file streaming core knows that it needs to watch out for a
channel masquerade, and if it occurs, to abort the announcement.

(closes BE-182)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-05 20:53:41 +00:00
Tilghman Lesher
f0cf18cc75 Solaris x86 compatibility fix
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-05 17:18:24 +00:00
Mark Michelson
fbbf1e2056 Fixing the build...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-05 15:19:47 +00:00
Jason Parker
5422814fa3 Do not try to unregister a NULL channel tech.
Also changed load_module function to use defines rather than numbers for return values.

Issue 10651, patch by rbraun_proformatique, with additions by me.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-05 15:14:30 +00:00
Mark Michelson
f5cc747662 Reverting behavior of QUEUE_MEMBER_COUNT to only count members who are logged in
and available.

(related to issue #10652, reported by wuwu)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81520 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-05 15:03:22 +00:00
Joshua Colp
0f82a9bbf1 (closes issue #10650)
Reported by: tacvbo
Only print out that the spy was removed while holding the spy lock.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81492 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-05 13:11:48 +00:00
Jason Parker
e805ee3d40 Rather than attempt to play a file, we can just check whether it exists.
Issue 10634, patch by me, testing by pabelanger, sanity checked by bweschke


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81455 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-04 20:54:51 +00:00
Jason Parker
ae2ccdf0ed Change default followme config file to point to the correct files.
Issue 10644, patch by pabelanger


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81453 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-04 19:56:06 +00:00
Russell Bryant
c95389856a Remove the typedefs on ao2_container and ao2_iterator. This is simply because
we don't typedef objects anywhere else in Asterisk, so we might as well make
this follow the same convention.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-04 18:37:44 +00:00
Kevin P. Fleming
0e39aced3c there is no point in sending 401 Unauthorized to a UAS that sent us a properly-formatted Authentication header with the expected username and nonce but an incorrect response (which indicates the shared secret does not match)... instead, let's send 403 Forbidden so that the UAS doesn't retry with the same authentication credentials repeatedly
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-04 16:40:39 +00:00
Joshua Colp
95db093c40 (closes issue #10632)
Reported by: jamesgolovich
Patches:
      asterisk-iaxfirmwareleak.diff.txt uploaded by jamesgolovich (license 176)
Fix memory leak when unloading chan_iax2. The firmware files were not being freed.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81439 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-04 14:23:18 +00:00
Joshua Colp
63669c4496 (closes issue #10476)
Reported by: mdu113
Only look for the end of a digit when waiting for a digit. This in turn disables emulation in the core.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-04 13:46:23 +00:00
Joshua Colp
7e7eef085c (closes issue #10610)
Reported by: john
Patches:
      dns.c.patch uploaded by john (license 218)
Tested by: mvanbaak
Don't return a match if no SRV record actually exists.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-04 13:10:56 +00:00
Russell Bryant
52a37f77c7 Remove a couple of calls to ast_string_field_free_pools() on peers in error
handling blocks in the code for building peers.  The peer object destructor
does this and doing it twice will cause a crash.
(closes issue #10625, reported by and patched by pnlarsson)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-03 18:57:53 +00:00
Mark Michelson
6ed2b5c1b2 Changed a comment to be more accurate.
(really this is just a test to make sure I can commit properly from home)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81428 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-01 15:57:31 +00:00
Mark Michelson
e0b90d3b06 Making match_by_addr into ao2_match_by_addr and making it available
everywhere since it could be a handy callback to have



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81426 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-01 06:02:06 +00:00
Russell Bryant
abc5bbdc36 Remove references to a debugging parameter that does not exist
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-31 21:27:49 +00:00
Mark Michelson
687f798f19 Fixed broken behavior of a reload on realtime queues. Prior to this patch, if a reload was issued and
a realtime queue had callers waiting in it, then the queue would be removed from the queue list, but it would
not actually be freed (in fact, a debug message warning about a memory leak would come up). With this patch,
reloads do not touch realtime queues at all.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-31 19:48:55 +00:00
Tilghman Lesher
a390611c48 The IF() function was not allowing true values that had embedded colons (closes issue #10613)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-31 19:16:52 +00:00
Jason Parker
86c32ff0ef Re-order dial options to be in line with the existing alpha order.
Issue 10621, initial patch by junky


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81412 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-31 18:44:44 +00:00
Philippe Sultan
1da5446f1a Make the 'gtalk show channels' CLI command available.
Closes issue 10548, reported by keepitcool.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-31 17:38:26 +00:00
Joshua Colp
a026dc5f43 Make it the engine's responsible to check for the presence of results.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-31 15:53:16 +00:00
Kevin P. Fleming
90b557afea add missing "transcoder show" (and deprecated "show transcoder") CLI commands that were in 1.2 but never added to 1.4
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-31 15:51:45 +00:00
Joshua Colp
85bf0ee987 (closes issue #10618)
Reported by: dimas
Don't pass through the stopped sounds frame.... just drop it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81403 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-31 14:38:59 +00:00
Joshua Colp
279d96a974 (closes issue #10009)
Reported by: dimas
Don't output a bridge failed warning message if it failed because one of the channels was part of the masquerade process. That is perfectly normal.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-30 23:53:41 +00:00
Mark Michelson
0589a7e1d0 Removing an extraneous (and possibly misleading) log message. Firstly, if the announce file isn't found, the
streaming functions will report it. Secondly, not all non-zero returns from play_file mean that the announce file
wasn't found. Positive return values simply mean that a digit was pressed (most likely to skip through the announcement).

(closes issue #10612, reported and patched by dimas)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81397 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-30 22:05:56 +00:00
Joshua Colp
fcee92481e (closes issue #10514)
Reported by: casper
Patches:
      chan_sip.c.80129.diff uploaded by casper (license 55)
Remove needless check for AUTH_UNKNOWN_DOMAIN. It was impossible for it to ever be that value.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81395 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-30 21:23:50 +00:00
Steve Murphy
07f7547e84 via issue 10599, where 'CDR already initialized' messages are being generated. Since all channels will have an init'd CDR attached at creation time, this message is now particularly useless. Removed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-30 21:11:48 +00:00
Russell Bryant
5f336e5a67 Add missing checks for the PTRACING define.
(closes issue #10559, paravoid)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-30 15:38:29 +00:00
Mark Michelson
4c16fcaa97 Changed some manager event messages to reflect whether a queue member is a realtime member or not
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-30 15:35:51 +00:00
Russell Bryant
828c0c1035 Fix a typo, update a reload command, and remove an unused configuration file.
(closes issue #10606, casper)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-30 15:33:48 +00:00
Joshua Colp
d080d7bfc4 (closes issue #10603)
Reported by: jmls
Patches:
      pbx.diff uploaded by jmls (license 141)
Backport changes from 81372. Add REASON dialplan variable for when an originated call fails and the failed extension is executed.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81375 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-30 14:53:43 +00:00
Christian Richter
f4126ffe68 Fixed some warnings.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-30 14:43:33 +00:00
Joshua Colp
a47dcc167c (issue #10599)
Reported by: dimas
Handle the -1 control subclass during feature dialing (it indicates to stop sounds).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-30 14:23:40 +00:00
Christian Richter
6576e93697 Fixed a severe issue where a misdn_read would lock the channel, but read would
not return because it blocks. later chan_misdn would try to queue a frame like
a AST_CONTROL_ANSWER which could result in a deadlock situation. misdn_read
will now not block forever anymore, and we don't queue the ANSWER frame at all
when we already was called with misdn_answer -> answer would be called twice.

Also we don't explicitly send a RELEASE_COMPLETE on receiption of a RELEASE
anymore, because mISDN does that for us, this resulted in a problem on some
switches, which would block our port after some calls for a short while.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-30 08:31:59 +00:00
Mark Michelson
dbe2d229a5 This patch, in essence, will correctly pause a realtime queue member and reflect those
changes in the realtime engine.

(issue #10424, reported by irroot, patch by me)

This patch creates a new function called update_realtime_member_field, which is a generic
function which will allow any one field of a realtime queue member to be updated. This patch
only uses this function to update the paused status of a queue member, but it lays the foundation
for persisting the state of a realtime member the same way that static members' state is maintained
when using the persistentmembers setting



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-29 16:35:29 +00:00
Mark Michelson
872ab1519e Changed some tabs to spaces
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-29 16:08:09 +00:00
Russell Bryant
8399112981 If chan_h323 is not being built, don't use g++ to do the final link of Asterisk.
(in response to a question on the asterisk-dev list)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81342 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-29 15:57:29 +00:00
Mark Michelson
2772c71560 This fix creates a more accurate way of detecting whether realtime members were deleted.
(closes issue 10541, reported by Alric, patched by me)

The REALLY nice things about this patch is that queue members now have a "realtime" field
which will be true if the member is a realtime member. This means we can check this value
prior to certain processing if it should ONLY be done for realtime members.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81340 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-29 15:52:42 +00:00
Joshua Colp
8fcc537329 (closes issue #9690)
Reported by: mattv
Make rtp timeouts work even if two RTP streams are directly bridged in the RTP stack.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-29 14:13:55 +00:00
Russell Bryant
587478ac3f Change the message about receiving a mini-frame before the first full voice
frame to a DEBUG message.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81291 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-28 21:38:26 +00:00
Russell Bryant
dce43f8d32 revert unintentional changes in rev 81226
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81228 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-28 15:43:18 +00:00
Russell Bryant
9b1802ffa3 Add Russian tones. (closes issue #7953, hanabana)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-28 15:41:15 +00:00
Mark Michelson
ee44807d4b Fixes a forwarding problem when using res_config_mysql
(closes issue #10573, reported by chrisvaughan, patch suggested by chrisvaughan as well)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81189 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-28 14:12:14 +00:00
Mark Michelson
214d980f86 Resolve a potential deadlock. In this case, a single queue is locked, then the queue list. In changethread(), the queue list is
locked, and then each individual queue is locked. Under the right circumstances, this could deadlock. As such, I have unlocked
the individual queue before locking the queue list, and then locked the queue back after the queue list is unlocked.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-27 22:40:19 +00:00
Mark Michelson
284c7cde35 DTMF begin frames should be ignored so that when an agent acks a call with the '#' key,
he doesn't cause a queue's announce file to be interrupted. Also went ahead and did the
same for the '*' key and for ending a call.

(closes issue #10528, reported by deskhack, patched by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-27 21:08:48 +00:00
Russell Bryant
a9c8aa431f Add a \todo to note that this module leaks most of the memory it allocates on
unload and should be fixed (when I'm not in the middle of something else ...).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81074 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-27 17:27:48 +00:00
Russell Bryant
264aeeca70 explicity define a variable as a boolean
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-27 16:38:33 +00:00
Russell Bryant
6e01a4ddaf (closes issue #10419)
Reported by: mustardman
Patches:
      asterisk-mohposition.diff.txt uploaded by jamesgolovich (license 176)

This patch fixes a few problems with music on hold.
 * Fix issues with starting at the beginning of a file when it shouldn't.
 * Fix the inuse counter to be decremented even if the class had not been
   set to be deleted when not in use anymore
 * Don't arbitrarily limit the number of MOH files to 255


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-27 16:16:25 +00:00
Joshua Colp
7a47ac4960 (closes issue #10561)
Reported by: jesselang
Patches:
      chan_sip-ChannelReload-20080825.patch uploaded by jesselang (license 202)
Remove an extra \r\n to make the ChannelReload event conform with every other event.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-27 15:01:59 +00:00
Mark Michelson
fe5489eead Found a case where the queue's membercount is off. It does not take into account dynamic members on a reload.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-27 14:55:44 +00:00
Joshua Colp
968be2def2 (closes issue #10562)
Reported by: idkpmiller
Correct jitter value output in the CLI to be as expected.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-27 13:20:31 +00:00
Russell Bryant
73275955bb Remove an extra signal_condition() for the scheduler thread.
(closes issue #10564, patch from casper)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-26 18:11:26 +00:00
Russell Bryant
f3d98a5f3c Fix some issues with the handling of the scheduler in chan_iax2. Most of the
places that scheduled items to be executed by the scheduler thread did not
signal the scheduler thread to wake up so that it could recalculate the time
until the next action.  These changes will make the scheduler thread more
responsive and ensure that actions get executed as close to when intended as
possible instead of it being possible for very long delays.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80895 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-25 17:37:39 +00:00
Dwayne M. Hubbard
5155d31036 An empty string is an empty callerid ... so zap it. This closes issue #10502, which was pointed out by dswartz. Thank you, and may the swartz be with you
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80878 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-24 22:59:52 +00:00
Russell Bryant
a4e418458b If dnsmgr is in use, and no DNS servers are available when Asterisk first
starts, then don't give up on poking peers.  Allow the poke to get rescheduled
so that it will work once the dnsmgr is able to resolve the host.
(closes issue #10521, patch by jamesgolovich)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-24 21:22:50 +00:00
Russell Bryant
1959929a2a Improve the debouncing logic in the DTMF detector to fix some reliability
issues.  Previously, this code used a shift register of hits and non-hits.
However, if the start of the digit isn't clean, it is possible for the
leading edge detector to miss the digit.  These changes replace the flawed
shift register logic and also does the debouncing on the trailing edge as well.
(closes issue #10535, many thanks to softins for the patch)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-24 20:24:05 +00:00
BJ Weschke
318f0f6e46 A minor correction to the available logic of autofill. If a queue member is paused, they're not really "available" so don't count them as such. Somewhat related to issue #10155
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-24 19:52:06 +00:00
Steve Murphy
d96548ab3c From a complaint by jmls, I realize that the message in cdr_disposition is unnecessary. To get failure disposition, just return -1; no use having more than one case do that.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-24 18:52:15 +00:00
Mark Michelson
09fc9c894e Fix a possible crash in IMAP voicemail.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-24 15:51:03 +00:00
Tilghman Lesher
02d6a884bb Make the deprecation warning inline with the code, instead of only in documentation (closes issue #10549)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-24 15:41:43 +00:00
Russell Bryant
e56cb20774 Tweak the formatting of this MODULEINFO block. I think this would have caused
a "*" to get in the menuselect-tree file.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-24 15:28:05 +00:00
Steve Murphy
3e5c8457e1 This change addresses JerJer's complaint that aelparse builds and installs even if pbx_ael is unchecked in the menuselect stuff.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-24 14:48:49 +00:00
Steve Murphy
765b1af228 backport of 80649, a fix to an unreported problem in the ael parser, that results in a crash on a 64bit machine
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-24 13:20:18 +00:00
Philippe Sultan
0518339c30 Closes issue #10509
Googletalk calls are answered too early, which results in CDRs wrongly
stating that a call was ANSWERED when the calling party cancelled a
call before before being established.

We must not answer the call upon reception of a 'transport-accept' iq
packet, but this packet still needs to be acknowledged, otherwise the
remote peer would close the call (like in #8970).

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80661 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-24 11:42:46 +00:00
Dwayne M. Hubbard
2aff2acf0a make misdn/isdn_lib compile without warnings
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80617 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-23 21:34:16 +00:00
Dwayne M. Hubbard
4cf31ac7e1 make chan_misdn compile without warnings
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80601 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-23 21:07:50 +00:00
Russell Bryant
ed6d4ec72c When executing a dynamic feature, don't look it up a second time by digit pattern
after we already looked it up by name.  This causes broken behavior if there is
more than one feature defined with the same digit pattern.
(closes issue #10539, reported by bungalow, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-23 20:16:41 +00:00
Russell Bryant
7b1aaf8791 Revert very broken fix for issue #10540 ... none of these values take ms so I
don't know what I was thinking


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80547 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-23 19:29:44 +00:00
Russell Bryant
e5be9cb65f Fix func_timeout to take values in floating point so 1.5 actually means
1.5 seconds instead of being rounded.
(closes issue #10540, reported by spendergrass, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-23 19:21:53 +00:00
Jason Parker
4037855a28 *sigh*
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-23 17:14:05 +00:00
Jason Parker
64bec1f2e3 use autotagged externals
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-23 17:11:48 +00:00
Kevin P. Fleming
9a118809b4 report the actual channel number that was unregistered, instead of assuming that the interface list consists of channels 1 through <x> with no gaps in the sequence
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80501 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-23 17:08:25 +00:00
Russell Bryant
a44c1d55a2 Fix some code where it was possible for a reference to a peer to not get
released when it should.  Thank you to Marta Carbone for pointing this out!


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80499 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-23 17:02:50 +00:00
Russell Bryant
b2c65cf51d This is a hack to maintain old behavior of chan_iax2. This ensures that if
the peers and users are being stored in a linked list, that they go in the
list in the same order that the older code used.  This is necessary to maintain
the behavior of which peers and users get matched when traversing the container.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-23 16:53:52 +00:00
Russell Bryant
fa1bc2a13b Revert res_agi fix that didn't quite work until we get it right ...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-23 15:49:28 +00:00
Russell Bryant
e8c2f715b5 Add some more documentation on iterating ao2 containers. The documentation
implies that is possible to miss an object or see an object twice while
iterating.  After looking through the code and talking with mmichelson, I have
documented the exact conditions under which this can happen (which are rare and
harmless in most cases).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80426 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-22 22:54:03 +00:00
Russell Bryant
851b4e474c When converting this code to use the list macros, I changed it so objects are
added to the head of a bucket instead of the tail.  However, while looking over
code with mmichelson, we noticed that the algorithm used in ao2_iterator_next
requires that items are added to the tail.  This wouldn't have caused any huge
problem, but it wasn't correct.  It meant that if an object was added to a
container while you were iterating it, and it was added to the same bucket that
the current element is in, then the new object would be returned by 
ao2_iterator_next, and any other objects in the bucket would be bypassed in
the traversal.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80424 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-22 22:40:27 +00:00
Russell Bryant
c5cf1e50ac Don't crash when using realtime in chan_sip without an insecure setting in the database.
(closes issue #10348, reported by link55, fixed by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80390 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-22 21:00:44 +00:00
Russell Bryant
566371bd50 Merge changes from team/russell/iax_refcount.
This set of changes fixes problems with the handling of iax2_user and iax2_peer
objects.  It was very possible for a thread to still hold a reference to one of
these objects while a reload operation tries to delete them.  The fix here is to
ensure that all references to these objects are tracked so that they can't go away
while still in use.

To accomplish this, I used the astobj2 reference counted object model.  This
code has been in one of Luigi Rizzo's branches for a long time and was primarily
developed by one of his students, Marta Carbone.  I wanted to go ahead and bring
this in to 1.4 because there are other problems similar to the ones fixed by these
changes, so we might as well go ahead and use the new astobj if we're going to go
through all of the work necessary to fix the problems.

As a nice side benefit of these changes, peer and user handling got more efficient.
Using astobj2 lets us not hold the container lock for peers or users nearly as long
while iterating.  Also, by changing a define at the top of chan_iax2.c, the objects
will be distributed in a hash table, drastically increasing lookup speed in these
containers, which will have a very big impact on systems that have a large number of
users or peers.

The use of the hash table will be made the default in trunk.  It is not the default
in 1.4 because it changes the behavior slightly.  Previously, since peers and users
were stored in memory in the same order they were specified in the configuration file,
you could influence peer and user matching order based on the order they are specified
in the configuration.  The hash table does not guarantee any order in the container,
so this behavior will be going away.  It just means that you have to be a little
more careful ensuring that peers and users are matched explicitly and not forcing
chan_iax2 to have to guess which user is the right one based on secret, host, and
access list settings, instead of simply using the username.

If you have any questions, feel free to ask on the asterisk-dev list.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-22 20:21:36 +00:00
Russell Bryant
99adc3f020 Juggie in #asterisk-dev was reporting problems where fgets would return
without reading  the whole line when using fastagi.  When this happens,
errno was set to EINTR or EAGAIN.  This patch accounts for the possibility
and lets fgets continue in that case.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-22 19:53:30 +00:00
Jason Parker
9b23ab95aa Fix a few build issues in Solaris (and likely others).
Use GREP and ID variables from autoconf.

Reported to me in #asterisk-dev
I forgot who reported this - sorry. :(


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-22 18:53:18 +00:00
Jason Parker
a7583cd240 Change a syntax that the GNU make in Solaris dislikes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-22 18:25:34 +00:00
Jason Parker
a2787080d9 Fix a bashism (we explicitly request /bin/sh).
Remove some oddly placed quotes I found in passing.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-22 18:06:00 +00:00
Russell Bryant
55bedc87b6 Honor the contents of the COPTS variable as custom target CFLAGS. Apparently
this is what openwrt does.  
(reported by Brian Capouch on the asterisk-dev list, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-22 16:21:58 +00:00
Joshua Colp
d13b192018 (closes issue #10526)
Reported by: sinistermidget
Revert commit from issue #10355 and return timestamp skew to 640. 


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-22 16:14:38 +00:00
Russell Bryant
3c2eae9ab4 Don't record SIP dialog history if it's not turned on. Also, put an upper
limit on how many history entires will be stored for each SIP dialog.  It is
currently set to 50, but can be increased if deemed necessary.
(closes issue #10421, closes issue #10418, patches suggested by jmoldenhauer,
 patches updated by me)
(Security implications documented in AST-2007-020)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-21 18:42:15 +00:00
Steve Murphy
b84f9590a0 ugh. removing the diffs from ulaw.h and alaw.h for now; accidentally added them in 80166
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-21 16:39:09 +00:00
Steve Murphy
4b5a9ae533 This patch solves problem 1 in 8126; it should not slow down the alaw codec, but should prevent signal degradation via multiple trips thru the codec. Fossil estimates the twice thru this codec will prevent fax from working. 4-6 times thru would result hearable, noticeable, voice degradation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-21 16:36:34 +00:00
Russell Bryant
db1f93048f Don't try to dereference the owner channel when it may not exist
(issue #10507, maxper)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-21 15:22:22 +00:00
Jason Parker
8eda8a5fa6 (issue #10510)
Reported by: casper
Patches:
      cdr.conf.diff uploaded by casper (license 55)

Fix a few errors in sample cdr config file.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80130 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-21 15:03:45 +00:00
Russell Bryant
108326e3d1 Fix the build of app_queue
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-20 21:57:08 +00:00
Mark Michelson
6268d2d7ec After a discussion on #asterisk-dev, it was decided that this should be in 1.4 as well.
(issue #10424, reported and patched by irroot)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-20 21:39:17 +00:00
Mark Michelson
d66e174242 Found a pointless ternary if. member->dynamic was set to 1 and has no opportunity to change
between then and this line, so "dynamic" will ALWAYS be output.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-20 16:17:43 +00:00
Jason Parker
46bc382bcc (issue #10499)
Reported by: casper
Patches:
      extensions.conf.sample.diff uploaded by casper (license 55)

Update CLI examples in extensions.conf.sample to reflect command changes.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80047 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-20 16:08:49 +00:00
Mark Michelson
7c7ec6a1da Ukrainian language voicemail support.
(closes issue #10458, reported and patched by Oleh)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-20 15:34:43 +00:00
Tilghman Lesher
e6768adf1b Missing curly braces. Oops. (Reported by snuffy via IRC)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-20 02:42:49 +00:00
Tilghman Lesher
d0469e3c42 Don't allocate vmu for messagecount when we could just use the stack instead (closes issue #10490)
Also, remove a useless (and leaky) SQLAllocHandle (closes issue #10480)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-18 14:30:44 +00:00
Russell Bryant
467ceebc82 Avoid a crash in the handling of DTMF based Caller ID. It is valid for
ast_read to return NULL in the case that the channel has been hung up.
(crash reported by anonymouz666 on IRC in #asterisk-dev)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-17 21:01:43 +00:00
Mark Michelson
403ee9194c Patch allows for more seamless transition from file storage voicemail to ODBC storage voicemail.
If a retrieval of a greeting from the database fails, but the file is found on the file system, then
we go ahead an insert the greeting into the database. The result of this is that people who
switch from file storage to ODBC storage do not need to rerecord their voicemail greetings.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-17 19:14:05 +00:00
Jason Parker
f1cb3f70b7 Don't send a semicolon over the wire in sip notify messages.
Caused by fix for issue 9938.

I basically took the code that existed before 9938 was fixed, and
 copied it into a new function - ast_unescape_semicolon

There should be very few places this will be needed (pbx_config
 does NOT need this (see issue 9938 for details))

Issue 10430, patch by me, with help/ideas from murf (thanks murf).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-17 19:12:19 +00:00
Jason Parker
e9ab13fa81 Re-add the setting of callerid name and number.
Issue 10485, reported by and fix explained by paradise.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-17 17:44:22 +00:00
Russell Bryant
9be377d89f Fix some crashes in chan_sip. This patch changes various places that add items
to the scheduler to ensure that they don't overwrite the ID of a previously
scheduled item.  If there is one, it should be removed.
(closes issue #10391, closes issue #10256, probably others, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-17 13:37:08 +00:00
Christian Richter
c71c5098b7 sometimes we don't need to signal dtmf tones to asterisk, we just want them to go through as inband. Otherwise they might be generated by the other channel partner and then there is a double tone.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79833 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-17 08:22:36 +00:00
Russell Bryant
e24788d06f Fix a little race condition that could cause a crash if two channels had MOH
stopped at the same time that were using a class that had been marked for
deletion when its use count hits zero.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16 22:32:33 +00:00
Russell Bryant
3301d70848 This patch fixes a bug where reloading the module with "module reload" did not
delete classes from memory that were no longer in the config.  This patch fixes
that problem as well as another one.  Previously, if you reloaded MOH using the
"moh reload" CLI command, which behaved differently than "module reload ...",
MOH had to be stopped on every channel and started again immediately.  However,
there was no way to tell what class was being used, so they would all fall back
to the default class.

(closes issue #10139)
Reported by: blitzrage
Patches: 
      asterisk-10139-advanced.diff.txt uploaded by jamesgolovich (license 176)
Tested by: jamesgolovich


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16 22:24:25 +00:00
Russell Bryant
0dbd8e04af Fix more deadlocks in chan_iax2 that were introduced by making frame handling
and scheduling multi-threaded.  Unfortunately, we have to do some expensive
deadlock avoidance when queueing frames on to the ast_channel owner of the IAX2
pvt struct.  This was already handled for regular frames, but ast_queue_hangup
and ast_queue_control were still used directly.  Making these changes introduced
even more places where the IAX2 pvt struct can disappear in the context of a
function holding its lock due to calling a function that has to unlock/lock it
to avoid deadlocks.  I went through and fixed all of these places to account for
this possibility.
(issue #10362, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79756 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16 21:29:24 +00:00
Mark Michelson
6ec280adfc Fixes a problem where agents would get stuck busy due to their wrapuptime being longer than the queue's wrapuptime and
ringinuse=no for the queue.

(closes issue #10215, reported by Doug, repaired by me)

Special thanks to fkasumovic for pointing out the source of the problem and to bweschke for helping to come up with a solution!



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16 21:16:40 +00:00
Mark Michelson
ec2f24b901 base_encode is not trying to open a log file, so we should not call it a log file in the warning.
(related to issue #10452, reported by bcnit)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16 15:58:34 +00:00
Philippe Sultan
c6365f5138 A fix for two critical problems detected while working with Daniel
McKeehan in issue #10184. 

Upon priority change, the resource list is not NULL terminated when
moving an item to the end of the list. This makes Asterisk endlessy
loop whenever it needs to read the list. Jids with different resource and
priority values, like in Gmail's and GoogleTalk's jabber clients put
that problem in evidence.

Upon reception of a 'from' attribute with an empty resource string,
Asterisk crashes when trying to access the found->cap pointer if the
resource list for the given buddy is not empty. This situation is
perfectly valid and must be handled. The Gizmoproject's jabber client
put that problem in evidence.

Also added a few comments in the code as well as a handle for the
capabilities from Gmail's jabber client, which are stored in a caps:c tag
rather than the usual c tag.

Closes issue #10184.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79665 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16 09:37:10 +00:00
Christian Richter
6d6a045cc0 0x80 + protocol is wrong for USERUSER when we want to send IA5 Chars.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79642 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16 08:21:21 +00:00
Joshua Colp
6dbbfcdc25 (closes issue #10440)
Reported by: irroot
(closes issue #10454)
Reported by: flo_turc
Increase maximum timestamp skew to 120. 20 was apparently far too low.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-15 14:40:23 +00:00
Mark Michelson
176f95680b Fixed an error in the Russian language voicemail intro.
(issue #10458, reported and patched by Oleh)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-15 14:26:40 +00:00
Joshua Colp
e856a6fb34 (closes issue #10456)
Reported by: irroot
Patches:
      sip_timeout.patch uploaded by irroot (license 52)
Change hardcoded timer value to defined value. I'm doing this in 1.4 as well so if it needs to be changed in the future this place would not have been forgotten.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-15 14:18:44 +00:00
Russell Bryant
e3ecc74dc1 Fix another spot where an iax2_peer would be leaked if realtime was in use.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79470 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-14 18:49:10 +00:00
Russell Bryant
a713275c1b Fix some memory leaks throughout chan_iax2 related to the use of realtime.
I found these while working on iax2_peer object reference tracking.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-14 17:31:39 +00:00
Joshua Colp
784d5f32c0 (closes issue #10415)
Reported by: atis
Revert fix for #10327 as it causes more issues then it solves.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79397 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-14 15:27:13 +00:00
Steve Murphy
7d83255ef8 memset really, really needs to be used here.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 22:40:06 +00:00
Joshua Colp
924c88d3d0 Instead of accepting a single DTMF character accept a full string.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79334 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 21:57:20 +00:00
Russell Bryant
f2de04d1d1 Don't call find_peer in registry_authrequest with the pvt lock held to avoid a
deadlock.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79301 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 20:37:50 +00:00
Russell Bryant
68faf63811 Release the pvt lock before calling find_peer in register_verify to avoid a
deadlock.  Also, remove some unnecessary locking in auth_fail that was only done
recursively.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 20:18:30 +00:00
Russell Bryant
c06aba4c8a Don't call find_peer within update_registry with a pvt lock held. This can
cause a deadlock as the code will eventually call find_callno.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 20:02:57 +00:00
Russell Bryant
60bcd4e03c I am fighting deadlocks in chan_iax2. I have tracked them down to a single
core issue.  You can not call find_callno() while holding a pvt lock as this
function has to lock another (every) other pvt lock.  Doing so can lead to a
classic deadlock.  So, I am tracking down all of the code paths where this
can happen and fixing them.

The fix I committed earlier today was along the same theme.  This patch fixes
some code down the path of authenticate_reply.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 19:27:39 +00:00
Steve Murphy
9020699e0a This patch fixes bug 10411. I added a new regression test, some regression test cleanups
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 17:49:54 +00:00
Russell Bryant
4f785d7d28 Fix a potential deadlock in socket_process. check_provisioning can eventually
call find_callno.  You can't hold a pvt lock while calling find_callno because
it goes through and locks every single one looking for a match.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79214 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 15:28:13 +00:00
Joshua Colp
4f8857d608 Add an API call to allow the engine to know that DTMF was received.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79207 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 14:51:09 +00:00
Joshua Colp
9a35428295 (closes issue #10437)
Reported by: haklin
Don't set the callerid name and number a second time on a newly created channel. ast_channel_alloc itself already sets it and setting it twice would cause a memory leak.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 14:18:04 +00:00
Tilghman Lesher
d0489c9f50 Ensure the connection gets marked as used at allocation time (closes issue #10429, report and fix by mnicholson)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-11 05:23:04 +00:00
Steve Murphy
241769b53c From a user complaint on #asterisk, I have forced pbx_spool to explain what reason codes mean, when they are logged
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10 20:53:43 +00:00
Steve Murphy
0c21db3e79 Re bug behavior mentioned in #asterisk, made this tweak to code, to prevent hundreds of log messages from being generated
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10 18:25:51 +00:00
Steve Murphy
2544c0be73 This will help debug; from a question asked on #asterisk
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10 17:43:49 +00:00
Russell Bryant
d21e1596f8 The last set of changes that I made to "core show locks" made it not able to
track mutexes unless they were declared using AST_MUTEX_DEFINE_STATIC.  Locks
initialized with ast_mutex_init() were not tracked.  It should work now.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78995 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10 15:20:09 +00:00
Joshua Colp
c3ba2c8fc6 Don't bother having the core pass through or emulate begin DTMF frames when in an ast_waitstream. It only cares about the end of DTMF.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10 14:15:53 +00:00
Joshua Colp
8d0941cdfd (closes issue #10422)
Reported by: bhowell
Add note to sample configuration about module load order and how it can cause perfectly good queue members to be marked as invalid.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10 13:49:19 +00:00
Christian Richter
1f62b98d45 fixed a bug with the useruser information element. We send them now also in the disconnect message.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10 13:24:03 +00:00
Mark Michelson
7133eb1368 Improved a bit of logic regarding comma-separated mailboxes in has_voicemail. Also added some braces to some compound if statements
since unbraced if statements scare me in general.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09 23:47:00 +00:00
Steve Murphy
1e085b5dfb This fixes bug 10416; thanks to mvanbaak for the pretty output
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78891 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09 23:10:46 +00:00
Mark Michelson
48d9158cdd Removing some extra debug code I left in my last commit
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78860 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09 22:03:48 +00:00
Mark Michelson
fd5f948092 Quite a few changes regarding IMAP storage.
1. instead of using inboxcount as the core message counting function, we use messagecount instead. This makes it possible to count messages in folders besides just INBOX and Old.
2. inboxcount and hasvoicemail now use messagecount as their means of determining return values.
3. Added a copy_message function for IMAP storage. Unfortunately I don't have the means to test it, but it seems like a pretty straightforward function.
4. Removed a #ifndef IMAP_STORAGE and matching #endif from leave_voicemail for a couple of reasons. One, we want to support copying mail to multiple IMAP boxes, and two, IMAP was
   broken because a STORE macro had been moved into this section of code.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78859 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09 21:51:17 +00:00
Mark Michelson
6c3d28a231 I broke canreinvite...Now I'm fixing it. I put some new code in the wrong place and so I've reverted the canreinvite section to how it was and put my new code where it should be.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78826 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09 19:52:43 +00:00
Russell Bryant
f2bf48ce42 add a comment to indicate that inboxcount for ODBC_STORAGE needs to be fixed to support multiple mailboxes
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09 17:58:31 +00:00
Russell Bryant
e019aff438 Fix subscriptions to multiple mailboxes for ODBC_STORAGE. Also, leave a
comment for this to be fixed for IMAP_STORAGE, as well.  I left IMAP alone
since I know MarkM was working on this code right now for another reason.

This is broken even worse in trunk, but for a different reason.  The fact
that the mailbox option supported multiple mailboxes is completely not obvious
from the code in the channel drivers.  Anyway, I will fix that in another
commit ...


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09 17:24:40 +00:00
Russell Bryant
1996c3a71d Fix a problem with the combination of the 'F' option to pass DTMF through a
conference and options that use DTMF to activate various features.  The problem
was that the BEGIN frame would be passed through, but the END frame would get
intercepted to activate a feature.  Then, the other conference members would hear
DTMF for forever, which they didn't seem to like very much.
(closes issue #10400, reported by stevefeinstein, fixed by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09 16:12:57 +00:00
Jason Parker
9b95a12570 Fix mogs email address.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-08 19:29:42 +00:00
Mark Michelson
c97cdff67d Fixed some compiler warnings so that compiling with dev-mode and IMAP storage would not have any errors.
This section of code may get changed again shortly since my change uncovers a rather silly bit of logic.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-08 18:16:49 +00:00
Mark Michelson
f8c70a5799 Changing a bit of logic so that someone will NEVER exit the queue on timeout unless they have enabled the 'n' option.
This commit relates to issue #10320. Thanks to jfitzgibbon for detailing the idea behind this code change.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-08 14:26:36 +00:00
Joshua Colp
c98e199fb2 (closes issue #10335)
Reported by: adamgundy
Update sip.conf to include another scenario where directrtpsetup will fail.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-08 13:51:01 +00:00
Russell Bryant
0db2a076e1 Fix the build of this module on 64-bit platforms
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-07 20:57:54 +00:00
Mark Michelson
dcfb651931 The logic behind inboxcount's return value was reversed in has_voicemail and message_count.
(closes issue #10401, reported by st1710, patched by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-07 19:43:57 +00:00
Tilghman Lesher
75a3499df0 Don't free the environment handle when the connection fails, because other connections might be depending upon it
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-07 19:34:25 +00:00
Jason Parker
cb0701052c Allow chan_sip to build in devmode
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-07 19:11:50 +00:00
Tilghman Lesher
57996e930e Reconnection doesn't happen automatically when a DB goes down (fixes issue #9389)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-07 19:09:38 +00:00
Jason Parker
1b58e7a828 Properly check the capabilities count to avoid a segfault.
(ASA-2007-019)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78375 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-07 18:25:15 +00:00
Russell Bryant
c40325aecc Merged revisions 78370 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r78370 | russell | 2007-08-07 12:44:04 -0500 (Tue, 07 Aug 2007) | 4 lines

Revert patch committed for issue #9660.  It broke E&M trunks.
(closes issue #10360)
(closes issue #10364)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78371 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-07 17:45:30 +00:00
Joshua Colp
d76d2c5214 Add additional DTMF log messages to help when debugging issues.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 21:41:13 +00:00
Russell Bryant
2e8439052f Fix an issue where dynamic threads can get free'd, but still exist in the
dynamic thread list.
(closes issue #10392, patch from Mihai, with credit to his colleague, Pete)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78242 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 20:44:09 +00:00
Russell Bryant
ad13307328 Fix the return value of AST_LIST_REMOVE(). This shouldn't be causing any
problems, though, because the only code that uses the return value only checks
to see if it is NULL.
(closes issue #10390, pointed out by mihai)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 16:50:54 +00:00
Joshua Colp
03bcbd11c1 It is possible for a transfer to occur before the remote device has our tag in which case they send none in the transfer. In this case we need to not fail the transfer dialog lookup.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 16:32:44 +00:00
Jason Parker
e4f15628bb Fix an issue with using UpdateConfig (manager action) where escaped semicolons
in a config would be converted to just semicolons (\; to ;)

Issue 9938


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 16:30:51 +00:00
Joshua Colp
88b982d7ff (closes issue #10355)
Reported by: wdecarne
Now that we pass through RTP timestamp information we need to make the allowed timestamp skew considerably less. There are situations where a source may change and due to the timestamp difference the receiver will experience an audio gap since we did not indicate by setting the marker bit that the source changed.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78172 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 15:27:24 +00:00
Joshua Colp
3e3aedb3c9 (closes issue #10383)
Reported by: rizzo
Include stdlib.h so NULL gets defined for gethostbyname_r checks.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 14:18:20 +00:00
Mark Michelson
b463a8dcbb Fixed a mistake I made in realtime_peer which caused it to return NULL every time.
Thanks to Jon Fealy for emailing me the correction.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 13:33:07 +00:00
Tilghman Lesher
34f8812c64 Portability fix for devmode compiling (closes bug #10382)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-05 14:18:00 +00:00
Russell Bryant
38a51a53db Fix compilation failure when MALLOC_DEBUG is enabled, but DEBUG_THREADS is not
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-05 04:15:31 +00:00
Tilghman Lesher
a7ade6f213 If peer is not found, the error message is misleading (should be peer not found, not ACL failure)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78139 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-05 03:29:01 +00:00
Mark Michelson
05ba4d90d4 Changed the behavior of sip's realtime_peer function to match the corresponding way of matching for non-realtime peers.
Now matches are made on both the IP address and port number, or if the insecure setting is set to "port" then just match on the
IP address.

In order to accomplish this, I also added a new API call, ast_category_root, which returns the first variable of an ast_category struct



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-03 20:25:22 +00:00
Russell Bryant
76f4f0218c (closes issue #10194)
Reported by: blitzrage
Patches:
      bug0010194 uploaded by vovochka
Tested by: blitzrage

Fix a problem when you call Voicemail() with multiple mailboxes specified and 
ODBC_STORAGE is in use.  The audio part of the message was only given to the
first mailbox specified.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-03 20:14:06 +00:00
Russell Bryant
2f41cceb1f Add some improvements to lock debugging. These changes take effect
with DEBUG_THREADS enabled and provide the following:

 * This will keep track of which locks are held by which thread as well as
   which lock a thread is waiting for in a thread-local data structure.  A
   reference to this structure is available on the stack in the dummy_start()
   function, which is the common entry point for all threads.  This information
   can be easily retrieved using gdb if you switch to the dummy_start() stack
   frame of any thread and print the contents of the lock_info variable.

 * All of the thread-local structures for keeping track of this lock information
   are also stored in a list so that the information can be dumped to the CLI
   using the "core show locks" CLI command.  This introduces a little bit of a
   performance hit as it requires additional underlying locking operations
   inside of every lock/unlock on an ast_mutex.  However, the benefits of
   having this information available at the CLI is huge, especially considering
   this is only done in DEBUG_THREADS mode.  It means that in most cases where
   we debug deadlocks, we no longer have to request access to the machine to
   analyze the contents of ast_mutex_t structures.  We can now just ask them
   to get the output of "core show locks", which gives us all of the information
   we needed in most cases.

I also had to make some additional changes to astmm.c to make this work when
both MALLOC_DEBUG and DEBUG_THREADS are enabled.  I disabled tracking of one
of the locks in astmm.c because it gets used inside the replacement memory
allocation routines, and the lock tracking code allocates memory.  This caused
infinite recursion.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-03 19:39:49 +00:00
Russell Bryant
9c3f16e023 Only pass through HOLD and UNHOLD control frames when the mohinterpret option
is set to "passthrough".  This was pointed out by Kevin in the middle of a
training session.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-03 17:01:07 +00:00
Russell Bryant
f58354525f Don't reuse the timespec that was set to 0 in the previous timedwait as it
will just return immediately.  Also, fix some logic so the thread's lock
isn't unlocked twice in the weird case of dynamic threads getting acquired
right after a timeout.
(pointed out by SteveK)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-03 02:04:22 +00:00
Jason Parker
6caf638f90 Make sure we actually allow 6 chars to be sent.
Also make note of the "A" option of date format.

Issue 9779, modifications by DEA, wedhorn, and myself.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77996 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 21:53:39 +00:00
Jason Parker
eb63c3eece If a device disconnects, the session will go away.
If this happens during call setup, we need to give up.

Issue 10325.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77993 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 20:22:40 +00:00
Russell Bryant
311841c1b3 Fix the case where a dynamic thread times out waiting for something to do
during the first time it runs.  This shouldn't ever happen, but we should
account for it anyway.
(pointed out by pete, who works with mihai)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 19:25:14 +00:00
Jason Parker
4386df68d9 Make sure we clear the prompt status message on a hangup.
Also rearrange messages to better fit with what a wireshark trace shows it should be.

Issue 10299, initial patch and solution by sbisker, modified by me to fit with wireshark trace.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 18:42:36 +00:00
Steve Murphy
a181678820 Merged revisions 77942 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r77942 | murf | 2007-08-02 11:56:37 -0600 (Thu, 02 Aug 2007) | 1 line

This patch hopefully solves 10141; The user is running with it, and it doesn't appear to harm asterisk's operation, and may prevent a crash. I'll store it in 1.2, as we have shut down support on 1.2, but since I developed the patch before support finished, and it might affect 1.4 and trunk, I'm going ahead with it.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 18:21:40 +00:00
Russell Bryant
02f69d36f4 Fix another race condition in the handling of dynamic threads. If the dynamic
thread timed out waiting for something to do, but was acquired to perform an
action immediately afterwords, then wait on the condition again to give the
other thread a chance to finish setting up the data for what action this thread
should perform.  Otherwise, if it immediately continues, it will perform the
wrong action.
(reported on IRC by mihai, patch by me)
(related to issue #10289)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 18:04:43 +00:00
Russell Bryant
847515b5c6 Add another sanity check to vnak_retransmit(). This check ensures that frames
that have already been marked for deletion don't get retransmitted.
(closes issue #10361, patch from mihai)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 16:56:04 +00:00
Jason Parker
e3bf324023 Make sure that we show the correct extension if dialed from a macro
"From: 5555" rather than "From: s"

Issue 10358, initial patch by DEA, reworked by me to use S_OR, tested by sbisker


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 15:15:45 +00:00
Jason Parker
db137aca0f Put in some additional debug information for softkey/stimulus messages.
Issue 10291, patch by DEA.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 22:28:56 +00:00
Russell Bryant
5179aee53b Fix some race conditions which have been causing weird problems in chan_iax2.
The most notable problem is that people have been seeing storms of VNAK frames
being sent due to really old frames mysteriously being in the retransmission
queue and never getting removed.

It was possible that a dynamic thread got created, but did not acquire its lock
before the thread that created it signals it to perform an action.  When this
happens, the thread will sleep until it hits a timeout, and then get destroyed.
So, the action never gets performed and in some cases, means a frame doesn't
get transmitted and never gets freed since the scheduler never gets a chance
to reschedule transmission.

Another less severe race condition is in the handling of a timeout for a dynamic
thread.  It was possible for it to be acquired to perform at action at the same
time that it hit a timeout.  When this occurs, whatever action it was acquired
for would never get performed.

(patch contributed by Mihai and SteveK)
(closes issue #10289)
(closes issue #10248)
(closes issue #10232)
(possibly related to issue #10359)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 22:16:17 +00:00
Tilghman Lesher
9b71e8eef2 Voicemail with ODBC_STORAGE defined does not compile cleanly (missing def)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 22:14:47 +00:00
Jason Parker
d44d0a9a8c Fix an issue that caused one-way audio on some newer devices (specifically the 7921),
due to sending packets in the wrong order during hangup.

Also make sure we clear tones/messages on the correct line/instance.

Issue 10291, patch by DEA, tested by sbisker and myself.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 21:08:42 +00:00
Joshua Colp
97885fed58 (closes issue #10351)
Reported by: ftarz
Some platforms don't like it when you pass NULL to vsnprintf so pass "" instead.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77871 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 18:08:51 +00:00
Joshua Colp
68c221f69a Add some fixes for building on Solaris.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77869 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 17:56:59 +00:00
Joshua Colp
8e5dfb3cf9 Whoops, I meant R_5 not R5.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 17:52:11 +00:00
Joshua Colp
927a66c9ae And for my last trick... make sure that if gethostbyname_r is exported by a library that it is used.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77865 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 17:42:52 +00:00
Joshua Colp
bc7150c380 Extend autoconf logic to determine which version of gethostbyname_r is on the system.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77863 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 17:22:35 +00:00
Mark Michelson
5739eba48e Fixes an issue I introduced to queues wherein a queue with joinempty=yes would kick people out of the queue because of erroneously
thinking the 'n' option was in use.

(closes issue #10320, reported by jfitzgibbon, patched by me, tested by blitzrage and me)

Thank you blitzrage for all the testing you've done lately with queues! It's much appreciated!



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77854 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 14:08:57 +00:00
Mark Michelson
7e6f78d95e If a queue uses dynamic realtime members, then the member list should be updated after each attempt to call the queue.
This fixes an issue where if a caller calls into a queue where no one is logged in, they would wait forever even if a member
logged in at some point.

(closes issue #10346, reported by and tested by blitzrage, patched by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 13:59:59 +00:00
Jim Dixon
93c169da6f Much newer version, 0.70 with much additions
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31 21:09:39 +00:00
Jim Dixon
cd1614fcd8 Made VAST improvements in DTMF receiver in RADIO_RELAX mode (thanx Steve
W9SH), and oversight in logic in TONE_VERIFY/RELAX mode in chan_zap.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31 21:00:08 +00:00
Steve Murphy
fa7175eefb Merged revisions 77842 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r77842 | murf | 2007-07-31 13:19:35 -0600 (Tue, 31 Jul 2007) | 1 line

This probably isn't super-general, but it's a first stab at using kill -11 to generate a core file instead of gcore.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77844 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31 20:59:10 +00:00
Joshua Colp
35ceaca691 Add a flag to the speech API that allows an engine to set whether it received results or not.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77831 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31 16:17:09 +00:00
Kevin P. Fleming
e03bec2c16 DETECT_DEADLOCKS can't be enabled without DEBUG_THREADS or it does nothing
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77827 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31 15:53:42 +00:00
Mark Michelson
43b39d02ae This patch makes Asterisk send 100 Trying provisional responses upon receipt of re-invites. This makes it so that if there are two or more Asterisk
servers between endpoints, the Asterisk servers will not keep retransmitting the re-invites.

(closes issue #10274, reported by cstadlmann, patched by me with approval from file)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77824 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31 15:21:22 +00:00
Jason Parker
25017ad181 Applications like SayAlpha() should not hang up the channel if you
request an "unknown" character such as a comma.
Instead, skip the character and move on.

Issue 10083, initial patch by jsmith, modified by me.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77795 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 20:17:08 +00:00
Russell Bryant
8ed859dfc0 Fix an issue that could potentially cause corruption of the global iax frame
queue.  In the network_thread() loop, it traverses the list using the
AST_LIST_TRAVERSE_SAFE macro.  However, to remove an element of the list within
this loop, it used AST_LIST_REMOVE, instead of AST_LIST_REMOVE_CURRENT, which I
believe could leave some of the internal variables of the SAFE macro invalid.
Mihai says that he already made this change in his local copy and it didn't help
his VNAK storm issues, but I still think it's wrong.  :)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77794 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 20:16:43 +00:00
Russell Bryant
0bc611f555 (closes issue #10279)
Reported by: seanbright
Patches:
      res_agi.carefulwrite.1.4.07252007.patch uploaded by seanbright (license 71)
      res_agi.carefulwrite.trunk.07252007.patch uploaded by seanbright (license 71)

Allow the "agi_network: yes" line to be printed out in the AGI debug output.
Also, allow partial writes to be handled when writing out this line just like
it is for all of the others.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77788 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 19:13:31 +00:00
Russell Bryant
0a2331cf26 file and I both committed changes for issue #10301. Remove a duplicated
assignment to restore the original value of the previous channel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 18:55:15 +00:00
Tilghman Lesher
834260a648 Merged revisions 77782 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r77782 | tilghman | 2007-07-30 13:40:54 -0500 (Mon, 30 Jul 2007) | 2 lines

Revert change in revision 71656, even though it fixed a bug, because many people were depending upon the (broken) behavior.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 18:43:55 +00:00
Russell Bryant
e533cabf1c (closes issue #10301)
Reported by: fnordian
Patches:
      asterisk-1.4.9-channel.c.patch uploaded by fnordian (license 110)
      Additional changes by me

Fix some problems in channel_find_locked() which can cause an infinite loop.
The reference to the previous channel is set to NULL in some cases.  These changes
ensure that the reference to the previous channel gets restored before needing
it again.

I'm not convinced that the code that is setting it to NULL is really the right
thing to do.  However, I am making these changes to fix the obvious problem
and just leaving an XXX comment that it needs a better explanation that what
is there now.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77780 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 17:29:43 +00:00
Joshua Colp
cd53ad9161 (closes issue #10327)
Reported by: kkiely
Instead of directly mucking with the extension/context/priority of the channel we are transferring when it has a PBX simply call ast_async_goto on it. This will ensure that the channel gets handled properly and sent to the right place.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 17:11:02 +00:00
Joshua Colp
33abae518a (closes issue #10301)
Reported by: fnordian
Patches:
      asterisk-1.4.9-channel.c.patch uploaded by fnordian (license 110)
Restore previous behavior where if we failed to lock the channel we wanted we would return to exactly the same point as if we had just reentered the function.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 15:47:52 +00:00
Joshua Colp
ef742da9a6 Merged revisions 77767 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r77767 | file | 2007-07-30 11:50:02 -0300 (Mon, 30 Jul 2007) | 4 lines

(closes issue #10334)
Reported by: ramonpeek
Pass through the return value from macro_exec through the MacroIf application.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 14:51:44 +00:00
Tilghman Lesher
548f3e339e Missing newline
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-27 18:15:58 +00:00
Joshua Colp
c28511d8ba (closes issue #10310)
Reported by: prashant_jois
Patches:
      cdr_pgsql.patch uploaded by prashant (license 114)
Finish the Postgresql connection after the log messages are printed so we don't access invalid memory.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-27 17:04:08 +00:00
Joshua Colp
20d0b01607 (closes issue #10323)
Reported by: julianjm
Patches:
      chan_sip_device_state_hold_fix.v1.diff.txt uploaded by julianjm (license 99)
Clear ONHOLD flag when decrementing the onHold peer count. If we did not do this the count may keep decreasing.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-27 16:27:16 +00:00
Mark Michelson
7a09244181 "re-invite" was misspelled
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-27 14:30:43 +00:00
Joshua Colp
8fa7c1e9b0 (closes issue #10302)
Reported by: litnialex
If a DTMF end frame comes from a channel without a begin and it is going to a technology that only accepts end frames (aka INFO) then use the minimum DTMF duration if one is not in the frame already.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77460 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26 23:19:04 +00:00
Kevin P. Fleming
e87baf1c81 change protocol for downloads as well
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26 22:16:42 +00:00
Kevin P. Fleming
02a3e0d1c7 use new canonical name for download server
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77424 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26 22:14:21 +00:00
Russell Bryant
536ef99117 AST_DEVMODE was defined in trunk, but not in 1.4. When Asterisk is compiled
under dev mode, AST_DEVMODE will get defined in buildopts.h.  Change 1.4 to
define it in the same way that trunk does.  Also, revert the change that added
this define in the Makefile

The advantage to doing it this way is that buildopts.h gets installed when
you install Asterisk.  Then, when building any out of tree modules, or
building asterisk-addons, these modules know which options the rest of Asterisk
was built with.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26 21:23:23 +00:00
Mark Michelson
dbfdbbf4cc Fixes to get ast_backtrace working properly. The AST_DEVMODE macro was never defined so the majority of ast_backtrace never
attempted compilation. The makefile now defines AST_DEVMODE if configure was run with --enable-dev-mode. Also, changes were 
made to acccomodate 64 bit systems in ast_backtrace.

Thanks to qwell, kpfleming, and Corydon76 for their roles in allowing me to get this committed



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26 20:35:17 +00:00
Tilghman Lesher
bf9ffe0d09 Missed one
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26 19:32:17 +00:00
Tilghman Lesher
e9a1a42967 Oops, that builtin define should be all-lowercase.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26 19:27:18 +00:00
Mark Michelson
e9c7f6f4f2 Two consecutive calls to PQfinish could occur, meaning free gets called on the same variable twice.
This patch sets the connection to NULL after calls to PQfinish so that the problem does not occur.
Also in this patch, prashant_jois informed me that it is safe to pass a null pointer to PQfinish, so
I have removed the check for conn's existence from my_unload_module.

(closes issue 10295, reported by junky, patched by me with input from prashant_jois)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26 18:30:29 +00:00
Steve Murphy
17e2aff7de This fix solves problem with intense squelch noise when someone joins conf in bug 9430; We repro'd the problem with meetme opts of 'CciMo'; Josh Colp supplied this patch, and I'm applying it. It looks like playing the recorded username will louse up the next thing played into the channel. Josh rearranged the code so as to start things over before playing data directly into the conference.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77191 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-25 22:39:27 +00:00
Joshua Colp
7bd5646815 (closes issue #10303)
Reported by: jtodd
Add SPEECH_DTMF_TERMINATOR variable so the user can specify the digit to terminate a DTMF string with. If none is specified then no terminator will be used.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-25 22:16:10 +00:00
Mark Michelson
ccb0f924af chan->emulate_dtmf_duration is an unsigned int, not a signed int, so use %u instead of %d in the format string
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-25 21:52:47 +00:00
Jason Parker
030d34d5b2 so are my fingers...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77136 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-25 20:23:51 +00:00
Jason Parker
d50d94dadb autotagexternals script is still obviously misbehaving...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77135 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-25 20:22:42 +00:00
Jason Parker
49b47a84cb use autotagged externals
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77116 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-25 19:57:22 +00:00
Joshua Colp
bc9a0ea685 Fix autoconf logic for finding OpenH323 when it is not in the first place searched (/usr/share/openh323).
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-25 17:14:14 +00:00
Luigi Rizzo
19ec0f8fe1 set the sequence number in a frame for all frame types
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-25 09:34:01 +00:00
Steve Murphy
0d7eb34a3e Merged revisions 76978 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r76978 | murf | 2007-07-24 18:07:24 -0600 (Tue, 24 Jul 2007) | 1 line

this fixes bug 10293, where the error message because defaultzone or loadzone was not defined was confusing
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76983 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-25 00:18:32 +00:00
Tilghman Lesher
e5c3ef3388 Merged revisions 76934 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r76934 | tilghman | 2007-07-24 17:11:33 -0500 (Tue, 24 Jul 2007) | 2 lines

Oops, res contains the error code, not errno.  I was wondering why a mutex was reporting "No such file or directory"...

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76937 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-24 22:12:43 +00:00
Tilghman Lesher
c7336cd3ff Found another place where we should be using the umask (thanks jcmoore)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76891 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-24 20:42:05 +00:00
Jason Parker
58e6ebd496 Blocked revisions 76802 via svnmerge
........
r76802 | qwell | 2007-07-24 11:32:04 -0500 (Tue, 24 Jul 2007) | 3 lines

Don't create the Asterisk channel until we are starting the PBX on it.
(ASA-2007-018)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-24 16:42:51 +00:00
Jason Parker
9e24b3926f Don't create the Asterisk channel until we are starting the PBX on it.
(ASA-2007-018)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-24 16:32:20 +00:00
Mark Michelson
ad4eb1b347 Added a membercount variable to call_queue struct which keeps track of the number of logged in members in a particular queue.
This makes it so that the 'n' option for Queue() can act properly depending on which strategy is used. If the strategy is
roundrobin, rrmemory, or ringall, we want to ring each phone once before moving on in the dialplan. However, if any other strategy is
used, we will only ring one phone since it cannot be guaranteed that a different phone will ring on subsequent attempts to ring a phone.

As a side effect of this, the QUEUE_MEMBER_COUNT dialplan function now just reads the membercount variable instead of traversing through
the member list to figure out how many members there are.

Special thanks to blitzrage for helping to test this out.

(closes issue #10127, reported by bcnit, patched by me, tested by blitzrage)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76801 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-24 16:26:58 +00:00
Tilghman Lesher
3630b5e477 It was our stated intention for 1.4 that files created in app_voicemail should
depend upon the umask.  Unfortunately, mkstemp() creates files with mode 0600,
regardless of the umask.  This corrects that deficiency.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76708 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23 22:38:06 +00:00
Jason Parker
c92ba70e75 Fix some incorrect softkey labels in messages.
Don't try to play dialtone in some unimplemented features.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23 18:59:28 +00:00
Joshua Colp
2c4fe2dc00 Merged revisions 76653 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r76653 | file | 2007-07-23 15:28:13 -0300 (Mon, 23 Jul 2007) | 4 lines

(closes issue #5866)
Reported by: tyler
Do not force channel format changes when a generator is present. The generator may have changed the formats itself and changing them back would cause issues.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23 18:29:48 +00:00
Jason Parker
b0040e0361 Don't try to queue up hold/unhold frames on a non-existent channel.
Issue 10276.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23 17:57:53 +00:00
Joshua Colp
1fc0771298 Allow app_morsecode to build on PPC Linux by putting the value of the digit char in an int.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23 17:48:51 +00:00
Joshua Colp
91eec8f228 Merged revisions 76560 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r76560 | file | 2007-07-23 11:32:07 -0300 (Mon, 23 Jul 2007) | 6 lines

(closes issue #10236)
Reported by: homesick
Patches:
      rpid_1.4_75840.patch uploaded by homesick (license 91)
Accept Remote Party ID on guest calls.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23 14:34:21 +00:00
Joshua Colp
bd0608a38f (closes issue #10268)
Reported by: mvanbaak
Patches:
      chan_skinny_openbsd.diff uploaded by mvanbaak (license 7)
Add another OS that has to use the Macros for byte ordering.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23 13:23:09 +00:00
Russell Bryant
b838fcc22e Use a signed integer for storing the number of bytes in the packet read from
the network.  Using an unsigned value here made it impossible to handle an
error returned from recvfrom().  Furthermore, in the case that recvfrom()
did return an error, this would cause a crash due to a heap overflow.
(closes issue #10265, reported by and fix suggested by timrobbins)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23 12:25:01 +00:00
Tilghman Lesher
a0ba47ec33 Blocked revisions 76409 via svnmerge
........
r76409 | tilghman | 2007-07-22 16:39:55 -0500 (Sun, 22 Jul 2007) | 2 lines

We should not use C++ reserved words in API headers (closes issue #10266)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-22 21:42:01 +00:00
Russell Bryant
b75f30bdd8 Merged revisions 76226 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r76226 | russell | 2007-07-20 21:01:46 -0500 (Fri, 20 Jul 2007) | 4 lines

Backport a fix for a memory leak that was fixed in trunk in reivision 76221
by rizzo.  The memory used for the localaddr list was not freed during a
configuration reload.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-21 02:02:54 +00:00
Steve Murphy
54e80e7c46 This patch from 10249 is worth applying! It prevents downloading sound files if they are already downloaded. Darn Practical, if you ask me
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-20 21:36:05 +00:00
Jason Parker
d0baa5500e Allow getting a call from an existing "sub" channel.
Cancel ringing if endpoint hangs up before answering.

Fixes were backported from trunk (there was apparently a bit of confusion during merge of a previous patch).
(closes issue #10241)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76178 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-20 21:03:57 +00:00
Jason Parker
24f0e6a947 Eliminate a compiler warning with gcc 4.2 by constifying a char *
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-20 20:54:10 +00:00
Jason Parker
73452d34a1 It's possible for sub->owner to be NULL here if you cancel the call immediately after/during sending a digit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-20 20:32:55 +00:00
Mark Michelson
7fd9d67e7a When using users.conf for the entries in the directory, if multiple users had the same last name, only the first user listed would be available
in the directory.

(closes issue #10200, reported by mrskippy, patched by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76139 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-20 18:42:27 +00:00
Russell Bryant
7f9bf7e970 Use the define that specifies the default length of an artificially created
DTMF digit in the ast_senddigit() function.  The define is set to 100ms by
default, which is the same thing that this function was using.  But, using
the define lets changes take effect in this case, as well as the others where
it was already used.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-20 18:22:24 +00:00
Joshua Colp
24e7873766 Merged revisions 76080 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r76080 | file | 2007-07-20 14:16:48 -0300 (Fri, 20 Jul 2007) | 6 lines

(closes issue #10247)
Reported by: fkasumovic
Patches:
      chan_sip.patch uploaded by fkasumovic (license #101)
Drop any peer realm authentication entries when reloading so multiple entries do not get added to the peer.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-20 17:20:09 +00:00
Joshua Colp
95be40cb27 (closes issue #10246)
Reported by: fkasumovic
Patches:
      res_conver.patch uploaded by fkasumovic (license #101)
Use the last occurance of . to find the extension, not the first occurance.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-20 17:10:17 +00:00
Joshua Colp
34b000a0e7 Move makeannouncement variable declaration to proper place.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76054 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-20 16:49:13 +00:00
Jason Parker
6fde7764dc Remove some duplicate code.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-19 20:36:06 +00:00
Mark Michelson
049fb8d98e The diff on this looks pretty big but all I did was remove a pointless if statement (always evaluates true).
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-19 18:59:30 +00:00
Mark Michelson
1f9e2457dd Changes in handling return values of several functions in app_queue. This all started as a fix for issue #10008
but now includes all of the following changes:

1. Simplifying the code to handle positive return values from ast API calls.
2. Removing the background_file function.
3. The fix for issue #10008

(closes issue #10008, reported and patched by dimas)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75969 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-19 16:26:10 +00:00
Russell Bryant
ee82ac13d6 Merged revisions 75927 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r75927 | russell | 2007-07-19 10:49:42 -0500 (Thu, 19 Jul 2007) | 6 lines

When processing full frames, take sequence number wraparound into account when
deciding whether or not we need to request retransmissions by sending a VNAK.
This code could cause VNAKs to be sent erroneously in some cases, and to not
be sent in other cases when it should have been.
(closes issue #10237, reported and patched by mihai)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75928 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-19 15:53:15 +00:00
Jason Parker
c6a174bd96 Need to make sure we set milliseconds and timestamp - pointed out by the recent ast_ time stuff from Tilghman
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 22:59:18 +00:00
Russell Bryant
5eedf74578 Merged revisions 75757 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r75757 | russell | 2007-07-18 16:09:13 -0500 (Wed, 18 Jul 2007) | 5 lines

When traversing the queue of frames for possible retransmission after
receiving a VNAK, handle sequence number wraparound so that all frames that 
should be retransmitted actually do get retransmitted.
(issue #10227, reported and patched by mihai)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 21:09:46 +00:00
Tilghman Lesher
0b6bdf6bf3 Merged revisions 75748 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r75748 | tilghman | 2007-07-18 15:31:36 -0500 (Wed, 18 Jul 2007) | 2 lines

Store prior to copy (closes issue #10193)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 20:40:18 +00:00
Jason Parker
48138cca9d Umm, why are we transmitting dialtone on cfwdall?
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 20:17:27 +00:00
Joshua Colp
6d143d401f Backport GCC 4.2 fixes. Without these Asterisk won't build under devmode using GCC 4.2.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 20:00:23 +00:00
Jason Parker
7d9778c9f8 Fixes for 7935/7936 conference phones.
Issue 9245, patch by slimey.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 19:54:32 +00:00
Jason Parker
2e7fe12cfb Fix issues with new 79x1 phones.
Issue 9887, patches by DEA


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 19:48:12 +00:00
Dwayne M. Hubbard
226a627244 Merged revisions 75657 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r75657 | dhubbard | 2007-07-18 12:48:33 -0500 (Wed, 18 Jul 2007) | 1 line

removed the word 'pissed' from ast_log(...) function call for BE-90
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75658 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 17:56:30 +00:00
Joshua Colp
55a12a986e Few more places that needs to check for onhold state.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 15:44:02 +00:00
Joshua Colp
f08e137283 (closes issue #10165)
Reported by: elandivar

It is possible for hold status to exist without call limits set, so we need to ensure update_call_counter is executed regardless.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 15:41:06 +00:00
Joshua Colp
dc9b640755 Don't bother reloading chan_h323 if it did not load successfully in the first place. This would otherwise cause a crash.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75619 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 15:25:45 +00:00
Joshua Colp
f836d642f9 (closes issue #10224)
Reported by: irroot

Record the threadid of each running thread before shutting them down as the thread themselves may change the value.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 14:18:53 +00:00
Tilghman Lesher
6cab645954 Using a freed frame causes crashes (closes issue #9317)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 12:29:41 +00:00
Russell Bryant
c6e2a119b7 Merged revisions 75449 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r75449 | russell | 2007-07-17 15:57:09 -0500 (Tue, 17 Jul 2007) | 3 lines

Properly check for the length in the skinny packet to prevent an invalid memcpy.
(ASA-2007-016)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 20:57:56 +00:00
Russell Bryant
c83a0b2a3c cast arguments to ast_log so that it builds without warnings for me
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75447 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 20:51:25 +00:00
Russell Bryant
89497599be Merged revisions 75444 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r75444 | russell | 2007-07-17 15:45:27 -0500 (Tue, 17 Jul 2007) | 5 lines

Ensure that when encoding the contents of an ast_frame into an iax_frame, that
the size of the destination buffer is known in the iax_frame so that code
won't write past the end of the allocated buffer when sending outgoing frames.
(ASA-2007-014)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 20:48:21 +00:00
Russell Bryant
2193734456 Merged revisions 75440 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r75440 | russell | 2007-07-17 15:41:41 -0500 (Tue, 17 Jul 2007) | 4 lines

After parsing information elements in IAX frames, set the data length to zero,
so that code later on does not think it has data to copy.
(ASA-2007-015)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75441 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 20:42:12 +00:00
Joshua Colp
396e723f17 Ensure that the pointer to STUN data does not go to unaccessible memory. (ASA-2007-017)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75439 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 20:40:57 +00:00
Russell Bryant
bdf09824c6 (issue #10210)
Reported by: juggie
Patches:
      10210-1.4-grr.patch uploaded by juggie (license #24)
Tested by: juggie, blitzrage

Log a warning if someone uses DeadAGI on a live channel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 20:33:06 +00:00
Mark Michelson
e4cc4ef183 Fixing an error I made earlier. ast_fileexists can return -1 on failure, so I need to be sure that we only enter the if
statement if it is successful.

Related to my fix to issue #10186



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 20:03:48 +00:00
Russell Bryant
0a1a04137e (closes issue #10209)
Reported by: juggie
Patches:
      10209-trunk-2.patch uploaded by juggie
Tested by: juggie, blitzrage

In ast_pbx_run(), mark a channel as hung up after an application returned -1, 
or when it runs out of extensions to execute.  This is so that code can detect
that this channel has been hung up for things like making sure DeadAGI is used
on actual dead channels, and is beneficial for other things, like making sure
someone doesn't try to start spying on a channel that is about to go away.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75403 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 20:01:12 +00:00
Russell Bryant
6f40b0d2b4 Remove a duplicated newline character in AGI debug output.
(closes issue #10207, patch by seanbright)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 19:45:07 +00:00
Kevin P. Fleming
d0cb9b141d Merged revisions 75304 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r75304 | kpfleming | 2007-07-16 15:46:58 -0500 (Mon, 16 Jul 2007) | 3 lines

provide proper copyright/license attribution for this structure that was copied from a BSD-licensed header file long, long ago...


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-16 20:53:24 +00:00
Kevin P. Fleming
725f93c497 another fix that is not needed here (finishing up 75251)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-16 18:33:50 +00:00
Mark Michelson
402820c9e3 Restoring functionality from 1.2 wherein Retrydial will not exit if there is no announce file specified.
This change makes it so that if there is no announce file specified, the application will continue until finished (or caller hangs up).
If a bogus announce file is specified, then a warning message will be printed saying that the file could not be found, but execution will
still continue. 

(closes issue #10186, reported by jon, patched by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-16 18:16:15 +00:00
Kevin P. Fleming
2efa8da290 block change that is not relevant here
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75252 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-16 18:12:31 +00:00
Russell Bryant
aa44ffb5c3 Merged revisions 75107 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r75107 | russell | 2007-07-13 15:35:22 -0500 (Fri, 13 Jul 2007) | 3 lines

Fix a couple potential minor memory leaks.  load_moh_classes() could return
without destroying the loaded configuration.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75108 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-13 20:36:16 +00:00
Mark Michelson
90da4da6ad Merged revisions 75066 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r75066 | mmichelson | 2007-07-13 15:10:39 -0500 (Fri, 13 Jul 2007) | 5 lines

Fixed an issue where chanspy flags were uninitialized if no options were passed.
What triggered this investigation was an IRC chat where some people's quiet flags were
set while others' weren't even though none of them had specified the q option.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-13 20:15:30 +00:00
Russell Bryant
e7afb1e237 Merged revisions 75059 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r75059 | russell | 2007-07-13 15:07:21 -0500 (Fri, 13 Jul 2007) | 6 lines

Ensure that adding a user to the list of users of a specific music on hold
class is not done at the same time as any of the other operations on this list
to prevent list corruption.  Using the global moh_data lock for this is not
ideal, but it is what is used to protect these lists everywhere else in the
module, and I am only changing what is necessary to fix the bug.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-13 20:10:40 +00:00
Russell Bryant
3e138057df Merged revisions 75052 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r75052 | russell | 2007-07-13 14:10:00 -0500 (Fri, 13 Jul 2007) | 12 lines

(closes issue #9660)
Reported by: mmacvicar
Patches submitted by: bbryant, russell
Tested by: mmacvicar, marco, arcivanov, jmhunter, explidous

When using a TDM400P (and probably other analog cards) there was a chance that
you could hang up and pick the phone back up where it has been long enough to
be not considered a flash hook, but too soon such that the device reports that
it is busy and the person on the phone will only hear silence.  This patch
makes chan_zap more tolerant of this and gives the device a couple of seconds 
to succeed so the person on the phone happily gets their dialtone.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-13 19:11:26 +00:00
Mark Michelson
613059e270 Change to my previous fix regarding agent logoff soft. Now uses deferlogoff instead of loginstart
since loginstart is used after logoff. Thanks to makoto for pointing this out and suggesting the fix.

(closes issue #10178, reported and patched by makoto, with modification by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-12 23:00:32 +00:00
Steve Murphy
2aab6c341f This patch resolves 10143; thanks to irroot for the patch; looked acceptable. Let the community decide if it messes things up
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-12 20:42:08 +00:00
Joshua Colp
7152afccd5 Whoops... didn't want this to be returned to 0 each iteration.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-12 19:17:59 +00:00
Joshua Colp
26acd893d3 When waiting for a digit ensure that a begin frame was received with it, not just an end frame. (issue #10084 reported by rushowr)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-12 17:16:28 +00:00
Jason Parker
f642f7fc86 It helps if I actually add this stuff for the 7921 too - otherwise it won't actually do much of anything.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-12 16:53:35 +00:00
Jason Parker
d6ff30694e Add device ID for 7921 wireless skinny phone
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-12 16:48:49 +00:00
Jason Parker
abf5430584 Fix dialing in skinny that was broken in some cases.
Issue 10136, fix provided by DEA.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-12 16:16:59 +00:00
Joshua Colp
54b08bfe83 Merged revisions 74814 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r74814 | file | 2007-07-12 12:51:24 -0300 (Thu, 12 Jul 2007) | 2 lines

Only print out a warning for situations where it is actually helpful. (issue #10187 reported by denke)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74815 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-12 15:53:55 +00:00
Russell Bryant
1eb3dd6381 Merged revisions 74766 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r74766 | russell | 2007-07-11 17:53:26 -0500 (Wed, 11 Jul 2007) | 5 lines

The function make_trunk() can fail and return -1 instead of a valid new call
number.  Fix the uses of this function to handle this instead of treating it
as the new call number.  This would cause a deadlock and memory corruption.
(possible cause of issue #9614 and others, patch by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74767 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-11 22:57:07 +00:00
Mark Michelson
b827d5a183 Merged revisions 74719 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r74719 | mmichelson | 2007-07-11 16:12:30 -0500 (Wed, 11 Jul 2007) | 5 lines

The cli command "agent logoff Agent/x soft" did not work...at all. Now it does.

(closes issue #10178, reported and patched by makoto, with slight modification for 1.4 and trunk by me)


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-11 21:14:09 +00:00
Russell Bryant
8b7295be2d Merged revisions 74656 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r74656 | russell | 2007-07-11 13:33:23 -0500 (Wed, 11 Jul 2007) | 4 lines

Make sure that the ESCAPE immediately follows the condition that uses LIKE.
This fixes realtime extensions with ODBC.
(closes issue #10175, reported by stuarth, patch by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74657 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-11 18:34:51 +00:00
Steve Murphy
7363244381 This fixes 10172, where the entire man8 dir gets removed during an uninstall of asterisk
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74642 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-11 18:18:42 +00:00
Steve Murphy
19041621f6 further reversion of previously applied floating point stuff for expr2
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-11 18:11:44 +00:00
Joshua Colp
8718f08cbd Blocked revisions 74587 via svnmerge
........
r74587 | file | 2007-07-11 14:15:11 -0300 (Wed, 11 Jul 2007) | 2 lines

Use some Makefile magic to determine if linux/compiler.h is present. (issue #10174 reported by francesco_r)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74590 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-11 17:16:25 +00:00
Joshua Colp
5f37fa26d2 Instead of figuring out kernel versions that have compiler.h and not... let's just use autoconf to check for it's presence. (issue #10174 reported by francesco_r)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-11 17:03:08 +00:00
Joshua Colp
058a40ff02 Only check if we need to do a SIGMA based tone generation if we have a card. (issue #10179 reported by mikowhy)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74515 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-11 14:09:13 +00:00
Mark Michelson
4ab675ca50 Forwarding a message with IMAP storage was storing the message in the sender's box instead of the forwarded mailbox.
(closes issue #10138, reported and patched by jaroth)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-10 23:32:52 +00:00
Jason Parker
05923bb562 Merged revisions 74427 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r74427 | qwell | 2007-07-10 14:57:20 -0500 (Tue, 10 Jul 2007) | 6 lines

Fix an issue where it was possible to have a service level of over 100%
Between the time recalc_holdtime and update_queue was called, it was possible that the call could have been hungup.
Move both additions to the same place, so this won't happen.

Issue 10158, initial patch by makoto, modified by me.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74428 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-10 19:58:53 +00:00
Jason Parker
7e0ab0fa62 Don't use #if to check if something is defined - use #ifdef instead.
Pointed out by kpfleming


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74388 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-10 19:10:36 +00:00
Jason Parker
f3c04c4b7e Merged revisions 74376 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r74376 | qwell | 2007-07-10 14:03:45 -0500 (Tue, 10 Jul 2007) | 4 lines

Fix an issue with wrapuptime not working when using AgentLogin.

Issue 10169, patch by makoto, with a minor mod by me to not re-break issue 9618

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-10 19:06:24 +00:00
Jason Parker
d4a7eb584f Merged revisions 74373 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r74373 | qwell | 2007-07-10 13:37:23 -0500 (Tue, 10 Jul 2007) | 5 lines

Use res_ndestroy on systems that have it.  Otherwise, use res_nclose.
This prevents a memleak on NetBSD - and possibly others.

Issue 10133, patch by me, reported and tested by scw

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-10 18:39:30 +00:00
Russell Bryant
3ddbe8e0b6 fix an uninitialized variable
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74323 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-10 16:00:11 +00:00
Jason Parker
53b44803ee Merged revisions 74316 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r74316 | qwell | 2007-07-10 10:37:54 -0500 (Tue, 10 Jul 2007) | 4 lines

Fix a small typo in description in of Voicemail() application.

Issue 10170, patch by casper.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-10 15:38:32 +00:00
Russell Bryant
b4865e6eea Merged revisions 74313 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r74313 | russell | 2007-07-10 10:30:20 -0500 (Tue, 10 Jul 2007) | 3 lines

Only use ESCAPE when LIKE is used.  
(issue #10075, this part reported by jmls on IRC, patch by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-10 15:31:41 +00:00
Joshua Colp
49584ec434 Merged revisions 74264 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r74264 | file | 2007-07-10 11:48:00 -0300 (Tue, 10 Jul 2007) | 2 lines

Ensure the group information category exists before trying to do a string comparison with it. (issue #10171 reported by mlegas)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-10 14:50:00 +00:00
Joshua Colp
446f14f0dc Only spit out an inringing warning message when it is applicable. Since call limits are already toast in realtime let's not scare the user if they are using it. (issue #10166 reported by bcnit)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-10 14:07:13 +00:00
Russell Bryant
1f96da91d4 Update the configure script to check for a required function that is not present
in the 1.2 version of libpri.  This will prevent the configure script from thinking
that it has compatible libpri support for Asterisk 1.4, when it actually does not
because the installed version is from 1.2.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-09 21:31:30 +00:00
Russell Bryant
e4142b6218 Blocked revisions 74165 via svnmerge
........
r74165 | russell | 2007-07-09 16:00:17 -0500 (Mon, 09 Jul 2007) | 4 lines

When the specified class isn't found, properly fall back to the channel's music
class or the default.
(issue #10123, reported by blitzrage, patches from juggie, qwell, and me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-09 21:00:47 +00:00
Russell Bryant
b4960ab566 (closes issue #10123)
Reported by: blitzrage
Patches submitted by: juggie, qwell, me
Tested by: blitzrage

When trying to find a music on hold class to use, try all of the options,
instead of only the first one that is set.  Also, change the MusicOnHold
applications to not hang up on the channel when a class can not be found.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74162 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-09 20:53:46 +00:00
Jason Parker
bf8172ff95 Merged revisions 74158 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r74158 | qwell | 2007-07-09 15:18:15 -0500 (Mon, 09 Jul 2007) | 8 lines

Several chan_zap options were not working on reload because they were arbitrarily
 disallowed when reloading some/most PRI options (such as signalling) was disallowed.

Options such as polarityonanswerdelay and answeronpolarityswitch can safely be changed on a reload.
This corrects that behavior.

Issue 9186, patch by tzafrir.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74159 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-09 20:19:28 +00:00
Mark Michelson
5112357ae1 Forgot to get rid of an extraneous debug message.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-09 18:38:28 +00:00
Mark Michelson
591f77fe14 The n option for Queue should make the queue exit immediately after failure to reach any members and should not
be dependent on the timeout value passed to Queue

(closes issue #10127, reported by bcnit, repaired by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-09 18:32:50 +00:00
Joshua Colp
94cd7026ef Only destroy the scheduler context if it was allocated. (issue #10124 reported by gzero)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-09 15:32:43 +00:00
Mark Michelson
441d1bbdf5 Fixed a logic error in leave_voicemail. Pass the mailbox instead of the context to inbox_count when the context is "default."
(closes issue #10135, reported by yannj, repaired by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74047 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-09 14:57:41 +00:00
Joshua Colp
ce4e654f2c Few minor thread synchronization tweaks. (issue #10124 reported by gzero)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-09 14:49:05 +00:00
Joshua Colp
475e3be7c0 Use AC_CHECK_HEADER to check for ptlib/openh323 to allow for cross compiling. (issue #9675 reported by zandbelt)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74043 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-09 14:34:33 +00:00
Tilghman Lesher
befa215f7b Doxygen formatting fixes; fixes errors while 'make progdocs'. (Closes issue #10104)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-09 04:03:20 +00:00
Joshua Colp
a979d44c9c Give Agent channel names priority when doing CDR merging. (issue #10011 reported by krtorio)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-09 03:13:19 +00:00
Joshua Colp
1944dea3bd Add a few sanity checks when writing out the dialplan. (issue #10157 reported by dome)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73930 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-09 01:13:57 +00:00
Olle Johansson
7bbda30564 While tracking down a bug, I need some more history. Dumphistory is very useful, indeed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-08 09:47:31 +00:00
Russell Bryant
5b544349d9 Merged revisions 73768 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r73768 | russell | 2007-07-06 18:01:22 -0500 (Fri, 06 Jul 2007) | 4 lines

If a sip_pvt struct has already registered an extension state callback,
remove the old one before adding a new one.  If this isn't done, Asterisk
will crash.  (issue #10120)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73769 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-06 23:02:58 +00:00
Mark Michelson
bf9d8ab999 Fixing a rare case which causes voicemail to crash when compiled with IMAP storage.
inboxcount has the possibility of finding an "interactive" vm_state when no persistent "non-interactive"
vm_state exists for that mailbox. If this should happen when someone attempts to leave a message, it results in
a crash. This patch, along with my commit in revision 72670 fix issue 10053, reported by jaroth.

closes issue #10053



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-06 16:36:17 +00:00
Russell Bryant
cfc227a879 Merged revisions 73684 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r73684 | russell | 2007-07-06 11:06:27 -0500 (Fri, 06 Jul 2007) | 8 lines

(closes issue #10075)
Reported by: apsaras
Patches submitted by: Corydon76
Tested by: apsaras

Fix a problem with MSSQL 2005 by explicitly stating that '\' is being used as
an escape character.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-06 16:12:51 +00:00
Russell Bryant
1e588db75a Merged revisions 73678 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r73678 | russell | 2007-07-06 10:55:41 -0500 (Fri, 06 Jul 2007) | 7 lines

(closes issue #10125)
Reported by: makoto
Patches submitted by: makoto

This fixes a crash in chan_sip that happens when the bindaddr setting is not
valid on Asterisk startup, gets fixed, and then a reload gets issued.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-06 15:57:25 +00:00
Mark Michelson
757160d5c9 Merged revisions 73674 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r73674 | mmichelson | 2007-07-06 10:26:40 -0500 (Fri, 06 Jul 2007) | 5 lines

Fixed a bug wherein agents get stuck busy. (issue 9618, reported by jiddings, patched by moi)

closes issue #9618


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73675 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-06 15:27:28 +00:00
Russell Bryant
43fedab263 fix a little spelling error
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-06 03:34:46 +00:00
Russell Bryant
be09062a6a Fix a crash in chan_sip. Don't try to stop the monitor thread if it was never
started.  (closes issue #10124, reported by gzero, fixed by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-05 23:59:22 +00:00
Russell Bryant
cf2c26a948 copy from the correct buffer when deferring a full frame
(related to issue #9937)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73555 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-05 23:05:33 +00:00
Russell Bryant
be1502faa3 * Store the call number that a thread is processing without the full frame bit
set to ease debugging
* When deferring a full frame for processing, stick it into the queue for the
  thread that is processing frames for that call, not the one that read the
  current frame and is about to go back into the idle list
(related to issue #9937)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-05 22:31:31 +00:00
Kevin P. Fleming
3b8be36363 Merged revisions 73547 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r73547 | kpfleming | 2007-07-05 17:11:51 -0500 (Thu, 05 Jul 2007) | 2 lines

we shouldn't allow G.723.1 endpoints to use VAD, just like we don't support it for G.729

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73548 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-05 22:20:44 +00:00
Russell Bryant
6a2ab6b475 Pass HOLD and UNHOLD frames to the other channel when they are returned from a
native bridge function.  This fixes a problem where when two zap channels are
natively bridged and one does a flash hook, the other channel did not receive
music on hold.  (Reported to me directly by Doug Bailey at Digium)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-05 20:50:08 +00:00
Joshua Colp
9b753a0649 Merged revisions 73466 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r73466 | file | 2007-07-05 16:15:18 -0300 (Thu, 05 Jul 2007) | 2 lines

Copy language information to the dialog structure when calling a peer for situations where a PBX may be started on the dialed channel. (issue #10121 reported by clegall_proformatique)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73467 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-05 19:18:02 +00:00
Mark Michelson
60c9f69f20 Correcting a minor CLI bug I found. When issuing the queue show command, if you type
queue show and then press tab, you can continue pressing tab and it will keep auto-completing
queue names even though only 1 queue can be used as an argument.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-05 15:59:41 +00:00
Russell Bryant
0041898603 Make this module build for me in dev-mode
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73398 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-05 15:28:27 +00:00
Joshua Colp
0e80607e17 Merged revisions 73349 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r73349 | file | 2007-07-05 11:19:14 -0300 (Thu, 05 Jul 2007) | 2 lines

Tweak spy locking. (issue #9951 reported by welles)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73355 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-05 14:21:44 +00:00
Joshua Colp
f912c6ba71 Merged revisions 73318 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r73318 | file | 2007-07-05 10:26:02 -0300 (Thu, 05 Jul 2007) | 2 lines

Actually check to make sure a PBX was started on one of the Local channels instead of blindly assuming it was. (issue #10112 reported by makoto)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73319 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-05 13:27:40 +00:00
Joshua Colp
6fec0a545f Merged revisions 73315 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r73315 | file | 2007-07-05 10:19:17 -0300 (Thu, 05 Jul 2007) | 2 lines

Reset ServicelevelPerf variable back to 0 if we are unable to calculate it each time... otherwise we will get previous values. (issue #10117 reported by noriyuki)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-05 13:22:13 +00:00
Christian Richter
a95d9718c9 Merged revisions 73252 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r73252 | crichter | 2007-07-04 16:50:58 +0200 (Mi, 04 Jul 2007) | 1 line

bchannel configurations like echocancel and volume control, need to be setuped on inbound calls too.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-04 14:53:48 +00:00
Christian Richter
17be3d5858 Merged revisions 73207 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r73207 | crichter | 2007-07-04 10:20:54 +0200 (Mi, 04 Jul 2007) | 1 line

bad bug in overlapdial case, we called start_pbx multiple times, because the state wasn't changed..
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73208 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-04 08:27:44 +00:00
Steve Murphy
ad36e954a7 Removing expr floating patch from 1.4; too much of a behavior change. If you want this fix, try trunk instead. bug 9508.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-03 20:17:31 +00:00
Jason Parker
7ba16c9878 What the heck. This should not have happened.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-03 15:42:16 +00:00
Jason Parker
0c7cde0efc use autotagged externals
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-03 15:40:14 +00:00
Tilghman Lesher
3a215d6a50 Merged revisions 73052 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r73052 | tilghman | 2007-07-03 07:34:14 -0500 (Tue, 03 Jul 2007) | 2 lines

RetryDial should accept a 0 argument, but it does not, because atoi does not distinguish between 0 and error (closes issue #10106)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-03 12:38:53 +00:00
Christian Richter
1e392965f4 Merged revisions 73004 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r73004 | crichter | 2007-07-03 10:04:35 +0200 (Di, 03 Jul 2007) | 1 line

fixed issue, that misdn_l2l1_check could only be called from mISDN Source channels.. #9449
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73005 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-03 08:17:06 +00:00
Steve Murphy
adc13be87b support for floating point numbers added to ast_expr2 $\[...\] exprs. Fixes bug 9508, where the expr code fails with fp numbers. The MATH function returns fp numbers by default, so this fix is considered necessary.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-02 20:16:31 +00:00
Russell Bryant
76164559c9 Remove a bogus comment and add proper locking to the handler function for the
CLI command to show information on manager actions.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-02 18:18:46 +00:00
Jason Parker
1c18332e3f Blocked revisions 72924 via svnmerge
........
r72924 | qwell | 2007-07-02 12:58:25 -0500 (Mon, 02 Jul 2007) | 4 lines

Fix an issue with playing "oclock" multiple times in French with 24 hour time format.

Issue 10101

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-02 17:59:38 +00:00
Joshua Colp
a3716070d1 Added additional DTMF debug messages for when emulation occurs.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-02 14:32:59 +00:00
Christian Richter
07a72b546f Merged revisions 72585 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72585 | crichter | 2007-06-29 15:08:26 +0200 (Fr, 29 Jun 2007) | 1 line

check if the bchannel stack id is already used, if so don't use it a second time. Also added a release_chan lock, so that the same chan_list object cannot be freed twice. chan_misdn does not crash anymore on heavy load with these changes.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-02 08:41:08 +00:00
Christian Richter
8fc4089947 Merged revisions 72099 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72099 | crichter | 2007-06-27 15:22:37 +0200 (Mi, 27 Jun 2007) | 1 line

simplified generation for dummy bchannels, also we mark them as dummies, so they are not used later as real-bchannels, optimized the RESTART mechanisms, we block a channel now on cause:44, and send out a RESTART automatically, then on reception of RESTART_ACKNOWLEDGE we unblock the channel again.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72851 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-02 08:27:19 +00:00
Christian Richter
9dc0104a12 Merged revisions 72087 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72087 | crichter | 2007-06-27 11:26:53 +0200 (Mi, 27 Jun 2007) | 1 line

simplified channel finding and locking a lot. removed unnecessary #ifdefed areas.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-02 08:14:43 +00:00
Russell Bryant
fde5578a20 Merged revisions 72805 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72805 | russell | 2007-07-01 18:51:34 -0500 (Sun, 01 Jul 2007) | 5 lines

When appending lines to call files to keep track of retries, write a leading
newline just in case the original call file did not have a newline at the end.
This fix is in response to a problem I saw reported on the asterisk-users
mailing list.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-01 23:52:45 +00:00
Russell Bryant
61a5a031f6 Tweak the configure script so that error output isn't spewed to the console
when searching for GTK2 libs, and they aren't found.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72766 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-30 16:50:40 +00:00
Russell Bryant
b16b099171 give format_pcm a more concise destription
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72705 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-29 20:56:18 +00:00
Luigi Rizzo
f870ccffff Use !defined(HAVE_GETHOSTBYNAME_R) to check for absence
of the function. This was already done in trunk.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72665 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-29 19:07:41 +00:00
Russell Bryant
16168a9b2b Blocked revisions 72629 via svnmerge
........
r72629 | russell | 2007-06-29 11:30:56 -0500 (Fri, 29 Jun 2007) | 4 lines

Backport changes that make chan_iax2 not start the PBX on an incoming channel
until the three-way call setup is completed.  These changes are already in 1.4
and trunk.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72630 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-29 16:31:37 +00:00
Joshua Colp
fe753c0846 Minor change for older GCC versions.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-29 14:26:32 +00:00
Joshua Colp
556b6b1267 Backport fix for GCC versions without support for declaration-after-statement.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72597 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-29 14:18:36 +00:00
Tilghman Lesher
6ffbaa32f3 Issue 10055 - Change memory allocation to use the heap for a command, since the output has the potential to overflow the stack (as it did here)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-29 04:47:11 +00:00
Tilghman Lesher
34ee6b0df8 Fix 1.4 breakage
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-29 04:43:15 +00:00
Russell Bryant
ef2ae2f856 regenerate the configure script for rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-28 19:44:11 +00:00
Luigi Rizzo
4134554eaa add a check for gethostbyname_r so we can
simplify the handling e.g. in utils.c

Also add comments on a couple of features which are not working on FreeBSD.

All the above has been already done in trunk so the merge must be blocked.


Can someone please regenerate ./configure ?



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-28 19:29:34 +00:00
Luigi Rizzo
475e73e27d Add -Wdeclaration-after-statement to AST_DEVMODE flags to catch
variable declarations in the middle of a block.

Fix the few instances of the above spotted out by the compiler.

All of this has been already done or is not applicable in trunk,
so the merge of this change will be blocked.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-28 19:05:59 +00:00
Luigi Rizzo
e0b32b53b1 cast a time_t so that it does not conflict with the print format.
This change was already done on trunk so this change needs to be
blocked from merging.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72453 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-28 18:37:20 +00:00
Brett Bryant
7c5fef5e74 Merged revisions 72373 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72373 | bbryant | 2007-06-27 18:22:13 -0500 (Wed, 27 Jun 2007) | 3 lines

Reinstating patch. This actually fixes the problem, however I was running a development branch without it and mistakenly thought it wasn't fixed. 
Fixes issue #10010, and #9654: 100% CPU usage caused by an asterisk console losing it's controlling terminal.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 23:29:14 +00:00
Joshua Colp
6c1076bd45 Merged revisions 72378 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72378 | file | 2007-06-27 19:24:01 -0400 (Wed, 27 Jun 2007) | 2 lines

Update documentation to clarify variable usage with MixMonitor. (issue #9494 reported by netoguy)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 23:25:12 +00:00
Brett Bryant
a241f406da Merged revisions 72333 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72333 | bbryant | 2007-06-27 17:58:53 -0500 (Wed, 27 Jun 2007) | 2 lines

Reverted changes for earlier revisions 72259 to 72261. Issue #9654, #10010

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 23:03:01 +00:00
Joshua Colp
5055793871 Make payload IDs for iLBC/Speex match to our list. Since these are dynamic payloads the other side shouldn't care. (issue #9426 reported by irroot)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 22:58:02 +00:00
Joshua Colp
2c67ae6869 Merged revisions 72327 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72327 | file | 2007-06-27 18:43:11 -0400 (Wed, 27 Jun 2007) | 2 lines

Fix issue where queue log events might be missing. (issue #7765 reported by mtryfoss)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72328 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 22:45:49 +00:00
Russell Bryant
9fe9682f50 Merged revisions 72267 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72267 | russell | 2007-06-27 16:06:45 -0500 (Wed, 27 Jun 2007) | 5 lines

Fix a minor issue with parsing the priority number.  You could have as much
whitespace as you want around a numeric priority, but you couldn't have any
whitespace around a special priority like "n" or "hint".
(issue #10039, reported by mitheloc, fixed by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 21:08:34 +00:00
Brett Bryant
b2cc514f08 Merged revisions 72259 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72259 | bbryant | 2007-06-27 15:43:53 -0500 (Wed, 27 Jun 2007) | 4 lines

Fixes 100% load when controlling terminal disappears.

Issue #9654, #10010

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 20:46:12 +00:00
Joshua Colp
a61fb24363 Merged revisions 72256 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72256 | file | 2007-06-27 16:23:24 -0400 (Wed, 27 Jun 2007) | 2 lines

I may possibly get shot for doing this... but... defer CDR processing until after the channel has been dealt with. This should eliminate all of the issues with channels going funky (SIP/PRI) when you are posting CDRs to a database that is either slow or unavailable and do not want to enable batching.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 20:25:24 +00:00
Kevin P. Fleming
39236d2728 use the proper type for storing group number bits so that if someone specifies 'group=42' it will actually work instead of being silently ignored
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72205 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 19:13:21 +00:00
Jason Parker
7fca3cc82c Blocked revisions 72184 via svnmerge
........
r72184 | qwell | 2007-06-27 13:40:15 -0500 (Wed, 27 Jun 2007) | 4 lines

Fix another problem in voicemail with missing symbols.

Issue 10074, patch by kryptolus, extended to include #if 0'd blocks (just in case)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72185 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 18:40:39 +00:00
Jason Parker
04524392d3 Fix another problem in voicemail with missing symbols.
Issue 10074, patch by kryptolus, extended to include #if 0'd blocks (just in case)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 18:36:56 +00:00
Joshua Colp
60990f0c73 Make the ast_read_noaudio API call behave better under circumstances where DTMF emulation was happening and a generator was setup. (issue #10065 reported by stevefeinstein)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72148 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 17:31:50 +00:00
Jason Parker
7508fce25b Don't modify a variable that we don't want modified. Make a copy of it instead.
Issue 10029, patch by phsultan with slight modifications by me (to remove needless casts).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 17:10:32 +00:00
Russell Bryant
d528f7791d Only output debug information related to RTCP timestamps when RTCP debug
is turned on (issue #10066, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 16:34:24 +00:00
Christian Richter
2294156c9d Merged revisions 72040-72041 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r72040 | crichter | 2007-06-27 09:49:27 +0200 (Mi, 27 Jun 2007) | 1 line

for inbound TE calls, we setup the bchannel when we get the CONNECT_ACKNOWLEDGE, to make sure mISDN has everything ready. removed some #if 0 areas which weren't used anymore.
........
r72041 | crichter | 2007-06-27 09:54:30 +0200 (Mi, 27 Jun 2007) | 1 line

isdn_lib.c didn't compile
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 07:58:06 +00:00
Joshua Colp
76c9d2be11 Make unloading of pbx_dundi actually work.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27 00:58:35 +00:00
Mark Michelson
83fd6c08d2 Removing a pointless line. This variable was already set earlier and between then and this
line, there is no way that the values on the right side of the assignment could have changed.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-26 23:02:09 +00:00
Jason Parker
8a7cb1ec48 Don't dereference a pointer that may be NULL here.
Issue 10017.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-26 20:36:09 +00:00
Mark Michelson
79332488f7 A few changes, the ultimate goal of which is to keep better track of the number of messages
that a mailbox currently has. A description of the changes:

1. Changed the "updated" field of the vm_state struct to act more as a binary semaphore than a
   counting semaphore, since its current implementation made the inboxcount function not work properly.
   This change falls in line with a change made by UPenn with their IMAP setup and helps to sync our changes with theirs.
2. Eliminated some redundant calls to get_vm_state_by_mailbox inside leave_voicemail
3. Use the play_folder variable to keep track of the number of old and new messages in a mailbox as the messages are deleted
4. Added an increment to the number of new messages that was not there previously in the leave_voicemail function



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71877 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-26 19:00:05 +00:00
Jason Parker
91df522edb Blocked revisions 71847 via svnmerge
........
r71847 | qwell | 2007-06-26 12:49:14 -0500 (Tue, 26 Jun 2007) | 4 lines

Don't try to install an init script that doesn't exist.

Reported to me on #asterisk on Freenode IRC.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-26 17:49:58 +00:00
Mark Michelson
555dcbc021 Fixing bug where the authuser was mistakenly pulled from the mailbox string instead
of the IMAP user.
(closes issue 10054, reported and patched by jaroth)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-26 15:47:31 +00:00
Tilghman Lesher
5da46f710e Merged revisions 71750 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r71750 | tilghman | 2007-06-26 07:25:58 -0500 (Tue, 26 Jun 2007) | 2 lines

Issue 10062 - Trying to move a message without selecting one first results in memory corruption

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-26 12:27:47 +00:00
Tilghman Lesher
ad5ad13662 Merged revisions 71656 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r71656 | tilghman | 2007-06-25 13:12:37 -0500 (Mon, 25 Jun 2007) | 2 lines

Issue 10035 - handle_exec returns a result inconsistent with all of the other AGI commands

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71657 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-25 18:14:59 +00:00
Joshua Colp
bd8be32993 Build a peer as well when hash323 is enabled in users.conf (issue #9599 reported by asagage)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-25 14:13:45 +00:00
Joshua Colp
e973bf0ba9 Minor tweak for queueing up the unhold frame... this will teach me to do bugs while half asleep. (issue #10046 reported by dimas)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-25 13:03:03 +00:00
Russell Bryant
ade10553ea Fix a typo in the Asterisk mib. (issue #10048, Matti)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-25 12:40:06 +00:00
Joshua Colp
a6895cb26d Merged revisions 71414 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r71414 | file | 2007-06-24 21:02:49 -0400 (Sun, 24 Jun 2007) | 2 lines

Ignore other URIs after the first in a 300 Multiple Choice response. (issue #10041 reported by homesick)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71430 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-25 01:10:06 +00:00
Joshua Colp
879bad257f Fix it so 1.4 actually compiles on my box.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-25 01:07:31 +00:00
Joshua Colp
2886f912d6 Check to make sure the channel pointer is present before queueing up an unhold frame on it. (issue #10046 reported by dimas)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71412 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-25 00:49:21 +00:00
Russell Bryant
06600190e6 Include the menuselect-tree file in tarballs to make builds from tarballs a
little bit faster


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71371 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-24 20:16:32 +00:00
Russell Bryant
b52d259c91 Merged revisions 71358 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r71358 | russell | 2007-06-24 15:04:21 -0500 (Sun, 24 Jun 2007) | 2 lines

Revert the patch from issue 9654 due to an unexpected side effect

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-24 20:06:31 +00:00
Tilghman Lesher
f02d20405b Issue 10044 - chan->cdr is NULL here, so peer->cdr is what we really wanted to use
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71291 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-24 17:50:24 +00:00
Tilghman Lesher
2e702c85eb Merged revisions 71288 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r71288 | tilghman | 2007-06-24 12:32:21 -0500 (Sun, 24 Jun 2007) | 2 lines

Issue 10043 - There is a legitimate need to be able to set variables to the empty string.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-24 17:39:34 +00:00
Steve Murphy
6f6ffbb5c5 This patch is meant to fix 8433; where clid and src are lost via bridging.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71230 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-23 03:29:48 +00:00
Christian Richter
d0bc56b953 Merged revisions 70341 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r70341 | crichter | 2007-06-20 17:29:09 +0200 (Mi, 20 Jun 2007) | 1 line

fixed a bug that was introduced by copy and paste in the last commit ..bchannels weren't cleaned properly.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71214 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22 22:44:42 +00:00
Joshua Colp
895849c2cb Blocked revisions 71124 via svnmerge
........
r71124 | file | 2007-06-22 12:02:40 -0400 (Fri, 22 Jun 2007) | 2 lines

Send an unhold indication when going off hold. (issue #10036 reported by speedy)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71128 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22 16:05:03 +00:00
Christian Richter
795e189aa2 Merged revisions 70672 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r70672 | crichter | 2007-06-21 15:11:29 +0200 (Do, 21 Jun 2007) | 1 line

we activate the bchannels in TE mode on incoming calls only when we want to connect the call.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22 15:38:08 +00:00
Christian Richter
e1791cab97 Merged revisions 70342 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r70342 | crichter | 2007-06-20 17:42:39 +0200 (Mi, 20 Jun 2007) | 1 line

forgot one place .. 
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22 15:34:31 +00:00
Christian Richter
9b17b11c08 Merged revisions 70311 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r70311 | crichter | 2007-06-20 16:47:59 +0200 (Mi, 20 Jun 2007) | 1 line

on receiption of cause:44 we mark the channel as in use and inform the user about the situation, we need to test the RESTART stuff then. Also shuffled the empty_chan_in_stack function after the bchannel cleaning functions, to avoid race conditions.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22 15:32:54 +00:00
Christian Richter
933ebc4141 Merged revisions 69887 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r69887 | crichter | 2007-06-19 15:23:04 +0200 (Di, 19 Jun 2007) | 1 line

when we send out a SETUP, but get no response, we should cleanup everything after reception of a hangup.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22 15:30:08 +00:00
Christian Richter
82fe97efd5 Merged revisions 69053 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r69053 | crichter | 2007-06-13 11:55:54 +0200 (Mi, 13 Jun 2007) | 1 line

restart indicator 0x80 is correct, at least that's what libpri does.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22 15:27:53 +00:00
Christian Richter
0847f57595 Merged revisions 68887 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r68887 | crichter | 2007-06-12 10:35:22 +0200 (Di, 12 Jun 2007) | 1 line

if the bridged partner is mISDN too we should not send dtmf tones, they are transmitted inband always
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22 15:22:06 +00:00
Christian Richter
84434f5f2f Merged revisions 68874 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r68874 | crichter | 2007-06-12 09:48:52 +0200 (Di, 12 Jun 2007) | 1 line

if we have already some digits, we just stop the tones.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71096 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22 15:17:04 +00:00
Jason Parker
e107da04b4 Merged revisions 71065 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r71065 | qwell | 2007-06-22 09:52:18 -0500 (Fri, 22 Jun 2007) | 4 lines

Fix a few silly usages of ast_playstream() - it only ever returns 0...

Issue 10035

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71068 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22 15:00:30 +00:00
Brett Bryant
a835f994ec Merged revisions 71064 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r71064 | bbryant | 2007-06-22 09:39:34 -0500 (Fri, 22 Jun 2007) | 10 lines

Fixed infinite loop when controlling terminal was lost
and return value of input function wasn't checked for
errors. This would cause 100% cpu to be taken up.

(closes issue #9654, issue #10010)
Reported by: mnicholson, and eserra

Idea for the patch from mnicholson, patched by me


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22 14:53:08 +00:00
Steve Murphy
533dbc02ff My conditions for merging amaflags info was naive; DOCUMENTATION is the default, although null is possible; theft of user-settable fields is not good. Just copy them, leave them alone.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22 14:10:24 +00:00
Russell Bryant
5fb99cbf73 Fix a small typo which ... well ... completely broke chan_iax2. oops!
(issue #9937, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22 03:14:41 +00:00
Steve Murphy
b13f79ad5b Merged revisions 70948 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r70948 | murf | 2007-06-21 16:29:50 -0600 (Thu, 21 Jun 2007) | 1 line

This little fix is in response to bug 10016, but may not cure it. The code is wrong, clearly. In a situation where you set the CDR's amaflags, and then ForkCDR, and then set the new CDR's amaflags to some other value, you will see that all CDRs have had their amaflags changed. This is not good. So I fixed it.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-21 22:34:41 +00:00
Joshua Colp
c7dc8d1735 Merged revisions 70898 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r70898 | file | 2007-06-21 17:37:55 -0400 (Thu, 21 Jun 2007) | 2 lines

Don't explode if the gain option is specified without a value. (issue #9274 reported by mfarver)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70899 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-21 21:40:19 +00:00
Russell Bryant
dbe2d8eeb6 Put the thread reading from the socket back in the idle list if it deferred the
processing of a full frame to another thread


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-21 21:14:53 +00:00
Russell Bryant
6e7332a507 If a full frame is received while one of the iax2 threads is in the middle
of handling a full frame for the same call, queue it up for processing by that
same thread later instead of dropping it.
(issue #9937, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-21 21:07:04 +00:00
Steve Murphy
a0e2381888 Merged revisions 70804 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r70804 | murf | 2007-06-21 13:13:17 -0600 (Thu, 21 Jun 2007) | 1 line

it was pointed out that the cdr_custom config load could get a lock, and under certain circumstances, would never release it. I also noted that the situation where more than one mapping spec was warned about, but did not ignore further mappings as it had promised. I think I have fixed both situations.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-21 20:19:36 +00:00
Mark Michelson
ac73d19138 When volgain is used don't leave a temporary file behind.
(Closes Issue 8514, Reported and patched by ulogic, code reviewed by Jason Parker)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-21 19:49:44 +00:00
Joshua Colp
164b3bca49 Do not Packet2Packet bridge if packetization settings do not allow it. (issue #9117 reported by phsultan)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-21 15:22:39 +00:00
Russell Bryant
a959ed6f67 Remove a couple of duplicate unlocks
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-21 15:21:16 +00:00
Joshua Colp
ce4f92604a Fix building with ODBC storage enabled. (issue #10025 reported by denisgalvao)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-21 13:58:36 +00:00
Steve Murphy
e7c040283e Via complaints aired in asterisk-users, I submit these changes, which allow cdr updates to see macro context/exten, whether hung up or not
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-21 13:00:39 +00:00
Jason Parker
b035606357 Fix some potential memory leaks in cdr_pgsql.
Issue 10020, patch by my, with credit to prashant_jois for pointing out the problem.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20 23:32:39 +00:00
Jason Parker
b7447818de Fix a stupid mistake in my last cdr_pgsql race condition fix
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20 22:55:21 +00:00
Jason Parker
6fd76e7bc3 Fix a race condition in cdr_pgsql that can occur when reloading the module.
Issue 10022, patch by me, with credit to prashant_jois for finding the bug.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20 22:31:35 +00:00
Joshua Colp
f1c32710a8 Merged revisions 70551 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r70551 | file | 2007-06-20 18:20:16 -0400 (Wed, 20 Jun 2007) | 2 lines

Don't overwrite the configured username setting upon a REGISTER. (issue #8565 reported by jsmith)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20 22:22:20 +00:00
Jason Parker
60bf4f35c6 Make sure we clear the previously dialed number if it did not exist.
Issue 9958.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70494 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20 20:53:16 +00:00
Tilghman Lesher
badad4a542 Merged revisions 70444 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r70444 | tilghman | 2007-06-20 14:25:54 -0500 (Wed, 20 Jun 2007) | 2 lines

Issue 9997 - Timelimit times out the wrong channel

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20 19:29:23 +00:00
Russell Bryant
85f7646a2a Merged revisions 70396 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r70396 | russell | 2007-06-20 13:45:38 -0500 (Wed, 20 Jun 2007) | 5 lines

Fix a problem where an established call would not be properly disconnected
when a PRI disconnect is received depending on which cause code was received.
(issue #9588, original patch by softins, updated patch from jtexter3, and some
 additional feedback from mhardeman)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70397 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20 18:46:49 +00:00
Joshua Colp
00a80bcb7d Put the speex packetization values back in but disable it when setting up the smoother.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20 17:52:57 +00:00
Joshua Colp
9c76e929c9 Don't do packetization/smoother stuff with speex, it doesn't work.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70198 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20 00:24:36 +00:00
Russell Bryant
bfa63cf854 don't delete the backtrace in ast_grab_core
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20 00:03:22 +00:00
Russell Bryant
a0a33670bd Only attempt to queue a hangup on the owner channel if it actually exists.
(issue #9795, patch from zandbelt)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70084 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-19 19:13:45 +00:00
Steve Murphy
c05bb13de9 Merged revisions 70053 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r70053 | murf | 2007-06-19 12:07:59 -0600 (Tue, 19 Jun 2007) | 1 line

This fixes 9246, where channel variables are not available in the 'h' exten, on a 'ZOMBIE' channel. The fix is to consolidate the channel variables during a masquerade, and then copy the merged variables back onto the clone, so the zombie has the same vars that the 'original' has.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70062 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-19 18:23:23 +00:00
Joshua Colp
8b71bbd6ed Merged revisions 69992 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r69992 | file | 2007-06-19 13:00:58 -0400 (Tue, 19 Jun 2007) | 2 lines

Handle the CC field in the RTP header. (issue #9384 reported by DoodleHu)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-19 17:07:40 +00:00
Russell Bryant
217d6f80ea Blocked revisions 69990 via svnmerge
........
r69990 | russell | 2007-06-19 11:45:37 -0500 (Tue, 19 Jun 2007) | 12 lines

Backport fix for crashes related to subscriptions from 1.4 ...

Fix a crash that could occur when handing device state changes.
When the state of a device changes, the device state thread tells the extension
state handling code that it changed.  Then, the extension state code calls the
callback in chan_sip so that it can update subscriptions to that extension.
A pointer to a sip_pvt structure is passed to this function as the call which
needs a NOTIFY sent.  However, there was no locking done to ensure that the pvt
struct didn't disappear during this process.
(issue #9946, reported by tdonahue, patch by me, patch updated to trunk to use
 the sip_pvt lock wrappers by eliel)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-19 16:46:43 +00:00
Joshua Colp
b6bd3b483e Merged revisions 69986 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r69986 | file | 2007-06-19 12:21:29 -0400 (Tue, 19 Jun 2007) | 2 lines

Update BRIDGEPEER variable if set to the new channel name when a masquerade happens. (issue #9699 reported by dimas)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69987 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-19 16:24:31 +00:00
Russell Bryant
a2084d8ab8 Fix a crash that could occur when handing device state changes.
When the state of a device changes, the device state thread tells the extension
state handling code that it changed.  Then, the extension state code calls the
callback in chan_sip so that it can update subscriptions to that extension.
A pointer to a sip_pvt structure is passed to this function as the call which
needs a NOTIFY sent.  However, there was no locking done to ensure that the pvt
struct didn't disappear during this process.
(issue #9946, reported by tdonahue, patch by me, patch updated to trunk to use
 the sip_pvt lock wrappers by eliel)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69944 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-19 15:22:36 +00:00
Joshua Colp
ff3d5422b6 Merged revisions 69894 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r69894 | file | 2007-06-19 09:54:03 -0400 (Tue, 19 Jun 2007) | 2 lines

Perform an extra hangup check just in case. (issue #9589 reported by bcnit)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69895 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-19 13:55:25 +00:00
Joshua Colp
bba22a6876 Merged revisions 69846 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r69846 | file | 2007-06-19 08:57:55 -0400 (Tue, 19 Jun 2007) | 2 lines

Add parked call extension AFTER the parking slot has been announced, otherwise two threads will try to handle the same channel and it will go kaboom. (issue #9191 reported by japple)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-19 13:00:57 +00:00
Joshua Colp
c77b8b9467 Fix for building on PowerPC under Linux.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-18 21:57:10 +00:00
Tilghman Lesher
759dc00599 Issue 10005 - Segfault with missing arguments, plus fix a missing define for SIP INFO channels
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-18 19:48:17 +00:00
Joshua Colp
a50bc6e3a8 Don't count RTP timeout when involved in a T38 fax session. (issue #9222 reported by ivoc)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69794 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-18 19:00:50 +00:00
Joshua Colp
f95038d97e Merged revisions 69765 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r69765 | file | 2007-06-18 14:13:03 -0400 (Mon, 18 Jun 2007) | 2 lines

Set the peer name on the dialog to the one configured in sip.conf and NOT the username to be used for authentication attempts. (issue #9967 reported by achauvin)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-18 18:18:12 +00:00
Tilghman Lesher
a9be8eb896 Merged revisions 69743 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r69743 | tilghman | 2007-06-18 12:45:15 -0500 (Mon, 18 Jun 2007) | 2 lines

Issue 9998 - Remove SIG prefix, since it's not supported by ksh

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69744 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-18 17:46:40 +00:00
Joshua Colp
2cce26c0ce Remember the DNS lookup done when dnsmgr is called for the first time so that it does not needlessly spit out changed messages when the host really didn't change.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69708 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-18 16:51:36 +00:00
Russell Bryant
cbdc6b5b2d To prevent 92138749238754 more reports of "I have unixodbc installed, but
still can't build *_odbc.so!", check for ltdl directly, instead of just listing
it as another library to include in the unixodbc check in the configure script.
This also makes ltdl show up as a dependency in menuselect so people know what
to go install.  (related to issue #9989, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69702 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-18 16:35:02 +00:00
Russell Bryant
a6df5f82fb Change the use of "echo -e" to "printf". On systems where /bin/sh is not bash,
most of the lines in menuselect-tree were getting a "-e" at the beginning of
every line.  I'm surprised nobody noticed this, but I think the XML parser was
being very nice and ignoring them.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-18 16:15:12 +00:00
Joshua Colp
009f6f9112 Don't defer the BYE till later on a transfer when the transfer itself goes kaboom and has no hope of working.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69668 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-18 16:04:55 +00:00
Joshua Colp
3e29d89200 Few minor transfer tweaks. We can't unlock something we never locked, and better handle a specific scenario with doing an attended transfer between two non-bridged calls.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69661 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-18 15:46:32 +00:00
Russell Bryant
56f7457883 Tweak paths for BSD systems (issue #10001, stuarth)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69660 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-18 15:46:14 +00:00
Joshua Colp
2c9ffadffb Fix issue where it would be possible for the negotiated codecs to get set back to nothing. (issue #9992 reported by yehavi)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69625 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-18 13:55:00 +00:00
Russell Bryant
1f9898d8bd Fix a silly deadlock in res_features that I found while debugging on one of
blitzrage's test machines.  It was one of the situations where he was seeing
hung channels, and may be the cause of some of the reports from other people.
(related to issue #9235)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-15 20:18:58 +00:00
Joshua Colp
ad3c504b10 Add support for setting the maximum length of acceptable DTMF in SpeechBackground.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-15 19:23:45 +00:00
Russell Bryant
4bce51f79f The SLATRUNK_STATUS variable indicated "SUCCESS" for both an answer of the
incoming call on the trunk, or if the trunk reached its ring timeout.
This patch changes the variable to say "RINGTIMEOUT" in that case.
(issue #9973, reported by n00dle, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69518 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-15 15:27:34 +00:00
Jason Parker
dbfc0c7daa Merged revisions 69469 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r69469 | qwell | 2007-06-14 18:21:45 -0500 (Thu, 14 Jun 2007) | 4 lines

Fix an issue where the line number in an unterminated comment block error message would show the wrong line number.

"Reported" to me on #asterisk (somebody posted an error message, and I happened to catch it)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69470 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14 23:22:51 +00:00
Jason Parker
07387ef1dd Update to latest versions of sound files.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69434 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14 22:56:09 +00:00
Kevin P. Fleming
ae82d97c6d use ast_localtime() in every place localtime_r() was being used
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14 21:50:40 +00:00
Russell Bryant
45ad7fcec8 Fix some problems with saying dates and times for the "tw" langauge
(issue #9964, ljmid)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14 21:08:23 +00:00
Jason Parker
5305d9c27f Merged revisions 69258 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r69258 | qwell | 2007-06-14 10:15:53 -0500 (Thu, 14 Jun 2007) | 4 lines

Change a quite broken while loop to a for loop, so "continue;" works as expected instead of eating 99% CPU...

Issue 9966, patch by me.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14 15:21:29 +00:00
Joshua Colp
b86b8229c8 Whoops...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69222 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-13 21:19:27 +00:00
Joshua Colp
9604f04ed5 Let's make chan_iax2 media only native transfers actually work. (issue #9376 reported by simone cittadini)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-13 21:17:28 +00:00
Joshua Colp
7572eb866a Add TXMEDIA to list so that it is properly displayed during iax2 packet output.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-13 19:58:59 +00:00
Russell Bryant
93f3abb3e8 Move the logic for destroying a call when no response is received to a BYE
outside of the block that checks for FLAG_FATAL to be set.  This flag is only
set when the packet is transmitted with the reliability set to XMIT_CRITICAL
when the original packet is transmitted.  A BYE is always sent with it set
to XMIT_RELIABLE, meaning this code could never be encountered.  This resulted
in seeing some SIP channels that would never go away with the last packet
sent being a BYE.
(part of issue #9235, patch from jcmoore)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-13 19:57:38 +00:00
Mark Michelson
9a68aa6d89 Contains a patch for fixing an encoding problem when using Outlook to view voicemail emails and attachments.
This fix has also been tested on Thunderbird, Evolution, Pine, and Mutt.
(Issue 9336, reported by marwick, patched by mutterc)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69181 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-13 19:41:13 +00:00
Joshua Colp
2a582ba2cf Really ignore NULL frames and check whether the channel hungup or not. (issue #9912 reported by junky)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69144 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-13 19:08:24 +00:00
Joshua Colp
8e544d1422 Merged revisions 69127 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r69127 | file | 2007-06-13 14:12:48 -0400 (Wed, 13 Jun 2007) | 2 lines

Return group counting to previous behavior where you could only have one group per category. (issue #9711 reported by irroot)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69128 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-13 18:16:00 +00:00
Russell Bryant
f56c3be8ad Clarify a bit of logic. This doesn't change behavior in any way, but it is
helpful when following the logic to debug problems like 9235.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-13 16:56:16 +00:00
Russell Bryant
0072ea9933 Fix a place where a chan_iax2 pvt struct was accessed without the lock held.
This issue was reported to me via email by Dmitry Mishchenko.  Thanks!


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-13 16:29:12 +00:00
Russell Bryant
5aea57eed1 Fix a memory leak pointed out by prashant_jois in #asterisk-bugs. PQclear() was
not called on the result structure after doing a PQexec().  Also, fix up some
formatting in passing.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69016 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-12 19:40:17 +00:00
Joshua Colp
200248f687 Change the full frame dropping log message to debug to avoid future bug reports.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69014 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-12 19:36:29 +00:00
Joshua Colp
9d7dae818f Schedule the sending of a PING packet a second later than previously so that it does not collide with the LAGRQ.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-12 19:26:38 +00:00
Russell Bryant
3fb6ac7fb7 In ast_channel_make_compatible(), just return if the channels' read and write
formats already match up.  There are code paths that call this function on a
pair of channels multiple times.  This made calls fail that were using g729
in some cases.  The reason is that codec_g729a will unregister itself from the
list of available translators will all licenses are in use.  So, the first
time the function got called, the right translation path was allocated.
However, the second time it got called, the code would not find a translation
path to/from g729 and make the call fail, even if the channel actually already
had a g729 translation path allocated.

(SPD-32)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-12 19:13:41 +00:00
Joshua Colp
8c01036a9f Merged revisions 68921 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r68921 | file | 2007-06-12 10:18:57 -0400 (Tue, 12 Jun 2007) | 2 lines

Bring RTP back to Asterisk at the end of a native bridge no matter what.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-12 14:23:11 +00:00
Jason Parker
0f45225441 Solaris 10 sometimes (?) needs this include in order to have NULL defined.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68814 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-11 21:20:15 +00:00
Tilghman Lesher
53700fd145 Issue 9947 - fn2 was unused / incorrectly used
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68781 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-11 20:45:53 +00:00
Christian Richter
48f8dc5340 Merged revisions 68732 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r68732 | crichter | 2007-06-11 18:49:00 +0200 (Mo, 11 Jun 2007) | 1 line

added check for NULL Pointer when calling misdn_new. Asterisk does not allow us to create channels anymore when stop gracefully is used :). also modified the restart_indicator to 0
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-11 16:57:59 +00:00
Joshua Colp
080acbfd16 Merged revisions 68682 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r68682 | file | 2007-06-11 10:29:58 -0400 (Mon, 11 Jun 2007) | 2 lines

Improve deadlock handling of the channel list. (issue #8376 reported by one47)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-11 14:33:12 +00:00
Christian Richter
7d491a7c24 Merged revisions 68631 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r68631 | crichter | 2007-06-11 11:18:01 +0200 (Mo, 11 Jun 2007) | 1 line

fixed problem that the dummybc chanels had no lock, checking for the lock now. Also fixed the channel restart stuff, we can now specify and restart particular channels too.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-11 10:29:18 +00:00
Tilghman Lesher
5ed9d5d64b "dialplan save" produced garbage in the config file
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-11 04:21:30 +00:00
Russell Bryant
337738d6d6 Merged revisions 68526 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r68526 | russell | 2007-06-08 17:22:36 -0500 (Fri, 08 Jun 2007) | 4 lines

Don't automatically hang up after running Dictate so that callers can exit
cleanly using '#'
(closes issue #9577, patch from Thomas Andrews)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-08 22:23:22 +00:00
Kevin P. Fleming
f4b7a2c9cb actually remember the type/subclass of full frames that are in process
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-08 15:52:47 +00:00
Joshua Colp
058f617af9 Merged revisions 68397 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r68397 | file | 2007-06-07 20:15:33 -0400 (Thu, 07 Jun 2007) | 2 lines

Don't call ast_waitstream_full when the control file descriptor and audio file descriptor are not set, simply call ast_waitstream! (issue #8530 reported by rickead2000)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-08 00:17:04 +00:00
Joshua Colp
14bde42bb6 Merged revisions 68368 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r68368 | file | 2007-06-07 19:59:04 -0400 (Thu, 07 Jun 2007) | 2 lines

Do a DNS lookup immediately upon calling the dnsmgr function, don't wait until a refresh happens. (issue #9097 reported by plack)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-08 00:02:34 +00:00
Russell Bryant
08a7d6a06b Merged revisions 68351 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r68351 | russell | 2007-06-07 18:13:33 -0500 (Thu, 07 Jun 2007) | 3 lines

Fix a problem where saying a character wouldn't properly break out when the caller pressed '#'
(issue #8113, reported by patbaker82, patch from jamesgolovich (hey, long time no see!) and patbaker82)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68354 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 23:14:45 +00:00
Jason Parker
30d9a8a20b Fix incorrect French syntax of "old messages".
Request for feedback was sent to asterisk-dev mailing list, with little response.

Issue 9118, patch by junky.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68326 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 23:00:01 +00:00
Kevin P. Fleming
e816700d6e some improvements to the IAX2 full frame dropping logic recently added:
- use inaddrcmp(), since we have it
- output the type of frame and subclass being dropped, and the type/subclass that is already being processed (which caused the drop)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68313 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 22:14:35 +00:00
Russell Bryant
e7cb53e8b2 Fix loading persistent queue members when using realtime configuration for queues.
Also, remove an unneeded leading slash for the astdb family.
(issue #9911, patch by atis)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68280 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 21:16:07 +00:00
Jason Parker
51f1d28d2d Fix an issue with newer phones which require packets be padded out to the correct length.
Issue 9887, patch by DEA.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68249 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 20:25:18 +00:00
Jason Parker
1d704b2857 Merged revisions 68204 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r68204 | qwell | 2007-06-07 15:02:50 -0500 (Thu, 07 Jun 2007) | 4 lines

Don't try to save voicemail greetings unless the user presses '1' to accept/save.

Issue 9904, patch by me.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 20:06:00 +00:00
Mark Michelson
878e480ff8 Submitting a fix for Issue 8016. Added a check to make sure that greetings get stored properly.
(Issue 8016, reported by edhorton, patched by alamantia with modification by me. Thanks to Jason Parker
for the advice on this).



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68198 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 19:47:42 +00:00
Olle Johansson
2d491b0eae Disable chan_features by default in menuselect
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 19:46:10 +00:00
Russell Bryant
452167fa3c Include stdarg.h for build issues on Solaris
(issue #9381)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68192 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 19:30:30 +00:00
Joshua Colp
ac65d7f143 Fix logic when doing a name based channel search for a structure when you want to start from a specific point in the channel list. (issue #9324 reported by slavon)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68157 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 18:39:52 +00:00
Joshua Colp
f07dfca43a Merged revisions 68070 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r68070 | file | 2007-06-07 10:19:40 -0400 (Thu, 07 Jun 2007) | 2 lines

Allow the 'g' option to work if used with the 'S' option. (issue #9888 reported by gasparz)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 14:21:59 +00:00
Olle Johansson
64b3683dbe Adding a few Todo's to res_jabber so we don't forget.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 10:00:17 +00:00
Olle Johansson
b857aed39e Ok, we found out that this is not about if you have any *active* clients using TLS, but
if you have initialized TLS at all during the lifetime of the module. So if you reload
to disable TLS, it won't help.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 09:55:13 +00:00
Olle Johansson
dd7f6f8e21 If you have a jabber client that uses TLS, refuse unload. Bad fix, but will prevent
crashes while we are trying to find a workaround.

Iksemel development seems to have stalled and we might have to stop using the 
TCP/TLS connections in that library and use our own, which would scale better
from a poll/select perspective I guess. It would also make it easier to migrate
to OpenSSL and stop Asterisk from depending on both OpenSSL and GnuTLS.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68027 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 09:42:26 +00:00
Olle Johansson
ff2943dd59 Issue #9738 - Make sure we can unload res_jabber. Patch by phsultan - thanks!
Due to a bug in the iksemel library, this will not work if you are using GTLS
in the connection. That's being investigated. If you figure out a way to handle
that without us having to patch iksemel, let us know in the bug report. Thanks.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67993 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 09:00:44 +00:00
Joshua Colp
b58a48d672 Merged revisions 67938 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r67938 | file | 2007-06-06 20:09:13 -0400 (Wed, 06 Jun 2007) | 2 lines

Only notify the devicestate system of a peer state change when the peer is built from the config file. (issue #9900 reported by arkadia)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67941 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 00:10:48 +00:00
Joshua Colp
928e69408e Properly handle cases where a stream can't be written to. (issue #9757 reported by junky)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 23:38:15 +00:00
Russell Bryant
b310d22e7c Disable reload functionality in res_snmp. It is not possible to initialize the
snmp library more than once without completely unloading the module and loading
it again.
(issue #9571, reported by hristo, additional helpful debug information from festr,
 patch from me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 22:08:02 +00:00
Russell Bryant
6595debbc5 Fix a crash when doing call pickups with SIP phones. The code unlocked the
channel when it should not have.
(issue #9652, reported by corruptor, fixed by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67862 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 21:14:46 +00:00
Mark Michelson
e8900612be Fix for Issue 9810. There was a segfault under a specific set of circumstances:
1. VoiceMailMain was configured in the dialplan with an extension as its argument
2. A message was left for this mailbox
3. Tried to call VoiceMailMain but hung up before entering password.

This was fixed by checking that a pointer was non-null prior to trying to dereference it.
(Issue 9810, reported by xmarksthespot, patched by Corydon76 with modifications by me).



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 19:26:55 +00:00
Russell Bryant
e7dd69eea8 Merged revisions 67715 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r67715 | russell | 2007-06-06 11:40:51 -0500 (Wed, 06 Jun 2007) | 5 lines

We have some bug reports showing crashes due to a double free of a channel.
Add a sanity check to ast_channel_free() to make sure we don't go on trying
to free a channel that wasn't found in the channel list.
(issue #8850, and others...)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67716 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 16:55:59 +00:00
Joshua Colp
1f6872a45e Merged revisions 67649 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r67649 | file | 2007-06-06 09:28:34 -0400 (Wed, 06 Jun 2007) | 2 lines

Reinvite the RTP back to the Asterisk machine when the timeout happens. (issue #9888 reported by gasparz)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67650 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 13:30:25 +00:00
Joshua Colp
7fb76769a8 Fix plc_samples warning when registering a translator. (issue #9897 reported by xylome)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 13:18:39 +00:00
Joshua Colp
a4ebf8b608 Include macroexten while searching for a channel to pick up in case they are in a macro. (issue #9491 reported by jamesb63)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 13:16:34 +00:00
Joshua Colp
ed7775bc53 Make the new "agi debug off" CLI command work. (issue #9890 reported by eliel)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67597 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 12:34:06 +00:00
Joshua Colp
26268d3a9a Merged revisions 67593 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r67593 | file | 2007-06-06 08:18:36 -0400 (Wed, 06 Jun 2007) | 2 lines

Revert channel name splitting fix for Zap. The moral of the story is don't use - in your user/peer names. (issue #9668 reported by stevedavies)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67594 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 12:20:27 +00:00
Russell Bryant
1a3e65a793 Fix some crashes related to the use of the "meetme" CLI command. The code for
this command was not locking the conference list at all.
(issue #9351, reported by and patch submitted by Junk-Y, committed patch
 is different and by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 23:01:44 +00:00
Steve Murphy
dc63d79143 this fixes bug 9883, wherein macros were not allowing the includes construct. fixed and tested, looks OK. Now includes can serve as an adjunct to catch.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 21:30:18 +00:00
Russell Bryant
fe9a3bef4e This bug has been hanging over my head ever since I wrote this SLA code.
Every time I tried to go debug it by adding some debug output, the behavior
would change.  It turns out I wasn't crazy.  I had the following piece of code:

   if (remove)
      AST_LIST_REMOVE_CURRENT(...);

Well, AST_LIST_REMOVE_CURRENT was not wrapped in braces, so my conditional
statement didn't do much good at all.  It always ran at least all of the
macro minus the first statement, so I was seeing list entries magically
disappear when they weren't supposed to.

After many hours of debugging, I have come to this extremely irritating fix. :)

(issues #9581, #9497)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67492 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 20:53:28 +00:00
Russell Bryant
83744c244a Suppress a bunch of debug output unless option_debug is on
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67457 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 19:48:02 +00:00
Mark Michelson
0a49a913ed Fix for bug number 9786, wherein voicemails saved to IMAP storage using extensions other than gsm were
unable to be played over the phone. (Issue 9786, reporter: xmarksthespot, Patched by xmarksthe spot with revisions by me,
reviewed by Russell Bryant).



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67424 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 18:32:50 +00:00
Jason Parker
4a7ae2ebde Correctly update date/time on devices throughout the life of the device, instead of just at registration.
Issue 9152, yet another patch by DEA.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67421 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 18:18:24 +00:00
Steve Murphy
b698ff265b Added code to automatically add a default case to switches that don't have one. In some cases, rather than fall thru, it results in a goto with -1 result, which terminates the extension; a sort of dialplan seqfault, sort of. This was required to fix bug reported in 9881
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67420 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 18:17:28 +00:00
Russell Bryant
9dd7be2f58 Handle a failure in malloc() in ast_safe_string_alloc()
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67372 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 17:07:30 +00:00
Russell Bryant
6d6cd29a87 Fix a problem that showed itself by causing Zap channel names to be completely
bogus on my machine.  ast_safe_string_alloc() was broken.  It called 
vsnprintf() on a va_args list twice without re-initializing it.  After the first
usage, va_end() and va_start() must be called again.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 16:56:36 +00:00
Christian Richter
619cdb016a Merged revisions 67307 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r67307 | crichter | 2007-06-05 17:42:03 +0200 (Di, 05 Jun 2007) | 1 line

briding is a bool, fixed copy and paste issue.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67334 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 16:14:07 +00:00
Christian Richter
b0dd31cb52 Merged revisions 67306 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r67306 | crichter | 2007-06-05 17:39:43 +0200 (Di, 05 Jun 2007) | 1 line

simplified the EVENT_SETUP handling in the cb_events function a lot. Commented the different possibilities a bit and made functions of shared code. When the dialed extension does not exist in the extensions.conf we'll jump into the 'i' extension if this does exist, else we disconnect the call with the cause:1 = No Route to Destination.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 16:11:57 +00:00
Russell Bryant
d5fd0cff73 When shutting down "gracefully", go through and run the unload() callbacks for
all of the modules.  "stop now" is considered a non-graceful shutdown and will
not go through this process.
(issue #9804, reported by chrisost, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 15:51:53 +00:00
Joshua Colp
24922406f4 Only muck with the thread structure if an idle one was found/created.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 15:22:30 +00:00
Kevin P. Fleming
5a5d549b1d ensure that a burst of full frames (AST_FRAME_DTMF being the prime example) will not be processed out of order... this is a brute force fix, but seems to be the safest fix for now (thanks to the Digium PQ department for finding this bug)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 14:35:52 +00:00
Christian Richter
9f749257ef Merged revisions 67209 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r67209 | crichter | 2007-06-05 12:05:45 +0200 (Di, 05 Jun 2007) | 1 line

added possibility to deactivate bridging per port
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 10:25:32 +00:00
Tilghman Lesher
cb8813a250 Merged revisions 67161 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r67161 | tilghman | 2007-06-04 18:41:49 -0500 (Mon, 04 Jun 2007) | 2 lines

According to MATH, 0+1181000386 = 1181000448.  Oops.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67162 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 23:43:01 +00:00
Russell Bryant
3b5bd316ed Fix up a bunch of places where the iax2 pvt structure can disappear and the
code did not account for it and crashes.
(issues #9642, #9569, #9666, probably others ... based on the work by
 stevedavies and mihai, with additional changes from me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 23:31:40 +00:00
Jason Parker
0b7607ad55 Fix for skinny keepalives.
If there is no traffic from the phone for (keep_alive * 1100) ms (arbitrarily
 adding 10% for network issues, etc),  unregister the device.

Issue 8394, patch by DEA.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67156 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 23:26:28 +00:00
Jason Parker
6b150d7b9c Fixes for dtmf/dialing with mgcp (similar to the recent fix for chan_skinny)
Issue 9855, patch by DEA.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 22:36:57 +00:00
Russell Bryant
885d846739 Add comments for two functions that get called with the appropriate call locked,
but perform operations that could result in the pvt structure getting destroyed
before returning again, causing numerous seg faults all over the module.
(inspired by issues #9642, #9569, and #9666, and the work done by stevedavies
 and mihai)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67119 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 22:28:55 +00:00
Steve Murphy
7609f70e20 This typo has been here since 1.4 forked. It has been the source of heartburn to many a dialplan/CDR programmer.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67073 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 21:59:34 +00:00
Russell Bryant
9074935852 Add a missing \n. (pointed out by jcmoore on IRC)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 21:47:36 +00:00
Joshua Colp
01456184f9 Better handle SIP devices that say they have SDP content... but really don't. (issue #9398 reported by mthomasslo)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67068 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 19:31:09 +00:00
Joshua Colp
1317920054 Initialize cidname variable to nothing since it may be used without having been touched. (issue #9661 reported by dimas)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 17:59:14 +00:00
Joshua Colp
26038a4b77 Returning a value that indicates the parking of a call was a success when it really wasn't (because the parking slot selected was in use) is the wrong thing to do. (issue #9723 reported by mdu113)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 17:41:59 +00:00
Tilghman Lesher
85779f9c3a Merged revisions 67060 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r67060 | tilghman | 2007-06-04 12:10:30 -0500 (Mon, 04 Jun 2007) | 2 lines

Add revision Id tags (by request of tzafrir)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 17:11:43 +00:00
Russell Bryant
28d8f9ee6e Change the configure script to build a test program against libcurl to make
sure the results from curl-config can be used to compile successfully.  This is
intended to help prevent a situation where you are cross compiling, and the
configure script finds the curl library installed on the host.
(issue #9865, reported and patched by zandbelt)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67026 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 16:02:31 +00:00
Tilghman Lesher
c314f35ac2 Issue 9739 - Malformed jid causes a crash
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67021 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 15:50:16 +00:00
Russell Bryant
0b7719e9a1 Resolve a deadlock in chan_iax2. When handling an implicit ACK to a frame that
was marked as the final transmission for a call, don't call iax2_destroy() for
that call while the global frame queue is still locked.  There is a very nice
explanation of the deadlock in the report.
(issue #9663, thorough report and patch from stevedavies, additional positive
 test reports from mihai and joff_oconnell)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67020 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 15:47:40 +00:00
Russell Bryant
35e7f6e86e Fix some compiler warnings in C++ modules.
(issue #9866, reported by osk, patch by Corydon76)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 15:28:33 +00:00
Tilghman Lesher
70b882702c On some drivers, deallocating the statement handle isn't enough. We also have to clear the cursor (nice, Oracle)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66919 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-01 21:45:44 +00:00
Mark Michelson
a90cf2d802 Removing extraneous debugging lines from revision 66897. Sorry :)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-01 21:31:49 +00:00
Mark Michelson
c71ead7c52 Submitting a fix for voicemail with IMAP storage. Attachments with format specified as gsm were duplicated (i.e. two attachments) were left.
Thank you very much to xmarksthespot for submitting the patch that fixed this. (Issues 9787 and 8873, Reported by xmarksthespot and jerjer, patched by xmarksthespot)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66897 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-01 21:09:30 +00:00
Russell Bryant
0ecb2ecf42 Changes to the way DTMF is handled in the core broke dialing in chan_skinny.
This patch makes chan_skinny usable again.  I did not end up testing this,
but there are multiple positive test reports listed in the bug report.
(issue #9596, reported by pj, testing by pj and mvanbaak, and the fix was
 written by DEA)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-01 19:41:30 +00:00
Russell Bryant
3db95c55d0 List app_meetme as a module that app_page depends on.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66879 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-01 19:35:13 +00:00
Tilghman Lesher
3ea9ee2f07 Issue 9850 - update preferred command line syntax
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66821 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-31 23:03:28 +00:00
Russell Bryant
19a2be29f3 Change a couple of header files to not use "new", which is a reserved keyword
in C++.  (issue #9830, reported by osk)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-31 18:41:58 +00:00
Tilghman Lesher
17329054c8 Merged revisions 66744 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r66744 | tilghman | 2007-05-31 10:58:45 -0500 (Thu, 31 May 2007) | 2 lines

Issue 9818 - Fix for issue 8329 breaks pbx_realtime.  Issue 8329 will remain unfixed for pbx_realtime, but only because we lack core API to do it.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-31 17:15:09 +00:00
Joshua Colp
c7112015ba Merged revisions 66764 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r66764 | file | 2007-05-31 12:12:39 -0400 (Thu, 31 May 2007) | 2 lines

It is now possible for this path of execution to have the frame pointer be NULL, therefore we need to check for it before trying to access it. (issue #9836 reported by barthpbx)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-31 16:14:48 +00:00
Mark Michelson
48b438a0c3 Fixed seg-faults when recording greetings in voicemail with IMAP enabled. (Issue No. 9735, reported by xmarksthespot, patched by me)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66671 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-30 23:26:39 +00:00
Joshua Colp
612f61a9b2 Silly me for having out of date source! Oh well... I'm still leaving my comment.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-30 17:28:12 +00:00
Joshua Colp
3d8d697e34 When calling some peer/host that may not exist/reply back... don't keep the dialog in memory for all of eternity.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-30 17:21:06 +00:00
Joshua Colp
7905fca326 Change how channel names are generated a bit. (issue #9825 reported by eldadran)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66602 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-30 16:06:37 +00:00
Tilghman Lesher
e21412d53d Merged revisions 66537 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r66537 | tilghman | 2007-05-29 16:49:35 -0500 (Tue, 29 May 2007) | 2 lines

If the value of a variable passed to FIELDQTY is blank, then FIELDQTY should return 0, not 1.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-29 21:56:07 +00:00
Olle Johansson
332eabcc07 Properly handle 408 request timeout - according to the RFC, the dialog dies if a request in a dialog gets this response.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66503 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-29 19:32:57 +00:00
Olle Johansson
8d06f379fe Don't issue hangup on hangup on hangup on hangup (for jcmoore)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-29 19:02:04 +00:00
Joshua Colp
13afc81f91 Handle cases where a frame may have no data. (issue #9519 reported by dmb)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-29 16:44:34 +00:00
Olle Johansson
9f15005143 Don't reset hangupcause if we already have one
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-29 16:07:44 +00:00
Olle Johansson
ff9e2751c6 Tracking down hanging channels, killing them one by one. Issue #9235 and related
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-29 16:02:50 +00:00
Joshua Colp
732418a95a Update datastores documentation. (issue #9801 reported by mnicholson)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66398 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-29 15:43:16 +00:00
Olle Johansson
bab6473879 Merged revisions 66349 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r66349 | oej | 2007-05-29 09:53:14 +0200 (Tue, 29 May 2007) | 2 lines

Issue #9802 - Change inuse counter on CANCEL

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-29 09:41:40 +00:00
Joshua Colp
3a5a649415 Make the usedistinctiveringdetection option work again. (issue #9823 reported by premeau)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-28 23:16:56 +00:00
Jason Parker
a8ab3e5738 I don't know what this was trying to do, but it's clearly incorrect.
Issues 9808 and 9809.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-27 04:12:37 +00:00
Kevin P. Fleming
12662b47ab have to check for OSP toolkit _after_ checking for OpenSSL
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-25 14:43:54 +00:00
Tilghman Lesher
8f6ec33fef Merged revisions 66127 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r66127 | tilghman | 2007-05-25 08:46:35 -0500 (Fri, 25 May 2007) | 2 lines

Issue 9791 - Fix pronunciation of seconds in Dutch

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66159 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-25 14:41:27 +00:00
Kevin P. Fleming
5f9897ba56 handle the GNUTLS library properly in the configure script and build system
don't build in OSP support unless we have found and are allowed to use SSL support


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66157 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-25 14:28:46 +00:00
Russell Bryant
a4c142d73d if the string field init fails, clean up the stuff that was allocated already
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 22:23:59 +00:00
Joshua Colp
dec3b2e618 Fix slinfactory logic when dealing with frames coming in that may already be in the signed linear format.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66074 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 22:16:58 +00:00
Russell Bryant
11d6381ec0 Check the result of ast_string_field_init() in ast_channel_alloc()
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 22:07:39 +00:00
Russell Bryant
a2a73cde51 Make 1.4 build on my machine, too..
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66068 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 22:06:13 +00:00
Jason Parker
27cb61f3e7 Rebuild configure script for previous ar fix.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 20:54:16 +00:00
Jason Parker
513ed47dac Following moving strip to AC_PATH_TOOL, we need to do something similar for ar.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 20:53:18 +00:00
Russell Bryant
c061b86966 Checking for the strip application needs to be done with AC_PATH_TOOL
instead of AC_PATH_PROG to properly handle cross compilation environments.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66026 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 20:42:53 +00:00
Russell Bryant
d5d3acb67f Clear CFLAGS before running make for menuselect.
(issue #9784, reported by ovi, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 19:05:08 +00:00
Kevin P. Fleming
0b14e93d00 oops, use #ifdef instead of #if
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65967 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 18:28:48 +00:00
Kevin P. Fleming
e49f14e6cb don't reference GnuTLS headers and functions unless the configure script found it
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65966 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 18:25:21 +00:00
Kevin P. Fleming
521b241738 don't use uninitialized variables
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65965 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 18:24:55 +00:00
Joshua Colp
533144b170 Add the ability to blacklist certain commands from being executed using the Command AMI action. (issue #9240 reported by junky)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 15:27:23 +00:00
Olle Johansson
4eab565b25 Issue 7672 - fix by zandbelt - Asterisk core dump since the GnuTLS interface did not support multithreading correctly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65901 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 15:26:10 +00:00
Olle Johansson
e8addde3f1 Issue 8193 - NAT issues with gtalk/STUN. Patch by phsultan. Thanks!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65892 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 15:20:54 +00:00
Jason Parker
e07b41da01 Update cleancount for that last commit - just for good measure.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 15:16:52 +00:00
Jason Parker
b4ea07a7eb Fix handling of zero-length frames when a codec is capable of native PLC.
Issue 9183, patch by Mihai.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65877 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 15:14:02 +00:00
Dwayne M. Hubbard
f4fc851405 merged qwell's func_math patch for issue 9507
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 15:08:56 +00:00
Joshua Colp
9f88eccda6 I like it when the RTP stack compiles myself...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65863 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 15:08:17 +00:00
Olle Johansson
abc8683ce7 Issue 7686, fix by phsultan, NAT issues when calling from gtalk to SIP over nat.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 15:05:10 +00:00
Russell Bryant
1990758086 Ensure that frames are fully initialized. This will probably fix getting
weird timestamp log messages in logs when using the Festival app.
(issue #9781, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65853 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 15:04:14 +00:00
Russell Bryant
f32662deb4 Fix the calculation of the RTT for RTCP. The previous code would result in
oscillating and incorrect data.  Additionally, the RTT would sometimes report
negative values due to incorrect calculations.
(issue #9601, patch from davetroy)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65842 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 14:49:05 +00:00
Olle Johansson
e4f9cc15e6 Issue #8536 - Caller ID not set in CDR for jingle
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 14:48:55 +00:00
Joshua Colp
0df2a42f96 Merged revisions 65837 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r65837 | file | 2007-05-24 10:40:38 -0400 (Thu, 24 May 2007) | 2 lines

Allow RFC2833 to be negotiated when an INVITE comes in without SDP and is not matched to a user or peer. (issue #9546 reported by mcrawford)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 14:42:12 +00:00
Olle Johansson
6cfe6a550e Issue 8409 - phsultan - Fix "login" as component to jabber server.
...and, by accident, fix a bug in chan_sip for stopping a loop on retransmits
   of BYE requests.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65836 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 14:38:30 +00:00
Christian Richter
9f54cd55af Merged revisions 65767 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r65767 | crichter | 2007-05-24 11:19:58 +0200 (Do, 24 Mai 2007) | 1 line

we should only activate the generator in chan_misdn, when asterisk hask not yet taken the call (WAITING4DIGS state). Alerting audio will be generated fomr asterisk for example.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 09:37:32 +00:00
Kevin P. Fleming
e1518f42ae start the delayed PBX when receive voice or video full frames as well, and comment this delayed-PBX activity
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-23 20:59:19 +00:00
Kevin P. Fleming
ca6b421be4 Merged revisions 65682 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r65682 | kpfleming | 2007-05-23 16:46:22 -0400 (Wed, 23 May 2007) | 2 lines

ensure that variables are set on a newly created channel before we start a PBX on it

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-23 20:51:56 +00:00
Kevin P. Fleming
b89faf596b clear the 'delay PBX' flag when we are ready to start the PBX
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-23 20:35:50 +00:00
Kevin P. Fleming
09dc4253d8 don't start a PBX on a new incoming IAX2 channel until we have some sort of response to our ACCEPT (ACK or anything else)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-23 20:30:24 +00:00
Kevin P. Fleming
f608d90283 Merged revisions 65676 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r65676 | kpfleming | 2007-05-23 16:06:13 -0400 (Wed, 23 May 2007) | 2 lines

if we are going to set variables on a newly created channel, it should be done *before* we start the PBX on it

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-23 20:07:59 +00:00
Russell Bryant
7398856cea Merged revisions 65588 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r65588 | russell | 2007-05-23 08:06:17 -0500 (Wed, 23 May 2007) | 3 lines

Revert revision 62417 as someone reported problems with it to Mark.  This was
related to issue #9588.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-23 13:07:13 +00:00
Kevin P. Fleming
d0be58c8e1 when building a version string for a developer branch, include the base branch in the version string
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-22 20:25:41 +00:00
Russell Bryant
c556cc222c List res_smdi as a dependency for app_voicemail and chan_zap
(Thanks to mnicholson for pointing it out)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65501 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-22 18:40:38 +00:00
Joshua Colp
aae1e3e377 Remove a double const.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-22 15:04:46 +00:00
BJ Weschke
288d51d94f Fix a problem with flag recognition.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-22 14:02:56 +00:00
Russell Bryant
ece55e3de7 Merged revisions 65389 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r65389 | russell | 2007-05-22 08:07:03 -0500 (Tue, 22 May 2007) | 4 lines

Fix a memory leak that I just noticed in the device state handling in app_queue.
On most device state changes, it would leak roughly 8 to 64 bytes (the length of
the name of the device).

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65394 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-22 13:09:34 +00:00
Christian Richter
e7355ec53b Merged revisions 65328 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r65328 | crichter | 2007-05-22 09:46:39 +0200 (Di, 22 Mai 2007) | 1 line

we stop the tones only when we're in the pre-call phase, otherwise e.g. when in CONNECTED state we should not stop tones when we receive an Information Message
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65342 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-22 08:12:20 +00:00
Joshua Colp
0a992b39de res_agi needs to export two symbols (ast_agi_register and ast_agi_unregister) for usage by others. (issue #9755 reported by mnicholson)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65250 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-20 17:59:58 +00:00
Steve Murphy
2419b6cfb8 Ugh. The svnmerge didn't catch the shift from cdr.c to main/cdr.c, and neither did I. This is the remainder of the 9717 patch, the fix for the run-away FAIL status for a call
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-18 22:26:51 +00:00
Steve Murphy
dfee354cfa Merged revisions 65172 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r65172 | murf | 2007-05-18 14:56:20 -0600 (Fri, 18 May 2007) | 1 line

This update will fix the situation that occurs as described by 9717, where when several targets are specified for a dial, if any one them reports FAIL, the whole call gets FAIL, even though others were ringing OK. I rearranged the priorities, so that a new disposition, NULL, is at the lowest level, and the disposition get init'd to NULL. Then, next up is FAIL, and next up is BUSY, then NOANSWER, then ANSWERED. All the related set routines will only do so if the disposition value to be set to is greater than what's already there. This gives the intended effect. So, if all the targets are busy, you'd get BUSY for the call disposition. If all get BUSY, but one, and that one rings is not answered, you get NOANSWER. If by some freak of nature, the NULL value doesn't get overridden, then the disp2str routine will report NOANSWER as before.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-18 22:06:27 +00:00
Olle Johansson
4483fa12e8 Merged revisions 65122 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r65122 | oej | 2007-05-18 20:10:46 +0200 (Fri, 18 May 2007) | 2 lines

Not getting an ACK to a 200 OK in the initial invite is critical to the call.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-18 18:16:09 +00:00
Olle Johansson
7fe3608300 Merged revisions 65075 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r65075 | oej | 2007-05-18 17:12:09 +0200 (Fri, 18 May 2007) | 5 lines

Issue 9235 - part of the problem, maybe not all. Please retry with this patch (and no
other patch) if you have problems with hanging SIP channels. Thank you.

A special Thank You to WeBRainstorm that gave me access to his system.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-18 15:18:13 +00:00
Olle Johansson
50f79ba4b2 - Adding support for putting calls OFF hold with a re-invite with blank SDP. This was a bug found while doing tests at SIPit in Antwerp.
- In order to not duplicate code, I restructured some of the code for putting calls on/off hold.

Thanks DEA for reminding me. This fix has been asleep in the videocaps branch until now.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65041 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-18 12:58:39 +00:00
Christian Richter
012fe116fa Merged revisions 65007 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r65007 | crichter | 2007-05-18 13:23:11 +0200 (Fr, 18 Mai 2007) | 1 line

fixed a warning regarding Keypad encoding. encode the IE sending_complete at the right position.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-18 12:40:46 +00:00
Olle Johansson
73d0ba053b Issue 9487 - stop media flows at hangup of call
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-18 10:37:44 +00:00
Christian Richter
d682a74e26 Merged revisions 64902 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r64902 | crichter | 2007-05-18 10:24:08 +0200 (Fr, 18 Mai 2007) | 1 line

we *need* to send a PROCEEDING when sending_complete is set, even if need_more_infos is requested.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-18 08:58:51 +00:00
Russell Bryant
88f6591b24 Fix a small bug I noticed while working on something else. app_queue did not
unregister its device state monitoring callback in unload_module().  So, this
would make Asterisk crash on the first device state change after you 
unload the module.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-18 02:48:51 +00:00
Tilghman Lesher
002214d84f Merged revisions 64819 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r64819 | tilghman | 2007-05-17 16:14:36 -0500 (Thu, 17 May 2007) | 2 lines

How is it that we never caught that this is returning the opposite of our documentation, until now?

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-17 21:19:34 +00:00
Jason Parker
954f082462 Merged revisions 64758 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r64758 | qwell | 2007-05-17 11:52:38 -0500 (Thu, 17 May 2007) | 4 lines

If we have a negative current message, we shouldn't go back even further...

Issue 9727.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64761 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-17 16:53:27 +00:00
Russell Bryant
c3d7124e49 Remove script that is no longer functional since the build system was redone.
(issue #9340, reported by junky)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-17 16:52:53 +00:00
Russell Bryant
78989c792f Increase the size of a buffer to support longer dial strings for channels.
(issue #9291, reported and fix suggested by meni)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64756 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-17 16:47:29 +00:00
Joshua Colp
7a8ca54257 Even more direct RTP setup fixes! Don't allow a codec that isn't supported to creep into the SDP of either side. (issue #9446 reported by marcelbarbulescu)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64754 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-17 16:10:12 +00:00
Joshua Colp
5e41785d73 Fix authuser support. (issue #9740 reported by xmarksthespot)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64720 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-17 13:48:44 +00:00
Russell Bryant
b1f6d367e8 Update the main README to reflect the new build process for 1.4 and above.
(issue #9725, patch by eliel)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64686 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-17 06:13:53 +00:00
Olle Johansson
2a7e311efe Blocking patch already in this code
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64609 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-16 11:01:11 +00:00
Olle Johansson
4ae20ba8e4 Fix auth on BYE. (Different patch than for 1.2)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-16 10:59:28 +00:00
Olle Johansson
5acc63d688 Issue #9681 - Handle www-auth on BYE
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64602 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-16 10:38:18 +00:00
Olle Johansson
374b52f717 Final part of issue #9483 - fixing transfer() of sip calls in the dial plan (twilson)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64578 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-16 10:05:47 +00:00
Olle Johansson
70ad556544 Issue #9439 - properly handle username parameters in SIP uri.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-16 09:57:22 +00:00
Olle Johansson
bf1a15b9bf Merged revisions 64535 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r64535 | oej | 2007-05-16 11:08:22 +0200 (Wed, 16 May 2007) | 2 lines

Support SIP uri's starting with SIP: and sip: (reported by Tony Mountfield on the mailing list. Thanks!)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-16 09:12:34 +00:00
Olle Johansson
56af259505 Merged following patch with a lot of changes for 1.4
------

Merged revisions 64514 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r64514 | oej | 2007-05-16 10:25:56 +0200 (Wed, 16 May 2007) | 6 lines

Issue #9726 - rlister - Better logging for ACL denials

While at it, also added better logging and handling of peers that are not supposed to register.

My patch, stole the issue report from Russell. My apologies, Russell :-)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64516 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-16 08:46:18 +00:00
Christian Richter
d17174cfc1 Merged revisions 64513 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r64513 | crichter | 2007-05-16 10:23:42 +0200 (Mi, 16 Mai 2007) | 1 line

in the case immediate=yes, we directly jump into the dialplan, where people can use PlayTones to indicate a Dialtone, so we don't need to to that by ourself. also we should not do a dialtone_indicate for incoming calls on a TE port in overlapdialmode.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64515 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-16 08:44:51 +00:00
Russell Bryant
69cd2cb213 Properly fix a problem that occurs when you set PARKINGEXTEN to an exten where
a call is already parked.  (issue #9723, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64426 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-15 19:52:18 +00:00
Russell Bryant
39ebbfe69d When someone requests a specific parking space using the PARKINGEXTEN variable,
ensure that no other caller is already there.
(issue #9723, reported by mdu113, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64353 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-14 21:16:39 +00:00
Olle Johansson
1f2afa0ff1 Change -2 to XMIT_ERROR to clarify a bit more
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64324 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-14 19:26:50 +00:00
Russell Bryant
b340fcd7d0 Properly handle AST_CONTROL_PROGRESS by just ignoring it. An unknown indication
will trigger an error and cause sounds to stop, which in this case, is ringing.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-14 19:13:00 +00:00
Olle Johansson
e041d57175 Handle network errors, like host or network unreachable, in a better way. This means that
calls to hosts or qualify (OPTION) messages will fail quicker if the TCP/IP stack tells us
that there is an issue.

Since this is an unconnected UDP socket, we will not get error messages directly
in most cases, but maybe on the second and third try.

This is already implemented in trunk.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64280 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-14 18:52:09 +00:00
Joshua Colp
e694a86517 Properly set datalen field when doing PLC in codec_speex. (issue #9722 reported by mihai)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-14 18:48:33 +00:00
Joshua Colp
656739534c Merged revisions 64275 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r64275 | file | 2007-05-14 14:34:06 -0400 (Mon, 14 May 2007) | 2 lines

Only perform stripping of - strings from the channel name for Zap channels. Anywhere else we might remove a legitimate part of a device name. (issue #9668 reported by stevedavies)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-14 18:36:34 +00:00
Joshua Colp
aff63fba76 Fix scenario where if a phone that simply called Echo() put itself on hold it could never get off hold.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-14 17:23:51 +00:00
Steve Murphy
8c635fb2c1 As per 9570, worrisome CDR warnings have been removed, that are either not helpful, or not relevant.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64193 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-14 13:58:42 +00:00
Olle Johansson
7583e21359 Add hangupcause when we lack codecs for transcoding
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64157 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-14 10:39:12 +00:00
Joshua Colp
9a73c07fb1 This concludes my final adventure with bitmasks and the onhold flag. Would anyone care for some peanuts?
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64114 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-12 22:27:04 +00:00
Joshua Colp
699aa6ad74 Tweak hold flags some more. They can be of three states when active: active, inactive, one direction.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-12 21:10:45 +00:00
Joshua Colp
026000bae8 Ensure the onhold flag is set no matter what when being put on hold.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-12 16:32:15 +00:00
Jason Parker
e0cac0c477 Hide manager password from "manager show user foo".
I realize that there are other ways to get this,
 but we really don't need to just show it in plain text so easily.

Issue 9273, patch by junky


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63982 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-11 20:16:17 +00:00
Tilghman Lesher
913f9b90a0 Merged revisions 63903 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r63903 | tilghman | 2007-05-11 11:31:03 -0500 (Fri, 11 May 2007) | 2 lines

Issue 9121 - fixups for safe_asterisk script

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-11 16:35:51 +00:00
Russell Bryant
7d478ee342 When MD5 authentication is not possible because there is no challenge present,
either because the Challenge action was never issued, or some other reason,
give a proper error message and return an error instead of claiming that the
user wasn't found.
(reported by jsmith on IRC)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-11 16:05:43 +00:00
Joshua Colp
438335c9a7 Make the PARKINGEXTEN feature of parking actually work. (issue #9708 reported by mdu113)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-11 15:43:14 +00:00
Jason Parker
c2c91c7fef Merged revisions 63828 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r63828 | qwell | 2007-05-10 18:14:55 -0500 (Thu, 10 May 2007) | 4 lines

Fix an issue with trying to kill a thread before it gets created.

Issue 9709, patch by nic_bellamy.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63830 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-10 23:15:37 +00:00
Russell Bryant
2465ea2cfa Strip terminal escape sequences from CLI command output that is going to be
sent out over the manager interface.
(issue #9659, reported by pari, fixed by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-10 22:23:42 +00:00
Doug Bailey
a75d0f5329 Add test for negative offsets in cid data to prevent infinite loops.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-10 20:48:54 +00:00
Olle Johansson
ca1ae5e81a Merged revisions 63748 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r63748 | oej | 2007-05-10 22:38:54 +0200 (Thu, 10 May 2007) | 4 lines

Do not allocate SIP pvt's for PEERs we can not reach. 

This was seen as a lot of dialogs being created then immediately destroyed at reload/restart of the SIP channel.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-10 20:46:41 +00:00
Joshua Colp
7deba0a857 Use the DTMF frame on the channel when returning a DTMF frame from AST_FRAME_NULL or AST_FRAME_VOICE.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63698 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-09 19:22:39 +00:00
Joshua Colp
67a0bbaa83 Do not prematurely go on hold if sendonly was not actually set.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-09 17:43:30 +00:00
Matthew Fredrickson
a181c6a777 Merged revisions 63653 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r63653 | mattf | 2007-05-09 12:20:20 -0500 (Wed, 09 May 2007) | 2 lines

Make sure we only create a DSP if it's requested on SUB_REAL

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-09 17:25:21 +00:00
Russell Bryant
da55121999 Modify ast_senddigit_begin() to use the same assumptions used elsewhere in the
code in that if a channel does not have a send_digit_begin() callback, it only
cares about DTMF END events.  (pointed out by Michael Neuhauser on the
asterisk-dev list)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-09 16:55:27 +00:00
Joshua Colp
c83c0072bb Merged revisions 63610 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r63610 | file | 2007-05-09 12:51:03 -0400 (Wed, 09 May 2007) | 2 lines

Properly handle hints that point to multiple devices in chan_sip. Why chan_sip is even doing this I have no idea but I would rather not go into a rant. (issue #9536 reported by rlister)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-09 16:54:56 +00:00
Russell Bryant
e9fab07122 Only call ast_senddigit_begin() in ast_senddigit() if the channel has a
send_digit_begin() callback.  Checking the END_DTMF_ONLY flag was the
wrong thing to do, because that flag indicates that a *bridged* channel
only wants DTMF END events coming from this channel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-09 16:43:50 +00:00
Tilghman Lesher
e7f9e2662b Merged revisions 63565 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r63565 | tilghman | 2007-05-09 09:48:06 -0500 (Wed, 09 May 2007) | 2 lines

Replicate fix from 51158 (app_voicemail) to app_directory (Issue 9224)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-09 14:50:33 +00:00
Russell Bryant
ab7e5b5c7e I have seen multiple people post questions trying to figure out what the
message "The configure script must be executed before running 'make'" means.
So, add another like that says to specifically run ./configure.  If this isn't
obvious enough, then they should be using something like AsteriskNOW and not
installing from source.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63535 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-09 13:24:03 +00:00
Christian Richter
3e63c9d542 Merged revisions 62945,63402,63519 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r62945 | crichter | 2007-05-03 17:39:21 +0200 (Do, 03 Mai 2007) | 1 line

when we're in state WAITING4DIGS, we use the asterisk tone-generator which prods us, so we can't just return -1 in misdn_write in this case. Added a MISDN_KEYPAD channel variable, and fixed the sending of keypad. this enables us to modify the call forward parameters in the switch.
........
r63402 | crichter | 2007-05-08 17:07:37 +0200 (Di, 08 Mai 2007) | 1 line

added application misdn_check_l2l1 which tries to pull up the L1/L2 on all ports that have the layers down in a group. It waits then for a timeout. This helps for scenarios where multiple PMP BRIs are grouped together, or where a provider has a faulty PTP Implementation, that looses the L2 after a while.
........
r63519 | crichter | 2007-05-09 13:26:16 +0200 (Mi, 09 Mai 2007) | 1 line

release_chan frees ch, so we should never touch ch after release_chan, this may cause segfaults.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63534 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-09 13:17:10 +00:00
Olle Johansson
d30faa1dc2 Don't retransmit 200 OK's on ignore status. (Reported on asterisk-users)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63532 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-09 13:04:14 +00:00
Tilghman Lesher
414b5a15f5 Merged revisions 63477 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r63477 | tilghman | 2007-05-08 17:19:15 -0500 (Tue, 08 May 2007) | 2 lines

Issue 9602 - segfault in app_macro

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63478 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-08 22:38:02 +00:00
Russell Bryant
1fb11df91a I mixed up the use of the find_feature() function, so I renamed it
find_dynamic_feature, and changed the code to use the correct lock when
using it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-08 16:53:09 +00:00
Russell Bryant
fd993ffd7d Use a read/write lock when accessing the built-in features.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-08 16:30:43 +00:00
Russell Bryant
6af1769e87 Move realtime_pgsql.sql to contrib/scripts to be with the rest of the sql examples.
(issue #9676, suretec)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63403 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-08 15:10:37 +00:00
Tilghman Lesher
dac8d487f7 Merged revisions 63359 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r63359 | tilghman | 2007-05-08 01:20:16 -0500 (Tue, 08 May 2007) | 2 lines

Issue 9527 - upon entering a folder, no message is selected (curmsg == -1), so deleting causes memory corruption (beyond bounds)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-08 06:22:37 +00:00
Russell Bryant
3062410ec1 Add a sample configuration file and example tables for use with res_config_pgsql.
(issue #9676, suretec)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-07 22:28:50 +00:00
Joshua Colp
99cdfb2542 Merged revisions 63285 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r63285 | file | 2007-05-07 17:39:52 -0400 (Mon, 07 May 2007) | 2 lines

Properly handle what happens during a masquerade in relation to group counting. (issue #9657 reported by ramonpeek)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-07 21:45:01 +00:00
Joshua Colp
b50b92ab77 Minor backport of revision 59083 in trunk. Don't queue an unhold frame up if the call was never on hold to begin with.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63283 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-07 21:26:58 +00:00
Olle Johansson
53929c4f01 Don't remove configuration from memory just because one section failed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63254 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-07 20:05:15 +00:00
Olle Johansson
523900c101 Guess svnmerge doesn't handle files that move around. Blocking patch to ./config.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-07 14:19:32 +00:00
Olle Johansson
d48415f678 Stop the video stream when you stop playback of all streams for a call
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-06 12:28:38 +00:00
Jason Parker
9ad1e5d09c Fix a crash when checking version attribute in an incoming XML caps element.
Issue 9667, patch by phsultan.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-04 20:03:49 +00:00
Pari Nannapaneni
0b01c54b90 explanation for httptimeout in manager.conf
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63047 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-04 16:45:29 +00:00
Joshua Colp
95de3fbf0c Merged revisions 62987 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r62987 | file | 2007-05-03 13:42:19 -0300 (Thu, 03 May 2007) | 2 lines

When a peer is seeded or built tell the devicestate core to update it's status. This is easier then having chan_sip load before pbx_config. (issue #9658 reported by dlynes)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-03 16:44:00 +00:00
Kevin P. Fleming
9c638b6507 improve loader a bit, by avoiding trying to initialize embedded modules twice and avoiding trying to load modules from disk when they have been loaded already during the 'preload' pass (reported by blitzrage on IRC, patch by me)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62986 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-03 16:38:56 +00:00
Russell Bryant
796acdbbdb Fix YADB (Yet Another DTMF Bug) ((C) Russell Bryant, 2007, TM, Patent Pending).
This set of changes came from a debugging session I had with Dwayne Hubbard.
When he called into his home FXO, ran the Echo application, and pressed a
digit, the digit would be echoed back and would never end.  This is fixed,
along with a couple other little improvements.

* When chan_zap is in the middle of playing a digit to a channel, it feeds
  back null frames, not voice frames.  So, I have modified ast_read to check
  the timing on emulated DTMF when it receives null frames, in addition to
  where it was doing this on voice frames.
* Make a tweak to setting the duration on emulated DTMF digits.  If there was
  no duration specified, it set it to be the minimum, instead of the default.
* Instead of timing the emulated digits off of the number of samples in audio
  frames that pass through, just use time values.  Now there is no code in this
  section that assumes 8kHz audio.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62942 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-03 15:23:13 +00:00
Steve Murphy
9056b0fa09 updated the ael regressions to match what's in trunk
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-03 14:41:53 +00:00
Christian Richter
460e677ea6 Merged revisions 61357,61770,62885 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61357 | crichter | 2007-04-11 14:05:57 +0200 (Mi, 11 Apr 2007) | 1 line

some fixes for PMP Hold/Retrieve, it should work now, when briding=no
........
r61770 | crichter | 2007-04-24 15:50:05 +0200 (Di, 24 Apr 2007) | 1 line

added lock for sending messages to avoid double sending. shuffled some empty_chans after the cb_event calls, this avoids that a release_complete from a quite different call releases a fresh created setup by accident.
........
r62885 | crichter | 2007-05-03 15:59:00 +0200 (Do, 03 Mai 2007) | 1 line

fixed the problem that misdn_write did not return -1 when called with 0 samples in a frame this resultet in a deadlock in some circumstances, when the call ended because of a busy extension.  added encoding of keypad.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-03 14:36:32 +00:00
Steve Murphy
fd54b47404 These mods fix bug 9623, where an '@' in the eswitch contents causes a syntax error. I also updated the regressions.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-03 13:54:56 +00:00
Kevin P. Fleming
b488e05054 Merged revisions 62841 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r62841 | kpfleming | 2007-05-02 20:23:00 -0400 (Wed, 02 May 2007) | 2 lines

doh... initializing the pointer variable will work just a bit better

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62842 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-03 00:23:37 +00:00
Kevin P. Fleming
ae0f7a3247 Merged revisions 62796 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r62796 | kpfleming | 2007-05-02 19:53:46 -0400 (Wed, 02 May 2007) | 7 lines

increase reliability and efficiency of static Realtime config loading via ODBC:
	don't request fields we aren't going to use
	don't request sorting on fields that are pointless to sort on
	explicitly request the fields we want, because we can't expect the database to always return them in the order they were created
	
(reported by blitzrage in person (!), patch by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-03 00:02:57 +00:00
Kevin P. Fleming
51d6dd84e6 improve static Realtime config loading from PostgreSQL:
don't request sorting on fields that are pointless to sort on
	use ast_build_string() instead of snprintf()
	don't request the list of fieldnames that resulted from the query when we both knew what they were before we ran the query _AND_ we aren't going to do anything with them anyway

(patch by me, inspired by blitzrage's bug report about res_config_odbc)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62797 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-02 23:57:23 +00:00
Russell Bryant
ff3e3ba129 Merge changes from team/russell/inband_dtmf ...
Fix some issues related to generating inband DTMF.  There are two changes here:

1)   The list of DTMF tones in the senddigit_begin() function explicitly
   specified 100ms of the tone followed by 100ms of silence.  This really
   broke things with the way that Asterisk now wants complete control
   over when the digit begins and ends.  So, regardless of what Asterisk
   really wanted to do, this was going to play out the tone at the length it
   wanted to.  This caused various problems like DTMF translation to inband to
   be extremely unreliable.
     The list of tones has been changed so that the correct DTMF tone is played
   indefinitely until Asterisk tells it to stop.

2) ast_write() had to be modified to let a DTMF_END frame get processed even
   when a generator is present.  This is how the tone will finally get stopped.

(issues #8944, #9250, #9348, maybe others.  Thanks to mdu113 from #8944 for
 the testing and feedback!)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-02 22:59:09 +00:00
Russell Bryant
ae7a38d87b Backport the change that only went in to trunk that fixes the command manager
action over http.  (reported internally by pari and bkruse)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62739 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-02 20:55:00 +00:00
Steve Murphy
d2c7601c21 Merged revisions 62737 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r62737 | murf | 2007-05-02 14:10:32 -0600 (Wed, 02 May 2007) | 1 line

Some tweaks to satisfy CDR bug 8796, where being in 'h' extension louses up the dst field
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62738 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-02 20:46:07 +00:00
Tilghman Lesher
8bcfcfca88 Merged revisions 62691 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r62691 | tilghman | 2007-05-02 12:38:16 -0500 (Wed, 02 May 2007) | 4 lines

Issue 9638 - if a text frame is sent with no terminating NULL through a bridged
IAX connection, the remote end will receive garbage characters tacked onto the
end.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62692 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-02 17:43:48 +00:00
Steve Murphy
55f4eb3e3d a)In chan_zap, set the clid, src fields in channel_alloc call. b)in the channel_alloc func, set the cid_num and name fields from the arglist[blush]. c) don't update the channel app & app data fields if you are in the 'h' extension. d)the load_module func in cdr_radius needs to return DECLINE, SUCCESS.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-02 17:10:50 +00:00
Olle Johansson
d5fda03428 Don't unlock a channel that we already know does not exist (propably isue 8228)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62624 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-02 06:15:43 +00:00
Russell Bryant
6e13855338 Merged revisions 62547 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r62547 | russell | 2007-05-01 16:55:19 -0500 (Tue, 01 May 2007) | 4 lines

Remove an unnecessary check that makes it so if you hang up after doing an
attended transfer before the target extension answers the channel, the transfer
is not successful.  (issue #9338, patch by svanlund)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62548 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-01 21:57:10 +00:00
Tilghman Lesher
e5f56f776d Bug 9590 - Memory leaks around find_user() (found by rayjay, different fixes by me)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-01 21:34:43 +00:00
Russell Bryant
58352f5d46 Merged revisions 62496 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r62496 | russell | 2007-05-01 11:26:23 -0500 (Tue, 01 May 2007) | 3 lines

Add indications.conf information for the Philippines.
(issue #9525, reported and patched by loloski)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-01 16:26:48 +00:00
Russell Bryant
3595c5fed1 Merged revisions 62417 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r62417 | russell | 2007-04-30 10:57:26 -0500 (Mon, 30 Apr 2007) | 4 lines

This patch fixes an issue where depending on the cause code, when the network
sends a PRI disconnect, the call may not be properly hung up.
(issue #9588, reported and patched by softins)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62419 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-30 15:58:28 +00:00
Russell Bryant
63a37f4755 When serving dynamic content, include a Cache-Control header to instruct the
browsers to not store the resulting content.  
(issue #9621, reported by Pari, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-30 15:25:31 +00:00
Jason Parker
16405bbca9 Remove unused (and potentially confusing) jitterbuffer options from sample config.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62371 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-30 14:52:31 +00:00
Joshua Colp
5c35c59bb4 Merged revisions 62368 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r62368 | file | 2007-04-30 11:34:07 -0300 (Mon, 30 Apr 2007) | 2 lines

Update copyright notice. It's now the year 2007!

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-30 14:36:11 +00:00
Russell Bryant
8936804377 Fix a bug that made the "language" setting in zapata.conf not
functional.  (issue #9626, reported and fixed by sergee)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-29 05:50:37 +00:00
Russell Bryant
698a82996e Note that the "talker optimization" option will be enabled by default in 1.6
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-28 21:56:20 +00:00
Russell Bryant
6b76a95f09 Fix a weird problem where when a caller talking to someone sitting behind an
agent channel sent a digit, the digit would be played to the agent for forever.
This is because chan_agent always returned -1 from its send_digit_begin and _end
callbacks.  This non-zero return value indicates to the Asterisk core that it
would like an inband DTMF generator put on the channel.  However, this is the
wrong thing to do.  It should *always* return 0, instead.  When the digit begin
and end functions are called on the proxied channel, the underlying channel
will indicate whether inband DTMF is needed or not, and the generator will be
put on that one, and not the Agent channel.
(issue #9615, #9616, reported by jiddings and BigJimmy, and fixed by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62218 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-27 21:10:51 +00:00
Jason Parker
45be059315 Merged revisions 62173 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r62173 | qwell | 2007-04-27 11:16:16 -0500 (Fri, 27 Apr 2007) | 3 lines

This transcoder message needn't be a NOTICE.
I've seen it cause confusion more than a few times.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-27 16:17:46 +00:00
Russell Bryant
a53ebcf546 If no variables were passed into pbx_substitute_variables_helper_full(), then
don't even bother creating a temporary bogus channel, since that is only for
allowing certain functions to operate on the variables as if they were on a 
channel.  Most importantly, this fixes a crash.
(issue #9613, reported by callguy, fixed by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-27 16:14:11 +00:00
Olle Johansson
34f9e0c4dd Merged revisions 62126 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r62126 | oej | 2007-04-27 15:57:45 +0200 (Fri, 27 Apr 2007) | 4 lines

Issue #7351 - SIP Cancel fails due to the wrong contact uri. Reported by PPYY, failed to fix by OEJ
final fix by wojtekka - THANKS!!!! THis was a hard one to catch.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-27 14:04:07 +00:00
Olle Johansson
b0121ca8a3 Issue #9608 - fix some annoying DEBUG messages not controlled by option_debug (DEA). Thanks!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-27 08:10:43 +00:00
Joshua Colp
0525347958 Merged revisions 62037 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r62037 | file | 2007-04-26 12:30:57 -0400 (Thu, 26 Apr 2007) | 2 lines

Revert previous fix for when the IAX2 channel goes funky (that's the technical term). This is causing legit calls to be prematurely hung up. (issue #9600 reported by justdave)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-26 16:33:52 +00:00
Joshua Colp
230dc4ad88 Missed an ast_app_group_discard during merge. Thanks blitzrage!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62005 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-26 03:19:51 +00:00
Joshua Colp
1c6f5bd851 Don't always say that the channel is being paused if it is actually being unpaused in the Manager ack message. (reported by jsmith in #asterisk-bugs)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61961 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-26 01:48:55 +00:00
Joshua Colp
19a9e28b09 Merged revisions 61958 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61958 | file | 2007-04-25 21:25:03 -0400 (Wed, 25 Apr 2007) | 2 lines

Don't count failed include attempts against the configuration include level. (issue #9593 reported by mostyn)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-26 01:27:18 +00:00
Kevin P. Fleming
0e525813a8 Merged revisions 61913 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61913 | kpfleming | 2007-04-25 17:24:59 -0500 (Wed, 25 Apr 2007) | 2 lines

handle a very bizarre race condition with channels being redirected before a simple switch can be started on them (issue #9286)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61914 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-25 22:29:53 +00:00
Russell Bryant
5574da0c12 Merged revisions 61866 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61866 | russell | 2007-04-25 16:55:23 -0500 (Wed, 25 Apr 2007) | 2 lines

If the callerid= option is specified, but empty, clear any previous data.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61870 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-25 21:59:07 +00:00
Russell Bryant
e6aa1145ed Merged revisions 61862 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61862 | russell | 2007-04-25 16:06:22 -0500 (Wed, 25 Apr 2007) | 2 lines

Ensure that callerid settings are reset on a reload.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61863 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-25 21:13:15 +00:00
Joshua Colp
1d4adc0174 Merged revisions 61804 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61804 | file | 2007-04-25 14:52:50 -0400 (Wed, 25 Apr 2007) | 2 lines

Merge rewritten group counting support. No more storing data on the variable list of the channels. That was bad, mmmk? (issue #7497 reported by sabbathbh)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-25 19:21:54 +00:00
Russell Bryant
77c52fd8bf Merged revisions 61798 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61798 | russell | 2007-04-25 11:20:38 -0500 (Wed, 25 Apr 2007) | 3 lines

Fix a typo where cid_num got copied instead of cid_ani.  
(issue #9587, reported and patched by xrg)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-25 16:22:07 +00:00
Russell Bryant
5bee74171d Merged revisions 61786 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61786 | russell | 2007-04-24 16:33:59 -0500 (Tue, 24 Apr 2007) | 4 lines

Don't crash if a manager connection provides a username that exists in
manager.conf but does not have a password, and also requests MD5 
authentication. (ASA-2007-012)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-24 21:34:53 +00:00
Russell Bryant
456cad8a47 Improve DTMF handling in ast_read() even more in response to a discussion on
the asterisk-dev mailing list.  I changed the enforced minimum length of a
digit from 100ms to 80ms.  Furthermore, I made it now enforce a gap of 45ms in
between digits.  These values are not configurable in a configuration file
right now, but they can be easily changed near the top of main/channel.c.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61781 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-24 19:00:06 +00:00
Dwayne M. Hubbard
db55615090 Merged revisions 61777 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61777 | dhubbard | 2007-04-24 13:20:31 -0500 (Tue, 24 Apr 2007) | 1 line

removed #if 0 block from chan_phone, chan_zap, and chan_modem restart_monitor()
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-24 18:43:53 +00:00
Russell Bryant
bdd29c22c2 Add a few more state changes in handle_frame_ownerless() so that the SLA code
will get notified of these changes even when an owner channel is not provided.
This isn't from a specific bug report, it's just something I noticed while
poking around.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-24 16:16:41 +00:00
Joshua Colp
b271179161 Merged revisions 61771 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61771 | file | 2007-04-24 12:05:06 -0400 (Tue, 24 Apr 2007) | 2 lines

Allow RFC2833 to be sent in the response SDP when an INVITE comes in without SDP. (issue #9546 reported by mcrawford)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-24 16:07:02 +00:00
Russell Bryant
215adb35b6 Some dialplan functions, such as CUT(), expect to operate on variables on a
channel.  So, this little hack lets them work in places where a channel doesn't
exist, such as within DUNDi configuration.
(issue #9465, reported and patched by Corydon76, testing by blitzrage)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61765 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-23 18:17:00 +00:00
Russell Bryant
baab073219 Ensure that digits passing through Asterisk have a reasonable minimum length.
It is currently 100 ms.  If someone thinks this should be different, feel free
to speak up.  (related to issues #8944, #9250, and #9348)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61763 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-23 17:57:32 +00:00
Jason Parker
9378347264 Avoid invalid seqno cycling detection.
Per comment from Dave Troy:
 This adds back in some simple typecasting I had in an earlier version
 which I realize now may be breaking things.

Issue #9554.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-20 21:35:27 +00:00
Jason Parker
bb59c9520b Merged revisions 61704 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61704 | qwell | 2007-04-20 16:14:27 -0500 (Fri, 20 Apr 2007) | 4 lines

Fix an issue that I noticed while looking over issue 9571.

The reload timestamp was getting set after reloading the built-in stuff, and before the modules.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61705 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-20 21:15:29 +00:00
Russell Bryant
477ff09bdf Remove a stray debug message introduced by a recent commit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61697 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-20 20:42:02 +00:00
Jason Parker
15d34ea798 Merged revisions 61692 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61692 | qwell | 2007-04-20 14:49:54 -0500 (Fri, 20 Apr 2007) | 5 lines

If the '* to hangup' option is not enabled, we don't need to disable * as a valid exit key.
  If it was enabled, this statement would've never been checked in the first place.

Issue #9552

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61694 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-20 19:51:49 +00:00
Russell Bryant
70eb19121e Fix the UpdateConfig manager action to properly treat "variables" and "objects"
differently (a=b versus a=>b).
(issue #9568, reported by pari, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-20 18:19:18 +00:00
Olle Johansson
32be6621f6 Merged revisions 61685 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61685 | oej | 2007-04-19 09:56:21 +0200 (Thu, 19 Apr 2007) | 3 lines

Send NOTIFY to Contact: in SUBSCRIBE 
- as reported by Intertex and Citel. Fixed during SIPit 20 in Antwerp.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61686 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-19 08:37:08 +00:00
Tilghman Lesher
6db075dd98 Bug 9557 - simple reason why reading a function always returned NULL
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-19 04:36:20 +00:00
Tilghman Lesher
1572777fa0 Merged revisions 61680 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61680 | tilghman | 2007-04-18 21:30:18 -0500 (Wed, 18 Apr 2007) | 5 lines

Bug 9557 - Specifying the GetVar AMI action without a Channel parameter can
cause Asterisk to crash.  The reason this needs to be fixed in the functions
instead of in AMI is because Channel can legitimately be NULL, such as when
retrieving global variables.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61681 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-19 02:45:05 +00:00
Kevin P. Fleming
b823c62709 allow external build systems to extract the required sound file versions
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-18 22:10:23 +00:00
Olle Johansson
521e1698e1 Clean upp formatting, add some doxygen stuff while we're in cleaning mode... Thanks Kevin!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-18 20:46:23 +00:00
Olle Johansson
0ef4dad39c Issue #9554 - Improve RTCP (Dave Troy)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-18 20:28:53 +00:00
Olle Johansson
dc6d309bdb #9483, half of patch by twilson to solve 302 redirect issues
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61666 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-16 14:47:05 +00:00
Olle Johansson
06b7d38720 Blocking AstHoloPatch from 1.2
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61664 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-16 14:21:48 +00:00
Steve Murphy
b74884a9cd This is a fix to the way CDR merge handles the data that results from ForkCDR.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61658 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-13 21:17:20 +00:00
Joshua Colp
03eb572457 Merged revisions 61655 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61655 | file | 2007-04-13 15:15:12 -0400 (Fri, 13 Apr 2007) | 2 lines

Add OUTBOUND_GROUP_ONCE variable to app_dial. This behaves the same as OUTBOUND_GROUP except it will get unset after use so it won't get accidentally inherited. (issue #BE-140)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-13 19:17:08 +00:00
Joshua Colp
72a00026cd Do not bother looking for a result if none are present.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-13 18:08:02 +00:00
Joshua Colp
eb631c00a3 For those very verbose SIP implementations that attach tons of info to the Contact header... let's increase our variable sizes. (issue #9535 reported by jeffg)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61648 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-13 17:19:53 +00:00
Russell Bryant
2ac2c7f64d Eliminate a compiler warning with ODBC_STORAGE enabled so that it will build
under dev-mode.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61645 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-13 17:10:19 +00:00
Steve Murphy
8a386a9816 A fix for chan_oss that resulted from the CDR changes; it helps to use the right info.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-13 17:01:02 +00:00
Joshua Colp
c06e063e1a Don't assume the callid of a dialog will be set, as in some circumstances it may not. (issue #9534 reported by tecnoxarxa)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61641 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-13 16:32:03 +00:00
Russell Bryant
5858778f40 Merged revisions 61476 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61476 | russell | 2007-04-11 11:01:25 -0500 (Wed, 11 Apr 2007) | 5 lines

If someone sets the "useragent" option in sip.conf to be empty, then don't add
the User-Agent header at all.  It is an optional header, anyway.  Also, the bug
report says that some of Japan's SIP providers don't allow it for some weird
reason.  (issue #9488, reported by makoto, fixed by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-11 16:05:29 +00:00
Nadi Sarrar
3bd81c31fb Don't export AOCD variables on misdn_hangup anymore, this was mainly a fix for trunk..
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61443 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-11 15:39:14 +00:00
Russell Bryant
a0d75effd5 Merged revisions 61426 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61426 | russell | 2007-04-11 10:05:36 -0500 (Wed, 11 Apr 2007) | 6 lines

Fix a bug with switching between host=dynamic and using specific hosts for
peers.  The code would only reset the peer's address when it is dynamic if
it was a new peer structure.  Now, it will also reset the address if it was
already in the peer list, but before the reload, it was not dynamic.
(issue #9515, reported by caio1982, fixed by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-11 15:09:39 +00:00
Russell Bryant
63ef5e53b0 Add "svgz" to the mimetypes table. (issue #9510, bkruse)
In passing, constify the elements of the mimetypes table.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61407 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-11 14:48:01 +00:00
Russell Bryant
9ce476a89c Merged revisions 61376 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61376 | russell | 2007-04-11 09:02:54 -0500 (Wed, 11 Apr 2007) | 5 lines

Remove the attempt at reporting configuration errors in sip.conf.  This can
cause a bunch of improper messages when using realtime.  I give up.  As oej
tried to convince me when I put this in, there is just no easy way to do it.
(inspired by a message on the -dev list)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-11 14:04:44 +00:00
Nadi Sarrar
4e2ab7de64 Export AOCD variables on misdn_hangup.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-11 13:40:26 +00:00
Nadi Sarrar
b31fe9be83 Ignore facility messages in case we don't have a corresponding channel object.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61372 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-11 13:33:30 +00:00
Nadi Sarrar
5e08746b28 AOCD's are now exported to asterisk channel variables.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61342 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-11 10:52:28 +00:00
Russell Bryant
706e448e28 File upload support was added to solve some needs for the Asterisk GUI.
However, after much discussion, it has been decided that adding this to 1.4 is
not in the best interests of the project.  It has been removed here, but will
remain in trunk.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61220 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-10 16:05:55 +00:00
Nadi Sarrar
50d606bbf8 Merged revisions 61170 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61170 | nadi | 2007-04-10 14:31:45 +0200 (Di, 10 Apr 2007) | 2 lines

msns config parameter defaults to '*'

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-10 12:43:40 +00:00
Steve Murphy
18ad368048 Finished up a previous fix to overcome a compiler warning; the app NoCDR() has been updated to mark the channel CDR as POST_DISABLED instead of destroying the CDR; this way its flags are propagated thru a bridge and the CDR is actually dropped. The cases where only one channel in a bridge has a CDR was cleaned up.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61136 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-10 05:18:26 +00:00
Olle Johansson
3e5c59f235 Merged revisions 61038 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61038 | oej | 2007-04-09 21:38:59 +0200 (Mon, 09 Apr 2007) | 3 lines

- Don't send ActionID before Response: header. 
- Don't use a blank in an AMI header

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-09 19:58:17 +00:00
Kevin P. Fleming
bf4969f66e fix up some warnings found using --enable-dev-mode
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-09 19:55:14 +00:00
Kevin P. Fleming
7d50ba6b85 remove some more stuff we don't need
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61062 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-09 19:49:09 +00:00
Russell Bryant
de8c29f5cb Remove another directory that should no longer be there
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-09 19:41:04 +00:00
Russell Bryant
96c472353a Remove various files that I thought I already removed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-09 19:40:29 +00:00
Jason Parker
7a8d30f3c3 Use the appropriate interface name with COMPLETECALLER.
Issue 9395.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-09 19:05:48 +00:00
Steve Murphy
7d5a79a0b9 This is a big improvement over the current CDR fixes. It may still need refinement, but this won't have as many folks bothered.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-09 18:32:07 +00:00
Olle Johansson
a1bdbc0289 Add final new line after JabberEvent
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60984 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-09 18:02:17 +00:00
Jason Parker
c8f511f31b Merged revisions 60935 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r60935 | qwell | 2007-04-09 12:22:15 -0500 (Mon, 09 Apr 2007) | 5 lines

Allow matching on names shorter than 3 chars.
This also fixes the case where somebody wants to match on less then 3 chars.

Issue 9071

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-09 17:22:59 +00:00
Tilghman Lesher
a5872f439b Merged revisions 60849 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r60849 | tilghman | 2007-04-08 21:49:06 -0500 (Sun, 08 Apr 2007) | 2 lines

Don't check for error when lowering priority (according to the manpage, it should never happen anyway).  It might could happen, though, if another thread messed with the priority, so safeguard against that (reported via -dev list).

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-09 03:01:12 +00:00
Tilghman Lesher
1d3fbc214a Merged revisions 60846 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r60846 | tilghman | 2007-04-08 21:37:18 -0500 (Sun, 08 Apr 2007) | 2 lines

Bug 9505 - If the return value for local_queue_frame is set, then p->lock is no longer valid.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-09 02:42:48 +00:00
Joshua Colp
88e5a094b6 Merged revisions 60797 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r60797 | file | 2007-04-08 20:59:29 -0400 (Sun, 08 Apr 2007) | 2 lines

When calling a device that then forwards us elsewhere... we have to make our channels compatible if it is the only channel being dialed. (issue #9445 reported by marcelbarbulescu)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-09 01:03:14 +00:00
Joshua Colp
acd37793b1 Allow app_queue to use MONITOR_EXEC even if MONITOR_OPTIONS is not set. (issue #9495 reported by cduffy)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-08 17:04:44 +00:00
Tilghman Lesher
0d5e645d47 Merged revisions 60711 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r60711 | tilghman | 2007-04-08 09:00:22 -0500 (Sun, 08 Apr 2007) | 2 lines

Gosub called within a Macro resets the arguments improperly and causes general weirdness. (Issue 8329)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-08 14:14:29 +00:00
Tilghman Lesher
86fc0a3c03 Fix --enable-dev-mode
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-08 14:12:00 +00:00
Tilghman Lesher
dc54d451dc Off by one error, resulting in a crash (Issue 9500)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60709 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-08 13:45:24 +00:00
Tilghman Lesher
f32fa7f2ee Merged revisions 60660 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r60660 | tilghman | 2007-04-07 20:39:25 -0500 (Sat, 07 Apr 2007) | 2 lines

Bug 9486 - memory leak when opening a filestream

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60661 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-08 01:40:47 +00:00
Russell Bryant
06ff84b549 To be able to achieve the things that we would like to achieve with the
Asterisk GUI project, we need a fully functional HTTP interface with access
to the Asterisk manager interface.  One of the things that was intended to be
a part of this system, but was never actually implemented, was the ability for
the GUI to be able to upload files to Asterisk.  So, this commit adds this in
the most minimally invasive way that we could come up with.

A lot of work on minimime was done by Steve Murphy.  He fixed a lot of bugs in
the parser, and updated it to be thread-safe.  The ability to check
permissions of active manager sessions was added by Dwayne Hubbard.  Then,
hacking this all together and do doing the modifications necessary to the HTTP
interface was done by me.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-06 20:58:43 +00:00
Dwayne M. Hubbard
04adac9bda clarified a sentence in the format_wav section
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-06 20:32:49 +00:00
Dwayne M. Hubbard
42efff0d82 updated UPGRADE.txt with format_wav GAIN change and plan to remove GAIN code from trunk
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-06 19:58:33 +00:00
Russell Bryant
762ed2a7ad When a station picks up a trunk that was on hold, make the hints reflect that
nobody has the trunk on hold anymore.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-06 19:50:52 +00:00
Russell Bryant
8908289ec7 Fix a few problems with SLA. (issue #9459, reported by francesco_r, fixed by me)
* The original behavior was that if one station put a call on hold, another one
  picked it up, and then hung up, the code would still consider the call on
  hold by the first station, so the trunk would not be hung up.  However, to
  better comply with what most people seem to expect it to behave, it will now
  hang up the trunk.

* Fix a problem with "barge=no".  This was only intended to prevent people from
  joining calls that are in progress.  However, it also prevented other people
  from picking up a call that was on hold.  This has been fixed.

* When there are no active stations on a trunk and it is on hold, the code now
  indicates the HOLD and UNHOLD conditions to the trunk channel.  This allows
  music on hold to be played to the trunk when it is on hold.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-06 18:58:46 +00:00
Matthew Fredrickson
e7e3929740 Make sure we check the faxdetect option before doing fax processing
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-06 18:21:52 +00:00
Matthew Fredrickson
96a8eadf29 Merged revisions 60456 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r60456 | mattf | 2007-04-06 12:03:15 -0500 (Fri, 06 Apr 2007) | 2 lines

There should only be one code path for doing DTMF conditionals on channels.  This fixes it.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60459 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-06 17:32:31 +00:00
Kevin P. Fleming
f6ab517b3f Merged revisions 60398 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r60398 | kpfleming | 2007-04-06 09:41:37 -0500 (Fri, 06 Apr 2007) | 2 lines

remove undocumented 'cardsmode' parameter and stop searching for transcoders during reload()

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60399 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-06 14:49:51 +00:00
Joshua Colp
f996b1cbc8 Add support for returning different types of results (ie: NBest).
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-06 01:14:00 +00:00
Dwayne M. Hubbard
8581b4d0d5 modified default GAIN for issue 5823, thanks jrwalliker
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60325 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-05 22:58:01 +00:00
Steve Murphy
79ff4ebbdf Added some clarification to the example configs for CDRs, on how to select a backend. Also, made cdr-csv the default if you 'make samples', and no other changes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60323 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-05 22:35:11 +00:00
Jason Parker
e658e931ca Merged revisions 60267 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r60267 | qwell | 2007-04-05 11:09:41 -0500 (Thu, 05 Apr 2007) | 5 lines

Just because we can't find the voicemail configuration file, doesn't
 mean that the module failed to load.  The user could be using realtime.

Issue #9473

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-05 16:10:48 +00:00
Russell Bryant
01b09027f7 Add the MIME type for gif by request from Pari
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-05 15:47:17 +00:00
Joshua Colp
a85156a737 Merged revisions 60213 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r60213 | file | 2007-04-05 08:52:50 -0400 (Thu, 05 Apr 2007) | 2 lines

Only unlock our pvt and net locks if we are actually going to try to lock the owner again. (issue #9472 reported by zoa)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60214 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-05 12:55:02 +00:00
Russell Bryant
ab5c3cd84e Merged revisions 60134 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r60134 | russell | 2007-04-04 12:38:47 -0500 (Wed, 04 Apr 2007) | 6 lines

It is valid to redirect channels via the manager interface that are not in the
UP state.  Instead of checking for that to prevent to ensure a dead channel
doesn't get redirected, just use the ast_check_hangup() API call.
(issue #9457, reported by Callmewind, patch by me)
(related to issue #8977)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-04 17:40:10 +00:00
Russell Bryant
0b94c7c27c Add a Content-Length of 0 to the response built by transmit_response_with_unsupported().
(issue #9454, reported by makoto, fixed by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-04 16:49:45 +00:00
Russell Bryant
3e058dab84 Merged revisions 60083 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r60083 | russell | 2007-04-04 11:37:04 -0500 (Wed, 04 Apr 2007) | 4 lines

Fix the return value of handle_common_options() so that it always properly
indicates whether it handled the option or not.  
(issue #9455, reported by Netview, fixed by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-04 16:39:04 +00:00
Russell Bryant
5119296ab5 Fix a problem where if a trunk was hung up while it was on hold, all of the
hints would reflect the line still on hold, even though it should reflect that
it is back to not in use.  (issue #9459, reported by francesco_r, fixed by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-04 16:26:23 +00:00
Russell Bryant
fa1120bb7c Blocked revisions 60016 via svnmerge
........
r60016 | russell | 2007-04-03 18:23:23 -0500 (Tue, 03 Apr 2007) | 3 lines

Add a missing "\r\n" in the body of the NOTIFY that is sent to indicate the
status of a transfer.  (issue #9388, reported by rarritt)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60017 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-03 23:25:24 +00:00
Russell Bryant
b588473370 Blocked revisions 60014 via svnmerge
........
r60014 | russell | 2007-04-03 18:00:10 -0500 (Tue, 03 Apr 2007) | 3 lines

Use the more generic check for "sed -r" support that was already present in 1.4.
(related to issue #9399)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-03 23:00:36 +00:00
Russell Bryant
3570221a98 Blocked revisions 60012 via svnmerge
........
r60012 | russell | 2007-04-03 17:54:49 -0500 (Tue, 03 Apr 2007) | 3 lines

On Darwin, the -r argument to sed is not valid.  It has to be -E.
(issue #9399, reported by jcovert)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@60013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-03 22:57:05 +00:00
Joshua Colp
06634b25ea Don't clash when a person both speaks and uses DTMF.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59963 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-03 19:40:59 +00:00
Russell Bryant
dff65e38f4 Merged revisions 59938 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59938 | russell | 2007-04-03 14:15:04 -0500 (Tue, 03 Apr 2007) | 4 lines

Don't attempt to report configuration errors in build_user().  oej pointed out
that for a "friend" entry, this won't work, because all user options are valid
for peers, but not the other way around.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-03 19:16:53 +00:00
Russell Bryant
f8773a1e80 Merged revisions 59916 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59916 | russell | 2007-04-03 13:43:54 -0500 (Tue, 03 Apr 2007) | 3 lines

Make chan_sip report when it encounters an unknown option.
(issue #9440, reported by nightcrawler)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-03 18:55:57 +00:00
Russell Bryant
9634ee4bbf Merged revisions 59886 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59886 | russell | 2007-04-03 12:58:19 -0500 (Tue, 03 Apr 2007) | 5 lines

When doing a built-in blind or attended transfer, restore the ability to use '#'
to terminate the number and immediately do the transfer instead of having to
dial the number and just wait for the feature digit timeout.
(issue #8366, xueliangliang)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-03 18:01:49 +00:00
Russell Bryant
af0f8ba422 Ensure that menuselect gets executed in dependency check mode every time you run make.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59853 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-03 16:03:35 +00:00
Nadi Sarrar
911a8f501d Merged revisions 59788,59803 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59788 | nadi | 2007-04-03 11:37:00 +0200 (Di, 03 Apr 2007) | 2 lines

Use the new sysfs way of mISDN 1.2 to check if a port is NT or not.

........
r59803 | nadi | 2007-04-03 12:40:58 +0200 (Di, 03 Apr 2007) | 2 lines

ptp is the 5th bit, not the 4th.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-03 11:02:46 +00:00
Christian Richter
30ace959bb Merged revisions 59623-59624,59639 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59623 | crichter | 2007-04-02 09:12:24 +0200 (Mo, 02 Apr 2007) | 1 line

we can now make 30 channels on a PRI (before we forgot chan 31..)
........
r59624 | crichter | 2007-04-02 09:25:54 +0200 (Mo, 02 Apr 2007) | 1 line

don't be verbose if no need
........
r59639 | crichter | 2007-04-02 14:08:12 +0200 (Mo, 02 Apr 2007) | 1 line

added option which allows us to accept incoming SETUP Messages without automatically sending Proceeding or Setup Acknowledge, this is useful with some broken switches and if you want to Release incoming calls without previously having acknowledged them. The new option is noautorespond_on_setup=yes|no default is no, so we don't break the existing behaviour
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-03 07:20:27 +00:00
Joshua Colp
76dcc531f0 Merged revisions 59723 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59723 | file | 2007-04-02 14:55:25 -0400 (Mon, 02 Apr 2007) | 2 lines

Increase the maximum size for a string of mailboxes to 1024. (issue #9270 reported by rtucker)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-02 18:58:24 +00:00
Steve Murphy
48b277a047 continue in for-loop should go to the incrementer, not the test. As per 9435, thanks to marcelbarbulescu
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-02 17:31:32 +00:00
Russell Bryant
6408918920 Merged revisions 59608 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59608 | russell | 2007-04-01 17:35:25 -0500 (Sun, 01 Apr 2007) | 6 lines

Add the SO_REUSEADDR flag to sockets handled by netsock.  This is needed by
the patch that went in for issue 7874.  chan_iax2 needs to be able to create
socket that is lisetning on INADDR_ANY, but also be able to bind sockets to
specific addresses.  (Thanks to Stevenson on the asterisk-dev mailing list
for explaining why this flag was needed.)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-02 15:39:07 +00:00
Jason Parker
40252c62c9 Add linux-uclibc host arch..."thingy". Sorry, I don't know what it's called...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-30 22:50:31 +00:00
Steve Murphy
798039b4d8 several changes via kpflemings review
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-30 17:51:17 +00:00
Steve Murphy
9c69e34f62 These mods fix CDR issues from 8221, 8593, 8680, 8743, and perhaps others. Mainly with CDRs generated from transfer situations.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59486 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-30 14:11:59 +00:00
Steve Murphy
ff6aacc1e8 A small clarification to keep bugs from being filed, and confusion from rising, if clearglobalvars is set, and globals are set in the AEL file. (9419)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-30 00:56:36 +00:00
Russell Bryant
0cb0e410ba When building a response to a subscription, the "from" must be the full Jabber
ID.  This fixes some problems where jabber users are not able to add their
Asterisk account to their user list, since they are unable to get Asterisk
to approve their subscription.  (issue #8210, reported by caspy, and verified
by bradtem)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-29 17:43:52 +00:00
Joshua Colp
4490052410 Merged revisions 59360 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59360 | file | 2007-03-29 13:33:58 -0400 (Thu, 29 Mar 2007) | 2 lines

Keep a global array of variables indicating whether certain conference rooms are in use. This ensures that two people going into a new dynamic conference when the 'e' option is set don't go into the same conference room. (issue #8835 reported by eliel)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-29 17:38:55 +00:00
Russell Bryant
6cdc236f09 Merged revisions 59357 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59357 | russell | 2007-03-29 12:14:33 -0500 (Thu, 29 Mar 2007) | 5 lines

If an error occurs when reading from an RTP socket, and the error code does not
indicate that we should try again, then return NULL instead of a "null frame".
This will prevent Asterisk from trying over and over again, and eventually
causing the system to crash.  (issue #8285, john)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-29 17:17:41 +00:00
Russell Bryant
8c3f8e8b97 Blocked revisions 59355 via svnmerge
........
r59355 | russell | 2007-03-29 12:10:28 -0500 (Thu, 29 Mar 2007) | 3 lines

Backport the change to chan_iax2 to return NULL instead of a "null frame"
from its read callback.  See revision 59341 to the 1.4 branch for more info.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59356 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-29 17:10:57 +00:00
Russell Bryant
8acd1e8349 When the IAX2 read callback gets called, return NULL instead of a "null frame".
This will cause Asterisk to hangup the call instead of keep trying whatever it
was doing.  Under normal conditions, this function would *never* be called.
However, the author of this patch says an error will occur that will cause it
to get called every 100 thousand calls or so.  When this does happen, it puts
the channel in a loop that eventually brings down the system.  So, hangup up
the call is certainly a better alternative.  (issue #8286, john)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-29 16:55:39 +00:00
Russell Bryant
fd7085a3ab Export the GTK2 library and include information to sub Makefiles.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-29 16:25:41 +00:00
Tilghman Lesher
55ccc79050 Merged revisions 59301 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59301 | tilghman | 2007-03-29 11:04:46 -0500 (Thu, 29 Mar 2007) | 3 lines

Issue 9415 - No point to getting a diagnostic field if we aren't doing anything with the information.
(Plus, it tends to crash the Postgres ODBC driver.)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-29 16:07:05 +00:00
Tilghman Lesher
51f3ea3f99 Blocked revisions 59299 via svnmerge
........
r59299 | tilghman | 2007-03-29 10:33:10 -0500 (Thu, 29 Mar 2007) | 2 lines

Change ENV section to use setenv, instead of putenv (Alexandru Pirvulescu <sigxcpu@gmail.com>, reported via -dev list)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-29 15:34:01 +00:00
Tilghman Lesher
fdfe1581e1 Another crash that I thought we had fixed already - Issue 9396
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-28 03:38:09 +00:00
Tilghman Lesher
ffabe730a1 Merged revisions 59283 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59283 | tilghman | 2007-03-27 18:36:49 -0500 (Tue, 27 Mar 2007) | 2 lines

Oops

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-27 23:37:31 +00:00
Tilghman Lesher
9be4250a0e Merged revisions 59280 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59280 | tilghman | 2007-03-27 18:31:20 -0500 (Tue, 27 Mar 2007) | 2 lines

Fix a few remaining bad mmap(2) return values

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59281 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-27 23:32:46 +00:00
Russell Bryant
87c1d334a0 Merged revisions 59277 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59277 | russell | 2007-03-27 18:19:41 -0500 (Tue, 27 Mar 2007) | 3 lines

Fix the check of the return value from mmap().  Thanks to Corydon for catching
this one.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-27 23:20:22 +00:00
Russell Bryant
b6b74d9b0a Fix app_directory to actually compile with ODBC_STORAGE, and update the code to
the latest res_odbc API.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-27 23:16:27 +00:00
Russell Bryant
d1403e32e2 Fix app_directory when ODBC_STORAGE is being used. The Makefile did not
properly ensure that this information got copied from what was selected
for app_voicemail.  (issue #9224)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-27 23:02:12 +00:00
Russell Bryant
a2fc7b9e36 Fix the check that ensures that the CHANNEL function's first argument is "rtpqos".
Thanks, Corydon.  :)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-27 18:17:47 +00:00
Steve Murphy
bd5967ea0c via 9373 (duplicate context in AEL crashes asterisk), kpfleming pointed on asterisk-dev, that DECLINE in this case the proper thing to do. This change now has it doing the proper thing.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-27 18:16:32 +00:00
Russell Bryant
8fdf6e3c47 Merged revisions 59258 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59258 | russell | 2007-03-27 13:04:02 -0500 (Tue, 27 Mar 2007) | 4 lines

Fix the use of the "sourceaddress" option when "bindaddr" is set to 0.0.0.0
instead of having each interface explicitly listed.
(issue #7874, patch by stevens)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-27 18:05:46 +00:00
Russell Bryant
c0aca26f30 Convert the RTPQOS function to just be additional parameter of the CHANNEL
function.  This way, it will be possible for other RTP based channel drivers
to expose this information in the future.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59256 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-27 16:20:53 +00:00
Christian Richter
10760fce2c Merged revisions 59252 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59252 | crichter | 2007-03-27 15:56:15 +0200 (Di, 27 Mär 2007) | 1 line

fixed #9355
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59254 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-27 15:00:10 +00:00
Tilghman Lesher
0220349ca4 Oops, this should be case insensitive
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59230 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-26 21:45:44 +00:00
Steve Murphy
1f08db56c5 fix for 9373 (duplicate context in AEL crashes asterisk). I turned a duplicate context from a WARNING to an ERROR. Now you get a module load failure, and asterisk just exits. That's better than a crash, right\?
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59228 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-26 21:41:32 +00:00
Tilghman Lesher
ec028bd1b2 Change this to a single dp function to make oej happy.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-26 21:37:41 +00:00
Steve Murphy
85cdf6218e Fix for 9257; by eliminating the globals in main/config.c, we make it thread-safe, which is a minimum requirement.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59225 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-26 20:06:12 +00:00
Joshua Colp
fd950a2955 Add ability to specify no timeout. This means as soon as the prompt is done playing it moves on to the next priority.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-26 19:34:14 +00:00
Russell Bryant
d036212872 Somehow the code for building the email for voicemail got out of sync. This
change makes a few tweaks to get 1.4 in sync with trunk.
(issue #9301)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59217 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-26 18:33:50 +00:00
Russell Bryant
3d052c0ca1 Fix some codec negotiation problems when CallerID support is not enabled in SLA.
(issue #9308, reported by twilson)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59215 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-26 18:28:29 +00:00
Joshua Colp
a541ea96e1 Make SpeechBackground obey the digit timeout value.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-26 18:13:06 +00:00
Russell Bryant
cd3238d543 Rename the new dialplan functions to match the variable name
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-26 17:53:07 +00:00
Russell Bryant
fa97f6c381 The AUDIORTPQOS and VIDEORTPQOS variables are not fully functional in some
because they get set in sip_hangup.  So, there are common situations where
the variables will not be available in the dialplan at all.  So, this patch
provides an alternate method for getting to this information by introducing
AUDIORTPQOS and VIDEORTPQOS dialplan functions.
(issue #9370, patch by Corydon76, with some testing by blitzrage)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59207 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-26 17:45:55 +00:00
Steve Murphy
19e8d3fdcb A fix for the flex input files, DONT_COMPILE, and STANDALONE_AEL
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-26 17:38:29 +00:00
Nadi Sarrar
980b0bc785 * mISDN >= 1.2 provides a dsp pipeline for i.e. echo cancellation modules, make chan_misdn use it.
* add a check for linux/mISDNdsp.h to configure.ac and update the autogenerated files: 'configure', 'autoconfig.h.in'
  (the 'configure' script was not in sync with the latest configure.ac, so the diff is a bit bigger than expected).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59202 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-26 15:25:53 +00:00
Joshua Colp
ca9872278b Have ast_copy_string magically appear in the aelparse binary! DONT_OPTIMIZE should now work once again.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-26 15:16:29 +00:00
Joshua Colp
3b6f376425 Merged revisions 59194 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59194 | file | 2007-03-23 21:35:49 -0400 (Fri, 23 Mar 2007) | 2 lines

Only try to handle a response if it has a response code. (ASA-2007-011)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59195 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-24 01:39:44 +00:00
Steve Murphy
70cc3c63d3 blocking out the fix in 59187... already incorporated here
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59189 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-23 16:11:15 +00:00
Steve Murphy
23c28f5aff Merged revisions 59186 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59186 | murf | 2007-03-23 09:57:26 -0600 (Fri, 23 Mar 2007) | 1 line

Added a few words in the Macro doc strings about the behavior of macros with hangups (et al.), as per 9337
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-23 16:09:01 +00:00
Kevin P. Fleming
cf58b2ba46 don't allow string input to overrun the buffer to hold it (ASA-2007-010)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-22 23:40:01 +00:00
Kevin P. Fleming
34f55a9bf6 remove variables that are no longer used (--enable-dev-mode is good, developers should be using it)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-22 23:34:22 +00:00
Steve Murphy
cb3e449d9b The stuff in utils was compiling with -O6 even if DONT_OPTIMIZE is set in menuconfig. Added the include to fix that
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59145 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-22 14:40:53 +00:00
Joshua Colp
27911f2128 Add svg mimetype for pari.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-21 18:08:57 +00:00
Joshua Colp
5d7bf5eb71 Merged revisions 59086 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r59086 | file | 2007-03-21 14:03:20 -0400 (Wed, 21 Mar 2007) | 2 lines

Indicate the filename changed when it is changed. (issue #9311 reported by jsmith)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-21 18:04:58 +00:00
Joshua Colp
067876afbc Until we can do media level parsing for sendrecv/etc just use the first value found. This crept up when a phone was offered audio+video and returned an inactive video stream. chan_sip thought the phone said to put the person on hold but that was totally wrong. (issue #9319 reported by benbrown)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59081 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-21 03:25:48 +00:00
Tilghman Lesher
007ee1324d Fix defines for inline stack backtraces (only used by developers anyway)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-20 21:04:52 +00:00
Joshua Colp
bfeb3bcf18 Copy len variable as well, should fix remaining IAX2 DTMF issues.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-20 20:42:46 +00:00
Steve Murphy
1d90b0dec7 Ooops. Sorry, messed up app_stack. This should return it to its previous, untouched, state.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-20 17:48:17 +00:00
Steve Murphy
6e869d135c The fix for the AEL <<security hole>> (bug 9316) is here...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-20 17:43:02 +00:00
Christian Richter
30165b1bf2 Merged revisions 58849-58850,59062-59063 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r58849 | crichter | 2007-03-13 12:58:16 +0100 (Di, 13 Mär 2007) | 1 line

added method standard_dec for dialing out on groups, to avoid conflicts, which caused issues with some ISDN providers
........
r58850 | crichter | 2007-03-13 13:58:32 +0100 (Di, 13 Mär 2007) | 1 line

fixed the crypt_keys stuff
........
r59062 | crichter | 2007-03-20 10:18:06 +0100 (Di, 20 Mär 2007) | 1 line

avoid sending a disconnect when we already received one.
........
r59063 | crichter | 2007-03-20 10:23:22 +0100 (Di, 20 Mär 2007) | 1 line

modified a loglevel
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-20 13:16:06 +00:00
Tilghman Lesher
7246207bd8 Oops, this should have been a %d all along
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-19 22:29:56 +00:00
Joshua Colp
54a94c650b Fix typo in help for CDR function. (issue #9295 reported by ajohnson)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-19 15:52:28 +00:00
Tilghman Lesher
fe446989eb Fix unescaped semicolon (reported via -dev list)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59040 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-19 15:42:26 +00:00
Olle Johansson
156c178143 Issue #9313, Asterisk crash on SIP return code 0 (reported by qwerty1979) (ASA-2007-011)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59037 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-18 20:37:06 +00:00
BJ Weschke
2a609b930c Don't return a non-zero return code if the profile doesn't exist, to match what the documentation says it already does. (#9307 Reported by kkiely)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@59035 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-18 16:36:44 +00:00
Joshua Colp
74ad0dbc66 Wait for the async thread to exit when hanging up all of the paged phones under all circumstances. (issue #9181 reported by PhilSmith)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-16 16:12:28 +00:00
Russell Bryant
31a7b4aceb fix a couple SLA documentation references
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-16 01:42:37 +00:00
Russell Bryant
1b8da31130 Making these documentation changes in the 1.4 branch upset various people, so
these chanes will only be done in the trunk.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-16 01:41:00 +00:00
Russell Bryant
2fc431b373 Add the --pdf option to the usage of rubber in prep_tarball
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-16 01:12:40 +00:00
Russell Bryant
fed69df9cd Add configure script checking for GTK2 and some additional Makefile targets
to support gmenuselect


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-15 23:53:26 +00:00
Tilghman Lesher
b6bd80b7f2 Refashion dump command to match common syntax and update the resulting appdocs TeX file
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-15 23:52:48 +00:00
Russell Bryant
045e66abda add a link to the rubber homepage
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58941 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-15 23:24:09 +00:00
Tilghman Lesher
6278d5c65b Expand deprecation warnings from simply warning on use to the builtin documentation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-15 23:11:33 +00:00
Russell Bryant
36aed17ca1 Add Asterisk version information to the generated PDF
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58937 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-15 22:51:29 +00:00
Russell Bryant
2e68c41d61 have prep_tarball attempt to build asterisk.pdf
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58935 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-15 22:35:52 +00:00
Tilghman Lesher
1771f9621d Function works fine, but the documentation is backwards.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-15 22:32:33 +00:00
Russell Bryant
c474809cdf Merge changes from svn/asterisk/team/russell/LaTeX_docs.
* Convert most of the doc directory into a single LaTeX formatted document
  so that we can generate a PDF, HTML, or other formats from this
  information.
* Add a CLI command to dump the application documentation into LaTeX format
  which will only be include if the configure script is run with 
  --enable-dev-mode.
* The PDF turned out to be close to 1 MB, so it is not included.  However, you
  can simply run "make asterisk.pdf" to generate it yourself.  We may include
  it in release tarballs or have automatically generated ones on the web site,
  but that has yet to be decided.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58931 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-15 22:25:12 +00:00
Joshua Colp
6548086af0 Don't assume that the pvt structure will still exist after calling schedule_delivery as it may not. (issue #9278 reported by fmachado)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58923 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-15 18:13:21 +00:00
Russell Bryant
4fc7d081d3 Some people like to put "limitonpeer" instead of "limitonpeers" in their
configuration.  While we're at it, support "limitonpeerz" and 
"limitonpeerssssss".  (inspired by issue #9172)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-14 19:18:08 +00:00
Russell Bryant
53bc57b467 Add a more basic example setup to the examples section
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-14 17:04:38 +00:00
Russell Bryant
06f55b3120 Merged revisions 58896 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r58896 | russell | 2007-03-14 11:38:48 -0500 (Wed, 14 Mar 2007) | 3 lines

Add a note to the security file that the Asterisk CLI and log files may contain
sensitive information, and that people should keep this in mind.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58897 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-14 16:40:22 +00:00
Russell Bryant
78d178173f By default, don't attempt to do any CallerID handling at all with SLA because
it is known to not work properly in some situations.  However, add an option to
enable it for those that would like to use it anyway.

The short story behind this is that to properly handle CallerID with SLA, we
need the ability to change the CallerID on an existing call, and we are not
ready to handle that.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-14 16:33:01 +00:00
Tilghman Lesher
2fd66654ac Issue 9162 - pbx_substitute_variables_helper assumes the buffer is initialized
to all zeroes.  This fixes a case where it wasn't.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-14 01:47:08 +00:00
Russell Bryant
b7f05aeaaa Ensure that the blinky lights show that the trunk stopped ringing when the
trunk hangs up before a station has answered it.
(issue #9234, reported by francesco_r)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-13 23:19:51 +00:00
Russell Bryant
d93c20ac9d fix the reference to the SLA documentation
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58870 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-13 23:11:08 +00:00
Olle Johansson
0eda92609d Merged revisions 58847 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r58847 | oej | 2007-03-13 12:45:52 +0100 (Tue, 13 Mar 2007) | 2 lines

Issue #9229 - No port in request URI on register to non default SIP ports (neelakantan)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-13 11:49:35 +00:00
Olle Johansson
f546453573 Don't hangup the call on OK or errors on MESSAGE and INFO
inside of a dialog (like video update requests).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-13 10:03:03 +00:00
Olle Johansson
83bb6718fc Issue #9251 - Clear From URI from user attributes (tgrman)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58843 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-13 09:12:16 +00:00
Joshua Colp
8f379dc693 Blocked revisions 58832 via svnmerge
........
r58832 | file | 2007-03-12 12:49:49 -0400 (Mon, 12 Mar 2007) | 2 lines

We can't use the assembler version of fetchadd_int under Intel Macs. (issue #9254 reported by darrell budic)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58833 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-12 16:52:14 +00:00
Christian Richter
5923e48d7f Merged revisions 57034,57523,57753,58558 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r57034 | crichter | 2007-02-28 17:09:27 +0100 (Mi, 28 Feb 2007) | 1 line

fixed bugs.digium.com bugs: #9157 and bugs.beronet.com bugs: #302, #303, #304
........
r57523 | crichter | 2007-03-02 19:32:51 +0100 (Fr, 02 Mar 2007) | 1 line

fixed typo
........
r57753 | crichter | 2007-03-04 11:39:50 +0100 (So, 04 Mar 2007) | 1 line

fixed another place where the out_cause was hardcoded to 16
........
r58558 | crichter | 2007-03-09 15:43:58 +0100 (Fr, 09 Mar 2007) | 1 line

we can free channel 31 as well, since we can occupy it
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58826 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-12 13:08:06 +00:00
Christian Richter
160cfaf1c6 added UU transceiving and corect handling for rdnis
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-12 12:43:24 +00:00
Joshua Colp
dd1a0aa1dd Allow RFC2833 compensation to compensate for even stupider implementations by queueing up the end frame at the start, not the actual end. (issue #8963 reported by AndrewZ)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-12 01:21:12 +00:00
Joshua Colp
fa866efb5c Add matchexterniplocally setting which only substitutes your externip/externhost setting if it matches the localnet setting. I know of at least two people who need opposite settings, so I made it an option! (issue #8821 reported by kokoskarokoska)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-12 00:51:16 +00:00
Russell Bryant
8ae4e264d1 Fix a few more places in chan_iax2 where the ast_frame used for receiving a
frame was not properly initialized.
 - Interpolating a frame when the jitterbuffer is in use
 - decrypting a frame when IAX2 encryption is on
 - frames in an IAX2 trunk


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58705 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-10 18:11:11 +00:00
Russell Bryant
442c9f222f Make the compiler happy and initialize a variable.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58669 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-10 03:58:27 +00:00
Russell Bryant
e836ed5ea3 Merge some updates to the SLA documentation. I plan to keep working on this
to explain all of the expected behavior with call handling, configuration
details for specific phones, and other things.  However, I got tired of doing
it in plain text, so I switched to using LaTeX.  I have included the PDF version.
I haven't been able to get a nice looking plain text version out of it yet, but
I'm not terribly concerned since this is supposed to be more of the manual,
while the plain text sample configuration file is the reference.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-09 23:59:10 +00:00
Joshua Colp
76f8e0c489 Fix spelling of unavailable in voicemail documentation. (issue #9248 reported by tensai)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58604 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-09 21:08:19 +00:00
Joshua Colp
b9124234e9 Merged revisions 58579 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r58579 | file | 2007-03-09 15:46:43 -0500 (Fri, 09 Mar 2007) | 2 lines

If we are unable to lookup the host in a c line we have to abort, otherwise the previous data is gone and we will (potentially) have no data when all is said and done.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-09 20:49:47 +00:00
Russell Bryant
90aa4ab658 Hang up the channel that put the call on hold in the event processing thread to
avoid a race condition.  Also, if the station originated the call that it is
putting on hold, don't hang up the trunk if it was the only station on the call
and it is hanging up due to hold and not a normal hangup.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-08 22:15:15 +00:00
Russell Bryant
2f54661cf8 Add a missing break statement so that handling the above event does not
incorrectly destroy the channel. (issue #9242, andrew)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58510 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-08 22:06:54 +00:00
Tilghman Lesher
ec21f50132 Fix segfault (Issue 9236)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-08 21:33:03 +00:00
Russell Bryant
ed9b9c6791 Refactor hold handling a bit so that it does not require keeping the call up
when a call is put on hold.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-08 20:54:56 +00:00
Joshua Colp
2b3c0dc1e4 Make early SDP seeding even smarter! We have to check codecs in the make_compatible function too. (issue #9221 reported by marcelbarbulescu)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-08 18:01:00 +00:00
Joshua Colp
add0cad065 Merged revisions 58388 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r58388 | file | 2007-03-08 11:04:58 -0500 (Thu, 08 Mar 2007) | 2 lines

Only print out debug message if the definition that makes the variables shows up was actually defined. (issue #9233 reported by serginuez)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58389 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-08 16:07:10 +00:00
Kevin P. Fleming
690da7f074 this change was not needed; fclose() handles closing the file descriptor already
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58354 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-08 13:23:46 +00:00
Kevin P. Fleming
37af77e79f fix a compiler warning, and overwriting 'res' value
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58352 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-08 13:17:42 +00:00
Kevin P. Fleming
8a2e3d0b8b fix two cases where HTTP session file descriptors would not be closed
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-08 13:17:17 +00:00
Russell Bryant
5603ca69eb If we receive ZT_EVENT_REMOVED, destroy the specified channel.
(issue #7256, tzafrir)

Also, update the configure script to make sure that we don't try to build 
chan_zap if the installed version of zaptel does not include ZT_EVENT_REMOVED.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58320 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-08 01:01:46 +00:00
Russell Bryant
f34c30860e (This bug was reported to me by Kinsey Moore)
Merged revisions 58242 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r58242 | russell | 2007-03-07 12:17:07 -0600 (Wed, 07 Mar 2007) | 7 lines

Fix a problem where the Asterisk channel name could be that of the wrong IAX2
user for a call.  This is because the first step of choosing this name is to
look for an IAX2 peer that happens to have the same IP/port number that this
call is coming from and assuming that is it.  However, this is not always
correct.  So, I have made it change this name after authentication happens
since at that point, we have an exact match.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58243 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-07 18:19:19 +00:00
Joshua Colp
240355d78b Ensure we have (or should have) at least one matching codec before attempting early bridge SDP seeding. (issue #9221 reported by marcelbarbulescu)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-07 17:52:58 +00:00
Russell Bryant
b393ff7feb Blocked revisions 58167 via svnmerge
........
r58167 | russell | 2007-03-06 18:27:04 -0600 (Tue, 06 Mar 2007) | 2 lines

Fix a misplaced block of code in the 1.2 version of the patch to fix issue #8977

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-07 00:27:59 +00:00
Russell Bryant
97fe798e7e Merged revisions 58164 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r58164 | russell | 2007-03-06 18:20:13 -0600 (Tue, 06 Mar 2007) | 4 lines

If the channels acquired using the manager Redirect action are not up, then
don't attempt to do anything with them.  It could lead to weird behavior,
including crashes.  (issue #8977)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-07 00:25:19 +00:00
Steve Murphy
81ef9a4f18 Merged revisions 58115 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r58115 | murf | 2007-03-06 15:52:52 -0700 (Tue, 06 Mar 2007) | 1 line

Fix for 9220: Eyebeam cannot renew subscriptions for presence info. Reason: re-SUBSCRIBE requests don't include Accept headers, which the rfc says are optional (to put it tersely), (it uses MAY), and luckily, the sip_pvt struct has the format info stored, so we simply leave it if the format is set, and the accept header null.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-06 23:10:14 +00:00
Russell Bryant
dd920562ee Clarify the documentation of the dialout and sendvoicemail options.
(issue #9000, caio1982 and serge-v)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58119 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-06 23:00:57 +00:00
Olle Johansson
275abf4e08 Merged revisions 58052 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r58052 | oej | 2007-03-06 21:33:21 +0100 (Tue, 06 Mar 2007) | 2 lines

Change error message to proper message

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-06 20:37:07 +00:00
Russell Bryant
905238839b Return an error of transmit_response is called without a session.
(issue #9002)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@58023 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-06 18:01:20 +00:00
Joshua Colp
94c9dcda60 Since chan_iax2 does not support reception of DTMF with duration ensure that it is set to 0 on the frame. (issue #8521 reported by gdhgdh)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57914 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-05 19:19:07 +00:00
Joshua Colp
a5b62f15c3 Don't create a listen channel and record the conference unless the option is turned on. (issue #9204 reported by francesco_r)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-05 18:39:28 +00:00
Joshua Colp
2feaf74cdd Merged revisions 57869 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r57869 | file | 2007-03-05 12:49:18 -0500 (Mon, 05 Mar 2007) | 2 lines

Make create_dirpath use our standard for return values. -1 is failure, 0 is success. (issue #9205 reported by ballares)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57870 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-05 17:52:03 +00:00
Steve Murphy
85b9c4f565 Merged revisions 57825 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r57825 | murf | 2007-03-05 07:53:57 -0700 (Mon, 05 Mar 2007) | 1 line

Fixed a typo introduced via 9156 (either the gotos or their doc strings are wrong)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57826 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-05 15:20:17 +00:00
Joshua Colp
127e1095f1 Don't allow a NULL pointer to reach ast_frdup. (issue #9155 reported by cmaj)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-05 04:19:53 +00:00
Joshua Colp
a00f75604b Don't reference a potentially NULL pointer. (issue #9199 reported by klolik)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-05 03:35:03 +00:00
Joshua Colp
44dd29ff61 Preserve marker bit when P2P bridging. (issue #9198 reported by edgreenberg)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-05 03:22:17 +00:00
Steve Murphy
b899145141 Updated the regression tests
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-03 15:31:12 +00:00
Tilghman Lesher
3687771760 Merged revisions 57648 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r57648 | tilghman | 2007-03-03 00:36:55 -0600 (Sat, 03 Mar 2007) | 2 lines

Memory leak of a list, if call recording was abandoned

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-03 06:45:00 +00:00
Dwayne M. Hubbard
9a47a4712f submitted patch for Georgian language, issue 9010, submitted by Alexander Shaduri
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-03 00:59:24 +00:00
Russell Bryant
3b6dc39807 add missing configuration template. Thanks to Lacy Moore on asterisk-users for pointing this out\!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57591 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-03 00:02:29 +00:00
Russell Bryant
b59030489b Update the check that is used to determine whether zaptel transcoder support
is present.  The interface has changed.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-02 23:03:01 +00:00
Joshua Colp
53b9bc89c0 Merged revisions 57475 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r57475 | file | 2007-03-02 12:02:46 -0500 (Fri, 02 Mar 2007) | 2 lines

If a SIP message comes in and goes to a method handler that requires additional values that may not be present then send back an error.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-02 17:06:52 +00:00
Steve Murphy
f8be0ce753 Merged revisions 57458 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r57458 | murf | 2007-03-02 09:39:33 -0700 (Fri, 02 Mar 2007) | 1 line

further refinement in wording of goto documentation, as per 9156, goto not proceeding to next instruction
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57473 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-02 16:55:16 +00:00
Steve Murphy
9fab305234 I almost had comma escapes right, but 9184 points out the problem-- the escape is removed by pbx_config, and pbx_ael should also, before sending it down into the pbx engine. Also, you have to insert it back in, if you are generating extensions.conf code from the AEL.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57426 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-02 05:21:36 +00:00
Russell Bryant
5a9cd3d235 Return the correct digit that interrupted the stream. This fixes exiting the
Background application when using the m option.
(issue #9176, mjagdis)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57396 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-02 00:20:44 +00:00
Russell Bryant
31cf37519f Merge changes from svn/asterisk/team/russell/sla_updates
* Originally, I put in the documentation that only Zap interfaces would be
  supported on the trunk side.  However, after a discussion with Qwell, we came
  up with a way to make IP trunks work as well, using some things already in
  Asterisk.  So, here it is, this now officially supports IP trunks.
* Update the SLA documentation to reflect how to setup IP trunks.
* Add a section in sla.txt that describes how to set up an SLA system with
  voicemail.
* Simplify the way DTMF passthrough is handled in MeetMe.
* Fix a bug that exposed itself when using a Local channel on the trunk side
  in SLA.  The station's channel needs to be passed to the dial API when
  dialing the trunk.
* Change a WARNING message to DEBUG in channel.h.  This message is of no use
  to users.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-01 23:42:53 +00:00
Joshua Colp
219f4b4913 Merged revisions 57317 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r57317 | file | 2007-03-01 17:19:32 -0500 (Thu, 01 Mar 2007) | 2 lines

Don't even attempt to optimize things when a proxy channel is involved. It will just explode in weird and unexplaineable ways. (issue #9175 reported by clegall_proformatique)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-01 22:21:44 +00:00
TransNexus OSP Development
81b8f64769 1. Corrected a typo for www.etsi.org. Thank Patrick.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-01 03:02:47 +00:00
Russell Bryant
65915e679a minor tweaks to the sla docs
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57207 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-28 23:01:52 +00:00
Russell Bryant
447561d7a2 Merge more changes from svn/asterisk/team/russell/sla_updates
* Add support for private hold.  By setting "hold=private" for a trunk, only
  the station that put the call on hold will be able to retrieve it from hold.
  Also, by setting "hold=private" for a station, any call that station puts
  on hold can only be retrieved by that station.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-28 22:07:05 +00:00
Russell Bryant
315c9614cb Minor formatting change
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-28 19:58:56 +00:00
Russell Bryant
9d3ff33b25 Merge changes from svn/asterisk/team/russell/sla_updates
* Add support for the "barge=no" option for trunks.  If this option is set,
  then stations will not be able to join in on a call that is on progress
  on this trunk.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57144 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-28 19:56:20 +00:00
Steve Murphy
6bc3d77c05 Merged revisions 57118 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r57118 | murf | 2007-02-28 12:12:41 -0700 (Wed, 28 Feb 2007) | 1 line

a small documentation update, to reflect reality in the goto doc strings, as per 9156, Goto does not proceed to next prio if jump fails
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57139 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-28 19:23:05 +00:00
Joshua Colp
43f841cadf Merged revisions 57092 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r57092 | file | 2007-02-28 13:55:45 -0500 (Wed, 28 Feb 2007) | 2 lines

Fix a few more issues with the agent logoff CLI command. (issue #9123 reported by arbrandes)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-28 18:57:52 +00:00
Russell Bryant
9021d3c3b2 Merge current set of changes from svn/asterisk/team/russell/sla_updates
* Add support for station ring delays.  Ring delays can be set globally for a
  station or for specific trunks on the station.
* Fix a few bugs in existing code.
* Restructure and Reorganize code to improve readability and maintainability.
* Improve formatting of the "sla show (trunks|stations)" CLI commands.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-28 18:20:05 +00:00
Joshua Colp
53b014b81a Picky compiler...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57055 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-28 17:55:03 +00:00
Joshua Colp
d92e56ac89 Better handle timeouts when the individual speaks after everything has been played but before the timeout ends.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-28 17:45:50 +00:00
Steve Murphy
96622ddd26 I was surprised that I had not yet downgraded missing goto targets and macro call defs to a warning, in case they are in extensions.conf; I rectified this problem. Also, A goto in a macro to a target in a catch block was not being found; I fixed this too; the cause was that I needed to treat catch statements like an extension in the find_match code.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@57049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-28 17:15:27 +00:00
Russell Bryant
1082f8d178 Fix voicemail email attachments. I missed the conversion of one of the line
endings and there was an extra one where it should not have been.
(issue #9128)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-27 17:36:09 +00:00
Tilghman Lesher
91355b5e5f Picky, picky... show deprecation warning in application help, too (reported via list)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-26 22:01:23 +00:00
Russell Bryant
83ce3720bc Restore the behavior of Asterisk 1.2 where if a device was not specified in
alsa.conf, then we just use the system default, instead of creating our own
default of hw:0,0.  (issue #9139)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-26 20:42:21 +00:00
Joshua Colp
31d02952de Merged revisions 56850 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r56850 | file | 2007-02-26 15:05:02 -0500 (Mon, 26 Feb 2007) | 2 lines

Obey the clearglobalvars option in extensions reload (or dialplan reload depending on your version). (issue #9146 reported by ramonpeek)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-26 20:07:18 +00:00
Russell Bryant
dd6b58edcd Fix a crash in my last change to iax2_indicate(). (issue #9150)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-26 20:04:13 +00:00
Joshua Colp
0750349819 Update app_record documentation to use new CLI command, core show file formats. (issue #9151 reported by junky)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-26 19:33:48 +00:00
Joshua Colp
51fc74da59 Use ast_strlen_zero to see if the language and/or context argument is not present for Background instead of just checking if it is NULL. (issue #9141 reported by mjagdis)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-26 17:09:53 +00:00
Russell Bryant
268fc8a9cc Do more complete locking of the chan_iax2_pvt struct in the indicate callback.
(Problem brought up by Ben Smithurst on the asterisk-dev list)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-26 16:51:18 +00:00
Joshua Colp
693cdc775e Allow both of the show version files and core show file versions CLI commands to work. (issue #9135 reported by mvanbaak)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-26 16:36:08 +00:00
Russell Bryant
11e4c71bc0 Move a comment to be in the correct struct.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-26 01:04:40 +00:00
Russell Bryant
6c89f9e883 Blocked revisions 56729 via svnmerge
........
r56729 | russell | 2007-02-25 18:34:31 -0600 (Sun, 25 Feb 2007) | 4 lines

Ensure that lock.h is included in utils.c with AST_API_MODULE defined so that
the implementations will be properly included when the AST_INLINE_API functions
are not going to be inlined.  (issue #9124, festr)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56730 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-26 00:35:04 +00:00
Tilghman Lesher
185d7f5a3a Merged revisions 56684 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r56684 | tilghman | 2007-02-25 08:38:03 -0600 (Sun, 25 Feb 2007) | 3 lines

Issue 9130 - If prev is the last item on the channel list, then evaluating
additional conditions (e.g. name prefix) will cause a NULL dereference.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-25 14:46:41 +00:00
Jason Parker
a9e4e0eefa Make sure to set a speeddials parent on creation.
Don't crash if hold is pressed when no call is active.
Don't return in places that we shouldn't..


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-24 02:02:53 +00:00
Kevin P. Fleming
3b191255bf update to match zaptel 1.4 API change that was committed a few minutes ago
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56548 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-24 00:53:55 +00:00
Russell Bryant
2020191f67 Merged revisions 56504 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r56504 | russell | 2007-02-23 17:20:55 -0600 (Fri, 23 Feb 2007) | 8 lines

Fix up a couple more signal handlers to not do bad things that could cause
various undesirable results.  The other day, I made Asterisk deadlock by
hitting Control-C because of a bad signal handler.  Now, signal handlers
just set a flag and write to an alert pipe for the flag to be handled.  Then,
there is another thread that is monitoring for these flags.  If being run in
console mode, it is just the main thread.  If Asterisk is in the background,
a thread is created to do it.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-23 23:24:18 +00:00
Joshua Colp
40712e5eaf Change log notice to debug. It is possible for a scheduled item to execute and be deleted at close to the same time and unavoidable. If this happens this message creeps up.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56457 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-23 21:53:41 +00:00
Russell Bryant
76a643978e Merged revisions 56406 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r56406 | russell | 2007-02-23 14:17:56 -0600 (Fri, 23 Feb 2007) | 4 lines

Don't destroy mutexes before unregistering all of the entry points from the core.
Also, fix a potential memory leak from not destroying the locks for all of the
possible call numbers (about 32k of them).

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56407 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-23 20:20:00 +00:00
Kevin P. Fleming
99b4865121 build special version strings for AADK/S800i builds
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56372 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-23 18:59:09 +00:00
Russell Bryant
ad720f24bb The IMAP storage code uses the same code to build the email that is used when
voicemail is sent via email using something like sendmail.  In the patch from
bug 8033 to fix various IMAP storage problems, the line endings in the email
file were changed in the code from "\n" to "\r\n".  However, this breaks
sending regular voicemail to email.  So, this change conditionally sets line
endings to "\r\n" only if IMAP_STORAGE is enabled.
(issue #9128, patch by jarjarbinks, modified by me to not break IMAP storage)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-23 17:58:57 +00:00
Joshua Colp
b31b7a9b87 Blocked revisions 56279 via svnmerge
........
r56279 | file | 2007-02-22 18:19:25 -0500 (Thu, 22 Feb 2007) | 2 lines

Always defer Agent logoff if any channels are up until they hang up. (issue #9123 reported by arbrandes)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56280 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-22 23:25:32 +00:00
Russell Bryant
f314685447 Merge changes from team/russell/sla_updates.
This batch of changes to the SLA code does a few different things.

* I made the SLA code event driven instead of having to act in a lot of busy
  loops while dialing things to wait for state changes.  This makes the code
  more efficient and readable at the same time.

* I have implemented a couple of new features.  The first is inbound trunk
  ringing timeouts.  This is an option that defines how long to let an incoming
  call on a trunk to ring.

* I have also implemented ring timeouts for stations.  They may be specified
  for the entire station, meaning it is how long to let the station ring before
  giving up.  You can also specify a ring timeout for a specific trunk on a
  station.  So, you can say that you only want a specific station to ring 5
  seconds if it is line1 ringing, but otherwise, there is no timeout.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-22 23:08:36 +00:00
Joshua Colp
4565c1483c Merged revisions 56230 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r56230 | file | 2007-02-22 13:44:24 -0500 (Thu, 22 Feb 2007) | 2 lines

Only change the original or clone channel if it's the channel behind the proxy channel, not if it's just a regular bridged channel.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56231 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-22 18:49:39 +00:00
TransNexus OSP Development
ae419981d6 Update OSP documentation for v1.4.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-22 14:06:56 +00:00
Olle Johansson
d67ef52159 Move message from verbose to debug
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-22 10:33:55 +00:00
Steve Murphy
2ed66c5a89 updated the sound tarball versions in Makefile
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56094 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-22 02:39:58 +00:00
Russell Bryant
9a7d1cc182 Restructure a little bit of code to reduce nesting. There is no functionality
change here.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56055 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-22 01:24:10 +00:00
Russell Bryant
71921a8329 Merged revisions 56010 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r56010 | russell | 2007-02-21 18:53:25 -0600 (Wed, 21 Feb 2007) | 3 lines

If we receive a frame that is not in any of the negotiated formats, then drop
it.  (potentially issue #8781 and SPD-12)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-22 00:57:36 +00:00
Joshua Colp
58ce1edf27 Print out deprecation notice on usage output of CLI commands. (issue #8925 reported by blitzrage)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-22 00:35:55 +00:00
Kevin P. Fleming
26bb928cfc disable unloading of embedded modules... there is a fundamental problem with doing so that will not be fixed in this version of Asterisk due to its invasiveness
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@56006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-22 00:08:54 +00:00
Joshua Colp
fee3b74617 Merged revisions 55956 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r55956 | file | 2007-02-21 15:32:16 -0500 (Wed, 21 Feb 2007) | 2 lines

Change naughty warning message to provide useful information. If a write now fails on a channel in meetme it will tell you the channel name instead of spitting out the wrong error message.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-21 20:35:40 +00:00
Jason Parker
b937d7e8bc Fix locking issue, and accept "transport-accept" as a valid accept message.
This should solve issues 8970 and 8503.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55954 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-21 20:27:08 +00:00
Russell Bryant
bb3aa2ee41 Simplify the last change to app_meetme, and move the call to dispose_conf()
up into the block where we know a conf exists.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-21 20:22:33 +00:00
Joshua Colp
54f59f4dad Only dispose of the conference if one was created.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-21 20:16:34 +00:00
Joshua Colp
10864c42ea Only start playing the next file if we have not been quieted.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-21 20:03:38 +00:00
Joshua Colp
3d95841eb3 Add a flag that indicates whether a SIP dialog is an outgoing call or not. SIP_OUTGOING originally did it but it was repurposed to the direction of the last transaction, which can cause update_call_counter to falsely decrease the wrong counters. (please don't hurt me oej) (issue #8943 reported by mdu113)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55914 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-21 17:18:19 +00:00
Kevin P. Fleming
aee9196ece Merged revisions 55868 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r55868 | kpfleming | 2007-02-21 08:03:11 -0600 (Wed, 21 Feb 2007) | 2 lines

use new tag version script

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55869 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-21 14:06:47 +00:00
Olle Johansson
c0f5102378 Issue #8848 - Turn off lamp more quickly after transfer (decrement inuse early on transferer's call leg)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-21 08:32:34 +00:00
Jason Parker
67421802de Fix segfault when buddy couldn't be found.
Issue 7764, patch by sailer


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-21 02:01:36 +00:00
Russell Bryant
39026c9f96 Improve the reference counting to fix bugs where people report seeing
conferences listed that have no members.
(issue #9073)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55758 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-21 01:03:25 +00:00
Russell Bryant
98cb7fa757 Blocked revisions 55750 via svnmerge
........
r55750 | russell | 2007-02-20 18:19:14 -0600 (Tue, 20 Feb 2007) | 9 lines

Fix random crashes when using the MeetMe application.  This patch converts list
handling to use the linked list macros and most importantly, implements
reference counting on the ast_conference objects.  The reference counting was
first backported from 1.4.  However, that code has some problems that caused
the reference count to never hit zero.  Those problems are fixed in this patch
and will be resolved in 1.4 and trunk next, with a different patch.

(issues #7647, #9073, #9106, BE-115). 

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-21 00:22:29 +00:00
Joshua Colp
51f20d54e7 Better handle dropped IMAP connections. (issue #9054 reported by bsmithurst)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-21 00:11:20 +00:00
Joshua Colp
30d30fef76 Return behavior I removed. I did not remember that you could just add a localnet entry to make it work.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-20 23:57:03 +00:00
Joshua Colp
49749e44a2 Don't test our own address against the localnet settings. At least one person has had issues as a result of this from #7051 so I'm reversing it. (issue #8821 reported by kokoskarokoska)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-20 23:08:45 +00:00
Joshua Colp
4f5689f95f Merged revisions 55669 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r55669 | file | 2007-02-20 17:39:14 -0500 (Tue, 20 Feb 2007) | 2 lines

Defer clearing callback information if channels are up until they are hung up. This ensures the hangup process goes smoothly and no channels get hung in limbo. (issue #8088 reported by kebl0155)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55670 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-20 22:47:00 +00:00
Russell Bryant
cb03702de9 Add the Asterisk version information to the Server header in HTTP
responses.  (requested by Pari)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55634 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-20 20:26:06 +00:00
Russell Bryant
71275050ab Increase the maximum number of manager headers to 128, at the request of Pari.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55590 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-20 19:57:07 +00:00
Russell Bryant
fc44ae4c31 Blocked revisions 55588 via svnmerge
........
r55588 | russell | 2007-02-20 13:49:50 -0600 (Tue, 20 Feb 2007) | 3 lines

Convert a tab to spaces so that the documentation is printed out properly
aligned.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-20 19:53:15 +00:00
Jason Parker
e0b88aba12 No need to cast nor free with strdupa (thanks file)
55555!


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55555 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-20 16:53:45 +00:00
Russell Bryant
6bdc40358a Change the formatting of sla.conf.sample to make it more readable.
(issue #9112, blitzrage)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-20 16:41:57 +00:00
Olle Johansson
920f332399 - Not sending arguments to an application is not "out of memory"
- Making error messages a bit more clear


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55483 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-19 21:12:55 +00:00
Tilghman Lesher
f0bf09466a Merged revisions 55434 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r55434 | tilghman | 2007-02-19 12:09:09 -0600 (Mon, 19 Feb 2007) | 2 lines

forcename and forcegreetings options should check to see if the recording already exists

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-19 18:11:48 +00:00
Doug Bailey
c967342095 Changed iax2 process thread to detached to correct memory leak due to left over thread context on thread exit.
Modified module unload process to avoid deadlocks on pthread cancels


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55397 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-19 14:52:59 +00:00
Olle Johansson
476d1c932e Merged revisions 55277 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r55277 | oej | 2007-02-18 13:32:13 +0100 (Sun, 18 Feb 2007) | 2 lines

Documentation update (#9053, jsmith)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-18 12:35:54 +00:00
Olle Johansson
e07ad5f742 Block patch that was made only for 1.2 (already implemented in 1.4 and trunk)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55250 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-18 10:51:22 +00:00
Joshua Colp
7cec18d933 Add missing membername option to AddQueueMember documentation. (issue #9088 reported by seanbright)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55219 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-17 17:39:32 +00:00
Jason Parker
0ade592435 Fix an issue where callerid would not be displayed on some phones.
Issue 8995, initial patch and research done by wedhorn


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55217 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-17 17:10:09 +00:00
Joshua Colp
ec6e4f6887 Merged revisions 55153 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r55153 | file | 2007-02-16 22:53:45 -0500 (Fri, 16 Feb 2007) | 2 lines

Answer the channel before recording privacy information. (issue #8926 reported by lmamane)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-17 03:55:30 +00:00
Joshua Colp
fccaadad94 Make the 'i' option of Queue actually work. (issue #8986 reported by utis)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-17 02:59:50 +00:00
Joshua Colp
7a4bed883e Merged revisions 55073 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r55073 | file | 2007-02-16 20:09:50 -0500 (Fri, 16 Feb 2007) | 2 lines

Allow chan_sip to handle attended transfers from a SIP phone that is sitting behind chan_agent. Yes folks, all it took was one line of code. (issue #8784 reported by pzieba)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-17 01:16:59 +00:00
Russell Bryant
137835c878 If the pg_config application is found, but there is probably executing it,
then consider postgres unavailable.  (issue #8637)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-17 00:40:34 +00:00
Russell Bryant
4b6558fb6b Filter out yet another architecture that does not work with the optimizations
in the built-in libgsm. (issue 8637, ovi)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-17 00:31:42 +00:00
Russell Bryant
960b4de2de Merged revisions 55005 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r55005 | russell | 2007-02-16 16:48:22 -0600 (Fri, 16 Feb 2007) | 9 lines

Revert the change I did in revisions 54955, 54969, and 54970, in 1.2, 1.4, 
and trunk.  I decided that once a conference is created from meetme.conf,
it is acceptable behavior that the pin can not be changed until the
conference goes away.  I also added a note in meetme.conf to describe this
behavior.

We still have another issue in 1.4 and trunk where some conferences with no
users don't go away.  That is the real bug that needs to be addressed here.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-16 22:49:42 +00:00
Joshua Colp
b0df14b32c Merged revisions 54999 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r54999 | file | 2007-02-16 17:13:45 -0500 (Fri, 16 Feb 2007) | 2 lines

Do not send indications through ast_indicate in chan_agent but instead go directly to the technology. This way when indications are emulated they happen on the Agent channel and do not screw up formats on the channels. (issue #8439 reported by punkgode)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@55002 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-16 22:18:46 +00:00
Russell Bryant
cad10249de Merged revisions 54955 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r54955 | russell | 2007-02-16 14:56:58 -0600 (Fri, 16 Feb 2007) | 5 lines

For conferences that are configured in meetme.conf, check the configuration
file every time someone joins the conference instead of only when the
conference is first created.  This is to ensure that changes to the pin
numbers in the config file are always honored.  (issue #9073)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54969 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-16 21:12:18 +00:00
Joshua Colp
3a1ceb4ff8 Need to check macro extension as well as macro context for directed pickup.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-16 18:51:15 +00:00
Russell Bryant
0c00d00d1e Fix setting "autofallthrough" to yes by default. It was set to enabled in
pbx.c.  However, if the option was not present in extensions.conf, then
pbx_config.c would set it back to disabled.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54898 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-16 18:03:41 +00:00
Russell Bryant
2986791f67 Clean up a few coding guidelines issues - spaces to tabs, use sizeof() to pass
the size of a static buffer, add spaces ...


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-16 17:40:38 +00:00
Jason Parker
84d057c5a5 Clarify a restart message. It's silly, but the reporter had a very valid point.
Issue 9079


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-16 17:25:21 +00:00
Joshua Colp
7722d96bea Allow directed pickup to pick up the real context instead of the macro context if a Macro is used. (issue #8984 reported by jamesb63)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54884 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-16 17:02:35 +00:00
Olle Johansson
3ca445e34c Issue #7541 - Handle multipart attachments to SIP messages - even if boundary is quoted.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-16 12:06:23 +00:00
Olle Johansson
a945ccf652 Merged revisions 54771 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r54771 | oej | 2007-02-16 12:38:03 +0100 (Fri, 16 Feb 2007) | 2 lines

Issue #9069 - If we open with TH we should not close with /TD. (seanbright)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-16 11:39:55 +00:00
Joshua Colp
ae5eec37dd Don't let dtmf leak over into the engine and let it skew the results... also give DTMF results priority. (issue #9014 reported by surftek)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-16 00:48:48 +00:00
Joshua Colp
bddfe6fea7 Merged revisions 54622 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r54622 | file | 2007-02-15 11:14:40 -0500 (Thu, 15 Feb 2007) | 2 lines

Use a separate variable to indicate execution should continue instead of the return value. (issue #8842 reported by pluto70)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-15 16:19:39 +00:00
Joshua Colp
dadf652e26 Forward begin DTMF frames as well as end. (issue #9068 reported by mhardeman)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54481 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-14 21:07:23 +00:00
Olle Johansson
ab60981de3 Block patch only needed in 1.2
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54439 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-14 18:44:58 +00:00
Matthew Fredrickson
91e22d1df2 Merged revisions 54373 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r54373 | mattf | 2007-02-14 10:25:49 -0600 (Wed, 14 Feb 2007) | 2 lines

When handling glare on a PRI, move the requested channel rather than hang up the old one. Fix for 8957 and 9011.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54375 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-14 16:56:40 +00:00
Joshua Colp
7d029cabf6 Add G722 to ast_best_codec. If anyone disagrees with it's placement, feel free to change it. (issue #9045 reported by gork)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-14 01:09:40 +00:00
Russell Bryant
7bcf1d913a Remove a couple of leftover debug messages
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54235 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-13 21:31:22 +00:00
Russell Bryant
3ed86f887e Fix the documentation on the return values from device state provider
registration and deletion.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54218 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-13 20:56:50 +00:00
Russell Bryant
b100b69703 If we fail to create the SIP socket, then return -1 from reload_config() so
that load_module() will return AST_MODULE_LOAD_DECLINE.  Otherwise, the console
will just get spammed with error messages every time chan_sip tries to send a
message.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54204 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-13 19:42:00 +00:00
Olle Johansson
8584300aac Blocking patch for 1.2 only
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-13 18:41:15 +00:00
Russell Bryant
913948066e Change ast_set_state_callback() to ast_dial_set_state_callback()
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-12 19:17:08 +00:00
Russell Bryant
5bc6ee1714 - Add the ability to register a callback to monitor state changes in an
asynchronous dial operation.
- Rename the various references to "status" to "state" in the dial API


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-12 17:58:43 +00:00
Joshua Colp
329df6f95e Make the --without-oss argument work. (issue #9026 reported by puzzled)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54026 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-12 16:34:45 +00:00
Russell Bryant
2123a1bf02 Fix a typo where "vmpassword" should be "vmsecret"
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@54002 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-12 15:38:39 +00:00
Paul Cadach
f5590445cc Fix VLDTMF reception
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-10 09:09:49 +00:00
Paul Cadach
f02a11732b Much simpler than previous one ;-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-10 09:08:55 +00:00
Paul Cadach
3a68e31940 Provide correct DTMF duration
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53879 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-10 09:07:11 +00:00
Paul Cadach
39d6429a35 Bring deprecated 'debug channel <x|all>' command back
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53878 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-10 09:04:47 +00:00
Kevin P. Fleming
4eccecc891 don't display the --with-imap message unless --with-imap was specified without a path
use '-n' instead of '! -z' for tests


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-10 06:06:08 +00:00
Russell Bryant
c16059235e Add some output for "show application SLAStation/SLATrunk"
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53821 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-10 01:02:00 +00:00
Russell Bryant
93fcd4a354 Change some text to properly state "On Hold", which was already done in trunk.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-10 00:41:57 +00:00
Russell Bryant
7ee02f585d Merge team/russell/sla_rewrite
This is a completely new implementation of the SLA functionality introduced in
Asterisk 1.4.  It is now functional and ready for testing.  However, I will be
adding some additional features over the next week, as well.

For information on how to set this up, see configs/sla.conf.sample 
and doc/sla.txt.

In addition to the changes in app_meetme.c for the SLA implementation itself,
this merge brings in various other changes:

chan_sip:
 - Add the ability to indicate HOLD state in NOTIFY messages.
 - Queue HOLD and UNHOLD control frames even if the channel is not bridged to
   another channel.

linkedlists.h:
 - Add support for rwlock based linked lists.

dial.c:
 - Add the ability to run ast_dial_start() without a reference channel to
   inherit information from.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53810 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-10 00:35:09 +00:00
Russell Bryant
2f5eabb51e When the Echo() application receives the digit '#', echo that back as well.
Since we already sent the BEGIN frame for that digit, it makes sense to send
the END as well.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-10 00:15:50 +00:00
Kevin P. Fleming
ff17d402de another dependency
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53781 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-09 23:52:44 +00:00
Kevin P. Fleming
07462b8d1b add some inter-module dependencies
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53780 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-09 23:51:41 +00:00
Kevin P. Fleming
fccb4abbb9 fix awk scripts to work when both MODULEINFO and MAKEOPTS are present in a source file
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-09 23:51:29 +00:00
Joshua Colp
1ba2aa702d Temporarily change musicclass on channel to one specified in Dial so that the 'm' option functions properly. (issue #8969 reported by christianbee)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-09 19:33:31 +00:00
Kevin P. Fleming
23fc99bc5f clarify the fact that voicemail IMAP storage cannot be built against a distro's binary c-client library package (at least not at this time)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53715 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-09 16:42:22 +00:00
Olle Johansson
89a3a01d0b Don't output debug unless we asked for it
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53672 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-08 23:18:59 +00:00
Joshua Colp
dce4b744a1 Fix timeout issue when utterance is longer then timeout itself.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53601 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-08 17:54:32 +00:00
Tilghman Lesher
ce2414804c Issue 9007 - Mutex not released on early return
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53532 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-08 13:47:54 +00:00
Tilghman Lesher
1612f65f9c Merged revisions 53529 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r53529 | tilghman | 2007-02-08 07:36:10 -0600 (Thu, 08 Feb 2007) | 2 lines

Issue 9003 - If fullname is empty, quote() passes back "\"" 

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53530 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-08 13:40:02 +00:00
Russell Bryant
2620b515a7 When building libdb1.a, put the additional flags needed at the beginning of
ASTCFLAGS, instead of at the end.  This way, we ensure that we find the local
headers first before accidentally trying to use headers that exist in
locations specified in the ASTCFLAGS passed from the main Makefile.
(issue #8637, ovi)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-07 23:52:45 +00:00
Russell Bryant
2b39ea96f0 The clean target actually needs to run "distclean" on editline. This is
because we need to make sure that its configure script gets executed again,
because the CFLAGS we want to pass to editline may have changed.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53464 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-07 20:07:39 +00:00
Joshua Colp
204b58a23c We can not reliably do P2P bridging with DTMF passing back with compensation if we need to listen for DTMF frames. (issue #8962 reported by caio1982)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53434 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-07 17:53:03 +00:00
Russell Bryant
2b5990387c When parsing the NTP timestamp in a sender report message, you are supposed to
take the low 16 bits of the integer part, and the high 16 bits of the
fractional part.  However, the code here was erroneously taking the low 16 bits
of the fractional part.  It then shifted the result 16 bits down, so the result
was always zero.  This fix makes it grab the appropriate high 16 bits, instead.
(issue #8991, pointed out by andre_abrantes)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-07 17:39:31 +00:00
Joshua Colp
670a0ff144 Directly load say.conf in load_module instead of calling the reload function. (issue #8946 reported by junky)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53399 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-07 17:04:44 +00:00
Joshua Colp
2f6312a37e Merged revisions 53357 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r53357 | file | 2007-02-07 10:38:48 -0500 (Wed, 07 Feb 2007) | 2 lines

Fix a few potential memory leaks with realtime users and peers. (issue #8999 reported by bsmithurst)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-07 15:43:39 +00:00
Tilghman Lesher
7f0c317655 Merged revisions 53354 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r53354 | tilghman | 2007-02-07 09:30:02 -0600 (Wed, 07 Feb 2007) | 2 lines

Issue 7440 - Macro called from Macro from the h extension exits prematurely

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53355 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-07 15:33:51 +00:00
Christian Richter
1c90803367 Merged revisions 52843 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r52843 | crichter | 2007-01-30 15:38:08 +0100 (Di, 30 Jan 2007) | 1 line

fixed some possible segfaults. also fixed an very important bug which occurs on high load (when calls are very fast generated)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53324 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-07 09:22:44 +00:00
Tilghman Lesher
27475a306d Text fix for jabber reload command (reported by bkruse via IRC)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-07 05:24:31 +00:00
Tilghman Lesher
f2decd2446 Merged revisions 53245 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r53245 | tilghman | 2007-02-06 00:58:28 -0600 (Tue, 06 Feb 2007) | 2 lines

Issue 8987 - Status could return two responses (mnicholson)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-06 07:00:52 +00:00
Olle Johansson
e7a0e86756 Formatting
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53222 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-05 23:43:59 +00:00
Joshua Colp
687b672a09 Ensure say_cfg is NULL when the module is loaded. (issue #8946 reported by junky)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-05 17:06:18 +00:00
Joshua Colp
e647794710 Unregister Playback CLI commands as well as dialplan application. (issue #8946 reported by junky)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53150 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-05 16:02:00 +00:00
Olle Johansson
8e07358edf Add some comments on queue system behaviour and how it affects the
SIP channel


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-05 00:18:34 +00:00
Joshua Colp
910898b7be Make SIPDtmfMode application work with recent capability changes, and also fix an RTP stack issue when the auto option was used. (issue #8972 reported by mdu113)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-03 21:05:02 +00:00
Russell Bryant
8f04a45ee9 Merged revisions 53133 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r53133 | russell | 2007-02-03 14:38:13 -0600 (Sat, 03 Feb 2007) | 4 lines

set the DIALSTATUS variable to contain "INVALIDARGS" when the dial application
exits early because of invalid arguments instead of just leaving it empty.
(issue #8975)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53136 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-03 20:44:20 +00:00
Russell Bryant
ab3a5d6542 Blocked revisions 53134 via svnmerge
........
r53134 | russell | 2007-02-03 14:39:45 -0600 (Sat, 03 Feb 2007) | 2 lines

Revert some changes that accidentally got committed as a part of another fix.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53135 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-03 20:40:26 +00:00
Paul Cadach
10ad9bb6d0 Remove quote from H.323 vendor string because due to compatibilities with CS1000 reported at www.voip-info.org
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53131 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-03 10:02:55 +00:00
BJ Weschke
c71401e705 I'm baaaaaaaaaack. :)
Post a warning to the console that things might possibly be misconfigured when queue member's states are still 'Not in Use' when we're about to bridge them with a caller from queue. Also, put some documentation quoted from oej's queues.txt efforts started in /trunk today. 
 This commit puts #7433 into feedback state for 1.4, and pending no further negative feedback, it will finally be closed.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-02 21:26:45 +00:00
Joshua Colp
f0329105f3 Correct a copy/pasted error message line for RTCP.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-02 17:15:22 +00:00
Joshua Colp
089486cfcf Merged revisions 53117 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r53117 | file | 2007-02-02 10:58:09 -0600 (Fri, 02 Feb 2007) | 2 lines

Pass the glob expanded filename to process_text_line so that error messages contain the actual filename, not the original include one. (issue #8959 reported by tzafrir)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-02 16:59:53 +00:00
Joshua Colp
177baaecc6 Add systemname to asterisk.conf generation per recent discussions about it. (issue #8968 reported by blitzrage)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53114 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-02 15:29:35 +00:00
Olle Johansson
90a4b844a9 Disable the direct p2p RTP call setup in SIP. You can enable it in sip.conf, but it is now
considered experimental until we solve the AST_CONTROL_ANSWER with payload and videocaps
stuff.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53109 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-02 00:24:03 +00:00
Jason Parker
b17706586f Blocked revisions 53107 via svnmerge
........
r53107 | qwell | 2007-02-01 17:14:09 -0600 (Thu, 01 Feb 2007) | 2 lines

Fix a small typo.  Synopsis lines shouldn't have a newline

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53108 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 23:16:08 +00:00
Joshua Colp
57fe6882ac Merged revisions 53103 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r53103 | file | 2007-02-01 16:21:56 -0600 (Thu, 01 Feb 2007) | 2 lines

Copy noncodeccapability over to the joint variable so that telephone-event will get transmitted in the sent INVITE.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 22:24:32 +00:00
Joshua Colp
ffe220faa5 Huh... fix the berkeley DB to compile here as well, but it apparently required both dev mode and no optimizations to creep up.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 22:04:58 +00:00
Joshua Colp
09844a7f1a Merged revisions 53095 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r53095 | file | 2007-02-01 15:47:11 -0600 (Thu, 01 Feb 2007) | 2 lines

Don't negotiate RFC2833 when not configured to do so. (issue #8799 reported by mdu113) 

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53097 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 21:54:28 +00:00
Russell Bryant
51bcb9d3be Fix the FIELDQTY function to not crash. (reported by blitzrage and Corydon on IRC)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 21:24:52 +00:00
Olle Johansson
0ed3148016 Going backwards, blame file.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 21:15:50 +00:00
Joshua Colp
9b42bff145 Merged revisions 53084 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r53084 | file | 2007-02-01 15:03:10 -0600 (Thu, 01 Feb 2007) | 2 lines

Return previous behavior of having MOH pick up where it was left off. (issue #8672 reported by sinistermidget)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 21:11:28 +00:00
Joshua Colp
290fd87817 Make func_strings build under dev mode. Didn't I do this today already in the berkeley DB?
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 21:06:02 +00:00
Olle Johansson
97efd0be22 - Clean INC_COUNT flag when we decrement call counter
- If it's still set at time of dialog destruction, make sure we decrement the device call counter properly
  before we destroy the dialog


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53085 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 21:05:34 +00:00
Olle Johansson
10f0da24c2 Change debug level for state change message that is not really informative when debugging app_queue
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53081 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 20:38:58 +00:00
Olle Johansson
6bb6bba6a3 Cleaning up the devicestate callback function
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 20:28:54 +00:00
Tilghman Lesher
86f51691c5 Oops.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53077 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 20:13:40 +00:00
Tilghman Lesher
a94d8f5bd8 Merged revisions 53074 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r53074 | tilghman | 2007-02-01 14:07:35 -0600 (Thu, 01 Feb 2007) | 2 lines

Bug 8965 - Allow FIELDQTY to work with both variables and dialplan functions

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53075 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 20:09:52 +00:00
Joshua Colp
9e90d55a78 Add missing 'F' letter to getopt so it magically becomes a valid option. (issue #8960 reported by tzafrir)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 19:33:33 +00:00
Tilghman Lesher
7e0a469bda Merged revisions 53069 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r53069 | tilghman | 2007-02-01 13:13:53 -0600 (Thu, 01 Feb 2007) | 2 lines

No wonder FIELDQTY doesn't work with functions... the documentation in pbx.c was wrong

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 19:21:20 +00:00
Joshua Colp
e86275c11c Fix silly logic. We really want to write UDPTL frames out when the call is up.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 17:37:44 +00:00
Olle Johansson
d7cde47f06 Add explanation of port= in combination with defaultip= (thanks jsmith)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53062 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 16:35:12 +00:00
Christian Richter
60ad44b8e9 we update the name on any first reply of our setup
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 13:17:18 +00:00
Paul Cadach
6fd3418e40 chan_h323 is very stable, so let it built by default
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 11:07:41 +00:00
Joshua Colp
28dacda047 When going on hold have the side that was put on hold reinvite back to Asterisk. When going off hold have the side that was taken off hold reinvited back to the other party.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 00:24:20 +00:00
Joshua Colp
7229c2ba48 Add more frame types to forward in the RTP bridge loops.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01 00:19:48 +00:00
Russell Bryant
9aab046002 Merged revisions 53045 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r53045 | russell | 2007-01-31 15:25:11 -0600 (Wed, 31 Jan 2007) | 3 lines

Fix a bunch of places where pthread_attr_init() was called, but
pthread_attr_destroy() was not.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-31 21:32:08 +00:00
Russell Bryant
43e68cac9a Remove an extra \r\n from manager user events. (issue #8955, mnicholson)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-31 18:18:25 +00:00
Russell Bryant
0bc7ef3b06 Merged revisions 53039 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r53039 | russell | 2007-01-31 11:41:51 -0600 (Wed, 31 Jan 2007) | 3 lines

Use the proper format string to print unsigned values in the rtp debug output.
(issue #8954, wmis)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53040 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-31 17:45:05 +00:00
Russell Bryant
ad254da05d Only changed the paused status in an existing queue member if the paused
column exists.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53037 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-31 17:39:28 +00:00
Russell Bryant
8dc0a7778f Instead of always creating a realtime queue member as unpaused, read the
"paused" column and use that value for the paused status of the member.
(issue #8949, jmls)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53035 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-31 17:34:22 +00:00
Russell Bryant
d652806c48 Update init script for SuSE 10. (issue #8363, johnlange)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@53001 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-30 23:38:42 +00:00
Russell Bryant
7669f073df Add documentation for using cdr_pgsql. (issue #8942, lters)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52999 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-30 23:30:34 +00:00
Russell Bryant
ff1ca74145 When we are checking for a system installed version of libgsm, we need to check
for gsm.h as well.  Furthermore, when checking for this header, it may be
located in a gsm/ sub directory, so check for that, as well.
(issue #8773)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-30 23:23:24 +00:00
Russell Bryant
248d86970d Blocked revisions 52954 via svnmerge
........
r52954 | russell | 2007-01-30 13:41:52 -0600 (Tue, 30 Jan 2007) | 4 lines

Don't print a message indicating that we don't know what to do with a proceeding
control frame in ast_request_and_dial().  We just need to ignore it.
(reported by JerJer on #asterisk-dev)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-30 19:43:59 +00:00
Russell Bryant
29b7393d84 Only set the DTMF flag on the rtp structure if the DTMF mode is actually
RFC2833, not just that it is not INFO.  This makes it get set for inband DTMF
as well, which is not valid.
(issue #8936)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52952 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-30 19:33:12 +00:00
Russell Bryant
083a9198ea Merged revisions 52903 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r52903 | russell | 2007-01-30 11:12:04 -0600 (Tue, 30 Jan 2007) | 9 lines

The SIGHUP handler was implemented to allow admins to send SIGHUP to a running
Asterisk process to reload the configuration.  However, doing the actual reload
in the signal handler itself is a very bad thing to do, because the reload
process includes calling non-reentrant functions such as malloc/calloc/etc.
If Asterisk is running in the background, then the reload will happen
immediately.  However, if running in console mode, the reload doesn't work
until something is typed at the console.  That sort of defeats the purpose,
but I don't see an easy way to get around it at this point.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-30 17:19:39 +00:00
Russell Bryant
073ecfb1d3 Blocked revisions 52857 via svnmerge
........
r52857 | russell | 2007-01-30 09:35:23 -0600 (Tue, 30 Jan 2007) | 5 lines

Comment out the parts in the Makefile that make codec_zap get built.  It will
not yet build against zaptel 1.2, so I am disabling it to prevent further bug
reports until it gets merged.
(issue #8940)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52859 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-30 15:36:36 +00:00
Joshua Colp
362abb9deb Drop the deprecated show commands since the original ones were changed back. (issue #8937 reported by PCadach)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-30 15:29:50 +00:00
Paul Cadach
a175571e39 Revert reprecation of h.323 gk cycle command from pre-1.4 version instead of duplicated h323 cycle gk
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-30 08:46:31 +00:00
Paul Cadach
df64b9a98c Don't play with free()'d pointers
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-30 08:34:26 +00:00
Paul Cadach
01c6b626c0 Handle non-standard OpenH323/PWLib library names
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-30 08:33:22 +00:00
Russell Bryant
a46e6d74df Merged revisions 52762 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r52762 | russell | 2007-01-29 18:15:06 -0600 (Mon, 29 Jan 2007) | 5 lines

Fix the extraction of the timestamp from video frames.  It was using the
mapping for a mini-frame instead of a video-frame, which caused it to
get invalid data.
(issue #8795, mihai)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52763 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-30 00:15:50 +00:00
Joshua Colp
f92505eec1 Merged revisions 52716 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r52716 | file | 2007-01-29 18:39:39 -0500 (Mon, 29 Jan 2007) | 2 lines

Now that filename is part of the structure and since it comes before postprocess... we have to add it to our postprocess line. (reported on asterisk-dev by Boris Bakchiev)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-29 23:43:40 +00:00
Russell Bryant
4bc823f540 Add a missing quotation mark. This was pointed out by jcmoore on #asterisk-dev.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52695 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-29 22:58:09 +00:00
Russell Bryant
771be23a9c Remove a recursive lock of the manager session. This was pointed out by
zandbelt in issue #8711.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-29 22:55:41 +00:00
Tilghman Lesher
f7459d4687 Argument number correction
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-29 22:12:12 +00:00
Russell Bryant
108085ed2d ASTLDFLAGS needs to be passed to the editline configure script as LDFLAGS.
(issue #8928, zandbelt)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-29 21:36:56 +00:00
Russell Bryant
06a3110ed8 Fix a problem with packet-to-packet bridging and DTMF mode translation. P2P
bridging can only be used when the DTMF modes don't match if the core is
monitoring DTMF in both directions.  Then, the core will handle the translation.
Otherwise, this bridging method can not be used.
(issue #8936)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52645 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-29 21:26:27 +00:00
Russell Bryant
ce753cf0d9 The session lock can not be held while calling action callbacks. If so, then
when the WaitEvent callback gets called, then no event can happen because the
session can't be locked by another thread.  Also, the session needs to be
locked in the HTTP callback when it reads out the output string.  This fixes
the deadlock reported in both 8711 and 8934.
Regarding issue 8711, there still may be an issue.  If there is a second action
requested before the processing of the first action is finished, there could
still be some corruption of the output string buffer used to build the result.
(issue #8711, #8934)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-29 20:39:20 +00:00
Joshua Colp
a4d3a2dbc9 Use ast_calloc instead of malloc.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-29 18:59:41 +00:00
Steve Murphy
f2fab700c3 this is for 8778 (pt_BR backport to 1.4). It was committed to trunk via 7663. But it wasn't so much an enhancement as a fix for the bad language output for portuguese in Brazil, so, after a lot of prodding from patient Brazilians, here is the same fix for 1.4
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52535 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-29 17:57:08 +00:00
Joshua Colp
e67ade2403 Set quota information to 0 when creating a vm_state. (issue #8924 reported by neutrino88)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-29 17:33:19 +00:00
Russell Bryant
824bed6260 Clean up a few things in the last commit to the adaptive jitterbuffer code.
- Specifically indicate to the compiler that the "dropem" variable only
   needs one but.
 - Change formatting to conform to coding guidelines.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52506 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-29 16:54:27 +00:00
Jim Dixon
2132e4f865 Fixed problem with jitterbuf, whereas it would not complain about, and
would allow itself to be overfilled (per the max_jitterbuf parameter). Now
it rejects any data over and above that size, and complains about it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52494 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-29 04:18:36 +00:00
Tilghman Lesher
21ede1662d Suggested change to fix normal usage of --with-tds=/usr/local (Sean Bright, via asterisk-dev mailing list)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-28 05:15:07 +00:00
Joshua Colp
47f9dd508a Merged revisions 52415 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r52415 | file | 2007-01-26 21:09:10 -0500 (Fri, 26 Jan 2007) | 2 lines

Make COMPLETECALLER and COMPLETEAGENT output to queue_log follow documentation. (issue #7677 reported by amilcar)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-27 02:13:41 +00:00
Joshua Colp
9c289fe01b Have the manager interface send back an "Already logged in" message instead of "Invalid/Unknown Command" when the client authenticates for a second time. (issue #8509 reported by pari)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-27 00:44:51 +00:00
Joshua Colp
6b462c95c9 Merged revisions 52360 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r52360 | file | 2007-01-26 19:03:23 -0500 (Fri, 26 Jan 2007) | 2 lines

Make the last context entry read in the dominant one. (issue #8918 reported by pj)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-27 00:08:18 +00:00
Joshua Colp
bc43c82f05 Fix core show file formats CLI command.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-26 23:46:47 +00:00
Joshua Colp
3b44625323 Merged revisions 52264 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r52264 | file | 2007-01-25 14:15:29 -0500 (Thu, 25 Jan 2007) | 2 lines

Allow dequeueing of frames with negative timestamp by moving jitterbuffer frames check to jb_next. (issue #8546 reported by harmen)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-25 19:18:33 +00:00
Joshua Colp
ed48c69f06 Drop out variables I accidentally put in.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-25 17:49:39 +00:00
Joshua Colp
6b08afd05d Decrement onHold count if we are hung up on and still on hold. (issue #8909 reported by alexh42)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52208 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-25 17:14:53 +00:00
Joshua Colp
6124ace110 Merged revisions 52162 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r52162 | file | 2007-01-24 20:48:52 -0500 (Wed, 24 Jan 2007) | 2 lines

Add another note about audio files being played back to each bridged party. (issue #8718 reported by ppyy)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52163 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-25 01:51:35 +00:00
Russell Bryant
96beb30159 By suggestion from kpfleming last week, change "vmpassword" to "vmsecret".
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-25 01:37:16 +00:00
Russell Bryant
f18b0c34d8 Remove libnsl as a required lib for libiksemel to work. This change was
already made in the trunk.
(issue #8762)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-25 01:05:46 +00:00
Russell Bryant
408fa17f71 Blocked revisions 52137 via svnmerge
........
r52137 | russell | 2007-01-24 18:39:50 -0600 (Wed, 24 Jan 2007) | 3 lines

Fix a seg fault when running this application with no arguments from AGI.
(issue #8905, junky)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-25 00:41:30 +00:00
Russell Bryant
6abcb7ae23 Fix the formatting of doxygen comments to properly indicate that the comment
documents the previous entity, as opposed to the next one.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-24 21:42:47 +00:00
Steve Murphy
e3f9fded3a Merged revisions 52002 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r52002 | murf | 2007-01-24 10:43:50 -0700 (Wed, 24 Jan 2007) | 1 line

updated check_expr via 8322 (refactoring of expression checking impl); elfring contributed a nice code reorg, I contributed some time to get it working again, better messages
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-24 18:26:22 +00:00
Joshua Colp
8acccb9254 Merge in dialing API and the app_page that uses it. (issue #BE-118)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-24 18:20:05 +00:00
Joshua Colp
5ebd1ecf63 Fix changing channel formats when joint capability changes and there are no audio formats... I didn't break it originally! (issue #8535 reported by ivoc)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52016 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-24 17:59:55 +00:00
Russell Bryant
d772b80b6b rebuild configure script to reflect last chan_h323 related changes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-24 17:14:11 +00:00
Christian Richter
9352eda642 added fix from #8899
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-24 12:57:22 +00:00
Christian Richter
6d2afb98b4 Merged revisions 51966 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51966 | crichter | 2007-01-24 11:48:09 +0100 (Mi, 24 Jan 2007) | 1 line

fixed the busy problem (dialstatus was not busy when we called a busy extension)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51979 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-24 11:24:53 +00:00
Olle Johansson
a207a31a97 Show capabilities *and* preference in general settings in "sip show settings"
(reported by Clona/Telio - Thanks!)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51931 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-24 09:30:21 +00:00
Paul Cadach
1b49688a74 Allow x64 builds of H.323 (please, rebuild configure)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51895 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-24 08:04:59 +00:00
Russell Bryant
9440d428a0 Merged revisions 51843 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51843 | russell | 2007-01-23 18:57:28 -0600 (Tue, 23 Jan 2007) | 6 lines

Fix an issue related to synchronization of recordings when using Monitor().
The bug is a miscalculation of the amount to seek the stream for writing to
disk when the number of samples coming in and out of a channel do not match up.
(issue #8298, #8887, report and patch by guillecabeza, patch files created and
 testing done by whoiswes)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-24 00:59:58 +00:00
Russell Bryant
d7d0c10c21 Merged revisions 51828 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51828 | russell | 2007-01-23 18:17:50 -0600 (Tue, 23 Jan 2007) | 4 lines

Don't set a new value for the END_ variable on the channel before using the
old value.  If you do, it will lead to accessing a memory address that has
been free()'d.  (issue #8895, arkadia)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-24 00:19:55 +00:00
Joshua Colp
8f7ddbef0d Update channel drivers to use module referencing so that unloading them while in use will not result in crashes. (issue #8897 reported by junky)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51788 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23 22:46:31 +00:00
Russell Bryant
2a37a53c57 Fix some bugs in process_message(). The manager session lock needs to be held
when sending some sort of response, or calling one of the manager action
callbacks.  This resolves an issue where people using the GUI would get random
crashes when they start clicking around a lot.
(issue #8711, reported and debugged by zandbelt)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51781 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23 22:04:01 +00:00
Russell Bryant
86f8e0a527 Fix setting the default port of 8088 on 64-bit or big-endian machines.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51755 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23 21:52:52 +00:00
Russell Bryant
3d5e9fa43c When traversing the list of manager actions, the iterator needs to be
initialized to the list head *after* locking the list.  Also, lock the actions
list in one place it is being accessed where it was not being done.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23 21:33:15 +00:00
Steve Murphy
be0c0cd6dd this mod from 8593 (dstchannel in cdr is empty when transfer call).
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51716 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23 20:32:54 +00:00
Steve Murphy
ec2c64c81b via 8748 (callerid.c loses name when returning PRIVATE_NUMBER flag), the user suggested this mod, saying it would allow 'WITHHELD' to appear in the name field, which would be useful
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23 18:58:27 +00:00
Christian Richter
e65aeb27b5 Merged revisions 50495,50506 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r50495 | crichter | 2007-01-11 14:27:52 +0100 (Do, 11 Jan 2007) | 6 lines

* more additions to make the RESTART message work
* added fix for misdn_call to allow SETUPs with empty 
  extensions, replaced the strtok_r functions with strsep for that 
  (inspired by Sandro Cappellazzo, thanks)


........
r50506 | crichter | 2007-01-11 15:45:38 +0100 (Do, 11 Jan 2007) | 1 line

when we get L2 UP, the L1 is UP definitely too, so we set the L1 state up as well.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23 10:28:54 +00:00
Christian Richter
19fdc9b14e manually merged r49922 and r50335, because of conflicts. this commint includes addition of the ISDN RESTART Message
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51648 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23 10:05:54 +00:00
Paul Cadach
964d2d2e42 Do not abort Asterisk startup if h323 configuration file not found (reported by mithraen)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51615 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23 06:51:51 +00:00
Joshua Colp
5a3acb0511 Only change audio formats on the channel if we have an audio format to change to. (issue #8535 reported by ivoc)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23 03:00:12 +00:00
Joshua Colp
3290b0d37a Merged revisions 51512 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51512 | file | 2007-01-22 20:41:35 -0500 (Mon, 22 Jan 2007) | 2 lines

Yield before reading from zaptel timing source under Solaris so that other threads get a chance to do things. (issue #7875 reported by bob)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23 01:45:04 +00:00
Russell Bryant
8f9f54811d Blocked revisions 51410 via svnmerge
........
r51410 | russell | 2007-01-22 13:39:30 -0600 (Mon, 22 Jan 2007) | 3 lines

Merge codec_zap support for the transcoder card.  This is a standalone codec
module so it will not affect anything else.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51411 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-22 19:41:00 +00:00
Steve Murphy
99ce040a80 This fixes 8836, according to dnatural
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-22 19:28:51 +00:00
Joshua Colp
c60c2b5ffc Merged revisions 51406 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51406 | file | 2007-01-22 14:08:52 -0500 (Mon, 22 Jan 2007) | 2 lines

Move filestream creation to Mixmonitor loop. This will prevent a blank file from being created if no frames ever pass through to be recorded. (issue #7589 reported by steve_mcneil)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51407 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-22 19:13:44 +00:00
Joshua Colp
fe68fe5802 Blocked revisions 51359 via svnmerge
........
r51359 | file | 2007-01-22 11:23:03 -0500 (Mon, 22 Jan 2007) | 2 lines

Explicitly declare what codecs are supported by default globally since using a bitmask for all may include ones we don't need. (issue #8357 reported by gknispel_proformatique)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-22 16:28:11 +00:00
Jason Parker
c9a898c665 Fix Italian numeral support in say.conf for "_[2-9]00" case.
"2131" would've translated to something along the lines of (pardon my..Italian {or lack thereof})
  "duecentocentotrentuno", which makes no sense at all.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-20 06:53:49 +00:00
Jason Parker
2e9e873c09 Fix German language support in say.conf
Properly support 21, 31, 41, 51, 61, 71, 81, and 91.
  einundzwanzig has the same format as zweiundzwanzig (as do all other "_ZX" spoken numerals)

Fix support for numbers in the 10,000,000 to 99,999,999 range.
Add support for numbers in the 100,000,000 to 999,999,999 range.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-20 06:16:06 +00:00
Russell Bryant
c41964cd78 Remove an unused instance of an unnamed enum.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51343 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-20 00:13:06 +00:00
Russell Bryant
c94df4db51 Remove another duplicated definition
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-19 22:19:10 +00:00
Russell Bryant
89285ade68 Remove a variable that was declared twice.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-19 21:20:20 +00:00
Russell Bryant
9bb2b196ce Add a couple more processors that need optimizations excluded.
(issue #8637)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-19 19:30:54 +00:00
Russell Bryant
0e37d936da Fix VLDTMF support in chan_gtalk. AST_FRAME_DTMF and AST_FRAME_DTMF_END are
actually the same thing.  So, a digit would have been interpreted incorrectly
here.  Since the channel driver will always have the begin and end callbacks
called for a digit, only support the button-down and button-up messages.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51328 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-19 19:08:25 +00:00
Russell Bryant
2767bad830 Bump the cleancount since my last commit changed the channel structure.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51326 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-19 19:02:55 +00:00
Russell Bryant
33235b40d6 Merge the changes from the /team/group/vldtmf_fixup branch.
The main bug being addressed here is a problem introduced when two SIP
channels using SIP INFO dtmf have their media directly bridged.  So, when a
DTMF END frame comes into Asterisk from an incoming INFO message, Asterisk
would try to emulate a digit of some length by first sending a DTMF BEGIN
frame and sending a DTMF END later timed off of incoming audio.  However,
since there was no audio coming in, the DTMF_END was never generated.  This
caused DTMF based features to no longer work.

To fix this, the core now knows when a channel doesn't care about DTMF BEGIN
frames (such as a SIP channel sending INFO dtmf).  If this is the case, then
Asterisk will not emulate a digit of some length, and will instead just pass
through the single DTMF END event.

Channel drivers also now get passed the length of the digit to their digit_end
callback.  This improves SIP INFO support even further by enabling us to put
the real digit duration in the INFO message instead of a hard coded 250ms.
Also, for an incoming INFO message, the duration is read from the frame and
passed into the core instead of just getting ignored.

(issue #8597, maybe others...)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-19 17:49:38 +00:00
Russell Bryant
879a71e921 Merged revisions 51300 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51300 | russell | 2007-01-19 10:44:09 -0600 (Fri, 19 Jan 2007) | 4 lines

Fix a memory leak on command line tab completion.  The container for the
matches was freed, but the individual matches themselves were not.
(issue #8851, arkadia)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-19 16:56:17 +00:00
Dwayne M. Hubbard
b62be97f7a chan_zap compiles without libpri after committing 7877 patch
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-19 00:17:32 +00:00
Dwayne M. Hubbard
a4317ce870 Merged revisions 51271 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51271 | dhubbard | 2007-01-18 17:47:10 -0600 (Thu, 18 Jan 2007) | 3 lines

issue 7877: chan_zap module reload does not use default/initialized values on subsequent loads.  Reset configuration variables to default values prior to parsing configuration file.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18 23:56:49 +00:00
Kevin P. Fleming
aa18d74426 block this patch since it is already here
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18 23:36:51 +00:00
Jason Parker
76eb4e76dc Add some more checks for option_debug before ast_log(LOG_DEBUG, ...) calls.
Issue 8832, patch(es) by tgrman


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18 22:50:23 +00:00
Russell Bryant
eedd121fbc Ensure that the locations given to the Asterisk configure script for ncurses,
curses, termcap, or tinfo are further passed along to the editline configure
script.  This fixes some cross-compilation environments.
(issue #8637, reported by ovi, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18 21:54:23 +00:00
Tilghman Lesher
8d59d5173a Merged revisions 51255 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51255 | tilghman | 2007-01-18 15:11:34 -0600 (Thu, 18 Jan 2007) | 2 lines

If a timezone is not specified, assume localtime (instead of gmtime) (Issue #7748)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51256 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18 21:14:24 +00:00
Joshua Colp
f6132a8ec4 Only start timeout once we reach the end of the files to play back.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51251 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18 19:17:34 +00:00
Jason Parker
65565ac74d Fix an issue with file name completion in "module load" and "load".
Issue 8846


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51245 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18 18:42:00 +00:00
Joshua Colp
1e3557c636 Copy MOH settings when calling a peer so that if they put someone on hold or get put on hold themselves they get the right music class. (issue #8840 reported by mdu113)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51243 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18 18:36:35 +00:00
Jason Parker
eab59cabdb Fix an issue with deprecated commands
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18 18:28:29 +00:00
Tilghman Lesher
80466ff3ed Merged revisions 51235 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51235 | tilghman | 2007-01-18 11:42:17 -0600 (Thu, 18 Jan 2007) | 2 lines

Document all the fields, including the indication that "uniqueid" should not be renamed.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51236 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18 17:49:41 +00:00
Russell Bryant
c5a3194042 Make the "hasmanager" option in users.conf actually have an effect.
(issue #8740, LnxPrgr3)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51233 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18 17:18:43 +00:00
Joshua Colp
d4398c0bb6 Build the IMAP remote directory string better and properly. Fix an issue with encoding the GSM voicemail when attaching to the voicemail. (issue #8808 reported by akohlsmith)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18 00:48:55 +00:00
Joshua Colp
9461aa0027 Pass data as well for hold/unhold/vidupdate frames. (issue #8840 reported by mdu113)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18 00:18:44 +00:00
Russell Bryant
8d0defa82b Fix some instances where when loading func_odbc, a double-free could occur.
Also, remove an unneeded error message.  If the failure condition is
actually a memory allocation failure, a log message will already be
generated automatically.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51205 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-17 23:31:11 +00:00
Russell Bryant
2b2f8d22f7 Instead of dividing the offset by 2 directly, make it more clear that the
offset is being scaled by the size of the elements in the buffer.
(Inspired by a discussing on the asterisk-dev list about this code)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51204 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-17 22:09:52 +00:00
Russell Bryant
4244459e31 Merged revisions 51197 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51197 | russell | 2007-01-17 15:17:21 -0600 (Wed, 17 Jan 2007) | 3 lines

Move the check for a failure of ast_channel_alloc() to before locking the
pvt structure again.  Otherwise, on a failure, this will cause a deadlock.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51198 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-17 21:18:35 +00:00
Tilghman Lesher
0baf4aa941 Merged revisions 51194 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51194 | tilghman | 2007-01-17 14:52:21 -0600 (Wed, 17 Jan 2007) | 4 lines

When ast_strip_quoted was called with a zero-length string, it would treat a
NULL as if it were the quoting character (and would thus return the string
in memory immediately following the passed-in string).

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51195 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-17 20:56:15 +00:00
Jason Parker
d47da64f51 re-add "password" for realtime voicemail
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-17 17:36:53 +00:00
Joshua Colp
9f0ad6093e Return the correct result when directly writing out a packet so that the core doesn't then decide to handle it the regular way again. (issue #8833 reported by rcourtna)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-17 06:36:41 +00:00
Kevin P. Fleming
439034e464 a few more coding style cleanups and one bug fix (from AnthonyL)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-17 01:29:12 +00:00
Joshua Colp
f986c4f2c3 Move rescheduling of lagrq/pings into the scheduler callback.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51172 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-17 00:46:29 +00:00
Jason Parker
1825fc3ee2 Fix issue with dtmf continuation packets when the dtmf digit is 0...
Issue 8831


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51170 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-17 00:20:56 +00:00
Jason Parker
c3f17ca3c1 Fix an issue with IMAP storage and realtime voicemail.
Also update the vmdb sql script for IMAP specific options.

Issue 8819, initial patches by bsmithurst (slightly modified by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-16 22:50:19 +00:00
Jason Parker
da01057b5e change documentation to reflect new procedure in 1.4/trunk
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-16 22:07:53 +00:00
Tilghman Lesher
2d893725fc Merged revisions 51161 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51161 | tilghman | 2007-01-16 15:50:04 -0600 (Tue, 16 Jan 2007) | 2 lines

Add documentation walkthrough on getting Postgres to work with voicemail (from Issue 8513)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51162 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-16 21:51:15 +00:00
Tilghman Lesher
87ea385650 Merged revisions 51158 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51158 | tilghman | 2007-01-16 15:26:06 -0600 (Tue, 16 Jan 2007) | 2 lines

Postgres driver doesn't like a NULL pointer when retrieving the length (Bug 8513)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51159 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-16 21:28:39 +00:00
Matt O'Gorman
ea3421ec27 minor things i missed before i get jumped on
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51150 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-16 17:46:12 +00:00
Joshua Colp
2db51f4608 Merged revisions 51145 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51145 | file | 2007-01-16 12:36:50 -0500 (Tue, 16 Jan 2007) | 2 lines

Return previous behavior. ParkedCalls will be able to do DTMF based transfers again. trunk however will get an option to allow this to be set on/off. (issue #8804 reported by nortex)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51148 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-16 17:39:50 +00:00
Jason Parker
897e4b5eaa Display more useful output when streaming files.
Include the channel name to which the file is being played.

Issue 8828, patch by junky.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-16 17:36:53 +00:00
Joshua Colp
531d008066 Merged revisions 51085 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51085 | file | 2007-01-16 00:53:31 -0500 (Tue, 16 Jan 2007) | 2 lines

Add none as a valid callgroup/pickupgroup option. I consider it a bug that it would inherit it all the way down and not have any way to reset it to nothing - so that's why it is in 1.2. (issue #8296 reported by gkloepfer)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-16 05:55:23 +00:00
Russell Bryant
de14e3d549 It is possible for the config pointer to be NULL here, so it needs to be
checked before dereferencing it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-16 01:15:44 +00:00
Matt O'Gorman
cc003179d4 Patch allows for changing voicemail password in users.conf from voicemail main, written by AnthonyL bug #8436
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-16 00:22:09 +00:00
Russell Bryant
91b5561669 Filter out a few CFLAGS that are not valid CXXFLAGS.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50994 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-15 23:49:48 +00:00
Tilghman Lesher
a935012721 Blocked revisions 50987 via svnmerge
........
r50987 | tilghman | 2007-01-15 17:09:02 -0600 (Mon, 15 Jan 2007) | 2 lines

Check return value before dereferencing (Bug 8822)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-15 23:10:08 +00:00
Matt O'Gorman
d95432aad3 Merged revisions 50946 via svnmerge from
https://svn.digium.com/svn/asterisk/branches/1.2

........
r50946 | mogorman | 2007-01-15 14:44:53 -0600 (Mon, 15 Jan 2007) | 4 lines

Solves issue with forwarding voicemails from folders other than inbox.
patch by anthonyl.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-15 21:08:07 +00:00
Jason Parker
9d49164921 re-add deprecated "show version" CLI command.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-15 18:23:21 +00:00
Joshua Colp
caa099357b Move event processing into do_message so that it gets executed again when events are tripped.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50895 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-15 16:36:07 +00:00
Kevin P. Fleming
dd357a71a7 use the ACX_PTHREAD macro from the Autoconf macro archive for setting up compiler pthreads support... should improve portability to platforms with unusual pthreads requirements
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-15 15:03:06 +00:00
Joshua Colp
50f951764f Add missing newlines for two memory CLI commands.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-14 21:59:05 +00:00
Tilghman Lesher
3fb08d4e9d Merged revisions 50781 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r50781 | tilghman | 2007-01-13 23:01:16 -0600 (Sat, 13 Jan 2007) | 2 lines

Bug 8814 - db should look for its header using a relative path, instead of the system path (Fixes FreeWRT)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50782 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-14 05:13:47 +00:00
Kevin P. Fleming
30e4f113a4 when building the sample greetings for maibox 1234@default during 'make samples', build a greeting for each language and file format the user selected to install with menuselect (reported by Brian Capouch on asterisk-dev)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50754 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-13 16:45:37 +00:00
Joshua Colp
e4de85c4f5 Only write a frame out to the channel if one exists. There are cases where one may not and would therefore cause the channel driver to segfault. (issue #8434 reported by slimey)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-13 06:00:24 +00:00
Joshua Colp
cc242206c6 Only join the snmp thread on an unload if the thread is actually running. (issue #8810 reported by junky)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-13 03:04:55 +00:00
Jason Parker
6de5768987 Update documentation to state that you shouldn't use realtime static with voicemail.conf
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-12 19:24:40 +00:00
Joshua Colp
5fe88c5f88 We need to check for res being 0 in do_message itself, otherwise our headers will get lost.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50602 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-12 16:42:33 +00:00
Kevin P. Fleming
34b5a7c8ae Merged revisions 50561 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r50561 | kpfleming | 2007-01-12 08:34:15 -0600 (Fri, 12 Jan 2007) | 2 lines

minor documentation clarification

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50562 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-12 14:42:24 +00:00
Joshua Colp
915f9315e1 Remove check for channel state as it can definitely be something other then ring, and also clean up the code a bit. This should solve the parking issues and maybe some attended transfer issues people have been seeing.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50468 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-11 05:53:09 +00:00
Joshua Colp
240ca25bea Add support to see whether NAT was detected (yay symmetric RTP) and also add a check in chan_sip so that if NAT has been detected and the reinvite behind nat option has been turned off, then just do partial bridge. (issue #8655 reported by mnicholson)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-11 05:19:39 +00:00
Joshua Colp
4ec0f8cbd6 Merge speech-multi branch which adds support for joining multiple sound files together to be played one after another in SpeechBackground.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-10 20:25:44 +00:00
Joshua Colp
c4d1757329 Fix parsing when using something like ldap settings. (done by anthonyl)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-10 19:46:29 +00:00
Joshua Colp
9aca2b2a54 Fix chan_sip not working issue. Let's not prematurely return 0. (issue #8783 reported by st41ker)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-10 18:32:29 +00:00
Jason Parker
4ed22c8198 Reverse some logic in cdr_manager, which made it fail to load if the config file existed.
Issue 8777


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-10 16:45:36 +00:00
Joshua Colp
2c4359d9b3 Merged revisions 50295 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r50295 | file | 2007-01-09 23:51:06 -0500 (Tue, 09 Jan 2007) | 2 lines

Add another return value to dial_exec_full that indicates execution is going to continuing at a new extension/context/priority and to just let it slide. (issue #8598 reported by jon)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-10 04:55:13 +00:00
Joshua Colp
59432b9e21 Ensure data's existence before trying to access it. (issue #8774 reported by rcourtna)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-10 03:51:29 +00:00
Russell Bryant
8fb6be645e Merged revisions 50227 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r50227 | russell | 2007-01-09 21:16:45 -0500 (Tue, 09 Jan 2007) | 6 lines

Make the number that represents the major version number a single digit instead
of 2.  Using two digits makes it an octal number when put into version.h, which
breaks the compilation of any out of tree module that checks the version for
any version after 1.2.7 (reported by Matteo Brancaleoni on the asterisk-dev
mailing list, who gave credit to vihai for pointing it out)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50228 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-10 02:17:46 +00:00
Jason Parker
281b1a890c Re-add CLI command that should have only been deprecated in 1.4.
Thanks kshumard!  (reported in person, so no associated issue #)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-09 17:11:53 +00:00
Tilghman Lesher
8597c8f7b4 Merged revisions 50150 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r50150 | tilghman | 2007-01-09 07:30:04 -0600 (Tue, 09 Jan 2007) | 4 lines

The advent of realtime has enabled people to use commas in the fullname field.
This could cause an issue with sending voicemails, when the field is unquoted.
(Issue 8595)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-09 13:40:45 +00:00
Olle Johansson
1a33c38a15 - handle re-invites properly in sip_hangup()
- Add some invitestate status changes just to be sure


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-09 11:25:20 +00:00
Jason Parker
5cd6177995 Fix an issue with voicemail and users.conf, where it wouldn't ever parse a password, since it was using "secret" instead of "password"
Issue 8761, reported by and patch suggestion from ssokol.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-08 23:39:12 +00:00
Matt O'Gorman
f7767f2e23 we can't unlock a channel if we cant find it. - AnthonyL bug #8741
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50073 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-08 21:11:16 +00:00
Joshua Colp
46700b62af Disable the more intense packet2packet bridging until the bugs can be worked out.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-08 18:21:31 +00:00
Olle Johansson
3394598f93 Issue #8677 - Handle failure of T.38 re-invite
This is not a fix, but adding an error message to tell the admin that
we have a bad configuration. We should not send T.38 re-invites to devices
that can't handle it (with the current architecture where you have to
hard-code t.38 support per device).

To really fix this, we need to figure out a way to tell the incoming
call that the re-invite failed, so we can signal failure on that
end and go back to the original call.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@50006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-08 14:26:14 +00:00
Olle Johansson
0f96f73768 Issue #8524, support multiple via header values (tardieu)
Thanks!


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49983 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-08 13:28:18 +00:00
Olle Johansson
be32fad9b8 We only need one forward declaration
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-08 09:08:10 +00:00
Olle Johansson
484add6554 Issue 8735: Terminate state when extension is unavailable for subscription
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-08 08:55:03 +00:00
Joshua Colp
0a51642588 Merged revisions 49889 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r49889 | file | 2007-01-08 00:10:07 -0500 (Mon, 08 Jan 2007) | 2 lines

Ensure we use the default refresh value of 60 if the remote server does not send one. (issue #8746 reported by maethor)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-08 05:11:54 +00:00
Kevin P. Fleming
708276e718 since we use AC_PATH_TOOL to find tools, we should use the results it provides for us (reported by Brian Capouch on the asterisk-dev list)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-08 03:53:53 +00:00
Tilghman Lesher
5d9b3e845f Merged revisions 49833 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r49833 | tilghman | 2007-01-07 15:43:10 -0600 (Sun, 07 Jan 2007) | 2 lines

If openstream fails, then we crash (Issue 8564)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-07 21:44:52 +00:00
Tilghman Lesher
dcbf36432e Second condition was a subset of the first, so hold was never decremented, thus hint stayed stuck (Issue 8747)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49831 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-07 21:24:04 +00:00
Jason Parker
9e621e99a5 Save 1 whopping byte of allocated memory!
This looks like it may have been a chicken/egg scenario..

You had to call a cleanup func, because everything was allocated.
Then since you had to call a cleanup func, you were forced to allocate - ie; strdup("").


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49742 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-06 00:24:38 +00:00
Kevin P. Fleming
fb05d85ac2 one more time...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49715 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 23:51:31 +00:00
Kevin P. Fleming
7023f1cf8f proper fix for r49712
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 23:49:52 +00:00
Kevin P. Fleming
c63f9a3fe8 if --with-foo=<path> is specific for a configure option, ensure that it is used for header file checking as well
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 23:40:29 +00:00
Kevin P. Fleming
d2d50d7a8e ast_func_read() needs a writable copy of the function name to be passed
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49710 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 23:31:38 +00:00
Jason Parker
9803b9a357 Make codec_zap and chan_zap also depend on zaptel.
This fixes an issue (8727) with zaptel being in a different directory, using --with-zaptel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49705 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 23:16:16 +00:00
Kevin P. Fleming
c56f17425c don't 'consume' the params list before we try to use it again
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 22:52:37 +00:00
Kevin P. Fleming
444adcb477 reduce stack consumption for AMI and AMI/HTTP requests by nearly 20K in most cases
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 22:16:33 +00:00
Joshua Colp
ac75028a50 Don't keep repeating the warning over and over when the end of the call is reached. (issue #8724 reported by xrg)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49675 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 22:14:47 +00:00
Kevin P. Fleming
fb010e49aa Merged revisions 49635 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r49635 | kpfleming | 2007-01-05 10:56:40 -0600 (Fri, 05 Jan 2007) | 2 lines

ensure that threads which are supposed to be detached (because we aren't going to wait on them) are created properly

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49636 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 17:09:00 +00:00
Kevin P. Fleming
ab4da71374 revert the dynamic_list insertion change... that was not the right thing to do
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 00:01:40 +00:00
Kevin P. Fleming
aed1467281 create the IAX2 processing threads as background threads so they will use smaller stacks
when we create a dynamic thread, put it on the dynamic_list right away so we don't lose track of it


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 23:50:15 +00:00
Joshua Colp
62b8b03294 It's possible for the iax2 pvt to disappear, so if it has... don't bother looking for dpentries.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 23:00:50 +00:00
Kevin P. Fleming
46d91e71c5 add support for tracking thread-local-storage objects that exist via 'threadstorage' CLI commands
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 22:51:01 +00:00
Joshua Colp
3d460e5a68 Only free comments and line buffer once we reach the first level. (issue #8678 reported by ssokol, fixed by anthonyl)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 22:28:29 +00:00
Kevin P. Fleming
24bb7d865e don't mark these allocations as 'cache' allocations when caching has been disabled
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 21:58:42 +00:00
Kevin P. Fleming
6b1817c0d1 if we're going to decrement the frame count when we free a frame, we should inrement it when we create one :-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 21:06:02 +00:00
Kevin P. Fleming
497dd42772 only do IAX2 frame caching for voice and video frames
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 18:31:55 +00:00
Kevin P. Fleming
fa5de60c6e don't do frame header caching in the core if LOW_MEMORY is defined
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 18:17:01 +00:00
Kevin P. Fleming
f7a47b38eb don't define this type either if LOW_MEMORY is enabled
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49460 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 18:16:40 +00:00
Matt O'Gorman
ff7a8f61a4 Merged revisions 49447 via svnmerge from
https://svn.digium.com/svn/asterisk/branches/1.2

........
r49447 | mogorman | 2007-01-04 11:45:16 -0600 (Thu, 04 Jan 2007) | 2 lines

converted a lot of 256 to PATH_MAX and some white space fixes.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49459 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 18:11:19 +00:00
Kevin P. Fleming
74258ab85e don't do frame caching in LOW_MEMORY mode
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 18:06:51 +00:00
Kevin P. Fleming
d49b295c1d make building of codec_gsm against the system GSM library actually work
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49457 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 18:05:47 +00:00
Matt O'Gorman
04b4ccc4c2 Merged revisions 49412 via svnmerge from
https://svn.digium.com/svn/asterisk/branches/1.2

........
r49412 | mogorman | 2007-01-04 10:48:43 -0600 (Thu, 04 Jan 2007) | 3 lines

good catch russell sorry i missed that.
fix magic number with proper sizeof

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 16:50:56 +00:00
Russell Bryant
525f5e6d75 Fix the REALTIME() dialplan function. ast_build_string() advances the string
pointer to the position to begin the next write into the buffer.  So, this 
pointer can not be used to copy the contents of the string later.  The
beginning of the buffer must be saved.  Interestingly enough, this code could
not have ever worked.  (Pointed out by Sebb on IRC, thanks!)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49388 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 04:33:00 +00:00
Matt O'Gorman
5ebc820813 Merged revisions 49354 via svnmerge from
https://svn.digium.com/svn/asterisk/branches/1.2

........
r49354 | mogorman | 2007-01-03 17:22:47 -0600 (Wed, 03 Jan 2007) | 6 lines

When using ODBC_STORAGE VoicemailMain doesn't create the
subdirectories for a mailbox such as the INBOX directory.

this patch solves that problem, was written by anthony
be-125

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49355 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-03 23:32:03 +00:00
Christian Richter
fb52698667 Merged revisions 48319,48321,48467,48552,48576,49135,49303 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48319 | crichter | 2006-12-06 15:35:25 +0100 (Mi, 06 Dez 2006) | 1 line

changed a few debugs to higher debug levels
........
r48321 | crichter | 2006-12-06 16:48:45 +0100 (Mi, 06 Dez 2006) | 1 line

added the export and import of the MISDN_ADDRESS_COMPLETE Variable to inidcate wether the extension is already completely dialed or if there might come additional digits by information elements. also added some docs for that.
........
r48467 | crichter | 2006-12-14 14:03:49 +0100 (Do, 14 Dez 2006) | 1 line

removed FIXUP state. added check for channel allocation conflict when we create a setup while the other site creates a setup on the same channel, besides the check we resolve this conflict.
........
r48552 | crichter | 2006-12-18 11:19:39 +0100 (Mo, 18 Dez 2006) | 1 line

when our PTP Partner sends us a SETUP with a preselected channel we just accept it, even when we're NT. added some checks for segfaults.
........
r48576 | crichter | 2006-12-19 14:08:51 +0100 (Di, 19 Dez 2006) | 1 line

when we reject a channel, because it's in use already, we shouldn't process the setup anymore. made the channel allocation a bit easier and more understandable, removed a few unused lines
........
r49135 | crichter | 2007-01-02 11:07:22 +0100 (Di, 02 Jan 2007) | 1 line

added check for channel ranges in the set/empty channel functions. set pmp_l1_check default to no. added misdn restart pid cli command. added cleaning of channel when we send a RELEASE_COMPLETE. 
........
r49303 | crichter | 2007-01-03 09:24:00 +0100 (Mi, 03 Jan 2007) | 9 lines

* Added check for bridging in misdn_call to avoid setting echocancellation
  when 2 mISDN channels are involved and when bridging is set. That lead
  to a kernel panic before under different situations, because we switched 
  about 2 times between hardware bridging and echocancelation
* readded MISDN_URATE variable which got lost before, this should make app_v110
  work again
* fixed typo


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49313 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-03 09:06:50 +00:00
Kevin P. Fleming
8332521122 various Makefile improvements to get chan_vpb (and any other C++ modules) to build properly
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49282 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-03 03:21:25 +00:00
Joshua Colp
40707f097a Check pvt structure presence before passing to send_command. This gets rid of the irritating message about a packet without pvt structure. This happens because the scheduled item is getting cancelled at almost the exact moment it is getting executed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-03 01:19:53 +00:00
Steve Murphy
49cce60e51 This is a slight modification to Josh's edits for #8579; both files edited were the produced by flex; so the source files need to be changed instead, and the generated files regenerated.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-02 22:30:53 +00:00
Olle Johansson
5edb7fa173 Small cleanup of add_t38sdp - it's always enabled at that point in the code
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49212 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-02 19:58:45 +00:00
Jason Parker
0b50088366 Allow fractions of a second in the Wait() application, like it says it allows.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49189 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-02 17:33:02 +00:00
Kevin P. Fleming
95758b4920 remove comment that is unrelated to this function
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-02 13:59:44 +00:00
Olle Johansson
ab6ee2376a Adding note on effect of applicationmap features on re-invites
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49145 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-02 12:08:50 +00:00
Kevin P. Fleming
f195c5d622 check specifically for VLDTMF and transcoding support in the system's Zaptel installation, and make only the modules that need those features dependent on them (this will allow building the other Zaptel-using parts of Asterisk against older versions of Zaptel or those on other platforms that haven't caught up yet to the Linux version)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-01 23:34:35 +00:00
Kevin P. Fleming
9944304c2f use a simpler (and portable) method to ensure that menuselect is built as a host binary
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-01 22:48:03 +00:00
Kevin P. Fleming
6e45c965e1 revert this change until a better solution can be found... 'env -i' was not being used properly, but even when changed to do so, this process fails during cross-compilation because the menuselect build still sees 'CC' as set to the cross-compiler
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-01 22:08:24 +00:00
Olle Johansson
7db2ca152c remove incomplete implementation of dnsmgr. Let's fix this in trunk.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49096 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-01 20:14:33 +00:00
Joshua Colp
cc8ee54779 IAX has been deprecated for quite some time so we had better use IAX2 when creating the dial string for users. (issue #8697 reported by ssokol)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49073 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-30 18:31:17 +00:00
Joshua Colp
05716471b5 Use asprintf to build the channel names instead of custom function. I believe the custom function is doing some things that are not portable across all implementations. (issue #8570 reported by hterag & issue #8692 reported by nicolasg)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-30 18:19:57 +00:00
Joshua Colp
156a6cf5db If the Packet2Packet bridge is being broken because of a masquerade then attempt to read a frame in so the masquerade actually happens. Otherwise weirdness will occur. (issue #8696 reported by kjotte)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-30 05:46:57 +00:00
Joshua Colp
37e5a39d76 Initialize the packet queue in load_module instead of just declaring the list with the default value. (issue #8695 reported by ssokol)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-30 03:37:22 +00:00
Steve Murphy
eae46d9a28 A fix for 8661, where the CUT func needed to have comma args converted to vertical bars. I hope this change does little harm.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-30 00:40:37 +00:00
Kevin P. Fleming
4c9809f6db put this value into the correct property
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49048 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-29 00:50:17 +00:00
Kevin P. Fleming
ad46f05d4a Merged revisions 49045 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r49045 | kpfleming | 2006-12-28 18:32:32 -0600 (Thu, 28 Dec 2006) | 2 lines

location of the bug posting guidelines has changed

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-29 00:32:59 +00:00
Kevin P. Fleming
1715794a0b simple commit to test CIA integration
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-29 00:05:46 +00:00
Jason Parker
52fb756adc Fix some deprecated commands.
Issue 8682, patch by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49035 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-28 21:26:04 +00:00
Jason Parker
c38c990bc7 saw this in passing... fix a small typo
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-28 20:40:23 +00:00
Kevin P. Fleming
0e3a9ba044 new versions of sounds
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-28 20:08:59 +00:00
Jason Parker
c2f688d2fd make the uris_lock a rwlock instead of a mutex lock - needs to be forward ported to trunk
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-28 19:52:46 +00:00
Joshua Colp
345968e6fb Backport support for read/write locks.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-28 19:43:15 +00:00
Steve Murphy
4d6a91eef0 removed <err.h> as in trunk from the ael stuff. Also, threw in a minor fix to frame.c to avoid build-killing compiler warnings.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49020 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-28 19:21:56 +00:00
Joshua Colp
6d582d75c7 ast_copy_string is not available when LOW_MEMORY is used and things are being built in the utils directory, so we need to resort to the old method of strncpy. (issue #8579 reported by mottano)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 22:28:46 +00:00
Kevin P. Fleming
a299485952 since these variables all have static duration, none of them need initializers (they default to zero anyway)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@49006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 22:06:56 +00:00
Kevin P. Fleming
3307ae060a move extern declaration for this option to a header file where it belongs
provide an initial value for 'languageprefix' option, instead of relying on randomness to provide a useful value


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 21:08:30 +00:00
Olle Johansson
1e9c141c2d Only include acl.h and lock.h once
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 21:06:48 +00:00
Olle Johansson
4f157be79e Only set rfc2833compensate flag once (handle_common_options)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48995 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 20:27:59 +00:00
Olle Johansson
f1f8bbaabe - Remove checking for T38 options twice. Keeping them in handle_common_options
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48993 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 20:24:03 +00:00
Kevin P. Fleming
0f5aae9688 make the option actually match the documentation
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 18:33:22 +00:00
Kevin P. Fleming
b2c8abbc6d allow 'show memory' and 'show memory summary' to distinguish memory allocations that were done for caching purposes, so they don't look like memory leaks
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48987 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 18:29:13 +00:00
Olle Johansson
d2b7e8b247 Be a bit more politically correct
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 17:59:53 +00:00
Olle Johansson
bfe4bb0f1e Issue #8575 - Buggy cisco MWI support.
Normally we try not to change our software for bugs in other devices. But in
this case, the Cisco phones are so widespread so we try to implement a fix while
waiting for a bugfix from Cisco.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48982 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 16:49:45 +00:00
Olle Johansson
e25756dfac - Make sure handle_common_options return 1 when we found a common option
- Move uncommon (only global) option away from handle_common_options
Reported by rizzo. Thanks!


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 16:31:55 +00:00
Olle Johansson
4ea530f2dc Issue 8599 (rizzo) Change invitestate before re-sending invite with auth.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 16:12:21 +00:00
Olle Johansson
8a42650605 Fix bogus content-length in t38 sdp. (rizzo, #8600)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27 15:58:13 +00:00
Joshua Colp
c4bde5b40a Get rid of a needless memory allocation and only create a conference structure in find_conf_realtime if data was read from realtime. (issue #8669 reported by robl)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48966 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-26 05:20:08 +00:00
Joshua Colp
9cc04e026d Add an API call that initializes an RTP structure. We need this because chan_sip is cheeky and uses a temporary RTP structure for codec purposes, and the API calls that are used rely on the lock. (Pointed out on asterisk-dev by Andy Wang)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48964 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-26 04:31:58 +00:00
Joshua Colp
84a2b97b17 Clean up autoconf file (gets rid of warnings seen when rebuilding configure) and rebuild configure.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48960 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-25 17:04:48 +00:00
Russell Bryant
ab43c25d33 Merged revisions 48955 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48955 | russell | 2006-12-25 00:19:48 -0500 (Mon, 25 Dec 2006) | 6 lines

Fix an error introduced by copying and pasting the handling of the >= operator
for the MATH function.  If a single equal sign was used as an operator, the
function would treat it is as if it were the >= operator.  Now, it properly
handles it as an invalid operator.
(issue #8665, patch by tempest1)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48956 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-25 05:21:20 +00:00
Russell Bryant
a1eee8d2d9 Fix a typo in an error message that indicated that the MGCP channel type could
not be registered, instead of the correct type, OSS.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48948 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-24 21:19:37 +00:00
Russell Bryant
53115ff688 Merged revisions 48943 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48943 | russell | 2006-12-24 02:23:07 -0500 (Sun, 24 Dec 2006) | 3 lines

Check for the proper return value on an error in a call to mmap().
This was reported by Andy Wang on the asterisk-dev list.  Thanks!

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48944 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-24 07:25:38 +00:00
Russell Bryant
1208869c00 Merged revisions 48939 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48939 | russell | 2006-12-24 01:47:29 -0500 (Sun, 24 Dec 2006) | 3 lines

Remove a couple of misplaced dots in log messages.  This was reported by
Andrea Spadaccini on the asterisk-dev mailing list.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-24 06:49:31 +00:00
Russell Bryant
395db9ea8b Implement locking for the list of URI handlers to make it thread-safe.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48931 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-23 20:22:52 +00:00
Jason Parker
d017436015 Minor fixes for Solaris.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-22 22:33:46 +00:00
Jason Parker
66783cb46f Note to self: Run make before committing...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-22 21:40:20 +00:00
Jason Parker
ef2f05a518 Fix for issue 7774 - patch by alamantia
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48870 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-22 20:43:05 +00:00
Joshua Colp
25f969b6eb Merged revisions 48782 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48782 | file | 2006-12-21 15:25:01 -0500 (Thu, 21 Dec 2006) | 2 lines

Add new silence sound files to the spec for Redhat. (issue #8652 reported by alvaro_palma_aste)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-21 20:26:29 +00:00
Joshua Colp
3a0a8b1908 vms doesn't exist on non-IMAP storage builds.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-20 02:56:09 +00:00
Joshua Colp
695c04cff3 Pass 'vms' pointer to record_and_review so it is then passed to the IMAP store file function. (issue #8614 reported by punknow)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48596 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-19 23:04:30 +00:00
Joshua Colp
cdab7c62eb find is not the same as bind when it comes to documentation. (issue #8626 reported by johann8384)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-19 22:00:57 +00:00
Kevin P. Fleming
2703d88576 suppress compiler warnings in this module until it can be improved
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48586 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-19 21:28:04 +00:00
Joshua Colp
8d7bdfc607 Merged revisions 48584 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48584 | file | 2006-12-19 16:10:26 -0500 (Tue, 19 Dec 2006) | 2 lines

Free localuser structure when we fail to dial (issue #8612 reported by rizzo)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-19 21:12:07 +00:00
Luigi Rizzo
0f325ae583 fix a bogus datalen in the frames generated by app_sms
(causing noisy output if you listen to the output!)

This affects trunk as well, whereas 1.2 is ok.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-19 21:03:02 +00:00
Kevin P. Fleming
8e900c7db7 use the proper variable type for these unixODBC API calls, eliminating warnings on 64-bit platforms that use the 'new' 64-bit types for ODBC API calls
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48577 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-19 14:57:09 +00:00
Joshua Colp
14f57685be Use env -i to start a fresh environment when going to build menuselect. This is more portable then using unset. (issue #8543 reported by jtodd)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-19 03:46:12 +00:00
Luigi Rizzo
f9e3c1ecb0 unbreak the macro used for incrementing the frame counters.
I don't know when the bug was introduced, but with the typical usage

	c->fin = FRAMECOUNT_INC(c->fin)

the frame counters stay to 0.

affects trunk as well (fix coming).



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48566 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-18 17:23:29 +00:00
Joshua Colp
11e61ea68a Put thread into proper list if we abort handling due to an error, and also hold the lock while putting it back into the proper idle list so we don't prematurely get a signal. (issue #8604 reported by arkadia)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48564 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-18 17:15:49 +00:00
Jason Parker
e755759a58 ctrl-w != w (nano search)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-18 16:55:46 +00:00
Kevin P. Fleming
9a78e1f90e remove some now-unnecessary explicit includes of autoconfig.h
clean up per-file dependencies during 'make clean'


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-18 11:59:24 +00:00
Kevin P. Fleming
64800bdeab need an additional argument here to make the downloads actually occur
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48548 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-17 18:33:24 +00:00
Kevin P. Fleming
ee8ce744c3 use m4 quoting for AC_MSG_NOTICE calls, to keep these calls from thinking they have multiple arguments
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-16 21:34:41 +00:00
Kevin P. Fleming
0509ca82b4 simplify dependency tracking system, using the compiler's built-in method for generating them, and only doing dependency tracking if developer mode is enabled via the configure script
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-16 21:14:34 +00:00
Kevin P. Fleming
be1b5dab06 since we really, really have to have autoconfig.h included before all other headers (especially system headers), the Makefile will now force it to happen (this will fix build problems with files like ast_expr2f.c, where we can't control the inclusion order in the file itself)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-16 20:12:41 +00:00
Kevin P. Fleming
c2490f8e72 instead of initializing the curl library every time the CURL() function is invoked, do it only once per thread (this allows multiple calls to CURL() in the dialplan for a channel to run much more quickly, and also to re-use connections to the server) (thanks to JerJer for frequently complaining about this performance problem)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-16 04:25:09 +00:00
Joshua Colp
8df2c7228f Turn payload_lock into bridge_lock and make it encompass all RTP structure contents that may relate to bridge information, including who we are bridged to.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48506 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-15 19:55:28 +00:00
Joshua Colp
a0c21d30ac Hold call structure lock in places where a qualify or peer action can destroy it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48504 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-15 19:38:51 +00:00
Joshua Colp
195c66b4a1 Lock network retransmission queue in all places that it is used.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48502 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-15 19:24:15 +00:00
Olle Johansson
c1f1cf48ac Issue #8592 - treat 504 as 503 (imported from 1.2)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-15 10:55:41 +00:00
Olle Johansson
a8fe77b95b Update to latest IANA spec
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48481 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-15 10:18:04 +00:00
Joshua Colp
3706ecbbc5 Use a wakeup variable so that we don't wait on IO indefinitely if packets need to be retransmitted.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48478 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-15 06:28:05 +00:00
Joshua Colp
0995fb8aeb Payload values on the RTP structure can change AFTER a bridge has started. This comes from the packet handling of the SIP response when indication that it was answered has been sent. Therefore we need to protect this data with a lock when we read/write. (issue #8232 reported by tgrman)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48472 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-14 17:36:12 +00:00
Joshua Colp
87a03da072 Remove direct RTCP bridging. I've come to the conclusion that we should handle this through the core and not just forward it on. Should solve a few bugs.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-14 03:33:30 +00:00
Steve Murphy
898c9dd6fa a block to keep 48434 out of 1.4; the code works fine here
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-13 04:31:12 +00:00
Kevin P. Fleming
c8e56895b8 when making a release, we can always use wget and we can't run the configure script to find that out...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-12 23:18:14 +00:00
Kevin P. Fleming
979b8eca80 block addition of silence files... not needed here
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-12 05:18:11 +00:00
Joshua Colp
9b8b64f08d Use S_OR in my previous app_voicemail. This is the way it should have been done.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-12 04:13:48 +00:00
Matt O'Gorman
0a55018f77 new sounds package with 100% more silence
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48399 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-11 23:02:10 +00:00
Matt O'Gorman
d24fad5537 Merged revisions 48394 via svnmerge from
https://svn.digium.com/svn/asterisk/branches/1.2

........
r48394 | mogorman | 2006-12-11 15:55:43 -0600 (Mon, 11 Dec 2006) | 4 lines

app_externalivr needs a real silence file, and additional
changes to add silence files into core instead of extra
patch provided by bug 8177 with minor additions.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48396 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-11 22:11:35 +00:00
Joshua Colp
8832f97a1f Return non-existant callerid handling to that which it was before. In 1.4 and trunk callerid can be allocated but not have any contents so we have to use ast_strlen_zero before passing it to the relevant functions. (issue #8567 reported by pabelanger)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-11 21:31:23 +00:00
Tilghman Lesher
fda0dce406 STRFTIME() does not actually require an argument (issue 8540)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-11 05:37:09 +00:00
Joshua Colp
c866263f50 Merge in my latest RTP changes. Break out RTP and RTCP callback functions so they no longer share a common one.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-11 05:36:45 +00:00
Joshua Colp
50ee01ccda Use the correct API call to say a device state changed. (Yes, I'm a nub.)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-11 05:30:01 +00:00
Joshua Colp
08ab40c1bf Don't access the conference structure after it has been freed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-11 04:57:38 +00:00
Tilghman Lesher
cb95f19c3f Merged revisions 48374 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48374 | tilghman | 2006-12-10 18:33:59 -0600 (Sun, 10 Dec 2006) | 5 lines

When doing a fork() and exec(), two problems existed (Issue 8086):
1) Ignored signals stayed ignored after the exec().
2) Signals could possibly fire between the fork() and exec(), causing Asterisk
signal handlers within the child to execute, which caused nasty race conditions.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48375 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-11 00:47:21 +00:00
Steve Murphy
f6cf1458ad Merged revisions 48371 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48371 | murf | 2006-12-09 19:14:13 -0700 (Sat, 09 Dec 2006) | 1 line

This version applies the patch suggested by stevens in bug 7836 (make inbound channel RINGING state consistent with other channels).
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48372 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-10 03:04:18 +00:00
Russell Bryant
eeb415e8dd Use locking when accessing the registrations list. This list is not actually
used very often, so the likelihood of there being a problem is pretty small,
but still possible.  For example, if the CLI command to list the registrations
was called at the same time that a reload was occurring and the registrations
list was getting destroyed and rebuilt, a crash could occur.

In passing, go ahead and convert this list to use the linked list macros.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-09 15:59:42 +00:00
Russell Bryant
0bcedc688d Blocked revisions 48361 via svnmerge
........
r48361 | russell | 2006-12-09 10:45:37 -0500 (Sat, 09 Dec 2006) | 6 lines

Use locking when accessing the registrations list.  This list is not actually
used very often, so the likelihood of there being a problem is pretty small,
but still possible.  For example, if the CLI command to list the registrations
was called at the same time that a reload was occurring and the registrations
list was getting destroyed and rebuilt, a crash could occur.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-09 15:47:01 +00:00
Russell Bryant
34384acbc9 Merged revisions 48356 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48356 | russell | 2006-12-07 13:14:13 -0500 (Thu, 07 Dec 2006) | 3 lines

Ensure that the file position is not incremented beyond the total number of
files available for playback.  (issue #8539, ulogic)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-07 18:17:28 +00:00
Steve Murphy
0ab411f2ed Here lies the fixes that killed bug 8423 -- OriginateSuccess and OriginateError incomplete channel name. May it rest in peace.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-07 15:33:32 +00:00
Olle Johansson
28c36660c7 Issue #8258 - fix handling of 487 being retransmitted to Asterisk
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48326 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-06 16:25:06 +00:00
Russell Bryant
4ee818eb8f Merged revisions 48322 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48322 | russell | 2006-12-06 11:05:54 -0500 (Wed, 06 Dec 2006) | 3 lines

Fix the name of the rtignoreregexpire option in the sample configuration file.
(issue #8526, arkadia)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48323 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-06 16:15:45 +00:00
Olle Johansson
0fe91149ae Don't send Contact on MESSAGE
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-06 12:27:43 +00:00
Olle Johansson
2d755929aa Block patch from 1.2
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-06 12:17:31 +00:00
Joshua Colp
6fbb04459c Regenerate configure from Qwell's last commit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48281 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-05 20:45:28 +00:00
Jason Parker
7bad11f0b6 Fix curl version number testing to be much more friendly to non-bash shells.
Issue 8508, patch by me.  This *SHOULD* be POSIX compliant now..


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-05 20:42:52 +00:00
Olle Johansson
694205de93 Merging the invitestate-1.4 branch after successful testing.
Will check if I can solve this with less changes in 1.2.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-05 17:29:43 +00:00
Olle Johansson
7945d4ca35 Add missing s from another repository. (thanks jcmoore!)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-05 15:59:05 +00:00
Olle Johansson
027096b3a3 Updating sip.conf.sample with information about T38 not working
when chan_local or chan_agent is involved in the call.

I don't know how big a fix that would be to solve, but this is
the current state of affairs.

(Chan_sip currently checks if the other side of the bridge
has a SIP tech. We could/should implement another check,
possibly for udptl_write or some flag in the ast_channel
structure).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-05 12:39:30 +00:00
Tilghman Lesher
025c60f84e Oops, forgot to release the odbc handle
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48254 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-05 01:41:02 +00:00
Tilghman Lesher
1cb96e926a Merged revisions 48251 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48251 | tilghman | 2006-12-04 19:26:08 -0600 (Mon, 04 Dec 2006) | 6 lines

If the recording in the database is too large, it will fail to retrieve with
an mmap error.  Not too sure why this doesn't happen when we put it in the
database, also, but since that doesn't seem to be broken, I'm not going to fix
it (at least until someone reports it).  Solution is to ask for the file in
smaller chunks.  (Bug 8385)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48252 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-05 01:34:34 +00:00
Jason Parker
db68a40698 Fix an issue which didn't allow unavail/greet/busy/etc messages from being saved into ODBC (and probably IMAP).
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48248 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-04 21:48:41 +00:00
Jason Parker
2f7c65ba9e Blocked revisions 48246 via svnmerge
........
r48246 | qwell | 2006-12-04 15:20:34 -0600 (Mon, 04 Dec 2006) | 7 lines

Revert change from 8016 - this breaks other stuff...  Needs further review.

Tip: When you've reported a bug about something and somebody has put up a
patch for it..  It's not a good idea to open a completely new bug and say that
something is broken because of the patch in the other bug - PLEASE mention
something in the bug where the patch was actually created.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48247 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-04 21:23:11 +00:00
Jason Parker
a0d84f5061 Blocked revisions 48236 via svnmerge
........
r48236 | qwell | 2006-12-04 13:06:26 -0600 (Mon, 04 Dec 2006) | 4 lines

Fix an issue where a message isn't saved correctly when using ODBC storage and reviewing a message.

Issue 8016 - patch by sokhapkin.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-04 19:08:18 +00:00
Joshua Colp
a4839b46a8 Blocked revisions 48233 via svnmerge
........
r48233 | file | 2006-12-04 13:14:46 -0500 (Mon, 04 Dec 2006) | 2 lines

If the generic bridge tells us not to retry, and we have a frame to spit out then break the bridge. Props to markit in #asterisk-bugs for bringing this up.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-04 18:16:31 +00:00
Jason Parker
56c03478ab Add documentation to voicemail.conf.sample for ODBC storage.
Issue 8499 - patch by blitzrage.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48230 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-04 17:54:46 +00:00
Jason Parker
6ef4425e81 Attempt to document some of the dependencies that are needed for net-snmp
Issue 8499 - initial patch by blitzrage.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48228 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-04 17:43:24 +00:00
Russell Bryant
0d8d3b7c43 When "fetch" is in use, instead of "wget", --continue is not a valid option.
(issue #8451)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-03 06:34:14 +00:00
Olle Johansson
9636bccb7c - Removing one of two pieces of code to handle 481 response on INVITE
- Move handling of REFER response to handle_response_refer()


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48219 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-02 21:45:58 +00:00
Olle Johansson
f89143bd13 - Disable RTP hold timers while T.38 fax transmission happens
- Encapsulate RTP timers in the rtp structure so we have one for video and one for audio
   The video one is not used in 1.4, really. Will be used for RTP keepalives when we can send
   something that video phones support in the RTP stream.
   I now this is a big architectual change at this stage for 1.4, but decided it was needed
   to avoid future bug reports.
- Document the RTP NAT keepalive option in sip.conf.sample

Issue 7679 in the bug tracker. Please test.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48199 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-02 11:32:51 +00:00
Russell Bryant
1298cf0ea6 Backport the comment containing the warning regarding the limitations on the
usage of this function.  It is thread safe, but not technically reentrant.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48195 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-02 03:50:58 +00:00
Kevin P. Fleming
a2f6499c0a Merged revisions 48192 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48192 | kpfleming | 2006-12-01 17:30:59 -0600 (Fri, 01 Dec 2006) | 2 lines

if Dial() is going to send music-on-hold to the calling party, it has to send PROGRESS first to ensure that the reverse audio path has been setup first (BE-106)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48193 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-01 23:37:28 +00:00
Russell Bryant
fee1970293 FreeBSD 6.1 does not include wget by default. However, it has fetch which will
work just fine for our purposes of downloading the sounds packages.  So, check
for both wget and fetch and the configure script and use what was found to
download them.  If neither one was found, and sound packages are selected that
must be downloaded, the install process will print out an informative error
message indicating the situation.

Also, fix a couple places where "make" was hard coded into some output messages
by replacing them with the $(MAKE) variable.

(issue #8451, initial patch by pabelanger, with additional modifications by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-01 23:16:28 +00:00
Jason Parker
8cbe6025b6 Merged revisions 48183 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48183 | qwell | 2006-12-01 14:19:10 -0600 (Fri, 01 Dec 2006) | 2 lines

Fix a small typo - issue 8848, reported by pabelanger

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-01 20:25:51 +00:00
Jason Parker
93eb47fdbe erm, hmm...I typod a merge...that went...strangely
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48185 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-01 20:24:32 +00:00
Jason Parker
0ba598baea Merged revisions 48182 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-01 20:19:44 +00:00
Tilghman Lesher
a78cc926d4 Double-unlock error (reported by blitzrage on IRC)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48179 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-01 19:38:59 +00:00
Olle Johansson
98d3fb64ed - Backport of the "limitonpeers" patch from trunk, to fix a lot of issues with queues and SIP device states
- Remove support for T.38 early media, since it's impossible.

(Two patches in one - extra friday evening offer due to being off line from svn today... :-)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48177 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-01 17:41:56 +00:00
Joshua Colp
b2b70adede Do not do a partial bridge for Google Talk since we need to handle STUN. (issue #8448 reported by phsultan)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-30 21:18:24 +00:00
Olle Johansson
76e35bac11 Issue 8319 - change noncecount before using it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-30 20:51:04 +00:00
Joshua Colp
b4edf92931 Blocked revisions 48161 via svnmerge
........
r48161 | file | 2006-11-30 15:27:29 -0500 (Thu, 30 Nov 2006) | 2 lines

Don't write AST_FRAME_NULL or AST_FRAME_IAX frames out to the channel driver. (issue #8390 reported by hselasky)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48162 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-30 20:28:19 +00:00
Joshua Colp
422c97eab7 Merged revisions 48157 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48157 | file | 2006-11-30 15:06:43 -0500 (Thu, 30 Nov 2006) | 2 lines

Only print out debug message if bridged channel is not NULL. (issue #8412 reported by jubilex)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-30 20:07:55 +00:00
Joshua Colp
0bed57a7f1 Merged revisions 48154 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48154 | file | 2006-11-30 14:04:11 -0500 (Thu, 30 Nov 2006) | 2 lines

Do not listen for DTMF on the bridge that comes into existence when ParkedCall is executed. This means native bridging can now occur for this. (issue #8406 reported by kebl0155)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48155 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-30 19:05:14 +00:00
Joshua Colp
191c129b4f Merged revisions 48151 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48151 | file | 2006-11-30 13:42:45 -0500 (Thu, 30 Nov 2006) | 2 lines

Print certain CDR messages out at the NOTICE level versus WARNING since they can occur when used with the CDR applications and are perfectly fine. (issue #8367 reported by dartvader)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-30 18:47:40 +00:00
Joshua Colp
1771ee4f05 Blocked revisions 48146 via svnmerge
........
r48146 | file | 2006-11-30 13:17:54 -0500 (Thu, 30 Nov 2006) | 2 lines

Remember the pointer to the allocated block of memory so that we can free it and not cause a memory leak. (issue #8449 reported by arkadia)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48147 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-30 18:19:55 +00:00
Joshua Colp
802c3c3ecf Merged revisions 48142 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48142 | file | 2006-11-30 12:55:23 -0500 (Thu, 30 Nov 2006) | 2 lines

Document 'port' for SIP peers, came up because of the current mailing list thread. (issue #8450 reported by blitzrage)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-30 17:57:35 +00:00
Olle Johansson
e49855c2bd Explain status reports and
make codefreeze more happy :-)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48135 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-30 14:29:39 +00:00
Olle Johansson
073e937757 Clean up bad dialogs properly. Caused by GS 487 adapter without CSEQ on separate line
in the REGISTER request. Imported from 1.2.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-30 09:12:30 +00:00
Joshua Colp
81c438713b Use MAILTMPLEN instead of sizeof in mm_login. (issue #8420 reported by slimey)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-29 21:05:17 +00:00
Olle Johansson
a68edf400f Explain the use device status system implemented in SIP for subscriptions,
queues and manager a bit better.

Like in 1.2, you will get more detailed information if you set a call 
limit for a device. When the call limit is reached, the status system will
report a device as busy.

For queues, setting a call limit per SIP device is propably a requirement.

In most cases, it will work much better if you only use type=peer and not
type=friend. We might decide to backport the new setting from trunk to
apply all call limits to the peer part of a friend only.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48113 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-29 19:56:56 +00:00
Joshua Colp
558639ff6a Merged revisions 48106 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48106 | file | 2006-11-29 11:47:10 -0500 (Wed, 29 Nov 2006) | 2 lines

If the frame was duplicated before writing out then we need to free it. (issue #8429 reported by edguy3)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-29 16:50:33 +00:00
Olle Johansson
3fe8e34039 Clarify RTP timers. Sorry, grandma.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-29 08:03:36 +00:00
Joshua Colp
53b04eea95 Don't crash if the mailstream was not created.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-29 04:26:53 +00:00
Jason Parker
1b872bbcfa Export several more variables in top level Makefile. Inspired by issue 8438.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-28 18:26:53 +00:00
Joshua Colp
68ad03e888 Merged revisions 48087 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48087 | file | 2006-11-28 11:56:01 -0500 (Tue, 28 Nov 2006) | 2 lines

According to the research I have done we never needed to include compiler.h in the first place so let's not! (issue #8430 reported by edguy3)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-28 16:57:16 +00:00
Joshua Colp
ec4cae4068 Merged revisions 48053 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48053 | file | 2006-11-27 13:03:57 -0500 (Mon, 27 Nov 2006) | 2 lines

Use the proper function to get the new message count instead of always using the filesystem. (issue #8421 reported by slimey)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48054 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-27 18:06:50 +00:00
Tilghman Lesher
76d002db24 Merged revisions 48045 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48045 | tilghman | 2006-11-27 11:15:54 -0600 (Mon, 27 Nov 2006) | 2 lines

Random MOH wasn't really random (bug 8381)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-27 17:20:37 +00:00
Russell Bryant
a569bfd1f2 Remove a couple of unused variables (issue #8380, casper)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-27 17:17:40 +00:00
Joshua Colp
fe50f34bab Merged revisions 48037 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r48037 | file | 2006-11-27 10:30:37 -0500 (Mon, 27 Nov 2006) | 2 lines

Do not reference the freed outgoing structure in the debug message. (issue #8425 reported by arkadia)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-27 15:32:19 +00:00
Olle Johansson
9436ecaad7 Change logging message
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48031 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-27 06:41:33 +00:00
Steve Murphy
be037061e8 might as well also document the raw values of the flag vars
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48017 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-26 00:26:16 +00:00
Steve Murphy
f4b1302b95 A little bit of func_cdr documentation upgrade-- no bug# involved, although 8221 may have inspired it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-26 00:01:34 +00:00
Olle Johansson
5a3dcaff3c Not having a HINT is not an ERROR. In 1.4 and future releases, you can disable
subscription support totally or per peer in sip.conf with allowsubscribe = yes | no



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@48002 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-25 09:28:28 +00:00
Steve Murphy
e6ce5ce979 bug 8189 posted this fix for main/translate.c for PLC
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-24 17:17:07 +00:00
Christian Richter
55229f98b9 Merged revisions 47968 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47968 | crichter | 2006-11-23 17:10:23 +0100 (Do, 23 Nov 2006) | 1 line

fixed a litle bug regarding HOLD/RETRIEVE. beatufied some logs, changed some loglevels. changed the default value of block_on_alarm
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-24 15:46:13 +00:00
Olle Johansson
c3a7e9d7c2 Don't allocate unused variable.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-23 11:01:47 +00:00
Joshua Colp
090c412c27 Video will never reach Packet2Packet bridging and can do more harm then good.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47944 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-22 21:47:43 +00:00
Steve Murphy
a248c7308d blocking 47910 from 1.4; the time-limits on Dial are working OK
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47911 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-22 02:37:26 +00:00
Joshua Colp
8c0f4c8711 If we have the non standard G726-32 setting turned on we want to return G726-32 to the SDP, not our AAL2 string. (issue #8330 reported by voipgate)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47897 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-21 17:32:27 +00:00
Olle Johansson
5c0be47e69 Apparently Exosip sends a 101 after a 100 provisional response. Let's not treat that as
early media. (discovered at the AVTF meeting in Paris).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47892 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-21 15:20:03 +00:00
Tilghman Lesher
f4133080ca Oops, merge missed release of odbc object
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-20 20:01:58 +00:00
Tilghman Lesher
04c4fbb3b3 Merged revisions 47862 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47862 | tilghman | 2006-11-20 13:59:07 -0600 (Mon, 20 Nov 2006) | 2 lines

Failing to trap -1 error from mmap causes segfault (Issue 8385)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47863 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-20 20:00:54 +00:00
Joshua Colp
0e684abd82 Merged revisions 47859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47859 | file | 2006-11-20 14:50:21 -0500 (Mon, 20 Nov 2006) | 2 lines

Don't forget to byte swap if we are exiting the smoother feed early. (issue #8287 reported by arturs)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47860 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-20 19:51:36 +00:00
Joshua Colp
9d45f7420e Blocked revisions 47855 via svnmerge
........
r47855 | file | 2006-11-20 11:16:22 -0500 (Mon, 20 Nov 2006) | 2 lines

Free history items at the end of use of the temporary SIP pvt structure. (issue #8383 reported by benh)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-20 16:17:47 +00:00
Joshua Colp
b42279c142 Only remove/destroy the RTCP I/O item if it exists.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-20 15:58:50 +00:00
Joshua Colp
335630b10c Use a separate variable in the channel structure to store the context that the channel was dialed from. (issue #8382 reported by jiddings)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-20 15:51:37 +00:00
Olle Johansson
7da1a54fe6 Explain properly how videosupport works.
Committ from Asterisk Video Task Force meeting in Paris!


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-20 11:45:22 +00:00
Olle Johansson
a7c1ac60b7 Make sure we destroy scheduled items and not use them ever again after destruction (rizzo)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47843 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-20 11:29:19 +00:00
Luigi Rizzo
d20e81d829 fix bug 7450 - Parsing fails if From header contains angle brackets
(the bug was only in a corner case where the < was right after the
opening quote, and the fix is trivial).



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-18 17:59:35 +00:00
Kevin P. Fleming
46ff647119 block patch that was already present here
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-17 19:02:38 +00:00
Jason Parker
67546a068c Fix a couple of typos. Initially pointed out by mrobinson.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47782 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-16 23:19:46 +00:00
Jason Parker
64eabdcdea Blocked revisions 47780 via svnmerge
........
r47780 | qwell | 2006-11-16 17:16:35 -0600 (Thu, 16 Nov 2006) | 2 lines

Fix a couple of typos in applications..  Initially spotted by mrobinson.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47781 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-16 23:18:22 +00:00
Kevin P. Fleming
517e7297f1 update documentation regarding IAX2 transfers and CDRs
Merged revisions 47776 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47776 | kpfleming | 2006-11-16 16:57:31 -0600 (Thu, 16 Nov 2006) | 2 lines

update clearly wrong documentation regarding cdr_custom

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-16 23:00:10 +00:00
Joshua Colp
f373cad528 Compare technology using the pointers instead of a straight comparison based on name. (issue #8228 reported by dean bath)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-16 21:11:06 +00:00
Joshua Colp
3a1d01828b Blocked revisions 47761 via svnmerge
........
r47761 | file | 2006-11-16 15:29:28 -0500 (Thu, 16 Nov 2006) | 2 lines

Look for the header file specifically in all cases, not just the existence of the directory. (issue #8358 reported by mrness)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-16 20:30:54 +00:00
Kevin P. Fleming
ee6bf62ac5 check for pre-1.4 versions of Zaptel and abort the configure script if found with an appropriate error message
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47758 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-16 20:09:10 +00:00
Olle Johansson
e1e6a1b2a8 Make the HOLD notification optional, in order to avoid a lot of extra database lookups
for all those realtime users out there.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47755 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-16 19:24:23 +00:00
Joshua Colp
88002f78fd Merged revisions 47750 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47750 | file | 2006-11-16 13:26:50 -0500 (Thu, 16 Nov 2006) | 2 lines

Because of the way chan_local is written we should be extra careful and make sure our callback functions have a tech_pvt. (issue #8275 reported by mflorell)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-16 18:29:12 +00:00
Joshua Colp
ee182a4b02 Don't unreference the SLA object if there is no SLA object in the devicestate callback. (issue #8354 reported by loloski)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-16 17:52:48 +00:00
Olle Johansson
d1ee29fc20 Don't fixup if there's nothing to fixup
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47744 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-16 16:51:59 +00:00
Olle Johansson
8f5a7bcd8d Warn users about change in canreinvite
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47736 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-16 15:16:58 +00:00
Olle Johansson
5bd53e3588 - CANCEL is never authenticated (according to the RFC)
- Update docs on canreinvite. "nonat" is the recommended setting for most users with
  phones behind a NAT.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-16 15:03:49 +00:00
Joshua Colp
e83e3123f7 Merged revisions 47711 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47711 | file | 2006-11-15 17:29:30 -0500 (Wed, 15 Nov 2006) | 2 lines

Make sure that the pvt structure exists before trying to do fixup on Local channels. (issue #7937 reported by mada123, fix by alamantia with mods by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 22:31:17 +00:00
Tilghman Lesher
07c309c8b1 Fix ODBC_STORAGE for when context is NULL
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47709 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 21:56:55 +00:00
Joshua Colp
cb11263607 We need to ensure timelimit stuff is included as well so warnings get played. (issue #8050 reported by KNK)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 21:33:41 +00:00
Kevin P. Fleming
3302cbea3e don't try to call fclose() if fopen() failed
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 20:50:06 +00:00
Olle Johansson
c78840b900 - Improve SIP history
- Never send reply to ACK (again...)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47698 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 20:31:11 +00:00
Kevin P. Fleming
5d59e5dd34 block fix that was found in this branch and backported to 1.2
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47697 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 20:31:02 +00:00
Kevin P. Fleming
17242b0602 Merged revisions 47677 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47677 | kpfleming | 2006-11-15 11:56:42 -0600 (Wed, 15 Nov 2006) | 4 lines

ensure that message duration is included in email notifications for forwarded messages (BE-96, fix by me after corydon used his clue-bat on me)
ensure that duration in the message metadata is updated if prepending is done during forwarding (related to BE-96)
remove prototype for API call that does not exist

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 20:27:38 +00:00
Kevin P. Fleming
7a5771161e Merged revisions 47686,47688-47689 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47686 | kpfleming | 2006-11-15 13:42:05 -0600 (Wed, 15 Nov 2006) | 2 lines

clear the category's variable tail pointer as well when variables are detached from it

........
r47688 | kpfleming | 2006-11-15 13:47:43 -0600 (Wed, 15 Nov 2006) | 2 lines

when appending a list of variable to a category, ensure the tail pointer points to the last variable in the list

........
r47689 | kpfleming | 2006-11-15 13:58:46 -0600 (Wed, 15 Nov 2006) | 2 lines

when re-writing the config file, don't repeat the path if it hasn't changed

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 20:01:22 +00:00
Kevin P. Fleming
cb4ed839c3 Merged revisions 47682 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47682 | kpfleming | 2006-11-15 12:39:47 -0600 (Wed, 15 Nov 2006) | 2 lines

ouch... don't use printf, use ast_log/ast_verbose

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 18:43:30 +00:00
Luigi Rizzo
a9057b2c65 fix longest match search in find_cli.
Trunk already fixed.

1.2 not affected (well, i have no idea, the code is totally
different there).



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47672 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 17:46:45 +00:00
Olle Johansson
63f87d112d Send error message when we can't allocate SIP dialog, possibly due to limitation of file descriptors.
(imported from 1.2)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 15:25:50 +00:00
Olle Johansson
91631c8a20 Block patch to 1.2 that already was fixed in 1.4.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 13:21:33 +00:00
Joshua Colp
bc6cff37bc If NAT detection is turned on or already detected then say NAT is active when setting the remote RTP peer when doing early bridging. (issue #8365 reported by marcelbarbulescu)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47645 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 04:45:24 +00:00
Kevin P. Fleming
8dc804fafe more formatting cleanup, and avoid running off the end of the string
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47641 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 00:19:05 +00:00
Joshua Colp
708b84da2f Turn notice about unknown RTCP packet type into a debug message instead.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 00:14:07 +00:00
Kevin P. Fleming
8dd76cc19a silence compiler warning on 64-bit platforms (this variable is an 'int' anyway, comparing it to 'signed long' is not useful)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-15 00:05:44 +00:00
Joshua Colp
0742fe1d7e Merged revisions 47631 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47631 | file | 2006-11-14 17:15:10 -0500 (Tue, 14 Nov 2006) | 2 lines

Update copyright information in the ADSI logo blob.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47632 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-14 22:17:16 +00:00
Joshua Colp
25b5cf18b7 Only keep the video RTP structure around if 1. Video support is enabled and 2. A video codec is enabled on the dialog
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-14 22:05:03 +00:00
Joshua Colp
039c552a47 Small documentation clarification for URIENCODE. (issue #8294 reported by salaud)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47625 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-14 21:30:44 +00:00
Tilghman Lesher
cd06244951 Conversion of res_odbc API to include ast_ prefix did not completely transition app_voicemail
when ODBC_STORAGE is used (reported on IRC by caio1982, not in bugtracker)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-14 18:54:40 +00:00
Joshua Colp
159c54a5e9 Use LOG_DEBUG to print out the indication that app_amd is using default settings instead of using LOG_NOTICE. This stops needless logging of this information under normal circumstances. (issue #8361 reported by Seb7)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47617 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-14 16:45:57 +00:00
Olle Johansson
4ecb09f6e8 Update documentation to fit the implementation...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-14 16:22:35 +00:00
Olle Johansson
cb82979700 Issue #8272 - Don't destroy dialog in retransmission system if it's an OPTION packet from peerpoke
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47597 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-14 11:14:01 +00:00
Joshua Colp
595f01984f Merged revisions 47583 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47583 | file | 2006-11-13 16:26:36 -0500 (Mon, 13 Nov 2006) | 2 lines

Initialize global pointers for connection and result to NULL. (issue #8356 reported by james)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 21:28:57 +00:00
Tilghman Lesher
e944561518 Merged revisions 47580 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47580 | tilghman | 2006-11-13 14:18:30 -0600 (Mon, 13 Nov 2006) | 2 lines

Having more than 255 old messages caused corruption in the new/old count

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 20:20:01 +00:00
Steve Murphy
2a0ac6ad9a This solves bug 8342, whereby a crash occurs under certain circumstances while reading a config file with comments-- a call to CB_ADD shouldn't happen if withcomments is zero
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 19:15:12 +00:00
Tilghman Lesher
6e4d0e50c8 Re-enable old deprecated commands
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 19:11:15 +00:00
Olle Johansson
55c8a5ded8 - Don't reply to INVITE already replied to when we get BYE
- Declare errmsg as int. Oops.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 19:10:39 +00:00
Steve Murphy
a619d5c3e0 Eager people beat me to fixing the messed if, but we all forgot to update the regressions. Until now.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47564 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 18:18:06 +00:00
Joshua Colp
c71a6b9004 Clean up last commit to better conform to standards.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 17:38:44 +00:00
Steve Murphy
dc8dca7807 AEL need not complain about parkedcalls not being found... just confuses users
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 17:13:20 +00:00
Joshua Colp
5c5c73ec0f Merged revisions 47549 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47549 | file | 2006-11-13 12:05:32 -0500 (Mon, 13 Nov 2006) | 2 lines

When sending an SMS with a user data header properly set the UDH flag in the first byte. (issue #8347 reported by hoffmeis)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 17:08:07 +00:00
Joshua Colp
6351e6bb2c Free full command string upon unregistering of CLI command. Backported from revision 47536 from rizzo.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 16:30:38 +00:00
Olle Johansson
0ca5dae550 Only produce error message about sip history once
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 16:00:57 +00:00
Russell Bryant
69aa0e88ca AC_PROG_SED is included in autoconf 2.60, but apparently it is not included
in 2.59.  So, to maintain compatability with 2.59 since it is a small change,
copy this macro into acinclude.m4 and rename it to AST_PROG_SED.
(issue #8345)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 05:48:18 +00:00
Tilghman Lesher
8e02de4bb2 Merged revisions 47525 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47525 | tilghman | 2006-11-12 23:45:11 -0600 (Sun, 12 Nov 2006) | 2 lines

If the execute fails a second time, make sure that we don't pass back a stale handle

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 05:46:18 +00:00
Tilghman Lesher
129280f4ee Merged revisions 47522 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47522 | tilghman | 2006-11-12 18:34:44 -0600 (Sun, 12 Nov 2006) | 2 lines

Don't play dialtone if the seizing the channel fails (Bug 7754)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-13 01:12:01 +00:00
Olle Johansson
153cb1309f Issue 8314 - Restore auto-framing (Thanks DEA!!!)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-12 16:12:12 +00:00
Olle Johansson
fc5f9c78d1 Part of issue 8078 - parse even if udptl is UDPTL in sdp...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-12 15:35:19 +00:00
Olle Johansson
a471f0a87c - Don't destroy SIP dialog because of a failed T.38 re-invite. Wait for a bye.
Final response to a re-invite does not mean that the session dies, only that
  the re-invite fails.
- Keep RTP active during processing of T.38 re-invite. If the re-invite fails,
  RTP needs to remain as before the re-invite.

Issue 8338 - darren1713. Please test.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-12 15:27:00 +00:00
Olle Johansson
853958e863 -Remove blocking of ptime: parsing in sdp
-Add some comments to t.38 code



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-12 15:10:53 +00:00
Russell Bryant
3964b50b05 Merged revisions 47496 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47496 | russell | 2006-11-12 01:09:03 -0500 (Sun, 12 Nov 2006) | 4 lines

Only do the check to determine whether the channel calling this function is an
IAX2 channel when getting the IP address using the special argument, 
CURRENTCHANNEL.  (issue #8341, jcovert)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-12 06:23:23 +00:00
Russell Bryant
3519337723 Add the target "menuconfig" as an alias for the "menuselect" target. This is
just a favor to users so that if you accidentally type "make menuconfig"
instead of "make menuselect", it still works.
(inspired by a comment on IRC from wangster calling me an "especially devious
asterisk developer" for having it be menuselect instead of menuconfig. :) )


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47494 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-11 15:31:08 +00:00
Russell Bryant
7ac2161b50 Tweak the formatting of this new function to better conform to coding guidelines.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47492 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-11 15:18:02 +00:00
Matt O'Gorman
5b02ba2bf1 woohoo safe out put!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-11 02:04:28 +00:00
Matthew Fredrickson
eb4c18e444 Make sure we don't use 32bits when we only need one bit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47480 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 22:23:58 +00:00
Olle Johansson
2a321d80f5 ...and make sure that the dialog is destroyed, even if we don't get any answer on the bye...
This is the channel that remains dead after the SIP transfer


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 21:42:27 +00:00
Olle Johansson
ea257647a2 Add debug output while trying to trace bug in bug report
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 21:36:49 +00:00
Olle Johansson
5fac7d357e Block backport to 1.2 from 1.4 so it's not coming back to 1.4
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 20:49:09 +00:00
Olle Johansson
ba58cf9ecd Make sure we destroy dialog...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 20:23:56 +00:00
Olle Johansson
1f2a4eb8c2 Small cleanup of handle_request_invite() - imported from 1.2 with changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 19:49:48 +00:00
Matthew Fredrickson
60c6acf03f Fix for #7321. Be able to explicitly hide callerid name for switches that bork
on it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 19:47:16 +00:00
Joshua Colp
ff947e3743 Let's give this a go...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47457 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 19:36:25 +00:00
Olle Johansson
d83a1f1356 Issue 8010 - Fix support for multipart SDP (alphaque)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47454 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 18:56:15 +00:00
Luigi Rizzo
36808cf771 grep -m is not available on BSD, so use head -1 instead
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47444 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 17:13:34 +00:00
Joshua Colp
6c9e737d70 Only split up extension and context if a value exists. (issue #8332 reported by loloski)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 16:53:16 +00:00
Tilghman Lesher
f11ea0549d Discussion of these CLI changes resulted in more consistency (Bug 8236)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 16:51:55 +00:00
Kevin P. Fleming
cb2930ecb4 if adding a queue member is LOG_NOTICE, then removing them should be LOG_NOTICE, not LOG_DEBUG
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 16:36:49 +00:00
Kevin P. Fleming
88fb11d10b reflect addition/removal of dynamic queue members in queue_log, so that people using dialplan replacement for AgentCallbackLogin can still track login/logout (issue #7736, reported/patched by whoiswes but this commit was written by me and covers all three paths for AQM/RQM)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47432 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 16:34:04 +00:00
Olle Johansson
54994dfe04 Rip out half implementation of 491 response support, since it wasn't implemented
properly and caused memory leaks in the case of us getting 491's, which Asterisk
actually sends...

Since it is a bit too complicated to fix this, I'll rip it out of 1.4 and put
it on the to-do-list for future releases. Now, we handle this as congestion,
which it really is.

Issue #8331



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 13:04:42 +00:00
Olle Johansson
27e6ea10fb Fix bit definition for SIP_PAG2_CALL_ONHOLD. Thanks fenlander!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 12:05:53 +00:00
Joshua Colp
e424d306ac Fix building of chan_h323 by completeing some structure definitions. (issue #8327 reported by Mithraen)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 03:44:36 +00:00
Joshua Colp
d2624d72ec Do conversion in a more easier to read and working way for \r, \n, and \t. (issue #8324 reported by johnlange)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47398 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-09 22:32:30 +00:00
Russell Bryant
58ed1b07ab Work around an issue that caused menuselect to display a bogus description for
app_voicemail and chan_zap.  These modules use some preprocessor directives to
determine what it will report to Asterisk as its description.  However, the way
we extract this information from the source files for menuselect is not smart
enough to figure this out.
(issue #8326, #8328)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-09 21:26:27 +00:00
Joshua Colp
6e693fdb0c Merged revisions 47379 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47379 | file | 2006-11-09 11:48:05 -0500 (Thu, 09 Nov 2006) | 2 lines

Don't include compiler.h on kernels 2.6.18 and higher as, well, it's apparently going to be removed. This should make all you FC6 fans happy as your Asterisk will now build without any mods.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-09 16:53:25 +00:00
Russell Bryant
5654be2803 fix tab completion for "core debug channel" and "core no debug channel"
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-09 16:28:15 +00:00
Russell Bryant
795ba043e2 Fix "core show channel". Also, fix tab completion for both "core show channel"
and "core show channels".


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47375 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-09 16:24:02 +00:00
Russell Bryant
6609cebaf2 Fix "core debug channel <whatever>". I guess someone needs to go through and
audit every CLI command that changed number of arguments ...


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47372 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-09 16:18:33 +00:00
Russell Bryant
9009cfcf79 revert the previous change, which actually modified the deprecated command,
"show profile".  Now, actually apply the change to "core show profile".


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-09 16:14:23 +00:00
Russell Bryant
38be3e38e2 Fix argument parsing for the "core show profile" CLI command
(fixed by rizzo in his branch, team/rizzo/astobj2)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-09 16:04:38 +00:00
Russell Bryant
0b927d2208 Fix another CLI command, "core show uptime" ...
(issue #8323, reported by johnlange, fixed by myself)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47366 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-09 15:49:39 +00:00
Russell Bryant
15ba13f1ec fix "core show version" to reflect the new number of arguments for this
CLI command (issue #8316, kshumard)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47352 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-09 06:31:37 +00:00
Steve Murphy
729ce4d791 This update fixes 7531
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-08 23:14:18 +00:00
Steve Murphy
1de03495a9 Committed in behalf of 8190.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-08 22:54:56 +00:00
Kevin P. Fleming
ea53cfcea3 the battle over CLI command formats has broken stuff...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-08 21:46:20 +00:00
Kevin P. Fleming
10978d0390 add simple fix for SDP to report proper sample rate for G.722 media sessions
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-08 18:07:16 +00:00
Russell Bryant
28b10444f6 I occasionally get email from users that are trying to figure out what this
does, or due to some misunderstanding as to what it is supposed to do, can't
get it to work.  So, I have added some text here to hopefully explain what
this application does and does not do.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-08 17:03:09 +00:00
Russell Bryant
487d4512d3 Make this module build again
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-08 16:55:35 +00:00
Russell Bryant
c70fd559ac Copy the macros from libtool.m4 to our own acinclude.m4 such that libtool is
no longer required to be installed to be able to generated the configure
script.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-08 16:31:59 +00:00
Russell Bryant
cbf38fec8e Remove aclocal.m4 from the tree since it is just an intermediate file created
while generating the configure script.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47323 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-08 16:08:50 +00:00
Olle Johansson
ac0918c059 Block patch that is not needed in 1.4
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47310 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-08 07:43:08 +00:00
Olle Johansson
764ba93e05 Destroy dialog properly at unload (rizzo)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-08 07:40:53 +00:00
Steve Murphy
517978fd5f These mods are to solve the problem in bug 7506. It's a lot of rework to solve a fairly small problem... such is life.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47303 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-07 23:46:41 +00:00
Joshua Colp
b3bf131dd8 This is not the commit you are looking for...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-07 20:14:58 +00:00
Joshua Colp
b832f42414 Make MOH work as it did before in chan_local, without this then it can go funky when transfers and MOH are involved. (issue #7671 reported by jmls)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-07 20:08:52 +00:00
Kevin P. Fleming
4fd3b973bf clean up sample config, and make native file playback the more obvious default choice
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-07 18:56:21 +00:00
Matt O'Gorman
0b6456b7f1 large overhaul to voicemail imap support. Allows support for more imap servers,
also a better implementation of several parts of the original work.
patch provided by 8033 with major upgrades.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-07 18:38:32 +00:00
Olle Johansson
647fb52e31 Issue 8303 (lrizzo) - break instead of continue.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-07 17:30:17 +00:00
Kevin P. Fleming
0aed8b63b4 remove another incorrect property
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-07 14:25:33 +00:00
Kevin P. Fleming
29d69a294f use editable URL for menuselect
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47256 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-07 14:12:43 +00:00
Olle Johansson
eac4efcf22 Fixing the attack shield so it doesn't produce attacks... Issue 8265 - never reply to an ACK
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47250 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-07 13:13:51 +00:00
Russell Bryant
798bb964d1 Merged revisions 47238 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47238 | russell | 2006-11-06 20:22:58 -0500 (Mon, 06 Nov 2006) | 5 lines

If random order is enabled for files mode music on hold, set a random initial
position, instead of always starting at the first file, and doing the random
operation only when switching to the next file.
(bug reported by John Lange on the asterisk-dev mailing list)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47239 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-07 01:25:10 +00:00
Olle Johansson
d5edfd432a Issue #8284: Fixes to Invite/replaces and transfer from "john"
Thank you!


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47199 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-04 18:32:02 +00:00
Russell Bryant
c8ee894823 Fix another bug in "core set debug" ...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-04 18:10:22 +00:00
Russell Bryant
789234df2d Really fix the "core set debug" and "core set verbose" CLI commands.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47195 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-04 17:59:39 +00:00
Russell Bryant
da6cf383d4 fix the "atleast" option to the "core set verbose" and "core set debug"
CLI commands


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47192 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-04 17:38:24 +00:00
Steve Murphy
b6079499e4 This fix introduced via bug 8233
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-03 23:17:01 +00:00
Luigi Rizzo
54be10b9e1 align bootstrap.sh with the version in trunk
(needs to be blocked as it is already in trunk)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47108 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-03 17:53:13 +00:00
Luigi Rizzo
0726f75faf add proper environment vars to detect modules on freebsd.
(already applied to trunk so it needs to be blocked there)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-03 17:46:10 +00:00
Tilghman Lesher
56a1e60c54 More changes making the CLI more consistent with "category verb arguments" (continuation of issue 8236)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-02 23:49:13 +00:00
Tilghman Lesher
e05a2752e8 Reverse change of "show" to "list" and make several other commands more consistent with "category verb arguments"
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-02 23:00:20 +00:00
Olle Johansson
ea69dd0cbc Move check for codec translation to sip_call() instead of in add_sdp. No one bothers
with the result of add_sdp anyway... Yet...


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-02 19:56:30 +00:00
Olle Johansson
bfb1d68414 Disable code for T38 over TCP and RTP since there's no trace of actual functionality for it :-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-02 18:26:57 +00:00
Russell Bryant
96e43ebee7 Merged revisions 46964 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r46964 | russell | 2006-11-02 12:47:56 -0500 (Thu, 02 Nov 2006) | 3 lines

ignore files in a music on hold directory that begin with '.'
(issue #8249, cboie)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46965 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-02 17:49:54 +00:00
Nadi Sarrar
72985e664f find_free_chan_in_stack usage fix
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46963 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-02 17:17:36 +00:00
Kevin P. Fleming
efdffc0cf8 don't send INVITE when we have determined that we can't offer any audio formats due to lack of trancoding support (or incorrect configuration)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46937 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-02 16:45:32 +00:00
Joshua Colp
eb25ec6ed5 Merged revisions 46920 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r46920 | file | 2006-11-02 11:02:27 -0500 (Thu, 02 Nov 2006) | 2 lines

Repeat after me oej: I will at least make sure my code compiles before I commit it.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46930 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-02 16:06:39 +00:00
Olle Johansson
5667c1c71d Dont overwrite pkt->flags (from 1.2)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46901 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-02 15:24:30 +00:00
Russell Bryant
105fa492b4 Add the missing call to free described in issue #8268. Also, add a bunch of
missing calls to free in callerid_feed_jp().


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-02 14:02:37 +00:00
Russell Bryant
e626d78269 fix saying one hundred and two hundred in hebrew (issue #7810, eldadran)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-01 23:01:48 +00:00
Russell Bryant
468fbbf3ca Fixes for cross-compilation on mips
(issue #8058, ywalther, with some modifications)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-01 22:51:21 +00:00
Russell Bryant
af3e243994 Add a check in the configure script to determine whether ld is GNU ld or not.
This is needed because module embedding only works for gnu ld.  GNU ld is now
listed as a dependency for all of the module embedding options in menuselect.
(issue #8143)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-01 22:32:12 +00:00
Matt O'Gorman
6a10570614 bind address support from bug 8164
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46822 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-01 20:35:41 +00:00
Steve Murphy
b2356087ab a fix for bug 8251; the var_val needs to accept longer strings or mass confusion and a lot of lost time is the result
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-01 19:49:40 +00:00
Joshua Colp
673e9f53a8 Force poll() emulation for Darwin to always be on. It's too broken to consider being used. This resolves the console issue OSX users have been seeing. I would have liked to autoconf this but I haven't been able to come up with a test case that works. Que sera.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46780 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-01 18:39:47 +00:00
Russell Bryant
5fa61df201 Merged revisions 46776 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r46776 | russell | 2006-11-01 13:24:17 -0500 (Wed, 01 Nov 2006) | 9 lines

soxmix and Asterisk expect different file extensions for certain formats.  This
was already handled for the wav49 format.  However, it was not handled for
ulaw and alaw.  I fixed this in such a way that using the alternate extensions
for ulaw and alaw will only happen if we know we're calling soxmix, and not a
custom script defined using the MONITOR_EXEC variable.  The wav49 processing
was left alone so that external scripts will see no behavior change.
(issue #7550, reported by mnicholson, proposed patch by junky, committed fix
is a bit different)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-01 18:26:35 +00:00
Joshua Colp
899d116be2 It's another round of chan_iax2 fixes! Should hopefully fix the deadlock issues people have been reporting. IAXtel now has qualify turned on for 800 peers and it is handling it fine.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-01 18:21:34 +00:00
Steve Murphy
a0078bbbc0 Cleanups suggested by Russell.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46760 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-01 17:48:48 +00:00
Russell Bryant
c9c41a0b85 Prevent an infinite loop when config processing gets to a jitterbuffer option
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46744 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-01 16:39:09 +00:00
Jason Parker
b12229c1ff Fix "core show translation" output. Issue #8243, patch by Damin.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46716 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 22:02:15 +00:00
Kevin P. Fleming
f532d2f198 add an API so that translators can activate/deactivate themselves when needed
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 21:47:48 +00:00
Kevin P. Fleming
160a0448c2 revert changes that were the wrong way to address this... proper fix coming
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 21:36:17 +00:00
Kevin P. Fleming
f725940328 let's set the seen flag early enough to actually make a difference...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 21:25:20 +00:00
Kevin P. Fleming
59186bb2d2 don't re-do setup operations for translators that can dynamically register themselves
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 21:23:06 +00:00
Tilghman Lesher
93e3d1157b Blocked revisions 46662 via svnmerge
........
r46662 | tilghman | 2006-10-31 09:46:04 -0600 (Tue, 31 Oct 2006) | 3 lines

Move thread-unsafe initializer to the module loading code; add the
corresponding function to the module unload to fix a memory leak.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 15:49:15 +00:00
Olle Johansson
d318976f4d Issue #8089 - Fix the ENUM support (picking one record by number). Thanks otmar!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 10:56:20 +00:00
Olle Johansson
9ab1cc22a4 Support ;rport when we're supposed to support ;rport. Issue #7473.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 10:26:16 +00:00
Olle Johansson
56f2cab81c If peer fails ACL check, fail peer at REGISTER
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 09:17:53 +00:00
Olle Johansson
83d0334d53 Block my messing around in the 1.2 branch...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 09:07:40 +00:00
Olle Johansson
cdb0c64271 Fix T38 too. Thanks, tgrman !
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 08:28:38 +00:00
Russell Bryant
134c4dcadd Start Asterisk later in the boot process to ensure it starts after stuff like
MySQL (issue #8253, Alric)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46563 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 06:30:53 +00:00
Russell Bryant
e998b2b609 Merged revisions 46560 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r46560 | russell | 2006-10-31 01:18:36 -0500 (Tue, 31 Oct 2006) | 3 lines

When handling the case where the hostname is just an IPV4 numeric address,
be sure to set the address type.  (issue #8247, alexr)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 06:19:56 +00:00
Russell Bryant
f124a6d1fc Merged revisions 46557 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r46557 | russell | 2006-10-31 01:13:09 -0500 (Tue, 31 Oct 2006) | 3 lines

fix some copy/paste bugs in the checking of arguments for the 
"control stream file" AGI command (issue #8255, mnicholson)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 06:14:13 +00:00
Russell Bryant
68720145e3 Add a small tweak to the code that checks to see whether destination formats
are translatable based on the source format.  If we have already determined
that there is no translation path in one direction, don't bother checking the
other direction.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 05:55:07 +00:00
Matt O'Gorman
29d2282f0a spelling typo
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-30 22:25:43 +00:00
Matt O'Gorman
f94fd0ff04 formatting fix.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-30 22:22:34 +00:00
Kevin P. Fleming
d8817c0d3c when unregistering a translator, don't rebuild the translation matrix unless needed
when filtering formats out of an offer, ensure we check for translation ability in both directions


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-30 22:19:55 +00:00
Kevin P. Fleming
c874ff482b ensure that items removed from a list are always unlinked from the list (next pointer set to NULL)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-30 21:46:07 +00:00
Joshua Colp
aa8099e50f Don't explicitly link in crypt as it is not used on some platforms.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46506 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-30 21:09:13 +00:00
Joshua Colp
a7e0a4d143 We need to lock the pvt structure during retransmission as another worker thread may be doing something as well.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-30 18:13:07 +00:00
Olle Johansson
86c973f71f Issue #8246 - Doxygen fixes from kshumard.
An extra big thankyou is given to everyone that contributes to doxygen!

		THANK YOU!



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-30 16:27:34 +00:00
Olle Johansson
e93e64a005 Bind RTCP to the same IP as RTP
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46431 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-30 16:09:05 +00:00
Olle Johansson
9213317979 Issue #7869 - Stop retransmission of 302 redirects (imported from 1.2)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46407 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-29 19:31:58 +00:00
Olle Johansson
4456e58811 Issue #7608 - Notifications sent with wrong content-type (imported from 1.2, modified)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46403 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-29 19:12:18 +00:00
Olle Johansson
e8350b836b Backport of patch for #7828 that was reported for trunk, but obviously
exists in 1.4 too. 


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-29 17:16:38 +00:00
Olle Johansson
0ff30203f9 Restoring the old logic, since working around it and fixing it seemed too complicated.
- The SIP_OUTGOING flag indicates the direction of the last transaction in the dialog.
- The initreq stores the last request in the dialog, the request that opened the 
  latest transaction.

Please now retry all the 1.4 bug reports with mixed to/from headers, tags etc
in ACK, BYE, CANCEL. Thanks!


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46398 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-29 08:45:05 +00:00
Olle Johansson
b1b2177079 Accepting a message twice may be misinterpreted...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46389 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-28 20:25:18 +00:00
Olle Johansson
5c59f2f5f5 - 183 is not reliable message...
- Error should not have SDP


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-28 19:08:58 +00:00
Joshua Colp
08b2a8e886 Don't build muted on OpenBSD, it is not supported.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-28 16:37:44 +00:00
Russell Bryant
0ed3384fb1 move the copy of the default settings to the global settings back out of
process_zap, so that they aren't overwritten when process_zap is called
multiple times


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-27 19:03:32 +00:00
Olle Johansson
5a2abaee46 Put some doxygen pressure on Christian :-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-27 18:29:21 +00:00
Russell Bryant
d7f9b5f912 We should always be using _exit() after a fork() or vfork() instead of exit().
This is because exit() does some extra cleanup which in some implementations
of vfork(), for example, can actually modify the state of the parent process,
causing very weird bugs or crashes.  (issue #7971, Nick Gavrikov)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-27 17:39:31 +00:00
Russell Bryant
cc818055b5 Blocked revisions 46361 via svnmerge
........
r46361 | russell | 2006-10-27 12:36:07 -0500 (Fri, 27 Oct 2006) | 5 lines

We should always be using _exit() after a fork() or vfork() instead of exit().
This is because exit() does some extra cleanup which in some implementations
of vfork(), for example, can actually modify the state of the parent process,
causing very weird bugs or crashes.  (issue #7971, Nick Gavrikov)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-27 17:37:20 +00:00
Russell Bryant
b588d56fc8 Instead of iterating all of the options once to look for jitterbuffer options,
and then again for everything else, move the processing of jitterbuffer
options into the main loop so that there are no erroneous messages about
ignoring unknown options.  (issue #8226)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-27 15:32:40 +00:00
Christian Richter
b03054fdfc Merged revisions 46350 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r46350 | crichter | 2006-10-27 11:24:01 +0200 (Fr, 27 Okt 2006) | 1 line

fixed a bug which caused chan_misdn to try to allocate 2 times the same channel on high load, which then caused instability of mISDN. removed a useless function from isdn_lib.c
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46353 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-27 10:03:23 +00:00
Christian Richter
f7a6f0efa2 fixed not compile issue, which was just introduced
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46352 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-27 09:58:44 +00:00
Christian Richter
6964f148ba Merged revisions 46176 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r46176 | crichter | 2006-10-25 10:41:59 +0200 (Mi, 25 Okt 2006) | 1 line

added nttimeout option to configure wether we disconnect calls on NT timeouts or not during an overlapdial session
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-27 09:49:20 +00:00
Jason Parker
f10529efed Fix small formatting issue, that causes misaligned line
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-26 20:25:44 +00:00
Olle Johansson
bd1891aa6d Block patch that only applies to 1.2
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46345 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-26 20:12:07 +00:00
Jason Parker
2894a00816 Merged revisions 46337 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r46337 | qwell | 2006-10-26 12:47:52 -0500 (Thu, 26 Oct 2006) | 2 lines

oops - somebody forgot to change this - long ago, probably.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46340 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-26 17:57:56 +00:00
Jason Parker
9a370f9ac1 grammar check
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-26 17:38:05 +00:00
Olle Johansson
8d3f730595 Corrections to changes
(Multiparking is not included)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-26 16:38:56 +00:00
Russell Bryant
3cb7bcd6d7 - If the source has no audio or no video portion, do not call powerof() to
get the format index.
- Don't run through the audio and video loops if there is no audio or video
  portion of the source
If 0 is passed to powerof, it will return -1.  This value of -1 was then being
used as an array index in these loops, which caused a crash on some systems.
Other than this issue, this code works as we expected it to.  If a format is
not in the source, and we have to translation path to it, it is not offered in
the list of acceptable destination formats.
(fixes issue #8231)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-26 16:31:05 +00:00
Kevin P. Fleming
58f292feae update to reflect G.722 addition
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-26 12:15:58 +00:00
Russell Bryant
10a3540c54 update backtrace documentation to reflect changes in 1.4 (issue #8230, kshumard)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-26 04:18:00 +00:00
Mark Spencer
72146fab32 Fix config comment code preservation code (thanks murf!)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-26 01:37:40 +00:00
Olle Johansson
77e12e971c Old todo note - Don't add Contact header on BYE and Cancel
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 20:14:57 +00:00
Russell Bryant
020e4f9725 regenerate configure script
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 19:24:11 +00:00
Russell Bryant
456186af50 fix error output when checking for openh323 to refer to openh323 instead
of pwlib (issue #8222, misaksen)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 19:20:23 +00:00
Olle Johansson
b36a4fad1b Somewhat ugly code to try to fix issue #7608.
Since the problem was not very well defined, the fix is a bit fuzzy too...
Thanks to Luigi for accidentally spotting the possible problem!


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46252 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 19:16:10 +00:00
Russell Bryant
28d9579584 update warning message to include "agi" option (issue #8225, jmls)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46249 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 19:08:18 +00:00
Kevin P. Fleming
54fd44e6f8 use 1.4.3 extra sounds with corrected silence files
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46248 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 18:13:54 +00:00
Kevin P. Fleming
cb32f7d941 add support for prebuilt G.722 prompts and music on hold files
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 17:08:58 +00:00
Olle Johansson
03b4e17d23 show settings doesn't produce a list
of similar objects, it should stay a "show"


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 15:56:08 +00:00
Olle Johansson
5d635e969e Block change to 1.2 that was already committed to 1.4
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46214 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 15:52:29 +00:00
Kevin P. Fleming
ce4b0afb73 apparently developers are still not aware that they should be use ast_copy_string instead of strncpy... fix up many more users, and fix some bugs in the process
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 14:32:08 +00:00
Tilghman Lesher
ab677899a7 WaitExten truncates decimals of times to wait, instead of accepting them (Bug 8208)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 04:58:44 +00:00
Kevin P. Fleming
6c17f1e07e add passthrough and file format support for G.722 16KHz audio (issue #5084, original patch by andrew, updated by mithraen)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 00:26:17 +00:00
Kevin P. Fleming
05eb71c699 code zone experiment: don't offer formats in the outbound INVITE that aren't either passthrough or translatable
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46153 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 00:10:54 +00:00
Kevin P. Fleming
c5f096e220 if multiple translators are registered for the same source/dest combination, ensure that the lowest-cost one is always inserted earlier in the list
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24 23:45:19 +00:00
Mark Spencer
72a23ce184 Fix FastAGI when there is no pid (bug #7628, #8147)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24 20:30:25 +00:00
Joshua Colp
c6b9449955 We need to initialize our scheduler pthread condition... yes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46130 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24 19:29:56 +00:00
Luigi Rizzo
e6451274d2 merge 45152 don't leak descriptors in http.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46117 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24 08:34:23 +00:00
Luigi Rizzo
50fda8522d merge 45966 refer_to_domain potentially containing options
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46116 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24 08:32:15 +00:00
Luigi Rizzo
d7b0db6530 merge 46026 improper checks on get_header() return values
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24 08:30:26 +00:00
Luigi Rizzo
fa4d6f23a6 merge 46045 prevent NULL args to ast_strdupa() in chan_sip.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46114 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24 07:14:17 +00:00
Russell Bryant
5cc4200696 Restore the ability to remove the firmware directory without causing the
installation to fail (issue #8111)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24 05:23:33 +00:00
Kevin P. Fleming
471c0eebdc ensure that the translation matrix is properly lock-protected every place it is used
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46083 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24 03:53:32 +00:00
Kevin P. Fleming
d2b10d5f4f add an API call to allow channel drivers to determine which media formats are compatible (passthrough or transcode) with the format an existing channel is already using
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24 03:45:42 +00:00
Kevin P. Fleming
eee62843d5 simplify and correct voicemail IMAP storage build instructions
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24 03:13:08 +00:00
Tilghman Lesher
de9c3aaa8d Pass through a frame if we don't know what it is, rather than trying to pass a
NULL, which will segfault a channel driver (Bug 8149)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24 03:01:00 +00:00
Russell Bryant
5a2f8ea4b7 In muted.c, check the return value of strdup. In ael_main.c, check the return
value of calloc.  (issue #8157)

In passing fix a few minor bugs in ael_main.c.  The last argument to strncpy()
was a hard-coded 100, where it should have been 99.  I changed this to use
sizeof() - 1.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46067 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24 01:27:42 +00:00
Russell Bryant
6a74bc409c Fix the descriptions of some of the MeetMeAdmin options (issue #8098, mflorell)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24 01:04:14 +00:00
Russell Bryant
edb73def8e don't crash when an incoming message has no "from" (issue #8205, jmls)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45999 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-23 17:07:45 +00:00
Joshua Colp
7a0a5b1480 Merged revisions 45927 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r45927 | file | 2006-10-22 20:25:28 -0400 (Sun, 22 Oct 2006) | 2 lines

Don't leak memory mmmk?

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45928 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-23 00:27:39 +00:00
Christian Richter
c01e86f14e Merged revisions 45808 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r45808 | crichter | 2006-10-21 14:35:13 +0200 (Sat, 21 Oct 2006) | 1 line

fixed issue, that if chan_misdn is loaded and couldn't be initialized it would cause a segfault after 'reload'. Reported by Drew/Matt thx.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45916 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-22 21:44:46 +00:00
Russell Bryant
4ebacc1d00 Add a couple missing unregistrations of manager actions and remove duplicate
unregistrations of applications.  (issue #8194, jmls)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-21 18:49:46 +00:00
Joshua Colp
bd40b393ec Don't use promotion on Darwin because it doesn't seem to work quite right in all cases, this should solve the unresolved symbol issue people have been seeing.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45817 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-21 18:48:58 +00:00
Joshua Colp
8deedb83fa Pass DESTDIR and ASTSBINDIR so that the utilities get installed in the proper location (reported on asterisk-dev mailing list)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-20 19:03:03 +00:00
Olle Johansson
2681aea6b2 Let's understand SIP:
- REFER can create dialog, Asterisk does not support it yet
- NOTIFY can create dialog in Asterisk's implementation (voicemail) even though
  we don't support the server side of it. In this case, the standard is a side issue ;-)
- Added extened functionality for unsupported methods (PING, PUBLISH) so we don't
  create PVT's for those either.

Russellb needs to judge what to do with this in 1.2, but I think the current implementation
n 1.2 is a bug since we're sending bad replies to NOTIFY and REFER outside of dialogs


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-20 07:44:42 +00:00
Joshua Colp
9ab793dcf8 Let's remember to unregister JabberStatus too (issue #8184 reported by jmls)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45694 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-19 17:24:40 +00:00
Joshua Colp
d7329034ea Merged revisions 45691 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r45691 | file | 2006-10-19 13:16:37 -0400 (Thu, 19 Oct 2006) | 2 lines

Respect language selection when seeing if the file exists (issue #8178 reported by mnicholson)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45692 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-19 17:19:47 +00:00
Joshua Colp
67c180956c If the jitterbuffer is forced on then we can't partially bridge (reported by wangster on #asterisk-dev)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-19 16:03:09 +00:00
Olle Johansson
a37a95c0d8 Cleaning up
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-19 07:09:37 +00:00
Russell Bryant
87cb020143 Don't leak the actual thread-specific sip_pvt struct
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-19 00:59:51 +00:00
Kevin P. Fleming
2f6a555fbd don't leak memory when a chan_sip thread is destroyed that has a thread-local temp_pvt allocated
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18 23:49:39 +00:00
Joshua Colp
54790d5ceb Don't modify things if we are using vfork as this is very bad and may cause unexpected behavior (issue #7970 reported by Nick Gavrikov)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18 21:03:34 +00:00
Olle Johansson
9bd68dd32c remove duplicate declarations
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18 11:54:33 +00:00
Luigi Rizzo
4280d28549 merge from trunk: move ast_variables_destroy() to a better
place in handle_uri() to avoid leaking memory on non existing files.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45464 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18 04:09:50 +00:00
Joshua Colp
64a875951a Don't segfault if you're using a channel driver that doesn't turn RTCP on
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18 03:02:08 +00:00
Russell Bryant
0a78fea2ac Don't attempt to access private data members of the pthread_mutex_t object,
because this does not work on all linux systems.  Instead, just access
the reentrancy field in the ast_mutex_info struct when DEBUG_THREADS is
enabled.  If DEBUG_CHANNEL_LOCKS is enabled, the developer probably has
DEBUG_THREADS on as well.
(issue #8139, me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45441 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18 02:41:36 +00:00
Russell Bryant
8273d95be3 update entry to reboot a snom phone (issue #7850, pnlarsson)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45439 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-18 02:19:07 +00:00
Kevin P. Fleming
5b9106eeb5 add a project-specific script to be used during release preparation
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-17 22:31:54 +00:00
Kevin P. Fleming
227d415709 optimize the 'quick response' code a bit more... no more malloc() or memset() for each response
expand stringfields API a bit to allow reusing the stringfield pool on a structure when needed, and remove some unnecessary code when the structure was being freed


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-17 22:24:10 +00:00
Joshua Colp
5658b611e5 Blocked revisions 45380 via svnmerge
........
r45380 | file | 2006-10-17 16:37:17 -0400 (Tue, 17 Oct 2006) | 2 lines

Don't create a "real" pvt structure for requests that shouldn't be able to create one. Instead use a temporary pvt and fill it with enough information so we can send a reply.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-17 20:38:15 +00:00
Joshua Colp
0c4dfe3aed Don't create a "real" pvt structure for requests that shouldn't be able to create one. Instead use a temporary pvt and fill it with enough information so we can send a reply.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-17 20:30:34 +00:00
Olle Johansson
590698e583 Adding information about Marks direct-RTP hack to the docs...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-17 17:39:18 +00:00
Kevin P. Fleming
ba658e6825 Merged revisions 45326 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r45326 | kpfleming | 2006-10-17 12:22:01 -0500 (Tue, 17 Oct 2006) | 2 lines

provide licensing language for IAXy firmware file

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-17 17:22:25 +00:00
Olle Johansson
45fc0eaba4 Now, remove all traces of the option that we did not need :-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-17 16:23:27 +00:00
Olle Johansson
1e2935d447 remove the option that was not needed, really.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45313 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-17 16:22:41 +00:00
Joshua Colp
d28fd24747 Merged revisions 45265 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r45265 | file | 2006-10-16 15:59:54 -0400 (Mon, 16 Oct 2006) | 2 lines

Use responses rather then replies even though they mean the same thing.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45280 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-16 20:06:18 +00:00
Joshua Colp
3f24dceeca Merged revisions 45260 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r45260 | file | 2006-10-16 15:28:18 -0400 (Mon, 16 Oct 2006) | 2 lines

Add 'ignoreoodreplies' option which will not create a pvt structure on a SIP response but instead basically drop it.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-16 19:37:34 +00:00
Joshua Colp
552ca7e926 Backport of new directed pickup (BE-85).
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45246 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-16 17:24:35 +00:00
Olle Johansson
46b25b4d8a Adding Inotel to credits for SIP transfers. Thanks for your support!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-16 13:59:51 +00:00
Olle Johansson
eaaddb90bf Don't destroy dialog for unexpected REFER response...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-16 13:00:07 +00:00
Steve Murphy
2ba44e6b10 update the doc string for both AEL and extensions.conf users.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-14 04:38:15 +00:00
Kevin P. Fleming
60a11a7568 ------------------------------------------------------------------------
r45119 | kpfleming | 2006-10-13 17:57:42 -0500 (Fri, 13 Oct 2006) | 2 lines

don't drop the entire permit/deny list when an attempt is made to add an invalid entry (BE-92)

------------------------------------------------------------------------


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-13 23:02:48 +00:00
Joshua Colp
cda9238a47 Clear the quiet flag too since we are restarting a recognition again (reported on -dev by Stephan Edelman)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-13 21:06:09 +00:00
Joshua Colp
8c09239585 Check return value from engine in case of failure (ie: out of licenses) (reported on -dev mailing list)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-13 21:01:13 +00:00
Steve Murphy
dc04209898 Bug 8128 fixed in this release via these changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-13 20:52:17 +00:00
Christian Richter
a05d2ebb96 avoiding warning, fixing potential bug
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-13 19:19:46 +00:00
Joshua Colp
8a9517ba9a And file said... let the compiler warnings STOP!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-13 18:42:49 +00:00
Joshua Colp
ba3ac1c86b Merged revisions 45060 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r45060 | file | 2006-10-13 13:01:22 -0400 (Fri, 13 Oct 2006) | 2 lines

Turn on volume adjustment if it needs to be on (issue #8136 reported by mnicholson)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-13 17:05:02 +00:00
Joshua Colp
c1f12bd5ad Move say.conf existence check to do_say function since it is called from multiple places (issue #8144 reported by kshumard)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-13 16:20:58 +00:00
Kevin P. Fleming
7f8528f21c Merged revisions 45048 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r45048 | kpfleming | 2006-10-13 11:18:08 -0500 (Fri, 13 Oct 2006) | 2 lines

when sending a call to a peer, use the proper socket if we have multiple bindings (reported on asterisk-dev)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-13 16:19:35 +00:00
Joshua Colp
1bfbc1419a Complete merging in RPID screen changes (issue #8101 reported by hristo, patch by oej in revision 44757)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45040 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-13 16:01:17 +00:00
Joshua Colp
a825206313 Merged revisions 45030 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r45030 | file | 2006-10-13 11:49:53 -0400 (Fri, 13 Oct 2006) | 2 lines

Pass the right value to usleep for sleeping, and always add the background refresh item back into the scheduler if enabled since it is deleted during reload. (issue #8142 reported by p_lindheimer)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45031 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-13 15:53:22 +00:00
Kevin P. Fleming
1944a9a07c use a configure script test for PMTU discovery control instead of just assuming it's available on Linux
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45027 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-13 15:41:14 +00:00
Christian Richter
3a602aa1d7 Merged revisions 45020 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r45020 | crichter | 2006-10-13 15:11:13 +0200 (Fr, 13 Okt 2006) | 1 line

fixed some echocandisable issues when bridged. this caused a kernel panic sometimes..also some minor formatting fixes
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@45026 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-13 14:45:39 +00:00
Christian Richter
887395b103 Merged revisions 44993 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r44993 | crichter | 2006-10-13 09:40:07 +0200 (Fr, 13 Okt 2006) | 1 line

fixed issue, that the hangupcause got a wrong isdn cause at RELEASE_COMPLETE
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44994 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-13 07:52:41 +00:00
Luigi Rizzo
0e230d79d8 merge formatting and minor code simplifications from trunk
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-12 22:07:11 +00:00
Matt O'Gorman
0c4d8edca6 fix for bug 7764.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44982 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-12 20:34:49 +00:00
Kevin P. Fleming
ec4bf13915 we can only send one 'a=ptime' attribute per media session, not one for each format
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44971 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-12 19:14:24 +00:00
Kevin P. Fleming
09f6a6a167 Merged revisions 44955 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r44955 | kpfleming | 2006-10-12 13:31:26 -0500 (Thu, 12 Oct 2006) | 2 lines

ensure that IAX2 and SIP sockets allow UDP fragmentation when running on Linux (thanks to Brian Candler on the asterisk-dev list for the tip)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44956 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-12 18:38:51 +00:00
Russell Bryant
def01ced3d fix a silly typo in a comment that I saw while reading the commit list
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-12 16:56:32 +00:00
Joshua Colp
4a4fc523b8 Pass off AUDIO_LIBS so muted can link on OSX (issue #8135 reported by ssokol)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44942 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-12 16:08:50 +00:00
Nadi Sarrar
8adb217804 append_event must be called while holding the session lock
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-12 12:55:25 +00:00
Russell Bryant
fecc14cd0f change some debug output to use LOG_DEBUG instead of verbose output
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44911 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-12 10:24:36 +00:00
Jason Parker
3c72ad9cb1 These are already set by the parent Makefile..
There is no need to have this here (it doesn't actually work anyways).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-11 16:57:06 +00:00
Christian Richter
8621f03cf2 removed warning because of missing prototype declaration
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44854 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-11 09:18:41 +00:00
Olle Johansson
84a6a67b15 Do not set default/global values in the variable declaration, set it in reload_config()
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44830 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-10 19:23:36 +00:00
Joshua Colp
e0dbc80f61 Move some stuff around so that a NOTIFY dialog won't hang around until the end of the world under certain circumstances
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44819 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-10 17:21:44 +00:00
Paul Cadach
53024e3508 CHANNEL() function sometime mix parameter and value
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-10 16:44:54 +00:00
Tilghman Lesher
88873fbafa Lost of a bit of logic when this was simplified between 1.2 and 1.4 (Bug 8117)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-10 16:42:19 +00:00
Joshua Colp
e4380a1b2e Bail out if we have no refer structure and we get a refer response
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-10 16:30:00 +00:00
Luigi Rizzo
0681269434 more merge from trunk (comments and change a static function name)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-10 16:21:22 +00:00
Joshua Colp
74171605af Only set DTMF information if an RTP structure exists
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44788 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-10 15:23:14 +00:00
Christian Richter
76dd912066 Merged revisions 44785 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r44785 | crichter | 2006-10-10 15:34:33 +0200 (Di, 10 Okt 2006) | 1 line

(re)added support of dynamical enabling hdlc on bchannels
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-10 13:50:26 +00:00
Luigi Rizzo
fde338ba2c whitespace changes related to previous commit
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-10 08:25:15 +00:00
Luigi Rizzo
e0f745b1f6 merge a few code simplifications that have gone
into trunk during last week, to reduce differences
between the two branches and make porting fixes easier.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44776 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-10 08:18:42 +00:00
Jason Parker
f3ba83ae1a Fix a problem where phones that go "missing" never got unregistered.
Issue #8067, reported by pj, patch by Anthony LaMantia (with minor whitespace modifications)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-09 16:12:35 +00:00
Joshua Colp
f11d155547 iaxs[callno] may go away if we try to avoid the deadlock
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44760 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-09 15:46:53 +00:00
Joshua Colp
8a7f8f5592 Properly avoid a collision with iax2_hangup (issue #8115 reported by vazir)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-09 15:41:28 +00:00
Olle Johansson
80ae948972 Block change from 1.2. Something broke severly when trying to merge it directly...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44758 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-09 14:52:42 +00:00
Luigi Rizzo
9d88cfa8dc merge svn 44744: do not dereference p if we know it is NULL
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-08 14:14:14 +00:00
Paul Cadach
e2676b1098 Propagate caller's transfer capability too
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-07 14:39:34 +00:00
Luigi Rizzo
f480d547cc merge revision 44664 - put common code in a function to avoid repetitions.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44665 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-07 11:37:30 +00:00
Luigi Rizzo
169342bc0d remove hardwired usage of 5060, use DEFAULT_SIP_PORT instead
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44662 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-07 11:11:16 +00:00
Luigi Rizzo
35d8151b55 merge rev 44253 - option_debug checking before printing to debug channel.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44661 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-07 11:04:30 +00:00
Luigi Rizzo
e65f2bd612 backport simplifications on sip_register,
usage of ast_set2_flag(), 
and fixes to the handling of failed module loading.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44660 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-07 10:59:27 +00:00
Luigi Rizzo
e5a838cac1 improve and document function get_in_brackets(), introducing
a helper function find_closing_quote() of more general use.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44650 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-07 09:36:00 +00:00
Kevin P. Fleming
f804e2f153 ensure that mutex locks inside list heads are initialized properly on platforms that require constructor initialization (issue #8029, patch from timrobbins)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-06 21:28:03 +00:00
Kevin P. Fleming
35697a1fce remove Jingle as per mog
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-06 21:09:16 +00:00
Joshua Colp
faf38b71ef Remove the seqno check for RFC2833, the handler is smart enough to not need it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-06 21:08:54 +00:00
Kevin P. Fleming
0f29a4ddd3 various cleanups
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-06 21:07:44 +00:00
Joshua Colp
2d3da5b500 When the sequence number rolls over then reset the recorded sequence number for DTMF (issue #8106 reported by bungalow)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-06 18:46:28 +00:00
Joshua Colp
1a5c679e51 Merged revisions 44580 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r44580 | file | 2006-10-06 12:52:14 -0400 (Fri, 06 Oct 2006) | 2 lines

Even more frames to treat as though the remote side disappeared (issue #8097 reported by eldadran)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-06 16:53:48 +00:00
Luigi Rizzo
f24ec459b2 make sure sockets are blocking when they should be blocking.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-06 15:59:23 +00:00
Christian Richter
290fe898f0 Merged revisions 44460 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r44460 | crichter | 2006-10-05 12:02:38 +0200 (Do, 05 Okt 2006) | 1 line

fixed segfault which happens during hold/transfer action
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44563 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-06 12:53:41 +00:00
Christian Richter
37df5208a1 Merged revisions 44335 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r44335 | crichter | 2006-10-04 17:26:59 +0200 (Mi, 04 Okt 2006) | 1 line

if INFORMATION Message come with keypad instead of called party number, we just use the keypad as called party number.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44562 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-06 12:52:01 +00:00
Christian Richter
13825dab85 Merged revisions 44334 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r44334 | crichter | 2006-10-04 17:13:58 +0200 (Mi, 04 Okt 2006) | 1 line

added the option 'reject_cause' to make it possible to set the RELEASE_COMPLETE - cause on the 3. incoming PMP channel, which is automatically rejected because chan_misdn does not support that kind of callwaiting. Therefore chan_misdn supports now 3 incoming channels on a PMP BRI Port. misdn_lib_get_free_bc now gets the info if the requested channel is incoming or outgoing to make the 3. channel possible
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-06 12:50:25 +00:00
Christian Richter
e0005b654a Merged revisions 44149 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r44149 | crichter | 2006-10-02 15:28:14 +0200 (Mo, 02 Okt 2006) | 1 line

fixed the hold/retrieve/transfer issues, removed a useless bc field, added setting of frame.delivery fields, some minor code cleanups
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-06 10:44:34 +00:00
Joshua Colp
dba3dae7f8 Merged revisions 44501 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r44501 | file | 2006-10-05 15:55:41 -0400 (Thu, 05 Oct 2006) | 2 lines

Treat busy control frames as hangup in the file streaming core (issue #8097 reported by eldadran)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44502 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-05 19:57:16 +00:00
Steve Murphy
25b33fd0c8 This mod fixes a problem pointed out by dgarstang. Many thanks to Doug\!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-05 18:21:39 +00:00
Joshua Colp
8d2f872a84 One more T.38 fix! Don't leave a reinvite hanging by a thread if the other side is already setup with T.38
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44486 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-05 18:01:51 +00:00
Kevin P. Fleming
6a70807a36 don't segfault when an argument without a close parenthesis is found
stop parsing as soon as that situation occurs


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-05 16:10:01 +00:00
Steve Murphy
80e8dd637b I put the accumulated changes from the commit logs and inspection, into CHANGES. Hope everyone approves\!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-05 15:22:37 +00:00
Steve Murphy
743097a6c1 Hang on a minute, the install process sticks muted.conf in /etc/asterisk, so that's where muted should look for it, right\?
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-05 15:04:22 +00:00
Joshua Colp
db989fc58c Don't totally bail out if T.38 was negotiated
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-05 02:40:40 +00:00
Kevin P. Fleming
1a8cca387b this change was correct, the old version is no longer needed
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-05 01:42:06 +00:00
Kevin P. Fleming
ca2bdd54c7 Merged revisions 44432 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r44432 | kpfleming | 2006-10-04 20:27:57 -0500 (Wed, 04 Oct 2006) | 2 lines

fix Polycom presence notification again

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-05 01:30:05 +00:00
Luigi Rizzo
85d81f17d1 as far as i can tell astman only uses newt...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04 22:52:11 +00:00
Luigi Rizzo
00a6fcb35e put linker flags in ASTLDFLAGS where they belong
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44407 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04 22:50:48 +00:00
Kevin P. Fleming
0ee719e52f Merged revisions 44392 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r44392 | kpfleming | 2006-10-04 16:15:29 -0500 (Wed, 04 Oct 2006) | 3 lines

remove workaround for old Polycom firmware SUBSCRIBE requests
add workaround for new Polycom firmware SUBSCRIBE requests (bug is known to exist in 2.0.1 firmware)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44393 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04 21:17:30 +00:00
Kevin P. Fleming
5c4434d0e7 make LOW_MEMORY builds actually work
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44390 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04 21:04:21 +00:00
Steve Murphy
c37666252d These changes fix the problems reported in bug 8090
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04 19:57:08 +00:00
Kevin P. Fleming
ff05bf15c8 update thread creation code a bit
reduce standard thread stack size slightly to allow the pthreads library to allocate the stack+data and not overflow a power-of-2 allocation in the kernel and waste memory/address space
add a new stack size for 'background' threads (those that don't handle PBX calls) when LOW_MEMORY is defined


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04 19:47:22 +00:00
Steve Murphy
caa0d129f2 I've been meaning to add some explanation about muted... here it is
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04 17:04:21 +00:00
Steve Murphy
7778d017fc CLI reverbification update to this config file
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44353 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04 16:49:47 +00:00
Steve Murphy
fcd80ee83b OOOps! There is no alternative to suggest in 1.4. A small erasure.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04 15:52:12 +00:00
Steve Murphy
7ceeecd23f In response to bug 7776, a Warning has been added to the doc string for Macro().
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44337 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04 15:49:20 +00:00
Kevin P. Fleming
fc72291807 ensure that local include files are always used
avoid a duplicate function name (term_init())


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44322 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04 00:25:44 +00:00
Matt O'Gorman
592cbc0452 fix issue with dialing client without resource.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-03 22:35:43 +00:00
Kevin P. Fleming
b4a673780a Merged revisions 44296 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r44296 | kpfleming | 2006-10-03 15:14:13 -0500 (Tue, 03 Oct 2006) | 2 lines

fix a logic error in my previous fix to the queue reload code

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-03 20:18:29 +00:00
Paul Cadach
bc3dee9d86 Change default presentation indicator to "user provided not screened" if octet 3a missed in CallingPartyNumber IE
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-03 18:42:20 +00:00
Joshua Colp
d241bab733 Use VideoSupport instead so it is considered a valid XML attribute name. (issue #8075 reported by renemendoza)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-03 18:35:55 +00:00
Paul Cadach
70dfcccd66 Fix preparation of type and presentation of calling number
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44283 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-03 18:30:48 +00:00
Matt O'Gorman
5058b9e13f updated res_jabber for even better component support, soon will be jep-0100 compliant.
also removed chan_jingle and infromed info from jingle.txt, chan_gtalk still works and should be used in this version.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-03 00:01:34 +00:00
Joshua Colp
d56d4a3f7f Merged revisions 44213 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r44213 | file | 2006-10-02 16:07:59 -0400 (Mon, 02 Oct 2006) | 2 lines

Change the fd on the I/O context in case it changed during the reload, which is indeed possible. (issue #7943 reported by eclubb)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44215 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-02 20:11:02 +00:00
Joshua Colp
0cc2b24ea6 Merged revisions 44198 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r44198 | file | 2006-10-02 15:39:59 -0400 (Mon, 02 Oct 2006) | 2 lines

We should be using $AST_SBIN instead of hardcoding the path for the error message (issue #7942 reported by eclubb)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44199 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-02 19:41:39 +00:00
Paul Cadach
6b37705130 Missed part of userconf functionality for chan_h323
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-02 18:52:56 +00:00
Joshua Colp
e7a2e3cb07 Merged revisions 44168 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r44168 | file | 2006-10-02 13:22:27 -0400 (Mon, 02 Oct 2006) | 2 lines

Shrink when current_ioc is unused. It is set to -1 when unused, not 0. (issue #7941 reported by eclubb)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-02 17:25:13 +00:00
Paul Cadach
20ff512ee9 Typo fix
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-02 17:16:37 +00:00
Paul Cadach
f76b7ab4a9 Optimization of oh323_indicate(): less locks - less problems, plus single exit point
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-02 17:15:11 +00:00
Mark Spencer
43b8d09b81 Don't use Channel when you're not talking about a channel :)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-02 02:38:28 +00:00
Paul Cadach
5ec38a80bf Do not simulate any audio tones if we got PROGRESS message
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44135 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-01 19:32:24 +00:00
Russell Bryant
aff14e6d89 Fix a problem that cuased AST_DATA_DIR in defaults.h to be empty. The cause is
that since ASTDATADIR is explicitly exported using "export ASTDATADIR" at the
top of the Makefile, make no longer considers the variable "undefined", so the
Makefile can't use ?= to set ASTDATADIR if not yet set.
(issue #8063, reported by akohlsmith, fixed by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-01 18:30:06 +00:00
Russell Bryant
3e2fa16670 Merged revisions 44110 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r44110 | russell | 2006-10-01 11:19:23 -0400 (Sun, 01 Oct 2006) | 3 lines

Fix the name of the "eventmemberstatus" option in the sample queues.conf
(issue #8065, adamg)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-01 15:20:12 +00:00
Luigi Rizzo
c88b87f6ed sync with trunk - move variable declarations to the beginning of a block.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44109 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-01 15:01:28 +00:00
Paul Cadach
b0bb62a7e5 Allow one-way RTP streams (device->Asterisk)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-30 19:20:38 +00:00
Luigi Rizzo
719ba6b535 fix two recent build problems:
- with AST_DEVMODE, building codecs/lpc10 fails because of lots
  of warnings, and the configure step in editline fails as well.
  Fix this by removing the -Werror in these steps.

- on FreeBSD (but probably on other platforms as well), the final
  link of asterisk fails because AST_LIBS was not exported to the
  subdirs Makefiles. Add a proper fix in the top-level Makefile
  (a possible alternative way is to add "export AST_LIBS" near
  the beginning of the file).
  With this fix, i believe that some of the platform-specific
  conditionals in main/Makefile are redundant (because they should
  be already dealt with in the top level Makefile) but i don't
  have a platform to check.
  
Merging to head will happen in a moment.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-30 16:28:39 +00:00
Paul Cadach
ffd8a2576b Fix issue #7928 correctly. Next is a comment of previous fix:
Issue #7928 - Don't send both 404 and 503. Fix by phsultan with
a small fix by me, myself or I. Thanks, Philippe!
(This was caused by my changes to the transaction handling)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-30 16:12:23 +00:00
Paul Cadach
7a7c5011a1 Found some buggy SIP clients (phones Planet VIP-153T firmware
1.0, Linksys PAP2 firmware 3.1.9(LSc)) which sends ACK not on OK
message only (when remote party answers) but on RINGING message
too, so when we send 200 OK message, we get unidentified ACK
message (because INVITE acknowledged on RINGING message already),
so 200 OK retransmits within its retransmission interval then
call gets dropped.

If someone else knows how to provide workaround for such cases,
please, fix it in correct way.

Thanks to ssh from #asteriskru for provide access to his box to
study and fix this case.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44068 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-30 04:37:39 +00:00
Kevin P. Fleming
886f6ecbb9 ignore temporary files made by the Makefiles during a build
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-29 22:51:53 +00:00
Kevin P. Fleming
ec2e4f2216 fix a few build system bugs, and convert Makefiles to be compatible with GNU make 3.80
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44055 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-29 22:47:40 +00:00
Jason Parker
2a5feb5485 Fix a bug with the removal of 'atleast' argument to 'core verbose' and 'core debug'.
Add that argument back in.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-29 22:35:09 +00:00
Paul Cadach
e4ff1716d5 Compile first, please
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44043 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-29 21:09:10 +00:00
Paul Cadach
8a107b3a16 Set TON/PRESENTATION information more carefully when no CallingNumber IE available
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-29 21:05:43 +00:00
Paul Cadach
4ecb66c6b4 Fake display name by called number on incoming calls (until passing connected number/connected name is not implemented)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44034 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-29 20:43:13 +00:00
Paul Cadach
5d8c027883 Ported code refers to H.450 - add includes
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44023 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-29 19:09:22 +00:00
Paul Cadach
6f72c19b74 Properly pass TON/PRESENTATION information - original
H323Connection::SendSignalSetup() destroys Q.931 fields.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-29 19:06:55 +00:00
Kevin P. Fleming
26524583fc yet another place where we were not using the correct CFLAGS by default
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-29 18:49:07 +00:00
Kevin P. Fleming
37f61d385a missed one conversion to ASTCFLAGS
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-29 18:40:17 +00:00
Paul Cadach
b05cb6d46b Pass TON/PRESENTATION information too
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-29 18:30:34 +00:00
Kevin P. Fleming
704397dc3c don't abuse CFLAGS and LDFLAGS for build of Asterisk components, because they are also then used for non-Asterisk components (like menuselect); use our own variables instead
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-29 18:25:49 +00:00
Kevin P. Fleming
2ac0d927ae support --without-curl in configure script
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-29 16:52:27 +00:00
Kevin P. Fleming
ea0cccc05f another cross-compile fix
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43996 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-29 16:47:05 +00:00
Kevin P. Fleming
9f2b0f44ec a couple more environment settings that can't leak into the menuselect build
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43993 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-29 16:38:27 +00:00
Kevin P. Fleming
c2475110cc proper fix for ast_group_t change
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-29 13:45:40 +00:00
Kevin P. Fleming
69528cec15 eliminate compiler warning when DEBUG_CHANNEL_LOCKS is enabled and users of this header file don't also include channel.h
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43952 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 22:42:18 +00:00
Jason Parker
4be96dc8d3 Fix incorrect argument order for member names, on persisted members.
Issue 8047, patch by jmls.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43944 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 20:11:22 +00:00
Joshua Colp
d2d4833b79 Put in missing \ns on the end of ast_logs (issue #7936 reported by wojtekka)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 18:05:43 +00:00
Joshua Colp
62619c66df Blocked revisions 43924 via svnmerge
........
r43924 | file | 2006-09-28 14:00:30 -0400 (Thu, 28 Sep 2006) | 2 lines

Put in missing \ns on the end of ast_logs (issue #7936 reported by wojtekka)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 18:01:58 +00:00
Kevin P. Fleming
78e8232ef8 Merged revisions 43916 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43916 | kpfleming | 2006-09-28 12:31:57 -0500 (Thu, 28 Sep 2006) | 2 lines

fix buggy (and overly complex) loop used during reload of app_queue for static member list updating

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43919 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 17:35:42 +00:00
Paul Cadach
13b9f34966 Extend call establishment timeout
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43918 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 17:34:19 +00:00
Joshua Colp
24b723af44 Make sure the pvt exists before accessing it again as it may have gone away (issue #7562 reported by Seb7 and issue #7939 reported by sorg)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 17:31:09 +00:00
Joshua Colp
cdf62550ed Warning be gone!
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 17:14:07 +00:00
BJ Weschke
1dd8d10aa9 Merged revisions 43897 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43897 | bweschke | 2006-09-28 12:37:15 -0400 (Thu, 28 Sep 2006) | 3 lines

 app_queue is comparing the device names incorrectly while checking their statuses. It's internal list of interfaces includes the dial string, while the argument passed to this function does not have the dial string (/n for a local channel). This causes it to ignore the device state changes because it thinks it belongs to none of its members. (#8040 reported and patch by tim_ringenbach)


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43899 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 16:41:05 +00:00
Kevin P. Fleming
81c8f6b539 Merged revisions 43895 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43895 | kpfleming | 2006-09-28 11:32:44 -0500 (Thu, 28 Sep 2006) | 2 lines

eliminate compiler warning introduced by recent changes

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43898 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 16:38:25 +00:00
Joshua Colp
a30a5f2f09 Merged revisions 43891 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43891 | file | 2006-09-28 12:13:55 -0400 (Thu, 28 Sep 2006) | 2 lines

Stop the stream after waitstream returns so that our formats get restored. (issue #7370 reported by kryptolus)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 16:17:36 +00:00
Paul Cadach
f1ebcc8e34 Fix compiler warning
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43877 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 15:56:21 +00:00
BJ Weschke
675749c706 Merged revisions 43871 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43871 | bweschke | 2006-09-28 11:18:05 -0400 (Thu, 28 Sep 2006) | 3 lines

 Fix race condion crash with get_member_status (#7864 - tim_ringenbach reported and patched)


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43873 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 15:29:21 +00:00
BJ Weschke
669bbb6784 Autopause not working for queue members. (#8042 - jmls reported and patch)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 13:24:10 +00:00
Paul Cadach
89e23aa040 Force remote side to start media on outgoing PROGRESS message
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43862 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 12:58:22 +00:00
Paul Cadach
bfaac1699c Put attribute tag at correct place
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 12:47:23 +00:00
Christian Richter
a3f43a7dfe Merged revisions 43764 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43764 | crichter | 2006-09-27 14:51:03 +0200 (Mi, 27 Sep 2006) | 1 line

fixed a bug which led to chan_list zombies, when the call could not be properly established in misdn_call. also removed the ACK_HDLC stuff which is not really needed.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 11:03:05 +00:00
Paul Cadach
e2d1986cec Do not open transmit channel until TCS is received
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 10:51:21 +00:00
Paul Cadach
13663f59cf Don't warn on HOLD/UNHOLD control frames
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43844 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 06:02:45 +00:00
Paul Cadach
8d881f8be0 Don't treat unknown control frames as voice
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43843 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 06:01:37 +00:00
Tilghman Lesher
07317339ce Merged revisions 43815 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43815 | tilghman | 2006-09-27 15:20:35 -0500 (Wed, 27 Sep 2006) | 2 lines

Avoid inability to lock directory log message by creating the directory ahead of time. (Issue 7631)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43816 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-27 20:21:54 +00:00
Jason Parker
482c18499e Fix an issue with PLAYBACKSTATUS not being set under certain circumstances.
Fix a minor issue, to make it use the filenames that were parsed, instead of the entire argument string.
Fix Background() to return -1 like Playback(), if no args are specified.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-27 19:44:02 +00:00
Jason Parker
a65a888802 Blocking this from 1.4, fix is quite a bit different.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43801 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-27 19:36:23 +00:00
Joshua Colp
f149686e8b Compensate for out of order packets better if RFC2833 compensation is turned on.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-27 19:10:59 +00:00
Joshua Colp
0929a218f3 Get rid of two functions from a time now past (we THINK these are from pre-recursive lock time) that may be contributing to two open issues on the bug tracker (7562/7939) and that has the potential to just make bad things happen if the timing is right.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-27 17:00:31 +00:00
Russell Bryant
439f15bdb9 Merged revisions 43778 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43778 | russell | 2006-09-27 12:54:30 -0400 (Wed, 27 Sep 2006) | 42 lines

Fix a problem that occurred if a user entered a digit that matched a bridge
feature that was configured using multiple digits, and the digit that was
pressed timed out in the feature digit timeout period.  For example, if blind
transfer is configured as '##', and a user presses just '#'.  In this situation,
the call would lock up and no longer pass any frames.
(issue #7977 reported by festr, and issue #7982 reported by michaels and
 valuable input provided by mneuhauser and kuj.  Fixed by me, with testing help
 and peer review from Joshua Colp).

There are a couple of issues involved in this fix:

1) When ast_generic_bridge determines that there has been a timeout, it returned
   AST_BRIDGE_RETRY.  Then, when ast_channel_bridge gets this result, it calls
   ast_generic_bridge over again with the same timestamp for the next event.
   This results in an endless loop of nothing until the call is terminated.
   This is resolved by simply changing ast_generic_bridge to return 
   AST_BRIDGE_COMPLETE when it sees a timeout.

2) I also changed ast_channel_bridge such that if in the process of calculating
   the time until the next event, it knows a timeout has already occured, to
   immediately return AST_BRIDGE_COMPLETE instead of attempting to bridge the
   channels anyway.

3) In the process of testing the previous two changes, I ran into a problem in
   res_features where ast_channel_bridge would return because it determined
   that there was a timeout.  However, ast_bridge_call in res_features would
   then determine by its own calculation that there was still 1 ms before the
   timeout really occurs.  It would then proceed, and since the bridge broke
   out and did *not* return a frame, it interpreted this as the call was over
   and hung up the channels.

   The reason for this was because ast_bridge_call in res_features and
   ast_channel_bridge in channel.c were using different times for their
   calculations.  channel.c uses the start_time on the bridge config, which
   is the time that the feature digit was recieved.  However, res_features
   had another time, 'start', which was set right before calling 
   ast_channel_bridge.  'start' will always be slightly after start_time in the
   bridge config, and sometimes enough to round up to one ms.

   This is fixed by making ast_bridge_call use the same time as 
   ast_channel_bridge for the timeout calculation.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-27 16:55:49 +00:00
Christian Richter
cf7b068f58 removed the chan_misdn versioning, since asterisk has it's own
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-27 16:24:51 +00:00
Joshua Colp
8459e9a7ac Make rfc2833compensate a global option.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-27 16:23:12 +00:00
Russell Bryant
86c80784e0 Backport revision 43754 from the trunk, which removes an unused buffer from
mm_login to close bug 8038, as well as addresses some formatting and coding
guidelines issues in passing.

Originally, I did not commit this to 1.4 since it is not necessarily fixing a
bug.  However, since the IMAP storage code is brand new, I decided it would
be better to make the change here as well, in case someone has to work on this
code to address issues in the very near future.  I don't want to make
unnecessary merge problems going to the trunk.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43756 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-27 04:35:18 +00:00
Steve Murphy
740233659f This change to extensions.ael was to fix bug 8031; the install scripts are causing it to be copied to /etc/asterisk/extensions.ael, and because it is a fairly direct conversion of the original extensions.conf, the macro and context names clash with the existing extensions.conf. So, I put an ael- in front of all macros and contexts, and checked every goto and macro call. Also, this file compiles under aelparse.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43739 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-27 02:32:47 +00:00
Russell Bryant
8857675a88 (This was actually BE-65)
Merged revisions 43708 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43708 | russell | 2006-09-26 16:49:21 -0400 (Tue, 26 Sep 2006) | 7 lines

Back in revision 4798, this message was changed from using ast_cli() to directly
calling write().  During this change, checking if this was a remote console was
removed.  This caused this message about using "exit" or "quit" to exit an
Asterisk console to come up in times where it did not make sense.  This change
restores the check to see if this is a remote console before printing the
message.  (fixes BE-4)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43710 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-26 20:56:42 +00:00
Joshua Colp
2862b777fe Merged revisions 43705 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43705 | file | 2006-09-26 16:38:06 -0400 (Tue, 26 Sep 2006) | 2 lines

Use proper type to represent the group variable (issue #8025 reported by makoto)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-26 20:47:26 +00:00
Russell Bryant
6a4c92a630 Add missing newline character in the warning message about deprecated TOS values
in configuration.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43703 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-26 20:30:36 +00:00
Russell Bryant
6cb2b9fedb Merged revisions 43699 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43699 | russell | 2006-09-26 16:23:15 -0400 (Tue, 26 Sep 2006) | 6 lines

When parsing the sections of voicemail.conf that contain mailbox definitions,
don't introduce a length limit on the definition by using a 256 byte temporary
storage buffer.  Instead, make the temporary buffer just as big as it needs
to be to hold the entire mailbox definition.
(fixes BE-68)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43700 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-26 20:24:39 +00:00
Joshua Colp
6dc8b23feb Strip options off the argument passed for devicestate in chan_local. (issue #8034 reported by pcardozo)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43697 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-26 20:19:33 +00:00
Joshua Colp
d95288fdf8 Slight overhaul of the whisper support. 1. We need to duplicate the frame from ast_translate 2. We need to ensure we always have signed linear coming in for signed linear combining. 3. We need to ensure we are always feeding signed linear out. 4. Properly store and restore write format when beeping on the channel we are whispering on. 5. Properly discontinue the stream on the channel for the beep. (issue #8019 reported by timkelly1980)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43695 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-26 20:09:41 +00:00
Kevin P. Fleming
07e5f6c4b5 update to use 1.4.3 core sounds, with corrected beep/beeperr/tt-monkeys files
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-26 18:34:27 +00:00
Jason Parker
49e903f56d Issue #8015, patch by Dan Austin.
Maximum values were incorrect, which is why this is being put in 1.4


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-26 18:08:51 +00:00
Jason Parker
955cb53b6b Add proper codec support to chan_skinny. Works with at least ulaw, alaw, and g729a.
This is technically a "new feature", but there are justifications for it.

I found a bug with the recent rtp packetization changes, which caused the media setup to
fail under certain circumstances, particularly when using allow=all, or having no allow=
statements (globally or on the device).

I could have either removed the rtp packetization features, or I could add proper codec
support (which, without, I think most people would consider to be a bug anyways).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43650 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-26 15:33:47 +00:00
Tilghman Lesher
314d85326e Should have moved these lines up in the merge, instead of removing them
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43642 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-25 22:07:44 +00:00
Tilghman Lesher
84f8e88490 Merged revisions 43634 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43634 | tilghman | 2006-09-25 16:14:41 -0500 (Mon, 25 Sep 2006) | 4 lines

Two bugs when forwarding voicemail (Issue 7824):
1) delete=yes was ignored
2) maxmessages was ignored

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-25 22:04:47 +00:00
Paul Cadach
f1018ee8bb Fix ASN1 description of non-standard Cisco extensions
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-25 21:26:12 +00:00
Paul Cadach
b2b256eeef Backport changes of trunk:
1) r43540: Avoid possible deadlock on channel destruction
2) r43590: Disable fastStart if requested by remote side


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-25 20:28:21 +00:00
Jason Parker
4238648bb6 One more fix for sounds installation - this time for portability.
Reported to asterisk-dev mailing list.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-25 15:23:31 +00:00
Steve Murphy
12ed099f07 This tiny fix prevents asterisk from crashing if trying to play an OGG moh file.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-25 14:52:28 +00:00
Paul Cadach
4b81fe1d28 Merged revisions 43472,43495 from trunk
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-25 06:15:24 +00:00
Russell Bryant
4a8a46a162 Fix a CLI command registration issue where an erroneous message claiming that
"iax2 show provisioning" was already registered.  This was because this command
was registering itself as both the command, as well as the command it is
deprecating.  (issue #8022, reported by bjweeks, fixed by myself)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43564 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-24 14:58:10 +00:00
Russell Bryant
c259876748 Merged revisions 43552 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43552 | russell | 2006-09-24 09:50:30 -0400 (Sun, 24 Sep 2006) | 4 lines

Check to see if the channel that is activating the IAXPEER function is actually
an IAX2 channel before proceeding to process it to avoid crashing.
(issue #8017, reported by admott, fixed by myself)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-24 13:53:35 +00:00
Kevin P. Fleming
6a27cee242 don't output the 'build complete' message when the target being run is already going to do an installation
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-22 23:44:47 +00:00
Jason Parker
e2365e0f0f Allow chan_skinny.so to be unloaded properly.
Remove reload support, since it doesn't actually...work.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43518 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-22 22:12:12 +00:00
Joshua Colp
2d6134db9c Blocked revisions 43509 via svnmerge
........
r43509 | file | 2006-09-22 17:53:51 -0400 (Fri, 22 Sep 2006) | 2 lines

Yay another 'round of spy fixes! This fixes a small logic flaw with the cleanup function and a memory allocation issue. (issue #7960 reported by jojo & issue #7999 reported by aster1) Special thanks to csum77 for letting me into a box where this issue was happening.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43510 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-22 21:59:50 +00:00
Steve Murphy
73b0ed54b9 This commits a change to return MODULE_LOAD_FAILURE on error, and SUCCESS (instead of 0) when all goes well for bug 8004
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-22 21:36:10 +00:00
Steve Murphy
3836bbd557 If the extensions.ael file not found, or unreadable, we return AST_MODULE_LOAD_DECLINE,
as per bug # 8004.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-22 21:08:36 +00:00
Jason Parker
408d4b978f Make sure we explicitly set the CLI command to not be deprecated, if it isn't.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43492 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-22 17:25:05 +00:00
Kevin P. Fleming
b84f7b0518 use rebuilt extra sounds
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-22 16:42:46 +00:00
Kevin P. Fleming
53ff7ae7cd all the Linux systems I have don't use '__m_count' for this field, so I don't know where this came from...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43486 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-22 15:51:13 +00:00
Russell Bryant
eb89724010 backport the compatability fix to use attribute_malloc instaed of
__attribute__ ((malloc))


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-22 15:47:14 +00:00
Russell Bryant
0b2dcac484 return AST_MODULE_LOAD_DECLIDE if mISDN could not be configured
(issue #8006, Mithraen)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43482 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-22 15:42:44 +00:00
Russell Bryant
33acd61f53 Suppress a compiler warning about the use of a potentially uninitialized
variable.  It couldn't actually happen, though.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-22 14:02:58 +00:00
Jason Parker
d940da0acf First shot at unload_module in chan_skinny..
More to come.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-22 03:01:16 +00:00
Matt O'Gorman
ff11e64e67 updates for better compontent support
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-21 23:50:56 +00:00
Tilghman Lesher
5ac0ca6af1 Twould help if we actually documented how the new features in res_odbc actually work. (Oops)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43464 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-21 23:24:41 +00:00
Joshua Colp
928c5f7bbc Some more clean up in the load function for chan_oss (issue #8002 reported by Mithraen with minor mods by moi)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43456 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-21 22:21:40 +00:00
Joshua Colp
e02f0bda8f Clean up chan_mgcp's module load function (issue #8001 reported by Mithraen with mods by moi)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43454 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-21 22:12:09 +00:00
Kevin P. Fleming
16a2f6e64f add another attempt to strip non-API symbols from the final binary... script will need to be extended to work on non-Linux systems
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-21 21:21:29 +00:00
Tilghman Lesher
f0fdf0acf9 Fix documentation to reflect how Url() really works
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-21 20:22:43 +00:00
Tilghman Lesher
c708dee67a Oops, missed the merge breakage
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43441 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-21 19:43:32 +00:00
Tilghman Lesher
b5902caa79 Merged revisions 43420 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43420 | tilghman | 2006-09-21 12:01:48 -0500 (Thu, 21 Sep 2006) | 2 lines

Whitespace change... really just an excuse to test repotools

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-21 17:04:40 +00:00
Tilghman Lesher
b727a4bde3 Merged revisions 43409 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43409 | tilghman | 2006-09-21 11:18:19 -0500 (Thu, 21 Sep 2006) | 2 lines

TDS 0.64 updates

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-21 16:31:59 +00:00
Kevin P. Fleming
44983fae40 remove this change... it requires binutils 2.17
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-21 16:08:03 +00:00
Kevin P. Fleming
05b0e38f98 remove extraneous property
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-21 16:02:30 +00:00
Jason Parker
1ec9e85709 fix minor typo in the way version is handled
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43396 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-20 23:19:25 +00:00
Kevin P. Fleming
9cf9c1373b merge down mark's users.conf fixes
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-20 23:01:50 +00:00
Kevin P. Fleming
1a68406874 make the sounds Makefile actually work again
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43388 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-20 22:54:55 +00:00
Jason Parker
0a0df5e171 Go back to the old(ish) way of installing sound files.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-20 22:27:54 +00:00
Russell Bryant
97502fdec0 Fix the total allocation count and total byte count in the memory summary
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43383 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-20 22:13:16 +00:00
Kevin P. Fleming
31a04cf56e it's time :-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@43376 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-20 21:46:52 +00:00
677 changed files with 122340 additions and 64353 deletions

View File

@@ -1 +1 @@
24
33

1
.lastclean Normal file
View File

@@ -0,0 +1 @@
33

1
.version Normal file
View File

@@ -0,0 +1 @@
1.4.26.2

4
BUGS
View File

@@ -7,10 +7,10 @@ the official Asterisk Bug Tracker at:
http://bugs.digium.com
For more information on using the bug tracker, or to
learn how you can contribute by acting as a bug marshall
learn how you can contribute by acting as a bug marshal
please see:
http://www.digium.com/index.php?menu=bugguidelines
http://www.asterisk.org/developers/bug-guidelines
If you would like to submit a feature request, please
resist the temptation to post it to the bug tracker.

499
CHANGES
View File

@@ -1,127 +1,374 @@
Changes since Asterisk 1.2.0-beta2:
Changes since Asterisk 1.2:
* Cygwin build system portability
* Optional generation of outbound silence during channel recording
Changes since Asterisk 1.2.0-beta1:
* Many, many bug fixes
* Documentation and sample configuration updates
* Vastly improved presence/subscription support in the SIP channel driver
* A new (experimental) mISDN channel driver
* A new monitoring application (MixMonitor)
* More portability fixes for non-Linux platforms
* New dialplan functions replacing old applications
* Significant deadlock and performance upgrades for the Manager interface
* An upgrade to the 'new' dialplan expression parser for all users
* New Zaptel echo cancellers with improved performance
* Support for the latest OSP toolkit from TransNexus
* Support user-controlled volume adjustment in MeetMe application
* More dialplan applications now return status variables instead of priority jumping
* Much more powerful ENUM support in the dialplan
* SIP domain support for authentication and virtual hosting
* Many PRI protocol updates and fixes, including more complete Q.SIG support
* New applications: Pickup() and Page()
Changes since Asterisk 1.0:
This list currently only containts changes made from the end of November until
March 26, 2005.
* Add new applications:
-- AgentMonitorOutgoing
-- Curl
-- ExecIf
-- ExecIfTime
-- IAX2Provision
-- MacroExit
-- MacroIf
-- PauseQueueMember
-- ReadFile
-- SetRDNIS
-- SIPAddHeader
-- SIPGetHeader
-- StartMusicOnHold
-- StopMusicOnHold
-- UnpauseQueueMember
-- WaitForSilence
-- While / EndWhile
* app Answer
-- added delay option
* app ChanIsAvail
-- added 's' option
* app Dial
-- add option to specify the class for musiconhold with m option
* app EnumLookup
-- added "reload enum" for configuration
* app Goto
-- added relative priorities
* app GotoIf
-- added relative priorities
* app MeetMe
-- added 'i' option
-- added 'r' option
-- added 'T' option
-- added 'P' option
-- added 'c' option
-- added adminpin to meetme.conf
-- added reload command
* app PrivacyManager
-- add config file privacy.conf
* app queue
-- queues.conf
-- added persistentmembers option to queues.conf
-- changed music option to musiconhold
-- added weight option
-- added note about why agent groups probably shouldn't be used
-- added timeoutrestart option
* app Read
-- added attempts parameter
-- added timeout parameter
* app Record
-- added 'q' option
* app SendDTMF
-- add timeout option
* app SMS
-- document alternative syntax for queueing messages
* app Voicemail
-- add info about VM_CATEGORY
-- voicemail.conf
-- added usedirectory option
-- added VM_CIDNUM and VM_CIDNAME in message config
* chan IAX2
-- new jitterbuffer
-- added setvar option
-- added regex to iax2 show peers/users
-- allow multiple bindaddr lines in iax.conf
-- added reload command
-- added forcejitterbuffer option
-- added note about specifying bindport before bindaddr
-- added trunktimestamps option
* chan Agent
-- added agent logoff CLI command
* chan OSS
-- added Flash CLI command
* chan SIP
-- added setvar option
-- added compactheaders option
-- added usereqphone option
-- added registertimeout option
-- added externhost option
-- added sip notify CLI command
-- added sip_notify.conf
-- added allowguest option
* chan Zap
-- added hanguponplarityswitch option
-- added sendcalleridafter option
-- added priresetinterval option
-- added TON/NPI config options (the ones right above the resetinterval option)
-- added answeronpolarityswitch option
-- added "never" for resetinterval
* extensions
-- allow '*' when including files (#include "sip-*.conf")
-- added eswitch
* General
-- added #exec syntax for including output from a command
-- added show features CLI command
-- added configuration templates for category inheritance
* over 4,000 commits since 1.2
* queue member naming
* CLI commands rework
o Change the way CLI commands are structured.
o Most commands are now <module> <verb> <args>
* chan_h323 update
* RTP packetization
* SLA (Shared Line Appearance) support
* T.38 Passthrough Support for faxing in SIP
* Generic channel jitterbuffer (spawned from RTP)
* Variable Length DTMF for better DTMF compatibility
* Improved chan_iax2 scalability by using multithreading
* AEL2 has replaced the original implementation of AEL. The "2" is removed. For more details,
read: http://www.voip-info.org/wiki/view/Asterisk+AEL2
AEL is no longer considered experimental.
* New sounds; English, Spanish, and French prompts, as well as music on hold files, in
multiple Asterisk native formats.
* IMAP storage of voicemail
* Jabber/GoogleTalk integration
* New speech recognition API for interfacing to different Voice Recognition software packages
* much more customizable and portable build system
o also for asterisk-addons
* Radius CDR logging
* SNMP support
* SMDI (Simplified Message Desk Interface) support
* Redesign of MusicOnHold configuration settings
* Manager over HTTP
* Significant chan_skinny updates
* Significant chan_misdn updates
* Improved SIP transfers
* SIP MWI subscription support
* Much improved support for SIP video
* Control over SIP transfers and subscriptions (enable/disable per device)
* ChanSpy whisper mode (Whisper Paging)
* Configurable language support for saying dates and times
* Significant architecture improvements for memory usage and performance
* Media-only IAX2 transfers
* Updates to the Radio Repeater app code
* Deprecation of AgentCallbackLogin in favor of a dialplan-based solution
* uClibc builds supported
* Work done for freeBSD portability
* Work done for Solaris portability
* FreeTDS-based database can be used with Realtime
* New internal data structure, stringfields, is implemented in IAX and SIP, reducing memory consumption by about 50%.
* Use of thread local storage for reduced memory allocation/freeing and lower stack consumption
* Reorganized files into docs/ main/ configs/, including name changes in some cases
* Much effort was expended in arranging documentation in source files in doxygen format
* Improved IP TOS support for IAX and SIP
* Builtin mini HTTP server
* Added support for Sigma Designs cards.
* Frame header caching to reduce memory allocation/freeing
* Passthrough and record/playback support for G.722 wideband audio
* using mpg123 to play MP3 files for music-on-hold will be deprecated in 1.4 (start using the "native support")
* New Apps:
1. AMD() ;; Answering Machine Detection
2. ChannelRedirect() ;; asynch goto, redirect chan to context/exten/priority
3. ContinueWhile() ;; Addition to the While() suite. Acts like "continue".
4. ExitWhile() ;; Addition to the While() suite. Acts like "break".
5. ExtenSpy() ;; A close cousin to ChanSpy().
6. FollowMe() ;; findme/followme call redirect app
7. Log() ;; Send a message to the log, based on severity level.
8. MacroExclusive() ;; No more than one invocation of this macro allowed at any one time.
9. MorseCode() ;; turns strings into dits and dahs. A playground for ham radio licensees!
10. OSPAuth() ;; OSP authentication
11. QueueLog() ;; allows you to write your own events into the queue log
12. SLAStation() ;; Shared Line Appearance
13. SLATrunk() ;; Shared Line Appearance
14. SpeechCreate() ;; Voice Recognition Engine interface...
15. SpeechActivateGrammar()
16. SpeechStart()
17. SpeechBackground
18. SpeechDeactivateGrammar()
19. SpeechProcessingSound()
20. SpeechDestroy()
21. SpeechLoadGrammar()
22. SpeechUnloadGrammar()
23. StopMixMonitor() ;; to stop the MixMonitor App.
24. TryExec() ;; execute dialplan app without fatal consequences
* Apps removed:
1. CheckGroup -- do a comparison to ${GROUP()}
2. Curl -- use the function CURL() instead
3. Cut -- use the function CUT() instead
4. DateTime -- use sayunixtime() app instead.
5. DBget -- deprecated in 1.2, now removed.
6. DBput -- deprecated in 1.2, now removed.
7. Enumlookup -- use the function ENUMLOOKUP() instead
8. Eval -- use the function EVAL() instead
9. GetGroupCount -- use the function GROUP_COUNT() instead
10. GetGroupMatchCount -- use the function GROUP_MATCH_COUNT() instead
11. Intercom -- use the chan_oss module instead
12. Math -- use the function MATH() instead
13. MD5 -- use the function MD5() instead
14. SetCIDname -- use the function CALLERID(name) instead
15. SetCIDnum -- use the function CALLERID(number) instead
16. SetGroup -- use Set(GROUP=group) instead
17. SetRDNIS -- use the function CALLERID(rdnis) instead
18. Sql_postgres -- was deprecated in 1.2, now removed
19. Txtcidname -- use the function TXTCIDNAME instead
* New Dialplan Functions:
1. ARRAY()
2. BASE_64_DECODE()
3. BASE_64_ENCODE()
4. CHANNEL()
5. CURL()
6. CUT()
7. DB_DELETE()
8. FILTER()
9. GLOBAL()
10. IFTIME()
11. KEYPADHASH()
12. ODBC()
13. QUOTE()
14. RAND()
15. REALTIME()
16. SHA1()
17. SORT()
18. SPRINTF()
19. SQL_ESC()
20. STAT()
21. STRPTIME()
22. AUDIOHOOK_INHERIT()
* Apps that have changes to their interface:
1. Authenticate() -- optional maxdigits argument added.
2. ChanSpy() -- new options:
o w -- Enable 'whisper' mode, so the spying channel can talk to...
o W -- Enable 'private whisper' mode, so the spying channel can...
3. DBdel() -- now marked as DEPRECATED in favor of the DB_DELETE func
4. Dial()
o New Option: O([x]) for Zaptel operator mode
o New Option: K/k parking via dtmf tones
5. Dictate() -- optional filename argument added.
6. Directory() -- new option: e - In addition to the name, also read the extension number...
7. ForkCDR() -- new options:
o 'a' -- update answer time on new cdr
o 'A' -- Lock the orig CDR answer time against changes.
o 'D' -- Copy the disposition from the orig to the new CDR.
o 'd' -- clear the dstcannel field in the new CDR.
o 'e' -- set the end time of the original CDR.
o 'R' -- do NOT reset the new CDR.
o 's' -- Add/change var in orig CDR.
o 'T' -- Force ast_cdr_end, answer to obey LOCKED flag for the orig. CDR.
-- ast_cdr_setvar will be forced also (used by the CDR() func in write mode)
8. Meetme() -- new options:
o 'I' -- announce user join/leave without review
o 'l' -- set listen only mode (Listen only, no talking)
o 'o' -- set talker optimization - treats talkers who aren't speaking as...
o '1' -- do not play message when first person enters
9. MeetmeAdmin() -- new options:
o 'r' -- Reset one user's volume settings
o 'R' -- Reset all users volume settings
o 's' -- Lower entire conference speaking volume
o 'S' -- Raise entire conference speaking volume
o 't' -- Lower one user's talk volume
o 'T' -- Lower all users talk volume
o 'u' -- Lower one user's listen volume
o 'U' -- Lower all users listen volume
o 'v' -- Lower entire conference listening volume
o 'V' -- Raise entire conference listening volume
10. OSPFinish() : now also can return ERROR result.
11. OSPLookup() : Sets more variables, also now returns ERROR result.
12. Page() -- New option: r - record the page into a file (see 'r' for app_meetme)
13. Pickup() -- multiple extensions, PICKUPMARK; read the description!
14. Queue()
o New Argument: AGI
o New option: i
15. Random() -- is now deprecated in 1.4
16. Read() -- replace 'skip' and 'noanswer' options with 's', 'n', add 'i' option.
17. Record() -- New option: 'x' : ignore all terminator keys (DTMF) and keep recording until hangup
18. UserEvent() -- slight change in behavior. Read the description.
19. VoiceMailMain() -- new a(#) option, goes to folder # directly.
20. WaitForSilence() -- new optional 3rd arg, time delay before returning.
* Functions that have changes to their interfaces:
1. CDR -- new options: u and s
2. LANGUAGE -- Deprecated. Use CHANNEL(language) instead.
3. MUSICCLASS -- Deprecated. Use CHANNEL(musicclass) instead.
* Configuration File Changes:
1. NEW config files:
1. amd.conf -- Answering Machine Detection parameters
2. followme.conf -- parameters for the findme/followme call forwarding
3. func_odbc.conf -- define sql access functions here
4. gtalk.conf -- how to handle gtalk protocol calls
5. h323.conf -- h323 configuration
6. http.conf -- config for the builtin mini-http server in asterisk
7. jabber.conf -- jabber interface
8. jingle.conf -- jingle protocol interface config
10. res_snmp.conf -- to enable snmp in asterisk, and define full/sub agent status
11. say.conf -- define per-language rules for numbers, dates, etc.
12. skinny.conf -- for those special skinny phones you want to use...
13. sla.conf -- Shared Line Appearance config
14. smdi.conf -- SMDI messaging config
15. udptl.conf -- T38's udptl transport config
16. users.conf -- user config
2. Changes to Existing Config files:
1. In General:
o Jitterbuffer support added to several channels. Usually adds these variables to a config file:
1. jbenable
2. jbmaxsize
3. jbresyncthreshold
4. jbimpl
5. jblog
o MusicOnHold upgrade introduces two new variables:
1. mohinterpret
2. mohsuggest
2. agents.conf
o multiplelogin variable added
o maxlogintries variable added
o autologoffunavail variable added
o endcall variable added
o goodbye variable added
o createlink variable REMOVED
3. alsa.conf
o mohinterpret variable added
o Jitterbuffer variables added
4. cdr.conf
o endbeforehexten variable added
o sections for csv and radius added, with variables usegmtime, loguniqueid,
loguserfield, and radiuscfg variables.
5. cdr_tds.conf
o table variable added
6. extensions.ael
o Many upgrades. See the info at http://www.voip-info.org/wiki/view/Asterisk+AEL2
7. extensions.conf
o autofallthru now set to "yes" by default
o userscontext variable added
o added info/examples on paging and hints.
8. features.conf
o parkedplay variable added (who to beep at)
o parkedmusicclass
o atxfernoanswertimeout variable added
o parkcall variable added (one step parking)
o improved documentation for dynamic feature declarations!
o added parkedcallltransfers option to control builtin transfers with parking
o added parkedcallparking option to control one touch parking w/ parking pickup
o added parkedcallhangup option to control disconnect feature w/ parking pickup
o added parkedcallrecording option to control one-touch record w/ parking pickup
o added BRIDGE_FEATURES variable to set available features for a channel
9. iax.conf
o adsi variable added
o mohinterpret variable added
o mohsuggest variable added
o jitterbuffer updates
o iaxthreadcount variable added
o iaxmaxthreadcount variable added
o the way to specify TOS has changed.
o mailboxdetail variable has been REMOVED.
10. indications.conf
o [bg] entry added (Bulgaria).
o [il] entry added (Israel)
o [in] entry added (India)
o [jp] entry added (Japan)
o [my] entry added (Malaysia)
o [th] entry added (Thailand)
11. manager.conf
o webenabled variable added
o httptimeout variable added
o timestampevents variable added
12. mgcp.conf
o Jitterbuffer support added
13. misdn.conf
o l1watcher_timeout variable added
o pp_l2_check variable added
o echocancelwhenbridged variable added
o echotraining variable added
o max_incoming variable added
o max_outgoing variable added
14. modules.conf
o a comment for preloading res_speech.so is added
o mention of global symbols is removed
o obsolesced entries for chan_modem_* and app_intercom have been removed
15. musiconhold.conf
o the default is now to do native moh from /var/lib/asterisk/moh
16. osp.conf
o authpolicy variable added
17. oss.conf
o debug variable added
o device variable added
o mixer variable added
o boost variable added
o callerid variable added
o autohangup variable added
o queuesize variable added
o frags variable added
o JitterBuffer support
o sections to define alternate sound cards
18. queues.conf
o autofill variable added
o monitor-type variable added
o musiconhold is now musicclass, with a difference in interpretation
o autofill variable added
o autopause variable added
o setinterfacevar variable added
o ringinuse variable added
19. res_odbc.conf
o pooling variable added
20. rpt.conf
o duplex variable added
o tailmessagetime variable added
o tailsquashedtime variable added
o tailmessages variable added
21. rtp.conf
o rtcpinterval varaible added
22. sip.conf
o allowguest variable can't be set to 'osp'
o allowoverlap variable added
o allowtransfer variable added
o limitonpeer variable added
o directrtpsetup variable added
o buggymwi variable added
o ospauth variable REMOVED
o notifyhold variable added
o autoframing variable added
o tos variable REMOVED
o tos_sip variable added
o tos_audio variable added
o tos_video variable added
o minexpiry variable added
o t1min variable added
o musicclass variable REMOVED
o mohinterpret variable added
o mohsuggest variable added
o allowsubscribe variable added
o videosupport variable added
o maxcallbitrate variable added
o g726nonstandard variable added
o dumphistory variable added
o t38pt_udptl variable added
o t38pt_rtp variable added
o t38pt_tcp variable added
o rfc2833compensate variable added
o matchexterniplocally variable added
o canreinvite variable can also now be set to 'nonat'
o rtsavesysname variable added
o JitterBuffer support added
o t38pt_usertpsource variable added
o regcontext variable can contains multiple contexts separated by an '&'
23. skinny.conf
o port variable renamed to bindport
o JitterBuffer support added
o model variable REMOVED
o mohinterpret variable added
o mohsuggest variable added
o speeddial variable added
o addon variable added
24. voicemail.conf
o userscontext variable added
o smdiport variable added
o attachfmt variable added
o volgain variable added
o tempgreetwarn variable added
25. zapata.conf
o pritimer variable has improved documentation
o New signalling method: fgccama
o New signalling method: fgccamamf
o outsignalling variable added
o distinctiveringaftercid variable added
o cidsignalling now also accepts v23_jp, and smdi
o usesmdi variable added
o smdiport variable added
o mohinterpret variable added
o mohsuggest variable added
o JitterBuffer support added
* Removed Codecs/Channels:
1. codec_g723 was removed because the actual codec implementation it was designed to use is not distributable
2. chan_modem_* and related modules are gone because the kernel support for those interfaces is old, buggy and unsupported
* New Utils:
1. aelparse -- compile .ael files outside of asterisk
* New manager events:
1. OriginateResponse event comes to replace OriginateSuccess and OriginateFailure
* iLBC source code no longer included (see UPGRADE.txt for details)
* New CLI command "pri show version" that shows the current version of libpri
that the library was built against (requires a version of libpri since this API
feature was added).

View File

@@ -131,7 +131,7 @@ Slav Klenov & Vanheuverzwijn Joachim - development of the generic jitterbuffer
Roy Sigurd Karlsbakk - providing funding for generic jitterbuffer development
roy@karlsbakk.net, Briiz Telecom AS
Voop A/S, Nuvio Inc and Foniris Telecom A/S - funding for rewrite of SIP transfers
Voop A/S, Nuvio Inc, Inotel S.A and Foniris Telecom A/S - funding for rewrite of SIP transfers
Philippe Sultan - RADIUS CDR module
INRIA, http://www.inria.fr/

25269
ChangeLog Normal file

File diff suppressed because it is too large Load Diff

23
LICENSE
View File

@@ -5,6 +5,18 @@ applies to all loadable Asterisk modules used on your system as well,
except as defined below. The GPL (version 2) is included in this
source tree in the file COPYING.
This package also includes various components that are not part of
Asterisk itself; these components are in the 'contrib' directory
and its subdirectories. Most of these components are also
distributed under the GPL version 2 as well, except for the following:
contrib/firmware/iax/iaxy.bin:
This file is Copyright (C) Digium, Inc. and is licensed for
use with Digium IAXy hardware devices only. It can be
distributed freely as long as the distribution is in the
original form present in this package (not reformatted or
modified).
Digium, Inc. (formerly Linux Support Services) holds copyright
and/or sufficient licenses to all components of the Asterisk
package, and therefore can grant, at its sole discretion, the ability
@@ -19,8 +31,8 @@ there is no requirement that you provide the same exception in your
GPL'd products (although if you've written a module for Asterisk we
would strongly encourage you to make the same exception that we do).
Specific permission is also granted to link Asterisk with OpenSSL and
OpenH323.
Specific permission is also granted to link Asterisk with OpenSSL, OpenH323
and/or the UW IMAP Toolkit and distribute the resulting binary files.
In addition, Asterisk implements two management/control protocols: the
Asterisk Manager Interface (AMI) and the Asterisk Gateway Interface
@@ -44,14 +56,13 @@ http://www.digium.com/en/company/profile/trademarkpolicy.php
If you have any questions regarding our licensing policy, please
contact us:
+1.877.546.8963 (via telephone in the USA)
+1.877.344.4861 (via telephone in the USA)
+1.256.428.6000 (via telephone outside the USA)
+1.256.864.0464 (via FAX inside or outside the USA)
IAX2/misery.digium.com/6000 (via IAX2)
IAX2/pbx.digium.com (via IAX2)
licensing@digium.com (via email)
Digium, Inc.
150 West Park Loop
Suite 100
445 Jan Davis Drive
Huntsville, AL 35806
USA

329
Makefile
View File

@@ -13,14 +13,61 @@
# All Makefiles use the following variables:
#
# LDFLAGS - linker flags (not libraries), used for all links
# ASTCFLAGS - compiler options
# ASTLDFLAGS - linker flags (not libraries)
# AST_LIBS - libraries to build binaries XXX
# LIBS - additional libraries, at top-level for all links,
# on a single object just for that object
# SOLINK - linker flags used only for creating shared objects (.so files),
# used for all .so links
#
# Default values fo ASTCFLAGS and ASTLDFLAGS can be specified in the
# environment when running make, as follows:
#
# $ ASTCFLAGS="-Werror" make
.EXPORT_ALL_VARIABLES:
export ASTTOPDIR
export ASTERISKVERSION
export ASTERISKVERSIONNUM
export INSTALL_PATH
export ASTETCDIR
export ASTVARRUNDIR
export MODULES_DIR
export ASTSPOOLDIR
export ASTVARLIBDIR
export ASTDATADIR
export ASTLOGDIR
export ASTLIBDIR
export ASTMANDIR
export ASTHEADERDIR
export ASTBINDIR
export ASTSBINDIR
export AGI_DIR
export ASTCONFPATH
export NOISY_BUILD
export MENUSELECT_CFLAGS
export CC
export CXX
export AR
export RANLIB
export HOST_CC
export STATIC_BUILD
export INSTALL
export DESTDIR
export PROC
export SOLINK
export STRIP
export DOWNLOAD
export AWK
export GREP
export ID
export OSARCH
export CURSES_DIR
export NCURSES_DIR
export TERMCAP_DIR
export TINFO_DIR
export GTK2_LIB
export GTK2_INCLUDE
# even though we could use '-include makeopts' here, use a wildcard
# lookup anyway, so that make won't try to build makeopts if it doesn't
@@ -29,13 +76,20 @@ ifneq ($(wildcard makeopts),)
include makeopts
endif
# Some build systems, such as the one in openwrt, like to pass custom target
# CFLAGS and LDFLAGS in the COPTS and LDOPTS variables.
ASTCFLAGS+=$(COPTS)
ASTLDFLAGS+=$(LDOPTS)
#Uncomment this to see all build commands instead of 'quiet' output
#NOISY_BUILD=yes
# Create OPTIONS variable
OPTIONS=
ASTTOPDIR:=$(shell pwd)
empty:=
space:=$(empty) $(empty)
ASTTOPDIR:=$(subst $(space),\$(space),$(CURDIR))
# Overwite config files on "make samples"
OVERWRITE=y
@@ -73,13 +127,16 @@ else
ASTLOGDIR=$(localstatedir)/log/asterisk
ASTVARRUNDIR=$(localstatedir)/run
ASTMANDIR=$(mandir)
ifeq ($(OSARCH),FreeBSD)
ifneq ($(findstring BSD,$(OSARCH)),)
ASTVARLIBDIR=$(prefix)/share/asterisk
ASTVARRUNDIR=$(localstatedir)/run/asterisk
else
ASTVARLIBDIR=$(localstatedir)/lib/asterisk
endif
endif
ASTDATADIR?=$(ASTVARLIBDIR)
ifeq ($(ASTDATADIR),)
ASTDATADIR:=$(ASTVARLIBDIR)
endif
# Asterisk.conf is located in ASTETCDIR or by using the -C flag
# when starting Asterisk
@@ -92,8 +149,6 @@ HTTP_DOCSDIR=/var/www/html
# Determine by a grep 'ScriptAlias' of your Apache httpd.conf file
HTTP_CGIDIR=/var/www/cgi-bin
ASTCFLAGS=
# Uncomment this to use the older DSP routines
#ASTCFLAGS+=-DOLD_DSP_ROUTINES
@@ -106,8 +161,8 @@ ASTCFLAGS=
GLOBAL_MAKEOPTS=$(wildcard /etc/asterisk.makeopts)
USER_MAKEOPTS=$(wildcard ~/.asterisk.makeopts)
MOD_SUBDIR_CFLAGS=-I../include
OTHER_SUBDIR_CFLAGS=-I../include
MOD_SUBDIR_CFLAGS=-I$(ASTTOPDIR)/include
OTHER_SUBDIR_CFLAGS=-I$(ASTTOPDIR)/include
ifeq ($(OSARCH),linux-gnu)
ifeq ($(PROC),x86_64)
@@ -142,14 +197,26 @@ ifeq ($(OSARCH),linux-gnu)
endif
endif
ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
ifeq ($(findstring -save-temps,$(ASTCFLAGS)),)
ASTCFLAGS+=-pipe
endif
ASTCFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
ifeq ($(AST_DEVMODE),yes)
ASTCFLAGS+=-Werror -Wunused
ASTCFLAGS+=-Werror
ASTCFLAGS+=-Wunused
ASTCFLAGS+=$(AST_DECLARATION_AFTER_STATEMENT)
ASTCFLAGS+=$(AST_FORTIFY_SOURCE)
# ASTCFLAGS+=-Wundef
ASTCFLAGS+=-Wformat -Wformat-security
ASTCFLAGS+=-Wmissing-format-attribute
# ASTCFLAGS+=-Wformat=2
endif
ifneq ($(findstring BSD,$(OSARCH)),)
ASTCFLAGS+=-I/usr/local/include -L/usr/local/lib
ASTCFLAGS+=-I/usr/local/include
ASTLDFLAGS+=-L/usr/local/lib
endif
ifneq ($(PROC),ultrasparc)
@@ -179,13 +246,10 @@ ifeq ($(OSARCH),SunOS)
ASTCFLAGS+=-Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include
endif
ASTERISKVERSION:=$(shell build_tools/make_version .)
ASTERISKVERSION:=$(shell GREP=$(GREP) AWK=$(AWK) build_tools/make_version .)
ifneq ($(wildcard .version),)
ASTERISKVERSIONNUM:=$(shell awk -F. '{printf "%02d%02d%02d", $$1, $$2, $$3}' .version)
RPMVERSION:=$(shell sed 's/[-\/:]/_/g' .version)
else
RPMVERSION=unknown
ASTERISKVERSIONNUM:=$(shell $(AWK) -F. '{printf "%01d%02d%02d", $$1, $$2, $$3}' .version)
endif
ifneq ($(wildcard .svn),)
@@ -199,14 +263,12 @@ OTHER_SUBDIRS:=utils agi
SUBDIRS:=$(OTHER_SUBDIRS) $(MOD_SUBDIRS)
SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
SUBDIRS_CLEAN:=$(SUBDIRS:%=%-clean)
SUBDIRS_CLEAN_DEPEND:=$(SUBDIRS:%=%-clean-depend)
MOD_SUBDIRS_DEPEND:=$(MOD_SUBDIRS:%=%-depend)
OTHER_SUBDIRS_DEPEND:=$(OTHER_SUBDIRS:%=%-depend)
SUBDIRS_DEPEND:=$(OTHER_SUBDIRS_DEPEND) $(MOD_SUBDIRS_DEPEND)
SUBDIRS_DIST_CLEAN:=$(SUBDIRS:%=%-dist-clean)
SUBDIRS_UNINSTALL:=$(SUBDIRS:%=%-uninstall)
MOD_SUBDIRS_EMBED_LDSCRIPT:=$(MOD_SUBDIRS:%=%-embed-ldscript)
MOD_SUBDIRS_EMBED_LDFLAGS:=$(MOD_SUBDIRS:%=%-embed-ldflags)
MOD_SUBDIRS_EMBED_LIBS:=$(MOD_SUBDIRS:%=%-embed-libs)
MOD_SUBDIRS_MENUSELECT_TREE:=$(MOD_SUBDIRS:%=%-menuselect-tree)
ifneq ($(findstring darwin,$(OSARCH)),)
ASTCFLAGS+=-D__Darwin__
@@ -214,16 +276,18 @@ ifneq ($(findstring darwin,$(OSARCH)),)
SOLINK=-dynamic -bundle -undefined suppress -force_flat_namespace
else
# These are used for all but Darwin
SOLINK=-shared -Xlinker -x
SOLINK=-shared
ifneq ($(findstring BSD,$(OSARCH)),)
LDFLAGS+=-L/usr/local/lib
endif
endif
ifeq ($(OSARCH),SunOS)
SOLINK=-shared -fpic -L/usr/local/ssl/lib
SOLINK=-shared -fpic -L/usr/local/ssl/lib -lrt
endif
SUBMAKE=$(MAKE) --quiet --no-print-directory
# This is used when generating the doxygen documentation
ifneq ($(DOT),:)
HAVEDOT=yes
@@ -231,31 +295,42 @@ else
HAVEDOT=no
endif
all: cleantest $(SUBDIRS)
all: _all
@echo " +--------- Asterisk Build Complete ---------+"
@echo " + Asterisk has successfully been built, and +"
@echo " + can be installed by running: +"
@echo " + +"
@echo " + make install +"
ifeq ($(MAKE), gmake)
@echo " + $(MAKE) install +"
else
@echo " + $(MAKE) install +"
endif
@echo " +-------------------------------------------+"
_all: cleantest $(SUBDIRS)
makeopts: configure
@echo "****"
@echo "**** The configure script must be executed before running 'make'."
@echo "**** The configure script must be executed before running '$(MAKE)'."
@echo "**** Please run \"./configure\"."
@echo "****"
@exit 1
menuselect.makeopts: menuselect/menuselect menuselect-tree
menuselect/menuselect --check-deps $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts
menuselect/menuselect --check-deps menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS)
$(MOD_SUBDIRS_EMBED_LDSCRIPT):
@echo "EMBED_LDSCRIPTS+="`$(MAKE) --quiet --no-print-directory -C $(@:-embed-ldscript=) SUBDIR=$(@:-embed-ldscript=) __embed_ldscript` >> makeopts.embed_rules
+@echo "EMBED_LDSCRIPTS+="`$(SUBMAKE) -C $(@:-embed-ldscript=) SUBDIR=$(@:-embed-ldscript=) __embed_ldscript` >> makeopts.embed_rules
$(MOD_SUBDIRS_EMBED_LDFLAGS):
@echo "EMBED_LDFLAGS+="`$(MAKE) --quiet --no-print-directory -C $(@:-embed-ldflags=) SUBDIR=$(@:-embed-ldflags=) __embed_ldflags` >> makeopts.embed_rules
+@echo "EMBED_LDFLAGS+="`$(SUBMAKE) -C $(@:-embed-ldflags=) SUBDIR=$(@:-embed-ldflags=) __embed_ldflags` >> makeopts.embed_rules
$(MOD_SUBDIRS_EMBED_LIBS):
@echo "EMBED_LIBS+="`$(MAKE) --quiet --no-print-directory -C $(@:-embed-libs=) SUBDIR=$(@:-embed-libs=) __embed_libs` >> makeopts.embed_rules
+@echo "EMBED_LIBS+="`$(SUBMAKE) -C $(@:-embed-libs=) SUBDIR=$(@:-embed-libs=) __embed_libs` >> makeopts.embed_rules
$(MOD_SUBDIRS_MENUSELECT_TREE):
@$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) moduleinfo
@$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) makeopts
makeopts.embed_rules: menuselect.makeopts
@echo "Generating embedded module rules ..."
@@ -264,7 +339,7 @@ makeopts.embed_rules: menuselect.makeopts
@$(MAKE) --no-print-directory $(MOD_SUBDIRS_EMBED_LDFLAGS)
@$(MAKE) --no-print-directory $(MOD_SUBDIRS_EMBED_LIBS)
$(SUBDIRS): depend makeopts.embed_rules
$(SUBDIRS): include/asterisk/version.h include/asterisk/buildopts.h defaults.h makeopts.embed_rules
# ensure that all module subdirectories are processed before 'main' during
# a parallel build, since if there are modules selected to be embedded the
@@ -273,10 +348,10 @@ $(SUBDIRS): depend makeopts.embed_rules
main: $(filter-out main,$(MOD_SUBDIRS))
$(MOD_SUBDIRS):
@CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $@ SUBDIR=$@ all
@ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" AST_LIBS="$(AST_LIBS)" $(MAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
$(OTHER_SUBDIRS):
@CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $@ SUBDIR=$@ all
@ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" AUDIO_LIBS="$(AUDIO_LIBS)" $(MAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
defaults.h: makeopts
@build_tools/make_defaults_h > $@.tmp
@@ -285,7 +360,7 @@ defaults.h: makeopts
fi
@rm -f $@.tmp
include/asterisk/version.h:
include/asterisk/version.h: FORCE
@build_tools/make_version_h > $@.tmp
@if cmp -s $@.tmp $@ ; then : ; else \
mv $@.tmp $@ ; \
@@ -299,38 +374,37 @@ include/asterisk/buildopts.h: menuselect.makeopts
fi
@rm -f $@.tmp
$(SUBDIRS_CLEAN_DEPEND):
@$(MAKE) --no-print-directory -C $(@:-clean-depend=) clean-depend
$(SUBDIRS_CLEAN):
@$(MAKE) --no-print-directory -C $(@:-clean=) clean
clean-depend: $(SUBDIRS_CLEAN_DEPEND)
$(SUBDIRS_DIST_CLEAN):
@$(MAKE) --no-print-directory -C $(@:-dist-clean=) dist-clean
clean: $(SUBDIRS_CLEAN) clean-depend
clean: $(SUBDIRS_CLEAN) _clean
_clean:
rm -f defaults.h
rm -f include/asterisk/build.h
rm -f include/asterisk/version.h
rm -f .depend
@$(MAKE) -C menuselect clean
cp -f .cleancount .lastclean
dist-clean: distclean
distclean: clean
distclean: $(SUBDIRS_DIST_CLEAN) _clean
@$(MAKE) -C menuselect dist-clean
@$(MAKE) -C sounds dist-clean
rm -f menuselect.makeopts makeopts menuselect-tree menuselect.makedeps
rm -f makeopts.embed_rules
rm -f config.log config.status
rm -f config.log config.status config.cache
rm -rf autom4te.cache
rm -f include/asterisk/autoconfig.h
rm -f include/asterisk/buildopts.h
rm -rf doc/api
rm -f build_tools/menuselect-deps
datafiles: all
if [ x`$(ID) -un` = xroot ]; then CFLAGS="$(ASTCFLAGS)" sh build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
datafiles: _all
if [ x`$(ID) -un` = xroot ]; then CFLAGS="$(ASTCFLAGS)" bash build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
# Should static HTTP be installed during make samples or even with its own target ala
# webvoicemail? There are portions here that *could* be customized but might also be
# improved a lot. I'll put it here for now.
@@ -355,7 +429,6 @@ update:
grep ^C update.out | cut -b4- ; \
fi ; \
rm -f update.out; \
$(MAKE) clean-depend; \
else \
echo "Not under version control"; \
fi
@@ -363,7 +436,7 @@ update:
NEWHEADERS=$(notdir $(wildcard include/asterisk/*.h))
OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
bininstall: all
installdirs:
mkdir -p $(DESTDIR)$(MODULES_DIR)
mkdir -p $(DESTDIR)$(ASTSBINDIR)
mkdir -p $(DESTDIR)$(ASTETCDIR)
@@ -375,12 +448,14 @@ bininstall: all
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
bininstall: _all installdirs $(SUBDIRS_INSTALL)
$(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
$(LN) -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
$(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
$(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
fi
$(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
@@ -401,15 +476,19 @@ bininstall: all
$(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
$(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
$(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
$(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
if [ -f contrib/firmware/iax/iaxy.bin ] ; then \
$(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin; \
fi
$(SUBDIRS_INSTALL):
@$(MAKE) -C $(@:-install=) install
@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" $(MAKE) -C $(@:-install=) install
NEWMODS=$(notdir $(wildcard */*.so))
OLDMODS=$(filter-out $(NEWMODS),$(notdir $(wildcard $(DESTDIR)$(MODULES_DIR)/*.so)))
DEPMODS=chan_zap.so app_zapras.so app_zapscan.so app_zapbarge.so codec_zap.so
OLDMODS=$(filter-out $(NEWMODS) $(DEPMODS),$(notdir $(wildcard $(DESTDIR)$(MODULES_DIR)/*.so)))
oldmodcheck:
@for f in $(DEPMODS); do rm -f $(DESTDIR)$(MODULES_DIR)/$$f; done
@if [ -n "$(OLDMODS)" ]; then \
echo " WARNING WARNING WARNING" ;\
echo "" ;\
@@ -427,7 +506,14 @@ oldmodcheck:
echo " WARNING WARNING WARNING" ;\
fi
install: all datafiles bininstall $(SUBDIRS_INSTALL)
badshell:
ifneq ($(findstring ~,$(DESTDIR)),)
@echo "Your shell doesn't do ~ expansion when expected (specifically, when doing \"make install DESTDIR=~/path\")."
@echo "Try replacing ~ with \$$HOME, as in \"make install DESTDIR=\$$HOME/path\"."
@exit 1
endif
install: badshell datafiles bininstall
@if [ -x /usr/sbin/asterisk-post-install ]; then \
/usr/sbin/asterisk-post-install $(DESTDIR) . ; \
fi
@@ -440,21 +526,29 @@ install: all datafiles bininstall $(SUBDIRS_INSTALL)
@echo " + configuration files (overwriting any +"
@echo " + existing config files), run: +"
@echo " + +"
ifeq ($(MAKE), gmake)
@echo " + $(MAKE) samples +"
else
@echo " + $(MAKE) samples +"
endif
@echo " + +"
@echo " +----------------- or ---------------------+"
@echo " + +"
@echo " + You can go ahead and install the asterisk +"
@echo " + program documentation now or later run: +"
@echo " + +"
ifeq ($(MAKE), gmake)
@echo " + $(MAKE) progdocs +"
else
@echo " + $(MAKE) progdocs +"
endif
@echo " + +"
@echo " + **Note** This requires that you have +"
@echo " + doxygen installed on your local system +"
@echo " +-------------------------------------------+"
@$(MAKE) -s oldmodcheck
upgrade: all bininstall
upgrade: bininstall
adsi:
mkdir -p $(DESTDIR)$(ASTETCDIR)
@@ -493,27 +587,46 @@ samples: adsi
echo "astrundir => $(ASTVARRUNDIR)" ; \
echo "astlogdir => $(ASTLOGDIR)" ; \
echo "" ; \
echo "[options]" ; \
echo "languageprefix = yes ; Use the new sound prefix path syntax" ; \
echo ";verbose = 3" ; \
echo ";debug = 3" ; \
echo ";alwaysfork = yes ; same as -F at startup" ; \
echo ";nofork = yes ; same as -f at startup" ; \
echo ";quiet = yes ; same as -q at startup" ; \
echo ";timestamp = yes ; same as -T at startup" ; \
echo ";execincludes = yes ; support #exec in config files" ; \
echo ";console = yes ; Run as console (same as -c at startup)" ; \
echo ";highpriority = yes ; Run realtime priority (same as -p at startup)" ; \
echo ";initcrypto = yes ; Initialize crypto keys (same as -i at startup)" ; \
echo ";nocolor = yes ; Disable console colors" ; \
echo ";dontwarn = yes ; Disable some warnings" ; \
echo ";dumpcore = yes ; Dump core on crash (same as -g at startup)" ; \
echo ";internal_timing = yes" ; \
echo ";systemname = my_system_name ; prefix uniqueid with a system name for global uniqueness issues" ; \
echo ";maxcalls = 10 ; Maximum amount of calls allowed" ; \
echo ";maxload = 0.9 ; Asterisk stops accepting new calls if the load average exceed this limit" ; \
echo ";cache_record_files = yes ; Cache recorded sound files to another directory during recording" ; \
echo ";record_cache_dir = /tmp ; Specify cache directory (used in cnjunction with cache_record_files)" ; \
echo ";transmit_silence_during_record = yes ; Transmit SLINEAR silence while a channel is being recorded" ; \
echo ";transmit_silence = yes ; Transmit SLINEAR silence while a channel is being recorded or DTMF is being generated" ; \
echo ";transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of directly" ; \
echo ";runuser = asterisk ; The user to run as" ; \
echo ";rungroup = asterisk ; The group to run as" ; \
echo ";dahdichanname = yes ; Channels created by chan_dahdi will be called 'DAHDI', otherwise 'Zap'" ; \
echo "" ; \
echo "; Changing the following lines may compromise your security." ; \
echo ";[files]" ; \
echo ";astctlpermissions = 0660" ; \
echo ";astctlowner = root" ; \
echo ";astctlgroup = apache" ; \
echo ";astctl = asterisk.ctl" ; \
echo ";[options]" ; \
echo ";internal_timing = yes" ; \
) > $(DESTDIR)$(ASTCONFPATH) ; \
else \
echo "Skipping asterisk.conf creation"; \
fi
mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
:> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm
for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \
cat $(DESTDIR)$(ASTDATADIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm ; \
done
:> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/busy.gsm
for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isonphone; do \
cat $(DESTDIR)$(ASTDATADIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/busy.gsm ; \
done
build_tools/make_sample_voicemail $(DESTDIR)/$(ASTDATADIR) $(DESTDIR)/$(ASTSPOOLDIR)
webvmail:
@[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
@@ -541,20 +654,6 @@ webvmail:
@echo " + +"
@echo " +-------------------------------------------+"
spec:
sed "s/^Version:.*/Version: $(RPMVERSION)/g" redhat/asterisk.spec > asterisk.spec ; \
rpm: __rpm
__rpm: include/asterisk/version.h include/asterisk/buildopts.h spec
rm -rf /tmp/asterisk ; \
mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
$(MAKE) DESTDIR=/tmp/asterisk install ; \
$(MAKE) DESTDIR=/tmp/asterisk samples ; \
mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \
cp -f contrib/init.d/rc.redhat.asterisk /tmp/asterisk/etc/rc.d/init.d/asterisk ; \
rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec
progdocs:
(cat contrib/asterisk-ng-doxygen; echo "HAVE_DOT=$(HAVEDOT)"; \
echo "PROJECT_NUMBER=$(ASTERISKVERSION)") | doxygen -
@@ -562,22 +661,22 @@ progdocs:
config:
@if [ "${OSARCH}" = "linux-gnu" ]; then \
if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
$(INSTALL) -m 755 contrib/init.d/rc.redhat.asterisk /etc/rc.d/init.d/asterisk; \
/sbin/chkconfig --add asterisk; \
$(INSTALL) -m 755 contrib/init.d/rc.redhat.asterisk $(DESTDIR)/etc/rc.d/init.d/asterisk; \
if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
elif [ -f /etc/debian_version ]; then \
$(INSTALL) -m 755 contrib/init.d/rc.debian.asterisk /etc/init.d/asterisk; \
/usr/sbin/update-rc.d asterisk start 10 2 3 4 5 . stop 91 2 3 4 5 .; \
$(INSTALL) -m 755 contrib/init.d/rc.debian.asterisk $(DESTDIR)/etc/init.d/asterisk; \
if [ -z "$(DESTDIR)" ]; then /usr/sbin/update-rc.d asterisk start 50 2 3 4 5 . stop 91 2 3 4 5 .; fi; \
elif [ -f /etc/gentoo-release ]; then \
$(INSTALL) -m 755 contrib/init.d/rc.gentoo.asterisk /etc/init.d/asterisk; \
/sbin/rc-update add asterisk default; \
elif [ -f /etc/mandrake-release ]; then \
$(INSTALL) -m 755 contrib/init.d/rc.mandrake.asterisk /etc/rc.d/init.d/asterisk; \
/sbin/chkconfig --add asterisk; \
$(INSTALL) -m 755 contrib/init.d/rc.gentoo.asterisk $(DESTDIR)/etc/init.d/asterisk; \
if [ -z "$(DESTDIR)" ]; then /sbin/rc-update add asterisk default; fi; \
elif [ -f /etc/mandrake-release -o -f /etc/mandriva-release ]; then \
$(INSTALL) -m 755 contrib/init.d/rc.mandrake.asterisk $(DESTDIR)/etc/rc.d/init.d/asterisk; \
if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
elif [ -f /etc/SuSE-release -o -f /etc/novell-release ]; then \
$(INSTALL) -m 755 contrib/init.d/rc.suse.asterisk /etc/init.d/asterisk; \
/sbin/chkconfig --add asterisk; \
$(INSTALL) -m 755 contrib/init.d/rc.suse.asterisk $(DESTDIR)/etc/init.d/asterisk; \
if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
elif [ -f /etc/slackware-version ]; then \
echo "Slackware is not currently supported, although an init script does exist for it." \
echo "Slackware is not currently supported, although an init script does exist for it."; \
else \
echo "We could not install init scripts for your distribution."; \
fi \
@@ -585,14 +684,6 @@ config:
echo "We could not install init scripts for your operating system."; \
fi
$(MOD_SUBDIRS_DEPEND):
@CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $(@:-depend=) depend
$(OTHER_SUBDIRS_DEPEND):
@CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $(@:-depend=) depend
depend: include/asterisk/version.h include/asterisk/buildopts.h defaults.h $(SUBDIRS_DEPEND)
sounds:
$(MAKE) -C sounds all
@@ -601,9 +692,7 @@ sounds:
# last clean count we had
cleantest:
@if ! cmp -s .cleancount .lastclean ; then \
$(MAKE) clean;\
fi
@cmp -s .cleancount .lastclean || $(MAKE) clean
$(SUBDIRS_UNINSTALL):
@$(MAKE) --no-print-directory -C $(@:-uninstall=) uninstall
@@ -615,7 +704,10 @@ _uninstall: $(SUBDIRS_UNINSTALL)
rm -f $(DESTDIR)$(ASTSBINDIR)/autosupport
rm -rf $(DESTDIR)$(ASTHEADERDIR)
rm -rf $(DESTDIR)$(ASTDATADIR)/firmware
rm -rf $(DESTDIR)$(ASTMANDIR)/man8
rm -f $(DESTDIR)$(ASTMANDIR)/man8/asterisk.8
rm -f $(DESTDIR)$(ASTMANDIR)/man8/astgenkey.8
rm -f $(DESTDIR)$(ASTMANDIR)/man8/autosupport.8
rm -f $(DESTDIR)$(ASTMANDIR)/man8/safe_asterisk.8
$(MAKE) -C sounds uninstall
uninstall: _uninstall
@@ -629,7 +721,11 @@ uninstall: _uninstall
@echo " + directories, and logs, run the following +"
@echo " + command: +"
@echo " + +"
ifeq ($(MAKE), gmake)
@echo " + $(MAKE) uninstall-all +"
else
@echo " + $(MAKE) uninstall-all +"
endif
@echo " +-------------------------------------------+"
uninstall-all: _uninstall
@@ -640,14 +736,37 @@ uninstall-all: _uninstall
rm -rf $(DESTDIR)$(ASTETCDIR)
rm -rf $(DESTDIR)$(ASTLOGDIR)
menuconfig: menuselect
gmenuconfig: gmenuselect
menuselect: menuselect/menuselect menuselect-tree
-@menuselect/menuselect $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
-@menuselect/menuselect menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
gmenuselect: menuselect/gmenuselect menuselect-tree
-@menuselect/gmenuselect menuselect.makeopts $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
menuselect/menuselect: makeopts menuselect/menuselect.c menuselect/menuselect_curses.c menuselect/menuselect_stub.c menuselect/menuselect.h menuselect/linkedlists.h makeopts
@unset CC LD AR RANLIB && $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
@CC="$(HOST_CC)" LD="" AR="" RANLIB="" CFLAGS="" $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml sounds/sounds.xml build_tools/embed_modules.xml
menuselect/gmenuselect: makeopts menuselect/menuselect.c menuselect/menuselect_gtk.c menuselect/menuselect_stub.c menuselect/menuselect.h menuselect/linkedlists.h makeopts
@CC="$(HOST_CC)" CXX="$(CXX)" LD="" AR="" RANLIB="" CFLAGS="" $(MAKE) -C menuselect _gmenuselect CONFIGURE_SILENT="--silent"
menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml build_tools/cflags-devmode.xml sounds/sounds.xml build_tools/embed_modules.xml configure
@echo "Generating input for menuselect ..."
@build_tools/prep_moduledeps > $@
@echo "<?xml version=\"1.0\"?>" > $@
@echo >> $@
@echo "<menu name=\"Asterisk Module and Build Option Selection\">" >> $@
+@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SUBMAKE) -C $${dir} SUBDIR=$${dir} moduleinfo >> $@; done
+@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SUBMAKE) -C $${dir} SUBDIR=$${dir} makeopts >> $@; done
@cat build_tools/cflags.xml >> $@
@if [ "${AST_DEVMODE}" = "yes" ]; then \
cat build_tools/cflags-devmode.xml >> $@; \
fi
@cat build_tools/embed_modules.xml >> $@
@cat sounds/sounds.xml >> $@
@echo "</menu>" >> $@
.PHONY: menuselect main sounds clean clean-depend dist-clean distclean all prereqs depend cleantest uninstall _uninstall uninstall-all dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_CLEAN) $(SUBDIRS_CLEAN_DEPEND) $(SUBDIRS_DEPEND) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS)
.PHONY: menuselect main sounds clean dist-clean distclean all prereqs cleantest uninstall _uninstall uninstall-all dont-optimize $(SUBDIRS_INSTALL) $(SUBDIRS_DIST_CLEAN) $(SUBDIRS_CLEAN) $(SUBDIRS_UNINSTALL) $(SUBDIRS) $(MOD_SUBDIRS_EMBED_LDSCRIPT) $(MOD_SUBDIRS_EMBED_LDFLAGS) $(MOD_SUBDIRS_EMBED_LIBS) badshell menuselect.makeopts installdirs _clean
FORCE:

View File

@@ -11,12 +11,8 @@
# the GNU General Public License
#
ifneq ($(findstring MALLOC_DEBUG,$(MENUSELECT_CFLAGS)),)
CFLAGS+=-include $(ASTTOPDIR)/include/asterisk/astmm.h
endif
ifeq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
CFLAGS+=${GC_CFLAGS}
ASTCFLAGS+=${GC_CFLAGS}
endif
ifneq ($(findstring STATIC_BUILD,$(MENUSELECT_CFLAGS)),)
@@ -27,37 +23,20 @@ include $(ASTTOPDIR)/Makefile.rules
comma:=,
define module_o_template
$(2): $(3)
$(2): CFLAGS+=-DAST_MODULE=\"$(1)\" $$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
endef
$(addsuffix .o,$(C_MODS)): ASTCFLAGS+=-DAST_MODULE=\"$*\" $(MENUSELECT_OPTS_$*:%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_INCLUDE))
$(addsuffix .oo,$(CC_MODS)): ASTCFLAGS+=-DAST_MODULE=\"$*\" $(MENUSELECT_OPTS_$*:%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_INCLUDE))
define module_so_template
$(1)=$(1).so
$(1).so: CFLAGS+=-fPIC
$(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
$(1).so: $(2)
endef
$(LOADABLE_MODS:%=%.so): ASTCFLAGS+=-fPIC
$(LOADABLE_MODS:%=%.so): LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_LIB))
$(LOADABLE_MODS:%=%.so): ASTLDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$*),$(value $(dep)_LDFLAGS))
define module_a_template
$(1)=modules.link
modules.link: $(2)
endef
$(addsuffix .so,$(filter $(LOADABLE_MODS),$(C_MODS))): %.so: %.o
$(addsuffix .so,$(filter $(LOADABLE_MODS),$(CC_MODS))): %.so: %.oo
$(foreach mod,$(C_MODS),$(eval $(call module_o_template,$(mod),$(mod).o,$(mod).c)))
modules.link: $(addsuffix .o,$(filter $(EMBEDDED_MODS),$(C_MODS)))
modules.link: $(addsuffix .oo,$(filter $(EMBEDDED_MODS),$(CC_MODS)))
$(foreach mod,$(CC_MODS),$(eval $(call module_o_template,$(mod),$(mod).oo,$(mod).cc)))
$(foreach mod,$(filter-out $(EMBEDDED_MODS),$(C_MODS)),$(eval $(call module_so_template,$(mod),$(mod).o)))
$(foreach mod,$(filter-out $(EMBEDDED_MODS),$(CC_MODS)),$(eval $(call module_so_template,$(mod),$(mod).oo)))
$(foreach mod,$(filter $(EMBEDDED_MODS),$(C_MODS)),$(eval $(call module_a_template,$(mod),$(mod).o)))
$(foreach mod,$(filter $(EMBEDDED_MODS),$(CC_MODS)),$(eval $(call module_a_template,$(mod),$(mod).oo)))
.PHONY: clean clean-depend depend uninstall _all
.PHONY: clean uninstall _all moduleinfo makeopts
ifneq ($(LOADABLE_MODS),)
_all: $(LOADABLE_MODS:%=%.so)
@@ -81,13 +60,12 @@ endif
modules.link:
@rm -f $@
@for file in $(patsubst $(ASTTOPDIR)/%,%,$(realpath $^)); do echo "INPUT (../$${file})" >> $@; done
@for file in $(patsubst %,$(SUBDIR)/%,$(filter %.o,$^)); do echo "INPUT (../$${file})" >> $@; done
@for file in $(patsubst %,$(SUBDIR)/%,$(filter-out %.o,$^)); do echo "INPUT (../$${file})" >> $@; done
clean-depend::
rm -f .depend
clean:: clean-depend
rm -f *.so *.o *.oo
clean::
rm -f *.so *.o *.oo *.s *.i *.ii
rm -f .*.d
rm -f modules.link
install:: all
@@ -95,11 +73,40 @@ install:: all
uninstall::
ifneq ($(wildcard .depend),)
include .depend
dist-clean::
rm -f .*.moduleinfo .moduleinfo
rm -f .*.makeopts .makeopts
.%.moduleinfo: %.c
@echo "<member name=\"$*\" displayname=\"$(shell $(GREP) -e AST_MODULE_INFO $< | head -n 1 | cut -d '"' -f 2)\" remove_on_change=\"$(SUBDIR)/$*.o $(SUBDIR)/$*.so\">" > $@
$(AWK) -f $(ASTTOPDIR)/build_tools/get_moduleinfo $< >> $@
echo "</member>" >> $@
.%.moduleinfo: %.cc
@echo "<member name=\"$*\" displayname=\"$(shell $(GREP) -e AST_MODULE_INFO $< | head -n 1 | cut -d '"' -f 2)\" remove_on_change=\"$(SUBDIR)/$*.oo $(SUBDIR)/$*.so\">" > $@
$(AWK) -f $(ASTTOPDIR)/build_tools/get_moduleinfo $< >> $@
echo "</member>" >> $@
.moduleinfo:: $(addsuffix .moduleinfo,$(addprefix .,$(ALL_C_MODS) $(ALL_CC_MODS)))
@echo "<category name=\"MENUSELECT_$(MENUSELECT_CATEGORY)\" displayname=\"$(MENUSELECT_DESCRIPTION)\" remove_on_change=\"$(SUBDIR)/modules.link\">" > $@
@cat $^ >> $@
@echo "</category>" >> $@
moduleinfo: .moduleinfo
@cat $<
.%.makeopts: %.c
@$(AWK) -f $(ASTTOPDIR)/build_tools/get_makeopts $< > $@
.%.makeopts: %.cc
@$(AWK) -f $(ASTTOPDIR)/build_tools/get_makeopts $< > $@
.makeopts:: $(addsuffix .makeopts,$(addprefix .,$(ALL_C_MODS) $(ALL_CC_MODS)))
@cat $^ > $@
makeopts: .makeopts
@cat $<
ifneq ($(wildcard .*.d),)
include .*.d
endif
depend: .depend
.depend:
../build_tools/mkdep $(CFLAGS) `ls *.c *.cc 2> /dev/null`

View File

@@ -3,7 +3,7 @@
#
# Makefile rules
#
# Copyright (C) 2006, Digium, Inc.
# Copyright (C) 2006-2008, Digium, Inc.
#
# Kevin P. Fleming <kpfleming@digium.com>
#
@@ -17,84 +17,118 @@
-include $(ASTTOPDIR)/makeopts
ifeq ($(NOISY_BUILD),)
ECHO_PREFIX=@
CMD_PREFIX=@
else
ECHO_PREFIX=@\#
CMD_PREFIX=
endif
.PHONY: dist-clean
ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS)),)
# More GSM codec optimization
# Uncomment to enable MMXTM optimizations for x86 architecture CPU's
# which support MMX instructions. This should be newer pentiums,
# ppro's, etc, as well as the AMD K6 and K7.
#K6OPT=-DK6OPT
# If 'make' decides to create intermediate files to satisfy a build requirement
# (like producing a .i from a .c), we want to keep them, so tell make to keep
# all intermediate files
.SECONDARY:
# extra cflags to build dependencies. Recursively expanded.
MAKE_DEPS=-MD -MT $@ -MF .$(subst /,_,$@).d -MP
ifeq ($(NOISY_BUILD),)
ECHO_PREFIX=@
CMD_PREFIX=@
else
ECHO_PREFIX=@\#
CMD_PREFIX=
endif
OPTIMIZE?=-O6
CFLAGS+=$(OPTIMIZE)
ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS)),)
# More GSM codec optimization
# Uncomment to enable MMXTM optimizations for x86 architecture CPU's
# which support MMX instructions. This should be newer pentiums,
# ppro's, etc, as well as the AMD K6 and K7.
#K6OPT=-DK6OPT
ASTCFLAGS+=$(OPTIMIZE)
endif
define ast_make_o_c
$(1): $(2)
$(ECHO_PREFIX) echo " [CC] $$< -> $$@"
$(CMD_PREFIX) $$(CC) -o $$@ -c $$< $$(CFLAGS)
endef
# shortcuts for common combinations of flags; these must be recursively expanded so that
# per-target settings will be applied
CC_CFLAGS=$(PTHREAD_CFLAGS) $(ASTCFLAGS)
CXX_CFLAGS=$(PTHREAD_CFLAGS) $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(AST_DECLARATION_AFTER_STATEMENT),$(ASTCFLAGS))
define ast_make_oo_cc
$(1): $(2)
$(ECHO_PREFIX) echo " [CXX] $$< -> $$@"
$(CMD_PREFIX) $$(CXX) -o $$@ -c $$< $$(CFLAGS)
endef
ifeq ($(GNU_LD),1)
SO_SUPPRESS_SYMBOLS=-Wl,--version-script,$(if $(wildcard $(subst .so,.exports,$@)),$(subst .so,.exports,$@),$(ASTTOPDIR)/default.exports)
endif
define ast_make_c_y
$(1): $(2)
$(ECHO_PREFIX) echo " [BISON] $$< -> $$@"
$(CMD_PREFIX) bison -o $$@ -d --name-prefix=ast_yy $$<
endef
CC_LDFLAGS_SO=$(PTHREAD_CFLAGS) $(ASTLDFLAGS) $(SOLINK) $(SO_SUPPRESS_SYMBOLS)
CXX_LDFLAGS_SO=$(PTHREAD_CFLAGS) $(ASTLDFLAGS) $(SOLINK) $(SO_SUPPRESS_SYMBOLS)
CC_LIBS=$(PTHREAD_LIBS) $(LIBS)
CXX_LIBS=$(PTHREAD_LIBS) $(LIBS)
define ast_make_c_fl
$(1): $(2)
$(ECHO_PREFIX) echo " [FLEX] $$< -> $$@"
$(CMD_PREFIX) flex -o $$@ --full $$<
endef
# determine whether to double-compile so that the optimizer can report code path problems
# this is only done when developer mode and DONT_OPTIMIZE are both enabled
# in that case, we run the preprocessor to produce a .i or .ii file from the source
# code, then compile once with optimizer enabled (and the output to /dev/null),
# and if that doesn't fail then compile again with optimizer disabled
ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS))$(AST_DEVMODE),DONT_OPTIMIZEyes)
COMPILE_DOUBLE=yes
endif
define ast_make_so_o
$(1): $(2)
$(ECHO_PREFIX) echo " [LD] $$^ -> $$@"
$(CMD_PREFIX) $$(CC) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
endef
%.o: %.s
$(ECHO_PREFIX) echo " [AS] $< -> $@"
ifeq ($(COMPILE_DOUBLE),yes)
$(CMD_PREFIX) $(CC) -o /dev/null -c $< $(CC_CFLAGS) $(OPTIMIZE)
endif
$(CMD_PREFIX) $(CC) -o $@ -c $< $(CC_CFLAGS)
define ast_make_so_oo
$(1): $(2)
$(ECHO_PREFIX) echo " [LDXX] $$^ -> $$@"
$(CMD_PREFIX) $$(CXX) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
endef
%.o: %.i
$(ECHO_PREFIX) echo " [CCi] $< -> $@"
ifeq ($(COMPILE_DOUBLE),yes)
$(CMD_PREFIX) $(CC) -o /dev/null -c $< $(CC_CFLAGS) $(OPTIMIZE)
endif
$(CMD_PREFIX) $(CC) -o $@ -c $< $(CC_CFLAGS)
define ast_make_a_o
$(1): $(2)
$(ECHO_PREFIX) echo " [AR] $$^ -> $$@"
$(CMD_PREFIX) $$(AR) cr $$@ $$^
$(CMD_PREFIX) $$(RANLIB) $$@
endef
ifneq ($(COMPILE_DOUBLE),yes)
%.o: %.c
$(ECHO_PREFIX) echo " [CC] $< -> $@"
$(CMD_PREFIX) $(CC) -o $@ -c $< $(CC_CFLAGS) $(MAKE_DEPS)
endif
define ast_make_final
$(1): $(2)
$(ECHO_PREFIX) echo " [LD] $$^ -> $$@"
$(CMD_PREFIX) $$(CXX) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$^ $$(LIBS)
endef
%.i: %.c
$(ECHO_PREFIX) echo " [CPP] $< -> $@"
$(CMD_PREFIX) $(CC) -o $@ -E $< $(CC_CFLAGS) $(MAKE_DEPS)
define ast_make_final_host
$(1): $(2)
$(ECHO_PREFIX) echo " [LD] $$^ -> $$@"
$(CMD_PREFIX) $$(HOST_CC) $$(STATIC_BUILD) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS)
endef
%.oo: %.ii
$(ECHO_PREFIX) echo " [CXXi] $< -> $@"
ifeq ($(COMPILE_DOUBLE),yes)
$(CMD_PREFIX) $(CXX) -o /dev/null -c $< $(CXX_CFLAGS) $(OPTIMIZE)
endif
$(CMD_PREFIX) $(CXX) -o $@ -c $< $(CXX_CFLAGS)
$(eval $(call ast_make_o_c,%.o,%.c))
ifneq ($(COMPILE_DOUBLE),yes)
%.oo: %.cc
$(ECHO_PREFIX) echo " [CXX] $< -> $@"
$(CMD_PREFIX) $(CXX) -o $@ -c $< $(CXX_CFLAGS) $(MAKE_DEPS)
endif
$(eval $(call ast_make_oo_cc,%.oo,%.cc))
%.ii: %.cc
$(ECHO_PREFIX) echo " [CPP] $< -> $@"
$(CMD_PREFIX) $(CXX) -o $@ -E $< $(CXX_CFLAGS) $(MAKE_DEPS)
$(eval $(call ast_make_so_o,%.so,%.o))
%.c: %.y
$(ECHO_PREFIX) echo " [BISON] $< -> $@"
$(CMD_PREFIX) bison -o $@ -d --name-prefix=ast_yy $<
$(eval $(call ast_make_final,%,%.o))
%.c: %.fl
$(ECHO_PREFIX) echo " [FLEX] $< -> $@"
$(CMD_PREFIX) flex -o $@ --full $<
%.so: %.o
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(CC_LDFLAGS_SO) $^ $(CC_LIBS)
%.so: %.oo
$(ECHO_PREFIX) echo " [LDXX] $^ -> $@"
$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(CXX_LDFLAGS_SO) $^ $(CXX_LIBS)
%: %.o
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(PTHREAD_CFLAGS) $(ASTLDFLAGS) $^ $(CXX_LIBS)
dist-clean:: clean

34
README
View File

@@ -2,7 +2,7 @@ The Asterisk(R) Open Source PBX
by Mark Spencer <markster@digium.com>
and the Asterisk.org developer community
Copyright (C) 2001-2006 Digium, Inc.
Copyright (C) 2001-2009 Digium, Inc.
and other copyright holders.
================================================================
@@ -11,7 +11,7 @@ and other copyright holders.
the security information file (doc/security.txt) before you attempt
to configure and run an Asterisk server.
* WHAT IS ASTERISK ?
* WHAT IS ASTERISK?
Asterisk is an Open Source PBX and telephony toolkit. It is, in a
sense, middleware between Internet and telephony channels on the bottom,
and Internet and telephony applications at the top. For more information
@@ -84,18 +84,28 @@ On many distributions, these files are installed by packages with names like
So let's proceed:
1) Read the README files.
There are more README files than this one in the doc/ directory.
Start with doc/00README.1st
You may also want to check the configuration files that contain
examples and reference guides. They are all in the configs/
directory.
1) Read this README file.
2) Run "make"
There are more documents than this one in the doc/ directory.
You may also want to check the configuration files that contain
examples and reference guides. They are all in the configs/
directory.
2) Run "./configure"
Execute the configure script to guess values for system-dependent
variables used during compilation.
3) Run "make menuselect" [optional]
This is needed if you want to select the modules that will be
compiled and to check modules dependencies.
4) Run "make"
Assuming the build completes successfully:
3) Run "make install"
5) Run "make install"
Each time you update or checkout from the repository, you are strongly
encouraged to ensure all previous object files are removed to avoid internal
@@ -106,7 +116,7 @@ is required, and the file .lastclean, which contains the last .cleancount used.
If this is your first time working with Asterisk, you may wish to install
the sample PBX, with demonstration extensions, etc. If so, run:
4) "make samples"
6) "make samples"
Doing so will overwrite any existing config files you have.
@@ -149,7 +159,7 @@ they're used only to help make the configuration file easier to
understand, and do not affect how it is actually parsed.
Entries of the form 'variable=value' set the value of some parameter in
asterisk. For example, in zapata.conf, one might specify:
asterisk. For example, in chan_dahdi.conf, one might specify:
switchtype=national

210
UPGRADE-1.2.txt Normal file
View File

@@ -0,0 +1,210 @@
=========================================================
=== Information for upgrading from Asterisk 1.0 to 1.2
===
===
=== UPGRADE-1.2.txt -- Upgrade info for 1.0 to 1.2
=== UPGRADE.txt -- Upgrade info for 1.2 to 1.4
=========================================================
Compiling:
* The Asterisk 1.2 source code now uses C language features
supported only by 'modern' C compilers. Generally, this means GCC
version 3.0 or higher, although some GCC 2.96 releases will also
work. Some non-GCC compilers that support C99 and the common GCC
extensions (including anonymous structures and unions) will also
work. All releases of GCC 2.95 do _not_ have the requisite feature
support; systems using that compiler will need to be upgraded to
a more recent compiler release.
Dialplan Expressions:
* The dialplan expression parser (which handles $[ ... ] constructs)
has gone through a major upgrade, but has one incompatible change:
spaces are no longer required around expression operators, including
string comparisons. However, you can now use quoting to keep strings
together for comparison. For more details, please read the
doc/README.variables file, and check over your dialplan for possible
problems.
Agents:
* The default for ackcall has been changed to "no" instead of "yes"
because of a bug which caused the "yes" behavior to generally act like
"no". You may need to adjust the value if your agents behave
differently than you expect with respect to acknowledgement.
* The AgentCallBackLogin application now requires a second '|' before
specifying an extension@context. This is to distinguish the options
string from the extension, so that they do not conflict. See
'show application AgentCallbackLogin' for more details.
Parking:
* Parking behavior has changed slightly; when a parked call times out,
Asterisk will attempt to deliver the call back to the extension that
parked it, rather than the 's' extension. If that extension is busy
or unavailable, the parked call will be lost.
Dialing:
* The Caller*ID of the outbound leg is now the extension that was
called, rather than the Caller*ID of the inbound leg of the call. The
"o" flag for Dial can be used to restore the original behavior if
desired. Note that if you are looking for the originating callerid
from the manager event, there is a new manager event "Dial" which
provides the source and destination channels and callerid.
IAX:
* The naming convention for IAX channels has changed in two ways:
1. The call number follows a "-" rather than a "/" character.
2. The name of the channel has been simplified to IAX2/peer-callno,
rather than IAX2/peer@peer-callno or even IAX2/peer@peer/callno.
SIP:
* The global option "port" in 1.0.X that is used to set which port to
bind to has been changed to "bindport" to be more consistent with
the other channel drivers and to avoid confusion with the "port"
option for users/peers.
* The "Registry" event now uses "Username" rather than "User" for
consistency with IAX.
Applications:
* With the addition of dialplan functions (which operate similarly
to variables), the SetVar application has been renamed to Set.
* The CallerPres application has been removed. Use SetCallerPres
instead. It accepts both numeric and symbolic names.
* The applications GetGroupCount, GetGroupMatchCount, SetGroup, and
CheckGroup have been deprecated in favor of functions. Here is a
table of their replacements:
GetGroupCount([groupname][@category] GROUP_COUNT([groupname][@category]) Set(GROUPCOUNT=${GROUP_COUNT()})
GroupMatchCount(groupmatch[@category]) GROUP_MATCH_COUNT(groupmatch[@category]) Set(GROUPCOUNT=${GROUP_MATCH_COUNT(SIP/.*)})
SetGroup(groupname[@category]) GROUP([category])=groupname Set(GROUP()=test)
CheckGroup(max[@category]) N/A GotoIf($[ ${GROUP_COUNT()} > 5 ]?103)
Note that CheckGroup does not have a direct replacement. There is
also a new function called GROUP_LIST() which will return a space
separated list of all of the groups set on a channel. The GROUP()
function can also return the name of the group set on a channel when
used in a read environment.
* The applications DBGet and DBPut have been deprecated in favor of
functions. Here is a table of their replacements:
DBGet(foo=family/key) Set(foo=${DB(family/key)})
DBPut(family/key=${foo}) Set(DB(family/key)=${foo})
* The application SetLanguage has been deprecated in favor of the
function LANGUAGE().
SetLanguage(fr) Set(LANGUAGE()=fr)
The LANGUAGE function can also return the currently set language:
Set(MYLANG=${LANGUAGE()})
* The applications AbsoluteTimeout, DigitTimeout, and ResponseTimeout
have been deprecated in favor of the function TIMEOUT(timeouttype):
AbsoluteTimeout(300) Set(TIMEOUT(absolute)=300)
DigitTimeout(15) Set(TIMEOUT(digit)=15)
ResponseTimeout(15) Set(TIMEOUT(response)=15)
The TIMEOUT() function can also return the currently set timeouts:
Set(DTIMEOUT=${TIMEOUT(digit)})
* The applications SetCIDName, SetCIDNum, and SetRDNIS have been
deprecated in favor of the CALLERID(datatype) function:
SetCIDName(Joe Cool) Set(CALLERID(name)=Joe Cool)
SetCIDNum(2025551212) Set(CALLERID(number)=2025551212)
SetRDNIS(2024561414) Set(CALLERID(RDNIS)=2024561414)
* The application Record now uses the period to separate the filename
from the format, rather than the colon.
* The application VoiceMail now supports a 'temporary' greeting for each
mailbox. This greeting can be recorded by using option 4 in the
'mailbox options' menu, and 'change your password' option has been
moved to option 5.
* The application VoiceMailMain now only matches the 'default' context if
none is specified in the arguments. (This was the previously
documented behavior, however, we didn't follow that behavior.) The old
behavior can be restored by setting searchcontexts=yes in voicemail.conf.
Queues:
* A queue is now considered empty not only if there are no members but if
none of the members are available (e.g. agents not logged on). To
restore the original behavior, use "leavewhenempty=strict" or
"joinwhenempty=strict" instead of "=yes" for those options.
* It is now possible to use multi-digit extensions in the exit context
for a queue (although you should not have overlapping extensions,
as there is no digit timeout). This means that the EXITWITHKEY event
in queue_log can now contain a key field with more than a single
character in it.
Extensions:
* By default, there is a new option called "autofallthrough" in
extensions.conf that is set to yes. Asterisk 1.0 (and earlier)
behavior was to wait for an extension to be dialed after there were no
more extensions to execute. "autofallthrough" changes this behavior
so that the call will immediately be terminated with BUSY,
CONGESTION, or HANGUP based on Asterisk's best guess. If you are
writing an extension for IVR, you must use the WaitExten application
if "autofallthrough" is set to yes.
AGI:
* AGI scripts did not always get SIGHUP at the end, previously. That
behavior has been fixed. If you do not want your script to terminate
at the end of AGI being called (e.g. on a hangup) then set SIGHUP to
be ignored within your application.
* CallerID is reported with agi_callerid and agi_calleridname instead
of a single parameter holding both.
Music On Hold:
* The preferred format for musiconhold.conf has changed; please see the
sample configuration file for the new format. The existing format
is still supported but will generate warnings when the module is loaded.
chan_modem:
* All the chan_modem channel drivers (aopen, bestdata and i4l) are deprecated
in this release, and will be removed in the next major Asterisk release.
Please migrate to chan_misdn for ISDN interfaces; there is no upgrade
path for aopen and bestdata modem users.
MeetMe:
* The conference application now allows users to increase/decrease their
speaking volume and listening volume (independently of each other and
other users); the 'admin' and 'user' menus have changed, and new sound
files are included with this release. However, if a user calling in
over a Zaptel channel that does NOT have hardware DTMF detection
increases their speaking volume, it is likely they will no longer be
able to enter/exit the menu or make any further adjustments, as the
software DTMF detector will not be able to recognize the DTMF coming
from their device.
GetVar Manager Action:
* Previously, the behavior of the GetVar manager action reported the value
of a variable in the following manner:
> name: value
This has been changed to a manner similar to the SetVar action and is now
> Variable: name
> Value: value

View File

@@ -1,5 +1,18 @@
Information for Upgrading From Previous Asterisk Releases
=========================================================
=== Information for upgrading from Asterisk 1.2 to 1.4
===
===
=== UPGRADE-1.2.txt -- Upgrade info for 1.0 to 1.2
=== UPGRADE.txt -- Upgrade info for 1.2 to 1.4
=========================================================
IAX2:
* There have been some changes to the IAX2 protocol to address the security
concerns documented in the security advisory AST-2009-006. Please see the
IAX2 security document, doc/IAX2-security.pdf, for information regarding
backwards compatibility with versions of Asterisk that do not contain these
changes to IAX2.
Build Process (configure script):
@@ -101,6 +114,16 @@ PBX Core:
if your dialplan relies on the ability to 'run off the end' of an extension
and wait for a new extension without using WaitExten() to accomplish that,
you will need set autofallthrough to 'no' in your extensions.conf file.
Language Support:
* Support for Taiwanese was incorrectly supported with the "tw" language code.
In reality, the "tw" language code is reserved for the Twi language, native
to Ghana. If you were previously using the "tw" language code, you should
switch to using either "zh" (for Mandarin Chinese) or "zh_TW" for Taiwan
specific localizations. Additionally, "mx" should be changed to "es_MX",
Georgian was incorrectly specified as "ge" but should be "ka", and Czech is
"cs", not "cz".
Command Line Interface:
@@ -130,7 +153,9 @@ Applications:
interpolation falling back to globals when no channel variable is set.
* The application SetVar has been renamed to Set. The syntax SetVar was marked
deprecated in version 1.2 and is no longer recognized in this version.
deprecated in version 1.2 and is no longer recognized in this version. The
use of Set with multiple argument pairs has also been deprecated. Please
separate each name/value pair into its own dialplan line.
* app_read has been updated to use the newer options codes, using "skip" or
"noanswer" will not work. Use s or n. Also there is a new feature i, for
@@ -163,6 +188,23 @@ Applications:
option, it will default to "no" to keep backward compatability with the old
behavior.
* Queues depend on the channel driver reporting the proper state
for each member of the queue. To get proper signalling on
queue members that use the SIP channel driver, you need to
enable a call limit (could be set to a high value so it
is not put into action) and also make sure that both inbound
and outbound calls are accounted for.
Example:
[general]
limitonpeer = yes
[peername]
type=friend
call-limit=10
* The app_queue application now has the ability to use MixMonitor to
record conversations queue members are having with queue callers. Please
see configs/queues.conf.sample for more information on this option.
@@ -172,6 +214,11 @@ Applications:
provides more 'true' round-robin call delivery. For the Asterisk 1.6 release,
'rrmemory' will be renamed 'roundrobin'.
* The app_queue application option called 'monitor-join' has been deprecated
for this release. Users are encouraged to use 'monitor-type=mixmonitor' instead,
since it provides the same functionality but is not dependent on soxmix or some
other external program in order to mix the audio.
* app_meetme: The 'm' option (monitor) is renamed to 'l' (listen only), and
the 'm' option now provides the functionality of "initially muted".
In practice, most existing dialplans using the 'm' flag should not notice
@@ -247,6 +294,10 @@ Manager:
also been deprecated in favor of the already existing MeetmeTalking event
with a "Status" of "on" or "off" added.
* OriginateFailure and OriginateSuccess events were replaced by event
OriginateResponse with a header named "Response" to indicate success or
failure
Variables:
* The builtin variables ${CALLERID}, ${CALLERIDNAME}, ${CALLERIDNUM},
@@ -293,6 +344,21 @@ Functions:
The IAX2 channel:
* It is possible that previous configurations depended on the order in which
peers and users were specified in iax.conf for forcing the order in which
chan_iax2 matched against them. This behavior is going away and is considered
deprecated in this version. Avoid having ambiguous peer and user entries and
to make things easy on yourself, always set the "username" option for users
so that the remote end can match on that exactly instead of trying to infer
which user you want based on host.
If you would like to go ahead and use the new behavior which doesn't use the
order in the config file to influence matching order, then change the
MAX_PEER_BUCKETS define in chan_iax2.c to a value greater than one. An
example is provided there. By changing this, you will get *much* better
performance on systems that do a lot of peer and user lookups as they will be
stored in memory in a much more efficient manner.
* The "mailboxdetail" option has been deprecated. Previously, if this option
was not enabled, the 2 byte MSGCOUNT information element would be set to all
1's to indicate there there is some number of messages waiting. With this
@@ -323,6 +389,12 @@ The SIP channel:
in coming versions of Asterisk. Please use the dialplan application
sipaddheader() to add the "Alert-Info" header to the outbound invite.
* The "canreinvite" option has changed. canreinvite=yes used to disable
re-invites if you had NAT=yes. In 1.4, you need to set canreinvite=nonat
to disable re-invites when NAT=yes. This is propably what you want.
The settings are now: "yes", "no", "nonat", "update". Please consult
sip.conf.sample for detailed information.
The Zap channel:
* Support for MFC/R2 has been removed, as it has not been functional for some
@@ -422,3 +494,25 @@ API:
have a module that uses the services provided by res_adsi, res_odbc, or
res_agi, you will need to add ast_ prefixes to the functions that you call
from those modules.
Formats:
* format_wav: The GAIN preprocessor definition has been changed from 2 to 0
in Asterisk 1.4. This change was made in response to user complaints of
choppiness or the clipping of loud signal peaks. The GAIN preprocessor
definition will be retained in Asterisk 1.4, but will be removed in a
future release. The use of GAIN for the increasing of voicemail message
volume should use the 'volgain' option in voicemail.conf
iLBC Codec:
* Previously, the Asterisk source code distribution included the iLBC
encoder/decoder source code, from Global IP Solutions
(http://www.gipscorp.com). This code is not licensed for
distribution, and thus has been removed from the Asterisk source
code distribution. If you wish to use codec_ilbc to support iLBC
channels in Asterisk, you can run the contrib/scripts/get_ilbc_source.sh
script to download the source and put it in the proper place in
the Asterisk build tree. Once that is done you can follow your normal
steps of building Asterisk. You will need to run 'menuselect' and enable
the iLBC codec in the 'Codec Translators' category.

105
Zaptel-to-DAHDI.txt Normal file
View File

@@ -0,0 +1,105 @@
=========================================================
=== Information for upgrading from Zaptel to DAHDI ===
=========================================================
As announced in early 2008, Digium is renaming the Zaptel telephony
interface project to DAHDI (Digium Asterisk Hardware Device Interface)
to accommodate the desires of the owner of the Zaptel trademark for
telephony purposes.
This version of Asterisk can be built using either Zaptel or DAHDI,
and has many changes to make the use of DAHDI as easy as possible for
existing users with dialplans, CDR parsers, AMI applications, and
others that expect Zaptel to be in use.
First, the modules that directly use services from Zaptel/DAHDI have been
renamed; the new names are:
chan_zap.so -> chan_dahdi.so
app_zapbarge.so -> app_dahdibarge.so
app_zapras.so -> app_dahdiras.so
app_zapscan.so -> app_dahdiscan.so
codec_zap.so -> codec_dahdi.so
However, in spite of the file name changes, the channels and
applications provided by these modules can still be used with 'Zap'
style names; see below for more information.
Second, there are have been a number of efforts made to ensure that
existing systems will not have to have any major configuration changes
made solely because Asterisk was built against DAHDI instead of
Zaptel. This includes:
chan_dahdi.so:
This module will determine which channel name ('Zap' or 'DAHDI')
should be used for incoming and outgoing channels based on the
build-time choice of telephony drivers. However, if you wish to
continue using the 'Zap' channel name even though you built Asterisk
against the DAHDI drivers, you can add the following line to the
[options] section of your /etc/asterisk/asterisk.conf file:
dahdichanname = no
All CLI commands that begin with 'zap' are now available as 'dahdi'
commands as well; the 'zap' variants will report that they are
deprecated the first time you use each one in an Asterisk instance,
but they will otherwise operate just as they did in previous versions.
All Asterisk Manager Interface (AMI) actions that begin with 'Zap'
are also available with 'DAHDI' prefixes.
The ZapSendKeypadFacility dialplan application is now available as
DAHDISendKeypadFacility as well; the Zap variant will report a deprecation
warning but will otherwise operate as it did it in previous
versions.
The configuration for the channel driver will be read from
/etc/asterisk/chan_dahdi.conf unless 'dahdichanname' has been set to
'no' in asterisk.conf; if that is done, then the configuration will
be read from /etc/asterisk/zapata.conf, just as it was in previous
versions.
app_dahdibarge.so:
The ZapBarge application is now available as DAHDIBarge as well; the
ZapBarge variant will report a deprecation warning when used, but
will otherwise operate as it did in previous versions. Regardless of
which application name is used, the application will restrict itself
to channels of the proper type, based on the 'dahdichanname' setting
in asterisk.conf.
app_dahdiras.so:
The ZapRAS application is now available as DAHDIRAS as well; the
ZapRAS variant will report a deprecation warning when used, but will
otherwise operate as it did in previous versions. Regardless of
which application name is used, the application will restrict itself
to channels of the proper type, based on the 'dahdichanname' setting
in asterisk.conf.
app_dahdiscan.so:
The ZapScan application is now available as DAHDIScan as well; the
ZapScan variant will report a deprecation warning when used, but will
otherwise operate as it did in previous versions. Regardless of
which application name is used, the application will restrict itself
to channels of the proper type, based on the 'dahdichanname' setting
in asterisk.conf.
app_flash.so:
This application has not had any name changes, but will report its
usage (via 'show application flash') as being for either DAHDI or
Zaptel channels based on the 'dahdichanname' setting in
asterisk.conf.
app_chanspy.so:
This application will transparently create 'DAHDI' or 'Zap' channels
as needed, based on the 'dahdichanname' setting in asterisk.conf.
app_meetme.so:
This application will transparently create 'DAHDI' or 'Zap' channels
as needed, based on the 'dahdichanname' setting in asterisk.conf.

View File

@@ -1,491 +0,0 @@
# AST_GCC_ATTRIBUTE([attribute name])
AC_DEFUN([AST_GCC_ATTRIBUTE],
[
AC_MSG_CHECKING(for compiler 'attribute $1' support)
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM([static int __attribute__(($1)) test(void) {}],
[]),
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]),
AC_MSG_RESULT(no))
])
# AST_EXT_LIB_SETUP([package symbol name], [package friendly name], [package option name], [additional help text])
AC_DEFUN([AST_EXT_LIB_SETUP],
[
$1_DESCRIP="$2"
$1_OPTION="$3"
AC_ARG_WITH([$3], AC_HELP_STRING([--with-$3=PATH],[use $2 files in PATH $4]),[
case ${withval} in
n|no)
USE_$1=no
;;
y|ye|yes)
$1_MANDATORY="yes"
;;
*)
$1_DIR="${withval}"
$1_MANDATORY="yes"
;;
esac
])
PBX_$1=0
AC_SUBST([$1_LIB])
AC_SUBST([$1_INCLUDE])
AC_SUBST([PBX_$1])
])
# AST_EXT_LIB_CHECK([package symbol name], [package library name], [function to check], [package header], [additional LIB data])
AC_DEFUN([AST_EXT_LIB_CHECK],
[
if test "${USE_$1}" != "no"; then
pbxlibdir=""
if test "x${$1_DIR}" != "x"; then
if test -d ${$1_DIR}/lib; then
pbxlibdir="-L${$1_DIR}/lib"
else
pbxlibdir="-L${$1_DIR}"
fi
fi
AC_CHECK_LIB([$2], [$3], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], ${pbxlibdir} $5)
if test "${AST_$1_FOUND}" = "yes"; then
$1_LIB="-l$2 $5"
$1_HEADER_FOUND="1"
if test "x${$1_DIR}" != "x"; then
$1_LIB="${pbxlibdir} ${$1_LIB}"
$1_INCLUDE="-I${$1_DIR}/include"
if test "x$4" != "x" ; then
AC_CHECK_HEADER([${$1_DIR}/include/$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0] )
fi
else
if test "x$4" != "x" ; then
AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0] )
fi
fi
if test "x${$1_HEADER_FOUND}" = "x0" ; then
if test ! -z "${$1_MANDATORY}" ;
then
AC_MSG_NOTICE( ***)
AC_MSG_NOTICE( *** It appears that you do not have the $2 development package installed.)
AC_MSG_NOTICE( *** Please install it to include ${$1_DESCRIP} support, or re-run configure)
AC_MSG_NOTICE( *** without explicitly specifying --with-${$1_OPTION})
exit 1
fi
$1_LIB=""
$1_INCLUDE=""
PBX_$1=0
else
PBX_$1=1
AC_DEFINE_UNQUOTED([HAVE_$1], 1, [Define to indicate the ${$1_DESCRIP} library])
fi
elif test ! -z "${$1_MANDATORY}";
then
AC_MSG_NOTICE(***)
AC_MSG_NOTICE(*** The ${$1_DESCRIP} installation on this system appears to be broken.)
AC_MSG_NOTICE(*** Either correct the installation, or run configure)
AC_MSG_NOTICE(*** without explicitly specifying --with-${$1_OPTION})
exit 1
fi
fi
])
AC_DEFUN(
[AST_CHECK_GNU_MAKE], [AC_CACHE_CHECK(for GNU make, GNU_MAKE,
GNU_MAKE='Not Found' ;
GNU_MAKE_VERSION_MAJOR=0 ;
GNU_MAKE_VERSION_MINOR=0 ;
for a in make gmake gnumake ; do
if test -z "$a" ; then continue ; fi ;
if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
GNU_MAKE=$a ;
GNU_MAKE_VERSION_MAJOR=`$GNU_MAKE --version | grep "GNU Make" | cut -f3 -d' ' | cut -f1 -d'.'`
GNU_MAKE_VERSION_MINOR=`$GNU_MAKE --version | grep "GNU Make" | cut -f2 -d'.' | cut -c1-2`
break;
fi
done ;
) ;
if test "x$GNU_MAKE" = "xNot Found" ; then
AC_MSG_ERROR( *** Please install GNU make. It is required to build Asterisk!)
exit 1
fi
AC_SUBST([GNU_MAKE])
])
AC_DEFUN(
[AST_CHECK_PWLIB], [
PWLIB_INCDIR=
PWLIB_LIBDIR=
if test "${PWLIBDIR:-unset}" != "unset" ; then
AC_CHECK_FILE(${PWLIBDIR}/version.h, HAS_PWLIB=1, )
fi
if test "${HAS_PWLIB:-unset}" = "unset" ; then
if test "${OPENH323DIR:-unset}" != "unset"; then
AC_CHECK_FILE(${OPENH323DIR}/../pwlib/version.h, HAS_PWLIB=1, )
fi
if test "${HAS_PWLIB:-unset}" != "unset" ; then
PWLIBDIR="${OPENH323DIR}/../pwlib"
else
AC_CHECK_FILE(${HOME}/pwlib/include/ptlib.h, HAS_PWLIB=1, )
if test "${HAS_PWLIB:-unset}" != "unset" ; then
PWLIBDIR="${HOME}/pwlib"
else
AC_CHECK_FILE(/usr/local/include/ptlib.h, HAS_PWLIB=1, )
if test "${HAS_PWLIB:-unset}" != "unset" ; then
AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/bin)
if test "${PTLIB_CONFIG:-unset}" = "unset" ; then
AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/share/pwlib/make)
fi
PWLIB_INCDIR="/usr/local/include"
PWLIB_LIBDIR="/usr/local/lib"
else
AC_CHECK_FILE(/usr/include/ptlib.h, HAS_PWLIB=1, )
if test "${HAS_PWLIB:-unset}" != "unset" ; then
AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/share/pwlib/make)
PWLIB_INCDIR="/usr/include"
PWLIB_LIBDIR="/usr/lib"
fi
fi
fi
fi
fi
#if test "${HAS_PWLIB:-unset}" = "unset" ; then
# echo "Cannot find pwlib - please install or set PWLIBDIR and try again"
# exit
#fi
if test "${HAS_PWLIB:-unset}" != "unset" ; then
if test "${PWLIBDIR:-unset}" = "unset" ; then
if test "${PTLIB_CONFIG:-unset}" != "unset" ; then
PWLIBDIR=`$PTLIB_CONFIG --prefix`
else
echo "Cannot find ptlib-config - please install and try again"
exit
fi
fi
if test "x$PWLIBDIR" = "x/usr" -o "x$PWLIBDIR" = "x/usr/"; then
PWLIBDIR="/usr/share/pwlib"
PWLIB_INCDIR="/usr/include"
PWLIB_LIBDIR="/usr/lib"
fi
if test "x$PWLIBDIR" = "x/usr/local" -o "x$PWLIBDIR" = "x/usr/"; then
PWLIBDIR="/usr/local/share/pwlib"
PWLIB_INCDIR="/usr/local/include"
PWLIB_LIBDIR="/usr/local/lib"
fi
if test "${PWLIB_INCDIR:-unset}" = "unset"; then
PWLIB_INCDIR="${PWLIBDIR}/include"
fi
if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
PWLIB_LIBDIR="${PWLIBDIR}/lib"
fi
AC_SUBST([PWLIBDIR])
AC_SUBST([PWLIB_INCDIR])
AC_SUBST([PWLIB_LIBDIR])
fi
])
AC_DEFUN(
[AST_CHECK_OPENH323_PLATFORM], [
PWLIB_OSTYPE=
case "$host_os" in
linux*) PWLIB_OSTYPE=linux ;
;;
freebsd* ) PWLIB_OSTYPE=FreeBSD ;
;;
openbsd* ) PWLIB_OSTYPE=OpenBSD ;
ENDLDLIBS="-lossaudio" ;
;;
netbsd* ) PWLIB_OSTYPE=NetBSD ;
ENDLDLIBS="-lossaudio" ;
;;
solaris* | sunos* ) PWLIB_OSTYPE=solaris ;
;;
darwin* ) PWLIB_OSTYPE=Darwin ;
;;
beos*) PWLIB_OSTYPE=beos ;
STDCCFLAGS="$STDCCFLAGS -D__BEOS__"
;;
cygwin*) PWLIB_OSTYPE=cygwin ;
;;
mingw*) PWLIB_OSTYPE=mingw ;
STDCCFLAGS="$STDCCFLAGS -mms-bitfields" ;
ENDLDLIBS="-lwinmm -lwsock32 -lsnmpapi -lmpr -lcomdlg32 -lgdi32 -lavicap32" ;
;;
* ) PWLIB_OSTYPE="$host_os" ;
AC_MSG_WARN("OS $PWLIB_OSTYPE not recognized - proceed with caution!") ;
;;
esac
PWLIB_MACHTYPE=
case "$host_cpu" in
x86 | i686 | i586 | i486 | i386 ) PWLIB_MACHTYPE=x86
;;
x86_64) PWLIB_MACHTYPE=x86_64 ;
P_64BIT=1 ;
LIB64=1 ;
;;
alpha | alphaev56 | alphaev6 | alphaev67 | alphaev7) PWLIB_MACHTYPE=alpha ;
P_64BIT=1 ;
;;
sparc ) PWLIB_MACHTYPE=sparc ;
;;
powerpc ) PWLIB_MACHTYPE=ppc ;
;;
ppc ) PWLIB_MACHTYPE=ppc ;
;;
powerpc64 ) PWLIB_MACHTYPE=ppc64 ;
P_64BIT=1 ;
LIB64=1 ;
;;
ppc64 ) PWLIB_MACHTYPE=ppc64 ;
P_64BIT=1 ;
LIB64=1 ;
;;
ia64) PWLIB_MACHTYPE=ia64 ;
P_64BIT=1 ;
;;
s390x) PWLIB_MACHTYPE=s390x ;
P_64BIT=1 ;
LIB64=1 ;
;;
s390) PWLIB_MACHTYPE=s390 ;
;;
* ) PWLIB_MACHTYPE="$host_cpu";
AC_MSG_WARN("CPU $PWLIB_MACHTYPE not recognized - proceed with caution!") ;;
esac
PWLIB_PLATFORM="${PWLIB_OSTYPE}_${PWLIB_MACHTYPE}"
AC_SUBST([PWLIB_PLATFORM])
])
AC_DEFUN(
[AST_CHECK_OPENH323], [
OPENH323_INCDIR=
OPENH323_LIBDIR=
if test "${OPENH323DIR:-unset}" != "unset" ; then
AC_CHECK_FILE(${OPENH323DIR}/version.h, HAS_OPENH323=1, )
fi
if test "${HAS_OPENH323:-unset}" = "unset" ; then
AC_CHECK_FILE(${PWLIBDIR}/../openh323/version.h, OPENH323DIR="${PWLIBDIR}/../openh323"; HAS_OPENH323=1, )
if test "${HAS_OPENH323:-unset}" != "unset" ; then
OPENH323DIR="${PWLIBDIR}/../openh323"
AC_CHECK_FILE(${OPENH323DIR}/include/h323.h, , OPENH323_INCDIR="${PWLIB_INCDIR}/openh323"; OPENH323_LIBDIR="${PWLIB_LIBDIR}")
else
AC_CHECK_FILE(${HOME}/openh323/include/h323.h, HAS_OPENH323=1, )
if test "${HAS_OPENH323:-unset}" != "unset" ; then
OPENH323DIR="${HOME}/openh323"
else
AC_CHECK_FILE(/usr/local/include/openh323/h323.h, HAS_OPENH323=1, )
if test "${HAS_OPENH323:-unset}" != "unset" ; then
OPENH323DIR="/usr/local/share/openh323"
OPENH323_INCDIR="/usr/local/include/openh323"
OPENH323_LIBDIR="/usr/local/lib"
else
AC_CHECK_FILE(/usr/include/openh323/h323.h, HAS_OPENH323=1, )
if test "${HAS_OPENH323:-unset}" != "unset" ; then
OPENH323DIR="/usr/share/openh323"
OPENH323_INCDIR="/usr/include/openh323"
OPENH323_LIBDIR="/usr/lib"
fi
fi
fi
fi
fi
if test "${HAS_OPENH323:-unset}" != "unset" ; then
if test "${OPENH323_INCDIR:-unset}" = "unset"; then
OPENH323_INCDIR="${OPENH323DIR}/include"
fi
if test "${OPENH323_LIBDIR:-unset}" = "unset"; then
OPENH323_LIBDIR="${OPENH323DIR}/lib"
fi
AC_SUBST([OPENH323DIR])
AC_SUBST([OPENH323_INCDIR])
AC_SUBST([OPENH323_LIBDIR])
fi
])
AC_DEFUN(
[AST_CHECK_PWLIB_VERSION], [
if test "${HAS_$2:-unset}" != "unset"; then
$2_VERSION=`grep "$2_VERSION" ${$2_INCDIR}/$3 | cut -f2 -d ' ' | sed -e 's/"//g'`
$2_MAJOR_VERSION=`echo ${$2_VERSION} | cut -f1 -d.`
$2_MINOR_VERSION=`echo ${$2_VERSION} | cut -f2 -d.`
$2_BUILD_NUMBER=`echo ${$2_VERSION} | cut -f3 -d.`
let $2_VER=${$2_MAJOR_VERSION}*10000+${$2_MINOR_VERSION}*100+${$2_BUILD_NUMBER}
let $2_REQ=$4*10000+$5*100+$6
AC_MSG_CHECKING(if $1 version ${$2_VERSION} is compatible with chan_h323)
if test ${$2_VER} -lt ${$2_REQ}; then
AC_MSG_RESULT(no)
unset HAS_$2
else
AC_MSG_RESULT(yes)
fi
fi
])
AC_DEFUN(
[AST_CHECK_PWLIB_BUILD], [
if test "${HAS_$2:-unset}" != "unset"; then
AC_MSG_CHECKING($1 installation validity)
saved_cppflags="${CPPFLAGS}"
saved_libs="${LIBS}"
LIBS="${LIBS} -L${$2_LIBDIR} -l${PLATFORM_$2} $7"
CPPFLAGS="${CPPFLAGS} -I${$2_INCDIR} $6"
AC_LANG_PUSH([C++])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([$4],[$5])],
[ AC_MSG_RESULT(yes)
ac_cv_lib_$2="yes"
],
[ AC_MSG_RESULT(no)
ac_cv_lib_$2="no"
]
)
AC_LANG_POP([C++])
LIBS="${saved_libs}"
CPPFLAGS="${saved_cppflags}"
if test "${ac_cv_lib_$2}" = "yes"; then
if test "${$2_LIBDIR}" != "" -a "${$2_LIBDIR}" != "/usr/lib"; then
$2_LIB="-L${$2_LIBDIR} -l${PLATFORM_$2}"
else
$2_LIB="-l${PLATFORM_$2}"
fi
if test "${$2_INCDIR}" != "" -a "${$2_INCDIR}" != "/usr/include"; then
$2_INCLUDE="-I${$2_INCDIR}"
fi
PBX_$2=1
AC_DEFINE([HAVE_$2], 1, [$3])
fi
fi
])
AC_DEFUN(
[AST_CHECK_OPENH323_BUILD], [
if test "${HAS_OPENH323:-unset}" != "unset"; then
AC_MSG_CHECKING(OpenH323 build option)
OPENH323_SUFFIX=
files=`ls -l ${OPENH323_LIBDIR}/libh323_${PWLIB_PLATFORM}_*.so*`
libfile=
if test -n "$files"; then
for f in $files; do
if test -f $f -a ! -L $f; then
libfile=`basename $f`
break;
fi
done
fi
if test "${libfile:-unset}" != "unset"; then
OPENH323_SUFFIX=`eval "echo ${libfile} | sed -e 's/libh323_${PWLIB_PLATFORM}_\(@<:@^.@:>@*\)\..*/\1/'"`
fi
case "${OPENH323_SUFFIX}" in
n)
OPENH323_BUILD="notrace";;
r)
OPENH323_BUILD="opt";;
d)
OPENH323_BUILD="debug";;
*)
OPENH323_BUILD="notrace";;
esac
AC_MSG_RESULT(${OPENH323_BUILD})
AC_SUBST([OPENH323_SUFFIX])
AC_SUBST([OPENH323_BUILD])
fi
])
# AST_FUNC_FORK
# -------------
AN_FUNCTION([fork], [AST_FUNC_FORK])
AN_FUNCTION([vfork], [AST_FUNC_FORK])
AC_DEFUN([AST_FUNC_FORK],
[AC_REQUIRE([AC_TYPE_PID_T])dnl
AC_CHECK_HEADERS(vfork.h)
AC_CHECK_FUNCS(fork vfork)
if test "x$ac_cv_func_fork" = xyes; then
_AST_FUNC_FORK
else
ac_cv_func_fork_works=$ac_cv_func_fork
fi
if test "x$ac_cv_func_fork_works" = xcross; then
case $host in
*-*-amigaos* | *-*-msdosdjgpp* | *-*-uclinux* )
# Override, as these systems have only a dummy fork() stub
ac_cv_func_fork_works=no
;;
*)
ac_cv_func_fork_works=yes
;;
esac
AC_MSG_WARN([result $ac_cv_func_fork_works guessed because of cross compilation])
fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
if test "x$ac_cv_func_vfork" = xyes; then
_AC_FUNC_VFORK
fi;
if test "x$ac_cv_func_fork_works" = xcross; then
ac_cv_func_vfork_works=$ac_cv_func_vfork
AC_MSG_WARN([result $ac_cv_func_vfork_works guessed because of cross compilation])
fi
if test "x$ac_cv_func_vfork_works" = xyes; then
AC_DEFINE(HAVE_WORKING_VFORK, 1, [Define to 1 if `vfork' works.])
else
AC_DEFINE(vfork, fork, [Define as `fork' if `vfork' does not work.])
fi
if test "x$ac_cv_func_fork_works" = xyes; then
AC_DEFINE(HAVE_WORKING_FORK, 1, [Define to 1 if `fork' works.])
fi
])# AST_FUNC_FORK
# _AST_FUNC_FORK
# -------------
AC_DEFUN([_AST_FUNC_FORK],
[AC_CACHE_CHECK(for working fork, ac_cv_func_fork_works,
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[
/* By Ruediger Kuhlmann. */
return fork () < 0;
])],
[ac_cv_func_fork_works=yes],
[ac_cv_func_fork_works=no],
[ac_cv_func_fork_works=cross])])]
)# _AST_FUNC_FORK

14
aclocal.m4 vendored
View File

@@ -1,14 +0,0 @@
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_include([acinclude.m4])

View File

@@ -11,7 +11,7 @@
# the GNU General Public License
#
.PHONY: clean clean-depend all depend uninstall
.PHONY: clean all uninstall
AGIS=agi-test.agi eagi-test eagi-sphinx-test jukebox.agi
@@ -21,14 +21,17 @@ endif
include $(ASTTOPDIR)/Makefile.rules
ASTCFLAGS+=-DSTANDALONE
all: $(AGIS)
strcompat.c: ../main/strcompat.c
@cp $< $@
eagi-test: eagi-test.o strcompat.o
eagi-sphinx-test: eagi-sphinx-test.o
$(eval $(call ast_make_o_c,strcompat.o,../main/strcompat.c))
install: all
mkdir -p $(DESTDIR)$(AGI_DIR)
for x in $(AGIS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(AGI_DIR) ; done
@@ -36,17 +39,11 @@ install: all
uninstall:
for x in $(AGIS); do rm -f $(DESTDIR)$(AGI_DIR)/$$x ; done
clean-depend:
rm -f .depend
clean: clean-depend
clean:
rm -f *.so *.o look eagi-test eagi-sphinx-test
rm -f .*.d *.s *.i
rm -f strcompat.c
ifneq ($(wildcard .depend),)
include .depend
ifneq ($(wildcard .*.d),)
include .*.d
endif
depend: .depend
.depend:
../build_tools/mkdep $(CFLAGS) `ls *.c`

View File

@@ -70,7 +70,9 @@ static int read_environment(void)
char *val;
/* Read environment */
for(;;) {
fgets(buf, sizeof(buf), stdin);
if (!fgets(buf, sizeof(buf), stdin)) {
return -1;
}
if (feof(stdin))
return -1;
buf[strlen(buf) - 1] = '\0';
@@ -121,7 +123,9 @@ static char *wait_result(void)
return NULL;
}
if (FD_ISSET(STDIN_FILENO, &fds)) {
fgets(astresp, sizeof(astresp), stdin);
if (!fgets(astresp, sizeof(astresp), stdin)) {
return NULL;
}
if (feof(stdin)) {
fprintf(stderr, "Got hungup on apparently\n");
return NULL;
@@ -132,9 +136,10 @@ static char *wait_result(void)
}
if (FD_ISSET(AUDIO_FILENO, &fds)) {
res = read(AUDIO_FILENO, audiobuf, sizeof(audiobuf));
if (res > 0) {
if (sphinx_sock > -1)
write(sphinx_sock, audiobuf, res);
if ((res > 0) && (sphinx_sock > -1)) {
if (write(sphinx_sock, audiobuf, res) < 0) {
fprintf(stderr, "write() failed: %s\n", strerror(errno));
}
}
}
if ((sphinx_sock > -1) && FD_ISSET(sphinx_sock, &fds)) {
@@ -209,7 +214,7 @@ int main(int argc, char *argv[])
connect_sphinx();
tmp = getenv("agi_enhanced");
if (tmp) {
if (sscanf(tmp, "%d.%d", &ver, &subver) != 2)
if (sscanf(tmp, "%30d.%30d", &ver, &subver) != 2)
ver = 0;
}
if (ver < 1) {

View File

@@ -24,7 +24,9 @@ static int read_environment(void)
char *val;
/* Read environment */
for(;;) {
fgets(buf, sizeof(buf), stdin);
if (!fgets(buf, sizeof(buf), stdin)) {
return -1;
}
if (feof(stdin))
return -1;
buf[strlen(buf) - 1] = '\0';
@@ -68,7 +70,9 @@ static char *wait_result(void)
return NULL;
}
if (FD_ISSET(STDIN_FILENO, &fds)) {
fgets(astresp, sizeof(astresp), stdin);
if (!fgets(astresp, sizeof(astresp), stdin)) {
return NULL;
}
if (feof(stdin)) {
fprintf(stderr, "Got hungup on apparently\n");
return NULL;
@@ -152,7 +156,7 @@ int main(int argc, char *argv[])
}
tmp = getenv("agi_enhanced");
if (tmp) {
if (sscanf(tmp, "%d.%d", &ver, &subver) != 2)
if (sscanf(tmp, "%30d.%30d", &ver, &subver) != 2)
ver = 0;
}
if (ver < 1) {

View File

@@ -11,8 +11,14 @@
-include ../menuselect.makeopts ../menuselect.makedeps
C_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.c,%,$(wildcard app_*.c)))
CC_MODS:=$(filter-out $(MENUSELECT_APPS),$(patsubst %.cc,%,$(wildcard app_*.cc)))
MENUSELECT_CATEGORY=APPS
MENUSELECT_DESCRIPTION=Applications
ALL_C_MODS:=$(patsubst %.c,%,$(wildcard app_*.c))
ALL_CC_MODS:=$(patsubst %.cc,%,$(wildcard app_*.cc))
C_MODS:=$(filter-out $(MENUSELECT_APPS),$(ALL_C_MODS))
CC_MODS:=$(filter-out $(MENUSELECT_APPS),$(ALL_CC_MODS))
LOADABLE_MODS:=$(C_MODS) $(CC_MODS)
@@ -21,16 +27,14 @@ ifneq ($(findstring apps,$(MENUSELECT_EMBED)),)
LOADABLE_MODS:=
endif
MENUSELECT_OPTS_app_directory:=$(MENUSELECT_OPTS_app_voicemail)
ifneq ($(findstring ODBC_STORAGE,$(MENUSELECT_OPTS_app_voicemail)),)
MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_ODBC_STORAGE)
MENUSELECT_DEPENDS_app_directory+=$(MENUSELECT_DEPENDS_ODBC_STORAGE)
endif
ifneq ($(findstring IMAP_STORAGE,$(MENUSELECT_OPTS_app_voicemail)),)
MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_IMAP_STORAGE)
endif
ifeq (SunOS,$(shell uname))
MENUSELECT_DEPENDS_app_chanspy+=RT
RT_LIB=-lrt
MENUSELECT_DEPENDS_app_directory+=$(MENUSELECT_DEPENDS_IMAP_STORAGE)
endif
all: _all

View File

@@ -25,6 +25,10 @@
* \ingroup applications
*/
/*** MODULEINFO
<depend>res_adsi</depend>
***/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -191,7 +195,7 @@ static int process_token(void *out, char *src, int maxlen, int argtype)
if (!(argtype & ARG_NUMBER))
return -1;
/* Octal value */
if (sscanf(src, "%o", (int *)out) != 1)
if (sscanf(src, "%30o", (int *)out) != 1)
return -1;
if (argtype & ARG_STRING) {
/* Convert */
@@ -201,7 +205,7 @@ static int process_token(void *out, char *src, int maxlen, int argtype)
if (!(argtype & ARG_NUMBER))
return -1;
/* Hex value */
if (sscanf(src + 2, "%x", (unsigned int *)out) != 1)
if (sscanf(src + 2, "%30x", (unsigned int *)out) != 1)
return -1;
if (argtype & ARG_STRING) {
/* Convert */
@@ -211,7 +215,7 @@ static int process_token(void *out, char *src, int maxlen, int argtype)
if (!(argtype & ARG_NUMBER))
return -1;
/* Hex value */
if (sscanf(src, "%d", (int *)out) != 1)
if (sscanf(src, "%30d", (int *)out) != 1)
return -1;
if (argtype & ARG_STRING) {
/* Convert */
@@ -1360,7 +1364,9 @@ static struct adsi_script *compile_script(char *script)
/* Create "main" as first subroutine */
getsubbyname(scr, "main", NULL, 0);
while(!feof(f)) {
fgets(buf, sizeof(buf), f);
if (!fgets(buf, sizeof(buf), f)) {
continue;
}
if (!feof(f)) {
lineno++;
/* Trim off trailing return */

View File

@@ -125,7 +125,7 @@ static void database_increment( char *key )
return;
}
sscanf(value, "%u", &v);
sscanf(value, "%30u", &v);
v++;
if(option_verbose >= 4)
@@ -136,7 +136,7 @@ static void database_increment( char *key )
res = ast_db_put(db_family, key, value);
if((res)&&(option_verbose >= 4))
ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: database_increment write error");
ast_verbose(VERBOSE_PREFIX_4 "AlarmReceiver: database_increment write error\n");
return;
}

View File

@@ -86,19 +86,22 @@ static int dfltBetweenWordsSilence = 50;
static int dfltMaximumNumberOfWords = 3;
static int dfltSilenceThreshold = 256;
/* Set to the lowest ms value provided in amd.conf or application parameters */
static int dfltMaxWaitTimeForFrame = 50;
static void isAnsweringMachine(struct ast_channel *chan, void *data)
{
int res = 0;
struct ast_frame *f = NULL;
struct ast_dsp *silenceDetector = NULL;
int dspsilence = 0, readFormat, framelength;
int dspsilence = 0, readFormat, framelength = 0;
int inInitialSilence = 1;
int inGreeting = 0;
int voiceDuration = 0;
int silenceDuration = 0;
int iTotalTime = 0;
int iWordsCount = 0;
int currentState = STATE_IN_SILENCE;
int currentState = STATE_IN_WORD;
int previousState = STATE_IN_SILENCE;
int consecutiveVoiceDuration = 0;
char amdCause[256] = "", amdStatus[256] = "";
@@ -116,6 +119,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
int betweenWordsSilence = dfltBetweenWordsSilence;
int maximumNumberOfWords = dfltMaximumNumberOfWords;
int silenceThreshold = dfltSilenceThreshold;
int maxWaitTimeForFrame = dfltMaxWaitTimeForFrame;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(argInitialSilence);
@@ -151,8 +155,22 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
maximumNumberOfWords = atoi(args.argMaximumNumberOfWords);
if (!ast_strlen_zero(args.argSilenceThreshold))
silenceThreshold = atoi(args.argSilenceThreshold);
} else
ast_log(LOG_NOTICE, "AMD using the default parameters.\n");
} else if (option_debug)
ast_log(LOG_DEBUG, "AMD using the default parameters.\n");
/* Find lowest ms value, that will be max wait time for a frame */
if (maxWaitTimeForFrame > initialSilence)
maxWaitTimeForFrame = initialSilence;
if (maxWaitTimeForFrame > greeting)
maxWaitTimeForFrame = greeting;
if (maxWaitTimeForFrame > afterGreetingSilence)
maxWaitTimeForFrame = afterGreetingSilence;
if (maxWaitTimeForFrame > totalAnalysisTime)
maxWaitTimeForFrame = totalAnalysisTime;
if (maxWaitTimeForFrame > minimumWordLength)
maxWaitTimeForFrame = minimumWordLength;
if (maxWaitTimeForFrame > betweenWordsSilence)
maxWaitTimeForFrame = betweenWordsSilence;
/* Now we're ready to roll! */
if (option_verbose > 2)
@@ -182,7 +200,8 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
ast_dsp_set_threshold(silenceDetector, silenceThreshold);
/* Now we go into a loop waiting for frames from the channel */
while ((res = ast_waitfor(chan, totalAnalysisTime)) > -1) {
while ((res = ast_waitfor(chan, 2 * maxWaitTimeForFrame)) > -1) {
/* If we fail to read in a frame, that means they hung up */
if (!(f = ast_read(chan))) {
if (option_verbose > 2)
@@ -193,9 +212,13 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
break;
}
if (f->frametype == AST_FRAME_VOICE) {
if (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_NULL || f->frametype == AST_FRAME_CNG) {
/* If the total time exceeds the analysis time then give up as we are not too sure */
framelength = (ast_codec_get_samples(f) / DEFAULT_SAMPLES_PER_MS);
if (f->frametype == AST_FRAME_VOICE)
framelength = (ast_codec_get_samples(f) / DEFAULT_SAMPLES_PER_MS);
else
framelength += 2 * maxWaitTimeForFrame;
iTotalTime += framelength;
if (iTotalTime >= totalAnalysisTime) {
if (option_verbose > 2)
@@ -207,9 +230,14 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
}
/* Feed the frame of audio into the silence detector and see if we get a result */
dspsilence = 0;
ast_dsp_silence(silenceDetector, f, &dspsilence);
if (dspsilence) {
if (f->frametype != AST_FRAME_VOICE)
dspsilence += 2 * maxWaitTimeForFrame;
else {
dspsilence = 0;
ast_dsp_silence(silenceDetector, f, &dspsilence);
}
if (dspsilence > 0) {
silenceDuration = dspsilence;
if (silenceDuration >= betweenWordsSilence) {
@@ -229,6 +257,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
ast_frfree(f);
strcpy(amdStatus , "MACHINE");
sprintf(amdCause , "INITIALSILENCE-%d-%d", silenceDuration, initialSilence);
res = 1;
break;
}
@@ -239,6 +268,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
ast_frfree(f);
strcpy(amdStatus , "HUMAN");
sprintf(amdCause , "HUMAN-%d-%d", silenceDuration, afterGreetingSilence);
res = 1;
break;
}
@@ -262,6 +292,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
ast_frfree(f);
strcpy(amdStatus , "MACHINE");
sprintf(amdCause , "MAXWORDS-%d-%d", iWordsCount, maximumNumberOfWords);
res = 1;
break;
}
@@ -271,6 +302,7 @@ static void isAnsweringMachine(struct ast_channel *chan, void *data)
ast_frfree(f);
strcpy(amdStatus , "MACHINE");
sprintf(amdCause , "LONGGREETING-%d-%d", voiceDuration, greeting);
res = 1;
break;
}

View File

@@ -167,9 +167,13 @@ static int auth_exec(struct ast_channel *chan, void *data)
char *md5secret = NULL;
while (!feof(f)) {
fgets(buf, sizeof(buf), f);
if (!feof(f) && !ast_strlen_zero(buf)) {
buf[strlen(buf) - 1] = '\0';
if (!fgets(buf, sizeof(buf), f)) {
continue;
}
if (!ast_strlen_zero(buf)) {
size_t len = strlen(buf);
if (buf[len - 1] == '\n')
buf[len - 1] = '\0';
if (ast_test_flag(&flags,OPT_MULTIPLE)) {
md5secret = strchr(buf, ':');
if (md5secret == NULL)

View File

@@ -51,8 +51,7 @@ static int nocdr_exec(struct ast_channel *chan, void *data)
u = ast_module_user_add(chan);
if (chan->cdr) {
ast_cdr_free(chan->cdr);
chan->cdr = NULL;
ast_set_flag(chan->cdr, AST_CDR_FLAG_POST_DISABLED);
}
ast_module_user_remove(u);

View File

@@ -108,6 +108,11 @@ static int asyncgoto_exec(struct ast_channel *chan, void *data)
if (option_debug > 1)
ast_log(LOG_DEBUG, "Attempting async goto (%s) to %s|%s|%d\n", args.channel, S_OR(context, chan2->context), S_OR(exten, chan2->exten), prio);
if (chan2->pbx) {
ast_channel_lock(chan2);
ast_set_flag(chan2, AST_FLAG_BRIDGE_HANGUP_DONT); /* don't let the after-bridge code run the h-exten */
ast_channel_unlock(chan2);
}
if (ast_async_goto_if_exists(chan2, S_OR(context, chan2->context), S_OR(exten, chan2->exten), prio))
ast_log(LOG_WARNING, "%s failed for %s\n", app, args.channel);
else

View File

@@ -2,7 +2,7 @@
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 2005 Anthony Minessale II (anthmct@yahoo.com)
* Copyright (C) 2005 - 2006, Digium, Inc.
* Copyright (C) 2005 - 2008, Digium, Inc.
*
* A license has been granted to Digium (via disclaimer) for the use of
* this code.
@@ -23,6 +23,8 @@
* \brief ChanSpy: Listen in on any channel.
*
* \author Anthony Minessale II <anthmct@yahoo.com>
* \author Joshua Colp <jcolp@digium.com>
* \author Russell Bryant <russell@digium.com>
*
* \ingroup applications
*/
@@ -36,11 +38,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <errno.h>
#include "asterisk/file.h"
#include "asterisk/logger.h"
#include "asterisk/channel.h"
#include "asterisk/chanspy.h"
#include "asterisk/audiohook.h"
#include "asterisk/features.h"
#include "asterisk/options.h"
#include "asterisk/app.h"
@@ -53,6 +56,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#define AST_NAME_STRLEN 256
/* "Zap/pseudo" is ten characters.
* "DAHDI/pseudo" is twelve characters.
*/
static const char *tdesc = "Listen to a channel, and optionally whisper into it";
static const char *app_chan = "ChanSpy";
static const char *desc_chan =
@@ -140,10 +147,12 @@ AST_APP_OPTIONS(spy_opts, {
AST_APP_OPTION_ARG('r', OPTION_RECORD, OPT_ARG_RECORD),
});
static int next_unique_id_to_use = 0;
struct chanspy_translation_helper {
/* spy data */
struct ast_channel_spy spy;
struct ast_audiohook spy_audiohook;
struct ast_audiohook whisper_audiohook;
int fd;
int volfactor;
};
@@ -162,26 +171,33 @@ static void spy_release(struct ast_channel *chan, void *data)
static int spy_generate(struct ast_channel *chan, void *data, int len, int samples)
{
struct chanspy_translation_helper *csth = data;
struct ast_frame *f;
if (csth->spy.status != CHANSPY_RUNNING)
/* Channel is already gone more than likely */
return -1;
struct ast_frame *f, *cur;
ast_mutex_lock(&csth->spy.lock);
f = ast_channel_spy_read_frame(&csth->spy, samples);
ast_mutex_unlock(&csth->spy.lock);
if (!f)
return 0;
if (ast_write(chan, f)) {
ast_frfree(f);
ast_audiohook_lock(&csth->spy_audiohook);
if (csth->spy_audiohook.status != AST_AUDIOHOOK_STATUS_RUNNING) {
ast_audiohook_unlock(&csth->spy_audiohook);
return -1;
}
if (csth->fd)
write(csth->fd, f->data, f->datalen);
f = ast_audiohook_read_frame(&csth->spy_audiohook, samples, AST_AUDIOHOOK_DIRECTION_BOTH, AST_FORMAT_SLINEAR);
ast_audiohook_unlock(&csth->spy_audiohook);
if (!f)
return 0;
for (cur = f; cur; cur = AST_LIST_NEXT(cur, frame_list)) {
if (ast_write(chan, cur)) {
ast_frfree(f);
return -1;
}
if (csth->fd) {
if (write(csth->fd, cur->data, cur->datalen) < 0) {
ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno));
}
}
}
ast_frfree(f);
@@ -194,54 +210,31 @@ static struct ast_generator spygen = {
.generate = spy_generate,
};
static int start_spying(struct ast_channel *chan, struct ast_channel *spychan, struct ast_channel_spy *spy)
static int start_spying(struct ast_channel *chan, const char *spychan_name, struct ast_audiohook *audiohook)
{
int res;
struct ast_channel *peer;
ast_log(LOG_NOTICE, "Attaching %s to %s\n", spychan->name, chan->name);
ast_log(LOG_NOTICE, "Attaching %s to %s\n", spychan_name, chan->name);
ast_channel_lock(chan);
res = ast_channel_spy_add(chan, spy);
ast_channel_unlock(chan);
ast_set_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC | AST_AUDIOHOOK_SMALL_QUEUE);
if (!res && ast_test_flag(chan, AST_FLAG_NBRIDGE) && (peer = ast_bridged_channel(chan)))
res = ast_audiohook_attach(chan, audiohook);
if (!res && ast_test_flag(chan, AST_FLAG_NBRIDGE) && (peer = ast_bridged_channel(chan))) {
ast_softhangup(peer, AST_SOFTHANGUP_UNBRIDGE);
}
return res;
}
/* Map 'volume' levels from -4 through +4 into
decibel (dB) settings for channel drivers
*/
static signed char volfactor_map[] = {
-24,
-18,
-12,
-6,
0,
6,
12,
18,
24,
struct chanspy_ds {
struct ast_channel *chan;
char unique_id[20];
ast_mutex_t lock;
};
/* attempt to set the desired gain adjustment via the channel driver;
if successful, clear it out of the csth structure so the
generator will not attempt to do the adjustment itself
*/
static void set_volume(struct ast_channel *chan, struct chanspy_translation_helper *csth)
{
signed char volume_adjust = volfactor_map[csth->volfactor + 4];
if (!ast_channel_setoption(chan, AST_OPTION_TXGAIN, &volume_adjust, sizeof(volume_adjust), 0))
csth->volfactor = 0;
csth->spy.read_vol_adjustment = csth->volfactor;
csth->spy.write_vol_adjustment = csth->volfactor;
}
static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int *volfactor, int fd,
const struct ast_flags *flags)
static int channel_spy(struct ast_channel *chan, struct chanspy_ds *spyee_chanspy_ds,
int *volfactor, int fd, const struct ast_flags *flags)
{
struct chanspy_translation_helper csth;
int running = 0, res, x = 0;
@@ -249,48 +242,61 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
char *name;
struct ast_frame *f;
struct ast_silence_generator *silgen = NULL;
struct ast_channel *spyee = NULL;
const char *spyer_name;
if (ast_check_hangup(chan) || ast_check_hangup(spyee))
ast_channel_lock(chan);
spyer_name = ast_strdupa(chan->name);
ast_channel_unlock(chan);
ast_mutex_lock(&spyee_chanspy_ds->lock);
if (spyee_chanspy_ds->chan) {
spyee = spyee_chanspy_ds->chan;
ast_channel_lock(spyee);
}
ast_mutex_unlock(&spyee_chanspy_ds->lock);
if (!spyee)
return 0;
/* We now hold the channel lock on spyee */
if (ast_check_hangup(chan) || ast_check_hangup(spyee)) {
ast_channel_unlock(spyee);
return 0;
}
name = ast_strdupa(spyee->name);
if (option_verbose >= 2)
ast_verbose(VERBOSE_PREFIX_2 "Spying on channel %s\n", name);
memset(&csth, 0, sizeof(csth));
ast_set_flag(&csth.spy, CHANSPY_FORMAT_AUDIO);
ast_set_flag(&csth.spy, CHANSPY_TRIGGER_NONE);
ast_set_flag(&csth.spy, CHANSPY_MIXAUDIO);
csth.spy.type = "ChanSpy";
csth.spy.status = CHANSPY_RUNNING;
csth.spy.read_queue.format = AST_FORMAT_SLINEAR;
csth.spy.write_queue.format = AST_FORMAT_SLINEAR;
ast_mutex_init(&csth.spy.lock);
csth.volfactor = *volfactor;
set_volume(chan, &csth);
csth.fd = fd;
if (start_spying(spyee, chan, &csth.spy)) {
ast_mutex_destroy(&csth.spy.lock);
ast_audiohook_init(&csth.spy_audiohook, AST_AUDIOHOOK_TYPE_SPY, "ChanSpy");
if (start_spying(spyee, spyer_name, &csth.spy_audiohook)) {
ast_audiohook_destroy(&csth.spy_audiohook);
ast_channel_unlock(spyee);
return 0;
}
if (ast_test_flag(flags, OPTION_WHISPER)) {
struct ast_filestream *beepstream;
ast_channel_whisper_start(csth.spy.chan);
if ((beepstream = ast_openstream_full(chan, "beep", chan->language, 1))) {
struct ast_frame *f;
while ((f = ast_readframe(beepstream))) {
ast_channel_whisper_feed(csth.spy.chan, f);
ast_frfree(f);
}
ast_closestream(beepstream);
}
ast_audiohook_init(&csth.whisper_audiohook, AST_AUDIOHOOK_TYPE_WHISPER, "ChanSpy");
start_spying(spyee, spyer_name, &csth.whisper_audiohook);
}
ast_channel_unlock(spyee);
spyee = NULL;
csth.volfactor = *volfactor;
if (csth.volfactor) {
csth.spy_audiohook.options.read_volume = csth.volfactor;
csth.spy_audiohook.options.write_volume = csth.volfactor;
}
csth.fd = fd;
if (ast_test_flag(flags, OPTION_PRIVATE))
silgen = ast_channel_start_silence_generator(chan);
else
@@ -310,17 +316,16 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
has arrived, since the spied-on channel could have gone away while
we were waiting
*/
while ((res = ast_waitfor(chan, -1) > -1) &&
csth.spy.status == CHANSPY_RUNNING &&
csth.spy.chan) {
while ((res = ast_waitfor(chan, -1) > -1) && csth.spy_audiohook.status == AST_AUDIOHOOK_STATUS_RUNNING) {
if (!(f = ast_read(chan)) || ast_check_hangup(chan)) {
running = -1;
break;
}
if (ast_test_flag(flags, OPTION_WHISPER) &&
(f->frametype == AST_FRAME_VOICE)) {
ast_channel_whisper_feed(csth.spy.chan, f);
if (ast_test_flag(flags, OPTION_WHISPER) && (f->frametype == AST_FRAME_VOICE)) {
ast_audiohook_lock(&csth.whisper_audiohook);
ast_audiohook_write_frame(&csth.whisper_audiohook, AST_AUDIOHOOK_DIRECTION_WRITE, f);
ast_audiohook_unlock(&csth.whisper_audiohook);
ast_frfree(f);
continue;
}
@@ -353,28 +358,29 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Setting spy volume on %s to %d\n", chan->name, *volfactor);
csth.volfactor = *volfactor;
set_volume(chan, &csth);
csth.spy_audiohook.options.read_volume = csth.volfactor;
csth.spy_audiohook.options.write_volume = csth.volfactor;
} else if (res >= '0' && res <= '9') {
inp[x++] = res;
}
}
if (ast_test_flag(flags, OPTION_WHISPER) && csth.spy.chan)
ast_channel_whisper_stop(csth.spy.chan);
if (ast_test_flag(flags, OPTION_PRIVATE))
ast_channel_stop_silence_generator(chan, silgen);
else
ast_deactivate_generator(chan);
/* If a channel still exists on our spy structure then we need to remove ourselves */
if (csth.spy.chan) {
csth.spy.status = CHANSPY_DONE;
ast_channel_lock(csth.spy.chan);
ast_channel_spy_remove(csth.spy.chan, &csth.spy);
ast_channel_unlock(csth.spy.chan);
if (ast_test_flag(flags, OPTION_WHISPER)) {
ast_audiohook_lock(&csth.whisper_audiohook);
ast_audiohook_detach(&csth.whisper_audiohook);
ast_audiohook_unlock(&csth.whisper_audiohook);
ast_audiohook_destroy(&csth.whisper_audiohook);
}
ast_channel_spy_free(&csth.spy);
ast_audiohook_lock(&csth.spy_audiohook);
ast_audiohook_detach(&csth.spy_audiohook);
ast_audiohook_unlock(&csth.spy_audiohook);
ast_audiohook_destroy(&csth.spy_audiohook);
if (option_verbose >= 2)
ast_verbose(VERBOSE_PREFIX_2 "Done Spying on channel %s\n", name);
@@ -382,12 +388,99 @@ static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int
return running;
}
static struct ast_channel *next_channel(const struct ast_channel *last, const char *spec,
const char *exten, const char *context)
/*!
* \note This relies on the embedded lock to be recursive, as it may be called
* due to a call to chanspy_ds_free with the lock held there.
*/
static void chanspy_ds_destroy(void *data)
{
struct chanspy_ds *chanspy_ds = data;
/* Setting chan to be NULL is an atomic operation, but we don't want this
* value to change while this lock is held. The lock is held elsewhere
* while it performs non-atomic operations with this channel pointer */
ast_mutex_lock(&chanspy_ds->lock);
chanspy_ds->chan = NULL;
ast_mutex_unlock(&chanspy_ds->lock);
}
static void chanspy_ds_chan_fixup(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)
{
struct chanspy_ds *chanspy_ds = data;
ast_mutex_lock(&chanspy_ds->lock);
chanspy_ds->chan = new_chan;
ast_mutex_unlock(&chanspy_ds->lock);
}
static const struct ast_datastore_info chanspy_ds_info = {
.type = "chanspy",
.destroy = chanspy_ds_destroy,
.chan_fixup = chanspy_ds_chan_fixup,
};
static struct chanspy_ds *chanspy_ds_free(struct chanspy_ds *chanspy_ds)
{
if (!chanspy_ds)
return NULL;
ast_mutex_lock(&chanspy_ds->lock);
if (chanspy_ds->chan) {
struct ast_datastore *datastore;
struct ast_channel *chan;
chan = chanspy_ds->chan;
ast_channel_lock(chan);
if ((datastore = ast_channel_datastore_find(chan, &chanspy_ds_info, chanspy_ds->unique_id))) {
ast_channel_datastore_remove(chan, datastore);
/* chanspy_ds->chan is NULL after this call */
chanspy_ds_destroy(datastore->data);
datastore->data = NULL;
ast_channel_datastore_free(datastore);
}
ast_channel_unlock(chan);
}
ast_mutex_unlock(&chanspy_ds->lock);
return NULL;
}
/*! \note Returns the channel in the chanspy_ds locked as well as the chanspy_ds locked */
static struct chanspy_ds *setup_chanspy_ds(struct ast_channel *chan, struct chanspy_ds *chanspy_ds)
{
struct ast_datastore *datastore = NULL;
ast_mutex_lock(&chanspy_ds->lock);
if (!(datastore = ast_channel_datastore_alloc(&chanspy_ds_info, chanspy_ds->unique_id))) {
ast_mutex_unlock(&chanspy_ds->lock);
chanspy_ds = chanspy_ds_free(chanspy_ds);
ast_channel_unlock(chan);
return NULL;
}
chanspy_ds->chan = chan;
datastore->data = chanspy_ds;
ast_channel_datastore_add(chan, datastore);
return chanspy_ds;
}
static struct chanspy_ds *next_channel(struct ast_channel *chan,
const struct ast_channel *last, const char *spec,
const char *exten, const char *context, struct chanspy_ds *chanspy_ds)
{
struct ast_channel *this;
char channel_name[AST_CHANNEL_NAME];
static size_t PSEUDO_CHAN_LEN = 0;
redo:
if (!PSEUDO_CHAN_LEN) {
PSEUDO_CHAN_LEN = *dahdi_chan_name_len + strlen("/pseudo");
}
redo:
if (spec)
this = ast_walk_channel_by_name_prefix_locked(last, spec, strlen(spec));
else if (exten)
@@ -395,20 +488,27 @@ static struct ast_channel *next_channel(const struct ast_channel *last, const ch
else
this = ast_channel_walk_locked(last);
if (this) {
if (!this)
return NULL;
snprintf(channel_name, AST_CHANNEL_NAME, "%s/pseudo", dahdi_chan_name);
if (!strncmp(this->name, channel_name, PSEUDO_CHAN_LEN)) {
last = this;
ast_channel_unlock(this);
if (!strncmp(this->name, "Zap/pseudo", 10))
goto redo;
goto redo;
} else if (this == chan) {
last = this;
ast_channel_unlock(this);
goto redo;
}
return this;
return setup_chanspy_ds(this, chanspy_ds);
}
static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
int volfactor, const int fd, const char *mygroup, const char *spec,
const char *exten, const char *context)
{
struct ast_channel *peer, *prev, *next;
char nameprefix[AST_NAME_STRLEN];
char peer_name[AST_NAME_STRLEN + 5];
signed char zero_volume = 0;
@@ -416,6 +516,12 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
int res;
char *ptr;
int num;
int num_spyed_upon = 1;
struct chanspy_ds chanspy_ds = { 0, };
ast_mutex_init(&chanspy_ds.lock);
snprintf(chanspy_ds.unique_id, sizeof(chanspy_ds.unique_id), "%d", ast_atomic_fetchadd_int(&next_unique_id_to_use, +1));
if (chan->_state != AST_STATE_UP)
ast_answer(chan);
@@ -425,7 +531,10 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
waitms = 100;
for (;;) {
if (!ast_test_flag(flags, OPTION_QUIET)) {
struct chanspy_ds *peer_chanspy_ds = NULL, *next_chanspy_ds = NULL;
struct ast_channel *prev = NULL, *peer = NULL;
if (!ast_test_flag(flags, OPTION_QUIET) && num_spyed_upon) {
res = ast_streamfile(chan, "beep", chan->language);
if (!res)
res = ast_waitstream(chan, "");
@@ -443,34 +552,50 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
/* reset for the next loop around, unless overridden later */
waitms = 100;
peer = prev = next = NULL;
num_spyed_upon = 0;
for (peer = next_channel(peer, spec, exten, context);
peer;
prev = peer, peer = next ? next : next_channel(peer, spec, exten, context), next = NULL) {
for (peer_chanspy_ds = next_channel(chan, prev, spec, exten, context, &chanspy_ds);
peer_chanspy_ds;
chanspy_ds_free(peer_chanspy_ds), prev = peer,
peer_chanspy_ds = next_chanspy_ds ? next_chanspy_ds :
next_channel(chan, prev, spec, exten, context, &chanspy_ds), next_chanspy_ds = NULL) {
const char *group;
int igrp = !mygroup;
char *groups[25];
int num_groups = 0;
char *dup_group;
char dup_group[512];
int x;
char *s;
if (peer == prev)
peer = peer_chanspy_ds->chan;
ast_mutex_unlock(&peer_chanspy_ds->lock);
if (peer == prev) {
ast_channel_unlock(peer);
chanspy_ds_free(peer_chanspy_ds);
break;
}
if (peer == chan)
continue;
if (ast_check_hangup(chan)) {
ast_channel_unlock(peer);
chanspy_ds_free(peer_chanspy_ds);
break;
}
if (ast_test_flag(flags, OPTION_BRIDGED) && !ast_bridged_channel(peer))
if (ast_test_flag(flags, OPTION_BRIDGED) && !ast_bridged_channel(peer)) {
ast_channel_unlock(peer);
continue;
}
if (ast_check_hangup(peer) || ast_test_flag(peer, AST_FLAG_SPYING))
if (ast_check_hangup(peer) || ast_test_flag(peer, AST_FLAG_SPYING)) {
ast_channel_unlock(peer);
continue;
}
if (mygroup) {
if ((group = pbx_builtin_getvar_helper(peer, "SPYGROUP"))) {
dup_group = ast_strdupa(group);
ast_copy_string(dup_group, group, sizeof(dup_group));
num_groups = ast_app_separate_args(dup_group, ':', groups,
sizeof(groups) / sizeof(groups[0]));
}
@@ -483,47 +608,73 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
}
}
if (!igrp)
if (!igrp) {
ast_channel_unlock(peer);
continue;
}
strcpy(peer_name, "spy-");
strncat(peer_name, peer->name, AST_NAME_STRLEN);
strncat(peer_name, peer->name, AST_NAME_STRLEN - 4 - 1);
ptr = strchr(peer_name, '/');
*ptr++ = '\0';
for (s = peer_name; s < ptr; s++)
*s = tolower(*s);
/* We have to unlock the peer channel here to avoid a deadlock.
* So, when we need to dereference it again, we have to lock the
* datastore and get the pointer from there to see if the channel
* is still valid. */
ast_channel_unlock(peer);
if (!ast_test_flag(flags, OPTION_QUIET)) {
if (ast_fileexists(peer_name, NULL, NULL) != -1) {
res = ast_streamfile(chan, peer_name, chan->language);
if (!res)
res = ast_waitstream(chan, "");
if (res)
if (res) {
chanspy_ds_free(peer_chanspy_ds);
break;
}
} else
res = ast_say_character_str(chan, peer_name, "", chan->language);
if ((num = atoi(ptr)))
ast_say_digits(chan, atoi(ptr), "", chan->language);
}
waitms = 5000;
res = channel_spy(chan, peer, &volfactor, fd, flags);
res = channel_spy(chan, peer_chanspy_ds, &volfactor, fd, flags);
num_spyed_upon++;
if (res == -1) {
chanspy_ds_free(peer_chanspy_ds);
break;
} else if (res > 1 && spec) {
struct ast_channel *next;
snprintf(nameprefix, AST_NAME_STRLEN, "%s/%d", spec, res);
if ((next = ast_get_channel_by_name_prefix_locked(nameprefix, strlen(nameprefix)))) {
ast_channel_unlock(next);
peer_chanspy_ds = chanspy_ds_free(peer_chanspy_ds);
next_chanspy_ds = setup_chanspy_ds(next, &chanspy_ds);
} else {
/* stay on this channel */
next = peer;
/* stay on this channel, if it is still valid */
ast_mutex_lock(&peer_chanspy_ds->lock);
if (peer_chanspy_ds->chan) {
ast_channel_lock(peer_chanspy_ds->chan);
next_chanspy_ds = peer_chanspy_ds;
peer_chanspy_ds = NULL;
} else {
/* the channel is gone */
ast_mutex_unlock(&peer_chanspy_ds->lock);
next_chanspy_ds = NULL;
}
}
peer = NULL;
}
}
if (res == -1)
if (res == -1 || ast_check_hangup(chan))
break;
}
@@ -531,6 +682,10 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
ast_channel_setoption(chan, AST_OPTION_TXGAIN, &zero_volume, sizeof(zero_volume), 0);
ast_mutex_lock(&chanspy_ds.lock);
ast_mutex_unlock(&chanspy_ds.lock);
ast_mutex_destroy(&chanspy_ds.lock);
return res;
}
@@ -576,7 +731,7 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
if (ast_test_flag(&flags, OPTION_VOLUME) && opts[OPT_ARG_VOLUME]) {
int vol;
if ((sscanf(opts[OPT_ARG_VOLUME], "%d", &vol) != 1) || (vol > 4) || (vol < -4))
if ((sscanf(opts[OPT_ARG_VOLUME], "%30d", &vol) != 1) || (vol > 4) || (vol < -4))
ast_log(LOG_NOTICE, "Volume factor must be a number between -4 and 4\n");
else
volfactor = vol;
@@ -584,7 +739,8 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
if (ast_test_flag(&flags, OPTION_PRIVATE))
ast_set_flag(&flags, OPTION_WHISPER);
}
} else
ast_clear_flag(&flags, AST_FLAGS_ALL);
oldwf = chan->writeformat;
if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
@@ -594,7 +750,7 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
}
if (recbase) {
char filename[512];
char filename[PATH_MAX];
snprintf(filename, sizeof(filename), "%s/%s.%d.raw", ast_config_AST_MONITOR_DIR, recbase, (int) time(NULL));
if ((fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0644)) <= 0) {
@@ -638,7 +794,8 @@ static int extenspy_exec(struct ast_channel *chan, void *data)
if ((argc = ast_app_separate_args(data, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
context = argv[0];
exten = strsep(&context, "@");
if (!ast_strlen_zero(argv[0]))
exten = strsep(&context, "@");
if (ast_strlen_zero(context))
context = ast_strdupa(chan->context);
if (argc > 1)
@@ -659,7 +816,7 @@ static int extenspy_exec(struct ast_channel *chan, void *data)
if (ast_test_flag(&flags, OPTION_VOLUME) && opts[OPT_ARG_VOLUME]) {
int vol;
if ((sscanf(opts[OPT_ARG_VOLUME], "%d", &vol) != 1) || (vol > 4) || (vol < -4))
if ((sscanf(opts[OPT_ARG_VOLUME], "%30d", &vol) != 1) || (vol > 4) || (vol < -4))
ast_log(LOG_NOTICE, "Volume factor must be a number between -4 and 4\n");
else
volfactor = vol;
@@ -667,7 +824,8 @@ static int extenspy_exec(struct ast_channel *chan, void *data)
if (ast_test_flag(&flags, OPTION_PRIVATE))
ast_set_flag(&flags, OPTION_WHISPER);
}
} else
ast_clear_flag(&flags, AST_FLAGS_ALL);
oldwf = chan->writeformat;
if (ast_set_write_format(chan, AST_FORMAT_SLINEAR) < 0) {
@@ -677,7 +835,7 @@ static int extenspy_exec(struct ast_channel *chan, void *data)
}
if (recbase) {
char filename[512];
char filename[PATH_MAX];
snprintf(filename, sizeof(filename), "%s/%s.%d.raw", ast_config_AST_MONITOR_DIR, recbase, (int) time(NULL));
if ((fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0644)) <= 0) {

View File

@@ -132,7 +132,7 @@ static int controlplayback_exec(struct ast_channel *chan, void *data)
res = ast_control_streamfile(chan, argv[arg_file], argv[arg_fwd], argv[arg_rev], argv[arg_stop], argv[arg_pause], argv[arg_restart], skipms);
/* If we stopped on one of our stop keys, return 0 */
if (argv[arg_stop] && strchr(argv[arg_stop], res)) {
if (res > 0 && argv[arg_stop] && strchr(argv[arg_stop], res)) {
res = 0;
pbx_builtin_setvar_helper(chan, "CPLAYBACKSTATUS", "USERSTOPPED");
} else {

View File

@@ -32,7 +32,7 @@
*/
/*** MODULEINFO
<depend>zaptel</depend>
<depend>dahdi</depend>
***/
#include "asterisk.h"
@@ -45,7 +45,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <unistd.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <zaptel/zaptel.h>
#include "asterisk/lock.h"
#include "asterisk/file.h"
@@ -60,16 +59,25 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/say.h"
#include "asterisk/utils.h"
static char *app = "ZapBarge";
#include "asterisk/dahdi_compat.h"
static char *synopsis = "Barge in (monitor) Zap channel";
static char *dahdi_app = "DAHDIBarge";
static char *zap_app = "ZapBarge";
static char *descrip =
" ZapBarge([channel]): Barges in on a specified zap\n"
static char *dahdi_synopsis = "Barge in (monitor) DAHDI channel";
static char *zap_synopsis = "Barge in (monitor) Zap channel";
static char *dahdi_descrip =
" DAHDIBarge([channel]): Barges in on a specified DAHDI\n"
"channel or prompts if one is not specified. Returns\n"
"-1 when caller user hangs up and is independent of the\n"
"state of the channel being monitored.";
static char *zap_descrip =
" ZapBarge([channel]): Barges in on a specified Zaptel\n"
"channel or prompts if one is not specified. Returns\n"
"-1 when caller user hangs up and is independent of the\n"
"state of the channel being monitored.";
#define CONF_SIZE 160
@@ -94,7 +102,7 @@ static int careful_write(int fd, unsigned char *data, int len)
static int conf_run(struct ast_channel *chan, int confno, int confflags)
{
int fd;
struct zt_confinfo ztc;
struct dahdi_confinfo ztc;
struct ast_frame *f;
struct ast_channel *c;
struct ast_frame fr;
@@ -106,8 +114,7 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
int retryzap;
int origfd;
int ret = -1;
ZT_BUFFERINFO bi;
struct dahdi_bufferinfo bi;
char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
char *buf = __buf + AST_FRIENDLY_OFFSET;
@@ -123,11 +130,11 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
goto outrun;
}
ast_indicate(chan, -1);
retryzap = strcasecmp(chan->tech->type, "Zap");
retryzap = strcasecmp(chan->tech->type, dahdi_chan_name);
zapretry:
origfd = chan->fds[0];
if (retryzap) {
fd = open("/dev/zap/pseudo", O_RDWR);
fd = open(DAHDI_FILE_PSEUDO, O_RDWR);
if (fd < 0) {
ast_log(LOG_WARNING, "Unable to open pseudo channel: %s\n", strerror(errno));
goto outrun;
@@ -147,10 +154,10 @@ zapretry:
/* Setup buffering information */
memset(&bi, 0, sizeof(bi));
bi.bufsize = CONF_SIZE;
bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.numbufs = 4;
if (ioctl(fd, ZT_SET_BUFINFO, &bi)) {
if (ioctl(fd, DAHDI_SET_BUFINFO, &bi)) {
ast_log(LOG_WARNING, "Unable to set buffering information: %s\n", strerror(errno));
close(fd);
goto outrun;
@@ -164,7 +171,7 @@ zapretry:
memset(&ztc, 0, sizeof(ztc));
/* Check to see if we're in a conference... */
ztc.chan = 0;
if (ioctl(fd, ZT_GETCONF, &ztc)) {
if (ioctl(fd, DAHDI_GETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error getting conference\n");
close(fd);
goto outrun;
@@ -172,7 +179,7 @@ zapretry:
if (ztc.confmode) {
/* Whoa, already in a conference... Retry... */
if (!retryzap) {
ast_log(LOG_DEBUG, "Zap channel is in a conference already, retrying with pseudo\n");
ast_log(LOG_DEBUG, "Channel is in a conference already, retrying with pseudo\n");
retryzap = 1;
goto zapretry;
}
@@ -181,14 +188,14 @@ zapretry:
/* Add us to the conference */
ztc.chan = 0;
ztc.confno = confno;
ztc.confmode = ZT_CONF_MONITORBOTH;
ztc.confmode = DAHDI_CONF_MONITORBOTH;
if (ioctl(fd, ZT_SETCONF, &ztc)) {
if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
goto outrun;
}
ast_log(LOG_DEBUG, "Placed channel %s in ZAP channel %d monitor\n", chan->name, confno);
ast_log(LOG_DEBUG, "Placed channel %s in channel %d monitor\n", chan->name, confno);
for(;;) {
outfd = -1;
@@ -247,7 +254,7 @@ zapretry:
ztc.chan = 0;
ztc.confno = 0;
ztc.confmode = 0;
if (ioctl(fd, ZT_SETCONF, &ztc)) {
if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
}
}
@@ -257,7 +264,7 @@ outrun:
return ret;
}
static int conf_exec(struct ast_channel *chan, void *data)
static int exec(struct ast_channel *chan, void *data, int dahdimode)
{
int res=-1;
struct ast_module_user *u;
@@ -269,11 +276,20 @@ static int conf_exec(struct ast_channel *chan, void *data)
u = ast_module_user_add(chan);
if (!ast_strlen_zero(data)) {
if ((sscanf(data, "Zap/%d", &confno) != 1) &&
(sscanf(data, "%d", &confno) != 1)) {
ast_log(LOG_WARNING, "ZapBarge Argument (if specified) must be a channel number, not '%s'\n", (char *)data);
ast_module_user_remove(u);
return 0;
if (dahdimode) {
if ((sscanf(data, "DAHDI/%30d", &confno) != 1) &&
(sscanf(data, "%30d", &confno) != 1)) {
ast_log(LOG_WARNING, "Argument (if specified) must be a channel number, not '%s'\n", (char *) data);
ast_module_user_remove(u);
return 0;
}
} else {
if ((sscanf(data, "Zap/%30d", &confno) != 1) &&
(sscanf(data, "%30d", &confno) != 1)) {
ast_log(LOG_WARNING, "Argument (if specified) must be a channel number, not '%s'\n", (char *) data);
ast_module_user_remove(u);
return 0;
}
}
}
@@ -285,7 +301,7 @@ static int conf_exec(struct ast_channel *chan, void *data)
confstr[0] = '\0';
res = ast_app_getdata(chan, "conf-getchannel",confstr, sizeof(confstr) - 1, 0);
if (res <0) goto out;
if (sscanf(confstr, "%d", &confno) != 1)
if (sscanf(confstr, "%30d", &confno) != 1)
confno = 0;
}
if (confno) {
@@ -299,20 +315,44 @@ out:
return res;
}
static int unload_module(void)
static int exec_zap(struct ast_channel *chan, void *data)
{
int res;
ast_log(LOG_WARNING, "Use of the command %s is deprecated, please use %s instead.\n", zap_app, dahdi_app);
res = ast_unregister_application(app);
return exec(chan, data, 0);
}
static int exec_dahdi(struct ast_channel *chan, void *data)
{
return exec(chan, data, 1);
}
static int unload_module(void)
{
int res = 0;
if (*dahdi_chan_mode == CHAN_DAHDI_PLUS_ZAP_MODE) {
res |= ast_unregister_application(dahdi_app);
}
res |= ast_unregister_application(zap_app);
ast_module_user_hangup_all();
return res;
return res;
}
static int load_module(void)
{
return ast_register_application(app, conf_exec, synopsis, descrip);
int res = 0;
if (*dahdi_chan_mode == CHAN_DAHDI_PLUS_ZAP_MODE) {
res |= ast_register_application(dahdi_app, exec_dahdi, dahdi_synopsis, dahdi_descrip);
}
res |= ast_register_application(zap_app, exec_zap, zap_synopsis, zap_descrip);
return res;
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Barge in on Zap channel application");
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Barge in on channel application");

View File

@@ -26,7 +26,8 @@
*/
/*** MODULEINFO
<depend>zaptel</depend>
<depend>dahdi</depend>
<depend>working_fork</depend>
***/
#include "asterisk.h"
@@ -48,7 +49,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
#include <zaptel/zaptel.h>
#include "asterisk/dahdi_compat.h"
#ifdef HAVE_CAP
#include <sys/capability.h>
#endif /* HAVE_CAP */
#include "asterisk/lock.h"
#include "asterisk/file.h"
@@ -58,17 +64,25 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/module.h"
#include "asterisk/options.h"
static char *app = "ZapRAS";
static char *dahdi_app = "DAHDIRAS";
static char *zap_app = "ZapRAS";
static char *synopsis = "Executes Zaptel ISDN RAS application";
static char *dahdi_synopsis = "Executes DAHDI ISDN RAS application";
static char *zap_synopsis = "Executes Zaptel ISDN RAS application";
static char *descrip =
" ZapRAS(args): Executes a RAS server using pppd on the given channel.\n"
"The channel must be a clear channel (i.e. PRI source) and a Zaptel\n"
"channel to be able to use this function (No modem emulation is included).\n"
"Your pppd must be patched to be zaptel aware. Arguments should be\n"
static char *dahdi_descrip =
" DAHDIRAS(args): Executes a RAS server using pppd on the given channel.\n"
"The channel must be a clear channel (i.e. PRI source) and a DAHDI\n"
"channel to be able to use this function (no modem emulation is included).\n"
"Your pppd must have the DAHDI plugin available. Arguments should be\n"
"separated by | characters.\n";
static char *zap_descrip =
" ZapRAS(args): Executes a RAS server using pppd on the given channel.\n"
"The channel must be a clear channel (i.e. PRI source) and a Zaptel\n"
"channel to be able to use this function (no modem emulation is included).\n"
"Your pppd must have the Zaptel plugin available. Arguments should be\n"
"separated by | characters.\n";
#define PPP_MAX_ARGS 32
#define PPP_EXEC "/usr/sbin/pppd"
@@ -82,11 +96,36 @@ static pid_t spawn_ras(struct ast_channel *chan, char *args)
char *argv[PPP_MAX_ARGS];
int argc = 0;
char *stringp=NULL;
sigset_t fullset, oldset;
#ifdef HAVE_CAP
cap_t cap;
#endif
sigfillset(&fullset);
pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
/* Start by forking */
pid = fork();
if (pid)
if (pid) {
pthread_sigmask(SIG_SETMASK, &oldset, NULL);
return pid;
}
#ifdef HAVE_CAP
cap = cap_from_text("cap_net_admin-eip");
if (cap_set_proc(cap)) {
/* Careful with order! Logging cannot happen after we close FDs */
ast_log(LOG_WARNING, "Unable to remove capabilities.\n");
}
cap_free(cap);
#endif
/* Restore original signal handlers */
for (x=0;x<NSIG;x++)
signal(x, SIG_DFL);
pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
/* Execute RAS on File handles */
dup2(chan->fds[0], STDIN_FILENO);
@@ -99,15 +138,11 @@ static pid_t spawn_ras(struct ast_channel *chan, char *args)
for (x=STDERR_FILENO + 1;x<1024;x++)
close(x);
/* Restore original signal handlers */
for (x=0;x<NSIG;x++)
signal(x, SIG_DFL);
/* Reset all arguments */
memset(argv, 0, sizeof(argv));
/* First argument is executable, followed by standard
arguments for zaptel PPP */
arguments for DAHDI PPP */
argv[argc++] = PPP_EXEC;
argv[argc++] = "nodetach";
@@ -120,7 +155,11 @@ static pid_t spawn_ras(struct ast_channel *chan, char *args)
}
argv[argc++] = "plugin";
#ifdef HAVE_ZAPTEL
argv[argc++] = "zaptel.so";
#else
argv[argc++] = "dahdi.so";
#endif
argv[argc++] = "stdin";
/* Finally launch PPP */
@@ -135,10 +174,10 @@ static void run_ras(struct ast_channel *chan, char *args)
int status;
int res;
int signalled = 0;
struct zt_bufferinfo savebi;
struct dahdi_bufferinfo savebi;
int x;
res = ioctl(chan->fds[0], ZT_GET_BUFINFO, &savebi);
res = ioctl(chan->fds[0], DAHDI_GET_BUFINFO, &savebi);
if(res) {
ast_log(LOG_WARNING, "Unable to check buffer policy on channel %s\n", chan->name);
return;
@@ -176,10 +215,10 @@ static void run_ras(struct ast_channel *chan, char *args)
}
/* Throw back into audio mode */
x = 1;
ioctl(chan->fds[0], ZT_AUDIOMODE, &x);
ioctl(chan->fds[0], DAHDI_AUDIOMODE, &x);
/* Restore saved values */
res = ioctl(chan->fds[0], ZT_SET_BUFINFO, &savebi);
res = ioctl(chan->fds[0], DAHDI_SET_BUFINFO, &savebi);
if (res < 0) {
ast_log(LOG_WARNING, "Unable to set buffer policy on channel %s\n", chan->name);
}
@@ -188,12 +227,12 @@ static void run_ras(struct ast_channel *chan, char *args)
}
}
static int zapras_exec(struct ast_channel *chan, void *data)
static int exec(struct ast_channel *chan, void *data)
{
int res=-1;
char *args;
struct ast_module_user *u;
ZT_PARAMS ztp;
struct dahdi_params ztp;
if (!data)
data = "";
@@ -205,17 +244,15 @@ static int zapras_exec(struct ast_channel *chan, void *data)
/* Answer the channel if it's not up */
if (chan->_state != AST_STATE_UP)
ast_answer(chan);
if (strcasecmp(chan->tech->type, "Zap")) {
/* If it's not a zap channel, we're done. Wait a couple of
seconds and then hangup... */
if (strcasecmp(chan->tech->type, dahdi_chan_name)) {
if (option_verbose > 1)
ast_verbose(VERBOSE_PREFIX_2 "Channel %s is not a Zap channel\n", chan->name);
ast_verbose(VERBOSE_PREFIX_2 "Channel %s is not a %s channel\n", chan->name, dahdi_chan_name);
sleep(2);
} else {
memset(&ztp, 0, sizeof(ztp));
if (ioctl(chan->fds[0], ZT_GET_PARAMS, &ztp)) {
ast_log(LOG_WARNING, "Unable to get zaptel parameters\n");
} else if (ztp.sigtype != ZT_SIG_CLEAR) {
if (ioctl(chan->fds[0], DAHDI_GET_PARAMS, &ztp)) {
ast_log(LOG_WARNING, "Unable to get parameters\n");
} else if (ztp.sigtype != DAHDI_SIG_CLEAR) {
if (option_verbose > 1)
ast_verbose(VERBOSE_PREFIX_2 "Channel %s is not a clear channel\n", chan->name);
} else {
@@ -230,11 +267,22 @@ static int zapras_exec(struct ast_channel *chan, void *data)
return res;
}
static int exec_warn(struct ast_channel *chan, void *data)
{
ast_log(LOG_WARNING, "Use of the command %s is deprecated, please use %s instead.\n", zap_app, dahdi_app);
return exec(chan, data);
}
static int unload_module(void)
{
int res;
int res = 0;
res = ast_unregister_application(app);
if (*dahdi_chan_mode == CHAN_DAHDI_PLUS_ZAP_MODE) {
res |= ast_unregister_application(dahdi_app);
}
res |= ast_unregister_application(zap_app);
ast_module_user_hangup_all();
@@ -243,8 +291,16 @@ static int unload_module(void)
static int load_module(void)
{
return ast_register_application(app, zapras_exec, synopsis, descrip);
int res = 0;
if (*dahdi_chan_mode == CHAN_DAHDI_PLUS_ZAP_MODE) {
res |= ast_register_application(dahdi_app, exec, dahdi_synopsis, dahdi_descrip);
}
res |= ast_register_application(zap_app, exec_warn, zap_synopsis, zap_descrip);
return res;
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Zap RAS Application");
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "DAHDI RAS Application");

View File

@@ -31,7 +31,7 @@
*/
/*** MODULEINFO
<depend>zaptel</depend>
<depend>dahdi</depend>
***/
#include "asterisk.h"
@@ -44,7 +44,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <unistd.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <zaptel/zaptel.h>
#include "asterisk/lock.h"
#include "asterisk/file.h"
@@ -59,7 +58,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/cli.h"
#include "asterisk/say.h"
static char *app = "ZapScan";
#include "asterisk/dahdi_compat.h"
static char *app = "DAHDIScan";
static char *deprecated_app = "ZapScan";
static char *synopsis = "Scan Zap channels to monitor calls";
@@ -74,7 +76,7 @@ static char *descrip =
static struct ast_channel *get_zap_channel_locked(int num) {
char name[80];
snprintf(name,sizeof(name),"Zap/%d-1",num);
snprintf(name,sizeof(name),"%s/%d-1", dahdi_chan_name, num);
return ast_get_channel_by_name_locked(name);
}
@@ -99,7 +101,7 @@ static int careful_write(int fd, unsigned char *data, int len)
static int conf_run(struct ast_channel *chan, int confno, int confflags)
{
int fd;
struct zt_confinfo ztc;
struct dahdi_confinfo ztc;
struct ast_frame *f;
struct ast_channel *c;
struct ast_frame fr;
@@ -113,8 +115,7 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
int ret = -1;
char input[4];
int ic=0;
ZT_BUFFERINFO bi;
struct dahdi_bufferinfo bi;
char __buf[CONF_SIZE + AST_FRIENDLY_OFFSET];
char *buf = __buf + AST_FRIENDLY_OFFSET;
@@ -134,7 +135,7 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
zapretry:
origfd = chan->fds[0];
if (retryzap) {
fd = open("/dev/zap/pseudo", O_RDWR);
fd = open(DAHDI_FILE_PSEUDO, O_RDWR);
if (fd < 0) {
ast_log(LOG_WARNING, "Unable to open pseudo channel: %s\n", strerror(errno));
goto outrun;
@@ -154,10 +155,10 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
/* Setup buffering information */
memset(&bi, 0, sizeof(bi));
bi.bufsize = CONF_SIZE;
bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE;
bi.numbufs = 4;
if (ioctl(fd, ZT_SET_BUFINFO, &bi)) {
if (ioctl(fd, DAHDI_SET_BUFINFO, &bi)) {
ast_log(LOG_WARNING, "Unable to set buffering information: %s\n", strerror(errno));
close(fd);
goto outrun;
@@ -171,7 +172,7 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
memset(&ztc, 0, sizeof(ztc));
/* Check to see if we're in a conference... */
ztc.chan = 0;
if (ioctl(fd, ZT_GETCONF, &ztc)) {
if (ioctl(fd, DAHDI_GETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error getting conference\n");
close(fd);
goto outrun;
@@ -188,9 +189,9 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
/* Add us to the conference */
ztc.chan = 0;
ztc.confno = confno;
ztc.confmode = ZT_CONF_MONITORBOTH;
ztc.confmode = DAHDI_CONF_MONITORBOTH;
if (ioctl(fd, ZT_SETCONF, &ztc)) {
if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
close(fd);
goto outrun;
@@ -274,7 +275,7 @@ static int conf_run(struct ast_channel *chan, int confno, int confflags)
ztc.chan = 0;
ztc.confno = 0;
ztc.confmode = 0;
if (ioctl(fd, ZT_SETCONF, &ztc)) {
if (ioctl(fd, DAHDI_SETCONF, &ztc)) {
ast_log(LOG_WARNING, "Error setting conference\n");
}
}
@@ -361,6 +362,12 @@ static int conf_exec(struct ast_channel *chan, void *data)
return res;
}
static int conf_exec_warn(struct ast_channel *chan, void *data)
{
ast_log(LOG_WARNING, "Use of the command %s is deprecated, please use %s instead.\n", deprecated_app, app);
return conf_exec(chan, data);
}
static int unload_module(void)
{
int res;
@@ -374,6 +381,7 @@ static int unload_module(void)
static int load_module(void)
{
ast_register_application(deprecated_app, conf_exec_warn, synopsis, descrip);
return ast_register_application(app, conf_exec, synopsis, descrip);
}

View File

@@ -50,7 +50,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
/*! \todo XXX Remove this application after 1.4 is relased */
static char *d_descrip =
" DBdel(family/key): This applicaiton will delete a key from the Asterisk\n"
" DBdel(family/key): This application will delete a key from the Asterisk\n"
"database.\n"
" This application has been DEPRECATED in favor of the DB_DELETE function.\n";

View File

@@ -25,6 +25,11 @@
* \ingroup applications
*/
/*** MODULEINFO
<depend>chan_local</depend>
***/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -57,9 +62,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/app.h"
#include "asterisk/causes.h"
#include "asterisk/rtp.h"
#include "asterisk/cdr.h"
#include "asterisk/manager.h"
#include "asterisk/privacy.h"
#include "asterisk/stringfields.h"
#include "asterisk/global_datastores.h"
static char *app = "Dial";
@@ -67,7 +74,7 @@ static char *synopsis = "Place a call and connect to the current channel";
static char *descrip =
" Dial(Technology/resource[&Tech2/resource2...][|timeout][|options][|URL]):\n"
"This applicaiton will place calls to one or more specified channels. As soon\n"
"This application will place calls to one or more specified channels. As soon\n"
"as one of the requested channels answers, the originating channel will be\n"
"answered, if it has not already been answered. These two channels will then\n"
"be active in a bridged call. All other channels that were requested will then\n"
@@ -82,7 +89,7 @@ static char *descrip =
" ANSWEREDTIME - This is the amount of time for actual call.\n"
" DIALSTATUS - This is the status of the call:\n"
" CHANUNAVAIL | CONGESTION | NOANSWER | BUSY | ANSWER | CANCEL\n"
" DONTCALL | TORTURE\n"
" DONTCALL | TORTURE | INVALIDARGS\n"
" For the Privacy and Screening Modes, the DIALSTATUS variable will be set to\n"
"DONTCALL if the called party chooses to send the calling party to the 'Go Away'\n"
"script. The DIALSTATUS variable will be set to TORTURE if the called party\n"
@@ -92,7 +99,10 @@ static char *descrip =
"ends the call.\n"
" The optional URL will be sent to the called party if the channel supports it.\n"
" If the OUTBOUND_GROUP variable is set, all peer channels created by this\n"
"application will be put into that group (as in Set(GROUP()=...).\n\n"
"application will be put into that group (as in Set(GROUP()=...).\n"
" If the OUTBOUND_GROUP_ONCE variable is set, all peer channels created by this\n"
"application will be put into that group (as in Set(GROUP()=...). Unlike OUTBOUND_GROUP,\n"
"however, the variable will be unset after use.\n\n"
" Options:\n"
" A(x) - Play an announcement to the called party, using 'x' as the file.\n"
" C - Reset the CDR for this call.\n"
@@ -116,11 +126,19 @@ static char *descrip =
" Optionally, an extension, or extension and context may be specified. \n"
" Otherwise, the current extension is used. You cannot use any additional\n"
" action post answer options in conjunction with this option.\n"
" h - Allow the called party to hang up by sending the '*' DTMF digit.\n"
" H - Allow the calling party to hang up by hitting the '*' DTMF digit.\n"
" h - Allow the called party to hang up by sending the '*' DTMF digit, or\n"
" whatever sequence was defined in the featuremap section for\n"
" 'disconnect' in features.conf\n"
" H - Allow the calling party to hang up by hitting the '*' DTMF digit, or\n"
" whatever sequence was defined in the featuremap section for\n"
" 'disconnect' in features.conf\n"
" i - Asterisk will ignore any forwarding requests it may receive on this\n"
" dial attempt.\n"
" j - Jump to priority n+101 if all of the requested channels were busy.\n"
" k - Allow the called party to enable parking of the call by sending\n"
" the DTMF sequence defined for call parking in the featuremap section of features.conf.\n"
" K - Allow the calling party to enable parking of the call by sending\n"
" the DTMF sequence defined for call parking in the featuremap section of features.conf.\n"
" L(x[:y][:z]) - Limit the call to 'x' ms. Play a warning when 'y' ms are\n"
" left. Repeat the warning every 'z' ms. The following special\n"
" variables can be used with this option:\n"
@@ -181,17 +199,17 @@ static char *descrip =
" S(x) - Hang up the call after 'x' seconds *after* the called party has\n"
" answered the call.\n"
" t - Allow the called party to transfer the calling party by sending the\n"
" DTMF sequence defined in features.conf.\n"
" DTMF sequence defined in the blindxfer setting in the featuremap section\n"
" of features.conf.\n"
" T - Allow the calling party to transfer the called party by sending the\n"
" DTMF sequence defined in features.conf.\n"
" DTMF sequence defined in the blindxfer setting in the featuremap section\n"
" of features.conf.\n"
" w - Allow the called party to enable recording of the call by sending\n"
" the DTMF sequence defined for one-touch recording in features.conf.\n"
" the DTMF sequence defined in the automon setting in the featuremap section\n"
" of features.conf.\n"
" W - Allow the calling party to enable recording of the call by sending\n"
" the DTMF sequence defined for one-touch recording in features.conf.\n"
" k - Allow the called party to enable parking of the call by sending\n"
" the DTMF sequence defined for call parking in features.conf.\n"
" K - Allow the calling party to enable parking of the call by sending\n"
" the DTMF sequence defined for call parking in features.conf.\n";
" the DTMF sequence defined in the automon setting in the featuremap section\n"
" of features.conf.\n";
/* RetryDial App by Anthony Minessale II <anthmct@yahoo.com> Jan/2005 */
static char *rapp = "RetryDial";
@@ -200,7 +218,7 @@ static char *rdescrip =
" RetryDial(announce|sleep|retries|dialargs): This application will attempt to\n"
"place a call using the normal Dial application. If no channel can be reached,\n"
"the 'announce' file will be played. Then, it will wait 'sleep' number of\n"
"seconds before retying the call. After 'retires' number of attempts, the\n"
"seconds before retrying the call. After 'retries' number of attempts, the\n"
"calling channel will continue at the next priority in the dialplan. If the\n"
"'retries' setting is set to 0, this application will retry endlessly.\n"
" While waiting to retry a call, a 1 digit extension may be dialed. If that\n"
@@ -269,13 +287,15 @@ AST_APP_OPTIONS(dial_exec_options, {
AST_APP_OPTION('H', OPT_CALLER_HANGUP),
AST_APP_OPTION('i', OPT_IGNORE_FORWARDING),
AST_APP_OPTION('j', OPT_PRIORITY_JUMP),
AST_APP_OPTION('k', OPT_CALLEE_PARK),
AST_APP_OPTION('K', OPT_CALLER_PARK),
AST_APP_OPTION_ARG('L', OPT_DURATION_LIMIT, OPT_ARG_DURATION_LIMIT),
AST_APP_OPTION_ARG('m', OPT_MUSICBACK, OPT_ARG_MUSICBACK),
AST_APP_OPTION_ARG('M', OPT_CALLEE_MACRO, OPT_ARG_CALLEE_MACRO),
AST_APP_OPTION('n', OPT_SCREEN_NOINTRO),
AST_APP_OPTION('N', OPT_SCREEN_NOCLID),
AST_APP_OPTION_ARG('O', OPT_OPERMODE,OPT_ARG_OPERMODE),
AST_APP_OPTION('o', OPT_ORIGINAL_CLID),
AST_APP_OPTION_ARG('O', OPT_OPERMODE,OPT_ARG_OPERMODE),
AST_APP_OPTION('p', OPT_SCREENING),
AST_APP_OPTION_ARG('P', OPT_PRIVACY, OPT_ARG_PRIVACY),
AST_APP_OPTION('r', OPT_RINGBACK),
@@ -284,10 +304,13 @@ AST_APP_OPTIONS(dial_exec_options, {
AST_APP_OPTION('T', OPT_CALLER_TRANSFER),
AST_APP_OPTION('w', OPT_CALLEE_MONITOR),
AST_APP_OPTION('W', OPT_CALLER_MONITOR),
AST_APP_OPTION('k', OPT_CALLEE_PARK),
AST_APP_OPTION('K', OPT_CALLER_PARK),
});
#define CAN_EARLY_BRIDGE(flags,chan,peer) (!ast_test_flag(flags, OPT_CALLEE_HANGUP | \
OPT_CALLER_HANGUP | OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER | \
OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR | OPT_CALLEE_PARK | OPT_CALLER_PARK) && \
!chan->audiohooks && !peer->audiohooks)
/* We define a custom "local user" structure because we
use it not only for keeping track of what is in use but
also for keeping track of who we're dialing. */
@@ -295,7 +318,6 @@ AST_APP_OPTIONS(dial_exec_options, {
struct dial_localuser {
struct ast_channel *chan;
unsigned int flags;
int forwards;
struct dial_localuser *next;
};
@@ -314,8 +336,6 @@ static void hanguptree(struct dial_localuser *outgoing, struct ast_channel *exce
}
}
#define AST_MAX_FORWARDS 8
#define AST_MAX_WATCHERS 256
#define HANDLE_CAUSE(cause, chan) do { \
@@ -330,11 +350,16 @@ static void hanguptree(struct dial_localuser *outgoing, struct ast_channel *exce
ast_cdr_failed(chan->cdr); \
numcongestion++; \
break; \
case AST_CAUSE_NO_ROUTE_DESTINATION: \
case AST_CAUSE_UNREGISTERED: \
if (chan->cdr) \
ast_cdr_failed(chan->cdr); \
numnochan++; \
break; \
case AST_CAUSE_NO_ANSWER: \
if (chan->cdr) \
ast_cdr_noanswer(chan->cdr); \
break; \
case AST_CAUSE_NORMAL_CLEARING: \
break; \
default: \
@@ -362,6 +387,7 @@ static int onedigit_goto(struct ast_channel *chan, const char *context, char ext
return 0;
}
static int detect_disconnect(struct ast_channel *chan, char code, char *featurecode, int len);
static const char *get_cid_name(char *name, int namelen, struct ast_channel *chan)
{
@@ -396,7 +422,9 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l
struct ast_channel *peer = NULL;
/* single is set if only one destination is enabled */
int single = outgoing && !outgoing->next && !ast_test_flag(outgoing, OPT_MUSICBACK | OPT_RINGBACK);
char featurecode[FEATURE_MAX_LEN + 1] = { 0, };
if (single) {
/* Turn off hold music, etc */
ast_deactivate_generator(in);
@@ -456,6 +484,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l
OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
OPT_CALLEE_PARK | OPT_CALLER_PARK |
DIAL_NOFORWARDHTML);
ast_copy_string(c->dialcontext, "", sizeof(c->dialcontext));
ast_copy_string(c->exten, "", sizeof(c->exten));
}
continue;
}
@@ -473,34 +503,31 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l
tech = tmpchan;
} else {
const char *forward_context = pbx_builtin_getvar_helper(c, "FORWARD_CONTEXT");
if (ast_strlen_zero(forward_context)) {
forward_context = NULL;
}
snprintf(tmpchan, sizeof(tmpchan), "%s@%s", c->call_forward, forward_context ? forward_context : c->context);
stuff = tmpchan;
tech = "Local";
}
/* Before processing channel, go ahead and check for forwarding */
o->forwards++;
if (o->forwards < AST_MAX_FORWARDS) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, c->name);
/* If we have been told to ignore forwards, just set this channel to null and continue processing extensions normally */
if (ast_test_flag(peerflags, OPT_IGNORE_FORWARDING)) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, c->name);
/* If we have been told to ignore forwards, just set this channel to null and continue processing extensions normally */
if (ast_test_flag(peerflags, OPT_IGNORE_FORWARDING)) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Forwarding %s to '%s/%s' prevented.\n", in->name, tech, stuff);
c = o->chan = NULL;
cause = AST_CAUSE_BUSY;
} else {
/* Setup parameters */
c = o->chan = ast_request(tech, in->nativeformats, stuff, &cause);
if (!c)
ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
else
ast_channel_inherit_variables(in, o->chan);
}
} else {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", c->name);
cause = AST_CAUSE_CONGESTION;
ast_verbose(VERBOSE_PREFIX_3 "Forwarding %s to '%s/%s' prevented.\n", in->name, tech, stuff);
c = o->chan = NULL;
cause = AST_CAUSE_BUSY;
} else {
/* Setup parameters */
if ((c = o->chan = ast_request(tech, in->nativeformats, stuff, &cause))) {
if (single)
ast_channel_make_compatible(o->chan, in);
ast_channel_inherit_variables(in, o->chan);
ast_channel_datastore_inherit(in, o->chan);
} else
ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
}
if (!c) {
ast_clear_flag(o, DIAL_STILLGOING);
@@ -543,10 +570,13 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l
senddialevent(in, c);
/* After calling, set callerid to extension */
if (!ast_test_flag(peerflags, OPT_ORIGINAL_CLID)) {
char cidname[AST_MAX_EXTENSION];
char cidname[AST_MAX_EXTENSION] = "";
ast_set_callerid(c, S_OR(in->macroexten, in->exten), get_cid_name(cidname, sizeof(cidname), in), NULL);
}
}
if (single) {
ast_indicate(in, -1);
}
}
/* Hangup the original channel now, in case we needed it */
ast_hangup(winner);
@@ -569,14 +599,21 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "%s answered %s\n", c->name, in->name);
peer = c;
if (peer->cdr) {
peer->cdr->answer = ast_tvnow();
peer->cdr->disposition = AST_CDR_ANSWERED;
}
ast_copy_flags(peerflags, o,
OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
OPT_CALLEE_PARK | OPT_CALLER_PARK |
DIAL_NOFORWARDHTML);
ast_copy_string(c->dialcontext, "", sizeof(c->dialcontext));
ast_copy_string(c->exten, "", sizeof(c->exten));
/* Setup RTP early bridge if appropriate */
ast_rtp_early_bridge(in, peer);
if (CAN_EARLY_BRIDGE(peerflags, in, peer))
ast_rtp_early_bridge(in, peer);
}
/* If call has been answered, then the eventual hangup is likely to be normal hangup */
in->hangupcause = AST_CAUSE_NORMAL_CLEARING;
@@ -604,7 +641,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "%s is ringing\n", c->name);
/* Setup early media if appropriate */
if (single)
if (single && CAN_EARLY_BRIDGE(peerflags, in, c))
ast_rtp_early_bridge(in, c);
if (!(*sentringing) && !ast_test_flag(outgoing, OPT_MUSICBACK)) {
ast_indicate(in, AST_CONTROL_RINGING);
@@ -615,7 +652,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l
if (option_verbose > 2)
ast_verbose (VERBOSE_PREFIX_3 "%s is making progress passing it to %s\n", c->name, in->name);
/* Setup early media if appropriate */
if (single)
if (single && CAN_EARLY_BRIDGE(peerflags, in, c))
ast_rtp_early_bridge(in, c);
if (!ast_test_flag(outgoing, OPT_RINGBACK))
ast_indicate(in, AST_CONTROL_PROGRESS);
@@ -625,10 +662,15 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l
ast_verbose (VERBOSE_PREFIX_3 "%s requested a video update, passing it to %s\n", c->name, in->name);
ast_indicate(in, AST_CONTROL_VIDUPDATE);
break;
case AST_CONTROL_SRCUPDATE:
if (option_verbose > 2)
ast_verbose (VERBOSE_PREFIX_3 "%s requested a source update, passing it to %s\n", c->name, in->name);
ast_indicate(in, AST_CONTROL_SRCUPDATE);
break;
case AST_CONTROL_PROCEEDING:
if (option_verbose > 2)
ast_verbose (VERBOSE_PREFIX_3 "%s is proceeding passing it to %s\n", c->name, in->name);
if (single)
if (single && CAN_EARLY_BRIDGE(peerflags, in, c))
ast_rtp_early_bridge(in, c);
if (!ast_test_flag(outgoing, OPT_RINGBACK))
ast_indicate(in, AST_CONTROL_PROCEEDING);
@@ -688,6 +730,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l
if (!f || ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_HANGUP))) {
/* Got hung up */
*to = -1;
ast_cdr_noanswer(in->cdr);
strcpy(status, "CANCEL");
if (f)
ast_frfree(f);
@@ -701,6 +744,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
*to=0;
ast_cdr_noanswer(in->cdr);
*result = f->subclass;
strcpy(status, "CANCEL");
ast_frfree(f);
@@ -708,11 +752,12 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l
}
}
if (ast_test_flag(peerflags, OPT_CALLER_HANGUP) &&
(f->subclass == '*')) { /* hmm it it not guaranteed to be '*' anymore. */
if (ast_test_flag(peerflags, OPT_CALLER_HANGUP) &&
detect_disconnect(in, f->subclass, featurecode, sizeof(featurecode))) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
ast_verbose(VERBOSE_PREFIX_3 "User requested call disconnect.\n");
*to=0;
ast_cdr_noanswer(in->cdr);
strcpy(status, "CANCEL");
ast_frfree(f);
return NULL;
@@ -725,14 +770,15 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l
ast_log(LOG_WARNING, "Unable to send URL\n");
if (single && ((f->frametype == AST_FRAME_VOICE) || (f->frametype == AST_FRAME_DTMF))) {
if (single && ((f->frametype == AST_FRAME_VOICE) || (f->frametype == AST_FRAME_DTMF_BEGIN) || (f->frametype == AST_FRAME_DTMF_END))) {
if (ast_write(outgoing->chan, f))
ast_log(LOG_WARNING, "Unable to forward voice\n");
ast_log(LOG_WARNING, "Unable to forward voice or dtmf\n");
}
if (single && (f->frametype == AST_FRAME_CONTROL) &&
((f->subclass == AST_CONTROL_HOLD) ||
(f->subclass == AST_CONTROL_UNHOLD) ||
(f->subclass == AST_CONTROL_VIDUPDATE))) {
(f->subclass == AST_CONTROL_VIDUPDATE) ||
(f->subclass == AST_CONTROL_SRCUPDATE))) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "%s requested special control %d, passing it to %s\n", in->name, f->subclass, outgoing->chan->name);
ast_indicate_data(outgoing->chan, f->subclass, f->data, f->datalen);
@@ -741,9 +787,41 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_l
}
if (!*to && (option_verbose > 2))
ast_verbose(VERBOSE_PREFIX_3 "Nobody picked up in %d ms\n", orig);
if (!*to || ast_check_hangup(in)) {
ast_cdr_noanswer(in->cdr);
}
}
return peer;
}
static int detect_disconnect(struct ast_channel *chan, char code, char *featurecode, int len)
{
struct ast_flags features = { AST_FEATURE_DISCONNECT }; /* only concerned with disconnect feature */
struct ast_call_feature feature = { 0, };
char *tmp;
int res;
if ((strlen(featurecode)) < (len - 2)) {
tmp = &featurecode[strlen(featurecode)];
tmp[0] = code;
tmp[1] = '\0';
} else {
featurecode[0] = 0;
return -1; /* no room in featurecode buffer */
}
return peer;
res = ast_feature_detect(chan, &features, featurecode, &feature);
if (res != FEATURE_RETURN_STOREDIGITS) {
featurecode[0] = '\0';
}
if (feature.feature_mask & AST_FEATURE_DISCONNECT) {
return 1;
}
return 0;
}
static void replace_macro_delimiter(char *s)
@@ -766,7 +844,36 @@ static int valid_priv_reply(struct ast_flags *opts, int res)
return 0;
}
static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags *peerflags)
static void end_bridge_callback (void *data)
{
char buf[80];
time_t end;
struct ast_channel *chan = data;
if (!chan->cdr) {
return;
}
time(&end);
ast_channel_lock(chan);
if (chan->cdr->answer.tv_sec) {
snprintf(buf, sizeof(buf), "%ld", end - chan->cdr->answer.tv_sec);
pbx_builtin_setvar_helper(chan, "ANSWEREDTIME", buf);
}
if (chan->cdr->start.tv_sec) {
snprintf(buf, sizeof(buf), "%ld", end - chan->cdr->start.tv_sec);
pbx_builtin_setvar_helper(chan, "DIALEDTIME", buf);
}
ast_channel_unlock(chan);
}
static void end_bridge_callback_data_fixup(struct ast_bridge_config *bconfig, struct ast_channel *originator, struct ast_channel *terminator) {
bconfig->end_bridge_callback_data = originator;
}
static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags *peerflags, int *continue_exec)
{
int res = -1;
struct ast_module_user *u;
@@ -778,10 +885,10 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
int numcongestion = 0;
int numnochan = 0;
int cause;
char numsubst[AST_MAX_EXTENSION];
char cidname[AST_MAX_EXTENSION];
char numsubst[256];
char cidname[AST_MAX_EXTENSION] = "";
int privdb_val = 0;
unsigned int calldurationlimit = 0;
int calldurationlimit = -1;
long timelimit = 0;
long play_warning = 0;
long warning_freq = 0;
@@ -789,7 +896,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
const char *end_sound = NULL;
const char *start_sound = NULL;
char *dtmfcalled = NULL, *dtmfcalling = NULL;
char status[256];
char status[256] = "INVALIDARGS";
int play_to_caller = 0, play_to_callee = 0;
int sentringing = 0, moh = 0;
const char *outbound_group = NULL;
@@ -807,24 +914,37 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
);
struct ast_flags opts = { 0, };
char *opt_args[OPT_ARG_ARRAY_SIZE];
struct ast_datastore *datastore = NULL;
int fulldial = 0, num_dialed = 0;
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n");
pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
return -1;
}
/* Reset all DIAL variables back to blank, to prevent confusion (in case we don't reset all of them). */
pbx_builtin_setvar_helper(chan, "DIALSTATUS", "");
pbx_builtin_setvar_helper(chan, "DIALEDPEERNUMBER", "");
pbx_builtin_setvar_helper(chan, "DIALEDPEERNAME", "");
pbx_builtin_setvar_helper(chan, "ANSWEREDTIME", "");
pbx_builtin_setvar_helper(chan, "DIALEDTIME", "");
u = ast_module_user_add(chan);
parse = ast_strdupa(data);
AST_STANDARD_APP_ARGS(args, parse);
if (!ast_strlen_zero(args.options) &&
ast_app_parse_options(dial_exec_options, &opts, opt_args, args.options))
ast_app_parse_options(dial_exec_options, &opts, opt_args, args.options)) {
pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
goto done;
}
if (ast_strlen_zero(args.peers)) {
ast_log(LOG_WARNING, "Dial requires an argument (technology/number)\n");
pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
goto done;
}
@@ -840,6 +960,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
calldurationlimit = atoi(opt_args[OPT_ARG_DURATION_STOP]);
if (!calldurationlimit) {
ast_log(LOG_WARNING, "Dial does not accept S(%s), hanging up.\n", opt_args[OPT_ARG_DURATION_STOP]);
pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
goto done;
}
if (option_verbose > 2)
@@ -905,7 +1026,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
start_sound = S_OR(var, NULL); /* XXX not much of a point in doing this! */
/* undo effect of S(x) in case they are both used */
calldurationlimit = 0;
calldurationlimit = -1;
/* more efficient to do it like S(x) does since no advanced opts */
if (!play_warning && !start_sound && !end_sound && timelimit) {
calldurationlimit = timelimit / 1000;
@@ -1025,6 +1146,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
"At the tone, please say your name:"
*/
ast_answer(chan);
res = ast_play_and_record(chan, "priv-recordintro", privintro, 4, "gsm", &duration, 128, 2000, 0); /* NOTE: I've reduced the total time to 4 sec */
/* don't think we'll need a lock removed, we took care of
conflicts by naming the privintro file */
@@ -1043,17 +1165,31 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
}
}
if (continue_exec)
*continue_exec = 0;
/* If a channel group has been specified, get it for use when we create peer channels */
outbound_group = pbx_builtin_getvar_helper(chan, "OUTBOUND_GROUP");
if ((outbound_group = pbx_builtin_getvar_helper(chan, "OUTBOUND_GROUP_ONCE"))) {
outbound_group = ast_strdupa(outbound_group);
pbx_builtin_setvar_helper(chan, "OUTBOUND_GROUP_ONCE", NULL);
} else {
outbound_group = pbx_builtin_getvar_helper(chan, "OUTBOUND_GROUP");
}
ast_copy_flags(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID | OPT_CALLER_HANGUP | OPT_IGNORE_FORWARDING);
/* loop through the list of dial destinations */
rest = args.peers;
while ((cur = strsep(&rest, "&")) ) {
struct dial_localuser *tmp;
/* Get a technology/[device:]number pair */
char *number = cur;
char *interface = ast_strdupa(number);
char *tech = strsep(&number, "/");
/* find if we already dialed this interface */
struct ast_dialed_interface *di;
AST_LIST_HEAD(, ast_dialed_interface) *dialed_interfaces;
num_dialed++;
if (!number) {
ast_log(LOG_WARNING, "Dial argument takes format (technology/[device:]number1)\n");
goto out;
@@ -1071,6 +1207,68 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
}
ast_copy_string(numsubst, number, sizeof(numsubst));
/* Request the peer */
ast_channel_lock(chan);
datastore = ast_channel_datastore_find(chan, &dialed_interface_info, NULL);
ast_channel_unlock(chan);
if (datastore)
dialed_interfaces = datastore->data;
else {
if (!(datastore = ast_channel_datastore_alloc(&dialed_interface_info, NULL))) {
ast_log(LOG_WARNING, "Unable to create channel datastore for dialed interfaces. Aborting!\n");
free(tmp);
goto out;
}
datastore->inheritance = DATASTORE_INHERIT_FOREVER;
if (!(dialed_interfaces = ast_calloc(1, sizeof(*dialed_interfaces)))) {
free(tmp);
goto out;
}
datastore->data = dialed_interfaces;
AST_LIST_HEAD_INIT(dialed_interfaces);
ast_channel_lock(chan);
ast_channel_datastore_add(chan, datastore);
ast_channel_unlock(chan);
}
AST_LIST_LOCK(dialed_interfaces);
AST_LIST_TRAVERSE(dialed_interfaces, di, list) {
if (!strcasecmp(di->interface, interface)) {
ast_log(LOG_WARNING, "Skipping dialing interface '%s' again since it has already been dialed\n",
di->interface);
break;
}
}
AST_LIST_UNLOCK(dialed_interfaces);
if (di) {
fulldial++;
free(tmp);
continue;
}
/* It is always ok to dial a Local interface. We only keep track of
* which "real" interfaces have been dialed. The Local channel will
* inherit this list so that if it ends up dialing a real interface,
* it won't call one that has already been called. */
if (strcasecmp(tech, "Local")) {
if (!(di = ast_calloc(1, sizeof(*di) + strlen(interface)))) {
AST_LIST_UNLOCK(dialed_interfaces);
free(tmp);
goto out;
}
strcpy(di->interface, interface);
AST_LIST_LOCK(dialed_interfaces);
AST_LIST_INSERT_TAIL(dialed_interfaces, di, list);
AST_LIST_UNLOCK(dialed_interfaces);
}
tmp->chan = ast_request(tech, chan->nativeformats, numsubst, &cause);
if (!tmp->chan) {
/* If we can't, just go on to the next call */
@@ -1078,58 +1276,18 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
HANDLE_CAUSE(cause, chan);
if (!rest) /* we are on the last destination */
chan->hangupcause = cause;
free(tmp);
continue;
}
pbx_builtin_setvar_helper(tmp->chan, "DIALEDPEERNUMBER", numsubst);
if (!ast_strlen_zero(tmp->chan->call_forward)) {
char tmpchan[256];
char *stuff;
char *tech;
ast_copy_string(tmpchan, tmp->chan->call_forward, sizeof(tmpchan));
if ((stuff = strchr(tmpchan, '/'))) {
*stuff++ = '\0';
tech = tmpchan;
} else {
snprintf(tmpchan, sizeof(tmpchan), "%s@%s", tmp->chan->call_forward, tmp->chan->context);
stuff = tmpchan;
tech = "Local";
}
tmp->forwards++;
if (tmp->forwards < AST_MAX_FORWARDS) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Now forwarding %s to '%s/%s' (thanks to %s)\n", chan->name, tech, stuff, tmp->chan->name);
ast_hangup(tmp->chan);
/* If we have been told to ignore forwards, just set this channel to null and continue processing extensions normally */
if (ast_test_flag(&opts, OPT_IGNORE_FORWARDING)) {
tmp->chan = NULL;
cause = AST_CAUSE_BUSY;
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Forwarding %s to '%s/%s' prevented.\n", chan->name, tech, stuff);
} else {
tmp->chan = ast_request(tech, chan->nativeformats, stuff, &cause);
}
if (!tmp->chan)
ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s' (cause = %d)\n", tech, stuff, cause);
else
ast_channel_inherit_variables(chan, tmp->chan);
} else {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Too many forwards from %s\n", tmp->chan->name);
ast_hangup(tmp->chan);
tmp->chan = NULL;
cause = AST_CAUSE_CONGESTION;
}
if (!tmp->chan) {
HANDLE_CAUSE(cause, chan);
continue;
}
}
pbx_builtin_setvar_helper(tmp->chan, "DIALEDPEERNUMBER", numsubst);
/* Setup outgoing SDP to match incoming one */
ast_rtp_make_compatible(tmp->chan, chan, !outgoing && !rest);
/* Inherit specially named variables from parent channel */
ast_channel_inherit_variables(chan, tmp->chan);
ast_channel_datastore_inherit(chan, tmp->chan);
tmp->chan->appl = "AppDial";
tmp->chan->data = "(Outgoing Line)";
@@ -1170,6 +1328,16 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
if (outbound_group)
ast_app_group_set_channel(tmp->chan, outbound_group);
/* Inherit context and extension */
if (!ast_strlen_zero(chan->macrocontext))
ast_copy_string(tmp->chan->dialcontext, chan->macrocontext, sizeof(tmp->chan->dialcontext));
else
ast_copy_string(tmp->chan->dialcontext, chan->context, sizeof(tmp->chan->dialcontext));
if (!ast_strlen_zero(chan->macroexten))
ast_copy_string(tmp->chan->exten, chan->macroexten, sizeof(tmp->chan->exten));
else
ast_copy_string(tmp->chan->exten, chan->exten, sizeof(tmp->chan->exten));
/* Place the call, but don't wait on the answer */
res = ast_call(tmp->chan, numsubst, 0);
@@ -1184,8 +1352,12 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
ast_log(LOG_DEBUG, "ast call on peer returned %d\n", res);
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Couldn't call %s\n", numsubst);
if (tmp->chan->hangupcause) {
chan->hangupcause = tmp->chan->hangupcause;
}
ast_hangup(tmp->chan);
tmp->chan = NULL;
free(tmp);
continue;
} else {
senddialevent(chan, tmp->chan);
@@ -1217,12 +1389,24 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
if (!outgoing) {
strcpy(status, "CHANUNAVAIL");
if(fulldial == num_dialed) {
res = -1;
goto out;
}
} else {
/* Our status will at least be NOANSWER */
strcpy(status, "NOANSWER");
if (ast_test_flag(outgoing, OPT_MUSICBACK)) {
moh = 1;
ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK], NULL);
if (!ast_strlen_zero(opt_args[OPT_ARG_MUSICBACK])) {
char *original_moh = ast_strdupa(chan->musicclass);
ast_string_field_set(chan, musicclass, opt_args[OPT_ARG_MUSICBACK]);
ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK], NULL);
ast_string_field_set(chan, musicclass, original_moh);
} else {
ast_moh_start(chan, NULL, NULL);
}
ast_indicate(chan, AST_CONTROL_PROGRESS);
} else if (ast_test_flag(outgoing, OPT_RINGBACK)) {
ast_indicate(chan, AST_CONTROL_RINGING);
sentringing++;
@@ -1231,7 +1415,15 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
time(&start_time);
peer = wait_for_answer(chan, outgoing, &to, peerflags, &sentringing, status, sizeof(status), numbusy, numnochan, numcongestion, ast_test_flag(&opts, OPT_PRIORITY_JUMP), &result);
/* The ast_channel_datastore_remove() function could fail here if the
* datastore was moved to another channel during a masquerade. If this is
* the case, don't free the datastore here because later, when the channel
* to which the datastore was moved hangs up, it will attempt to free this
* datastore again, causing a crash
*/
if (!ast_channel_datastore_remove(chan, datastore))
ast_channel_datastore_free(datastore);
if (!peer) {
if (result) {
res = result;
@@ -1243,9 +1435,9 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
/* almost done, although the 'else' block is 400 lines */
} else {
const char *number;
time_t end_time, answer_time = time(NULL);
strcpy(status, "ANSWER");
pbx_builtin_setvar_helper(chan, "DIALSTATUS", status);
/* Ah ha! Someone answered within the desired timeframe. Of course after this
we will always return with -1 so that it is hung up properly after the
conversation. */
@@ -1279,8 +1471,11 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
time and make the caller believe the peer hasn't picked up yet */
if (ast_test_flag(&opts, OPT_MUSICBACK) && !ast_strlen_zero(opt_args[OPT_ARG_MUSICBACK])) {
char *original_moh = ast_strdupa(chan->musicclass);
ast_indicate(chan, -1);
ast_string_field_set(chan, musicclass, opt_args[OPT_ARG_MUSICBACK]);
ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK], NULL);
ast_string_field_set(chan, musicclass, original_moh);
} else if (ast_test_flag(&opts, OPT_RINGBACK)) {
ast_indicate(chan, AST_CONTROL_RINGING);
sentringing++;
@@ -1444,10 +1639,14 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
if (chan && peer && ast_test_flag(&opts, OPT_GOTO) && !ast_strlen_zero(opt_args[OPT_ARG_GOTO])) {
replace_macro_delimiter(opt_args[OPT_ARG_GOTO]);
ast_parseable_goto(chan, opt_args[OPT_ARG_GOTO]);
ast_parseable_goto(peer, opt_args[OPT_ARG_GOTO]);
peer->priority++;
/* peer goes to the same context and extension as chan, so just copy info from chan*/
ast_copy_string(peer->context, chan->context, sizeof(peer->context));
ast_copy_string(peer->exten, chan->exten, sizeof(peer->exten));
peer->priority = chan->priority + 2;
ast_pbx_start(peer);
hanguptree(outgoing, NULL);
if (continue_exec)
*continue_exec = 1;
res = 0;
goto done;
}
@@ -1520,7 +1719,10 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
if (!res) {
if (calldurationlimit > 0) {
chan->whentohangup = time(NULL) + calldurationlimit;
peer->whentohangup = time(NULL) + calldurationlimit;
} else if (calldurationlimit != -1 && timelimit > 0) {
/* Not enough granularity to make it less, but we can't use the special value 0 */
peer->whentohangup = time(NULL) + 1;
}
if (!ast_strlen_zero(dtmfcalled)) {
if (option_verbose > 2)
@@ -1533,7 +1735,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
res = ast_dtmf_stream(chan,peer,dtmfcalling,250);
}
}
if (!res) {
struct ast_bridge_config config;
@@ -1558,6 +1760,8 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
ast_set_flag(&(config.features_callee), AST_FEATURE_PARKCALL);
if (ast_test_flag(peerflags, OPT_CALLER_PARK))
ast_set_flag(&(config.features_caller), AST_FEATURE_PARKCALL);
if (ast_test_flag(peerflags, OPT_GO_ON))
ast_set_flag(&(config.features_caller), AST_FEATURE_NO_H_EXTEN);
config.timelimit = timelimit;
config.play_warning = play_warning;
@@ -1565,6 +1769,9 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
config.warning_sound = warning_sound;
config.end_sound = end_sound;
config.start_sound = start_sound;
config.end_bridge_callback = end_bridge_callback;
config.end_bridge_callback_data = chan;
config.end_bridge_callback_data_fixup = end_bridge_callback_data_fixup;
if (moh) {
moh = 0;
ast_moh_stop(chan);
@@ -1582,8 +1789,9 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
res = -1;
goto done;
}
if (opermode && (!strncmp(chan->name,"Zap",3)) &&
(!strncmp(peer->name,"Zap",3)))
if (opermode &&
(((!strncasecmp(chan->name,"Zap",3)) && (!strncasecmp(peer->name,"Zap",3))) ||
((!strncasecmp(chan->name,"Dahdi",5)) && (!strncasecmp(peer->name,"Dahdi",5)))))
{
struct oprmode oprmode;
@@ -1594,27 +1802,13 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
AST_OPTION_OPRMODE,&oprmode,sizeof(struct oprmode),0);
}
res = ast_bridge_call(chan,peer,&config);
time(&end_time);
{
char toast[80];
snprintf(toast, sizeof(toast), "%ld", (long)(end_time - answer_time));
pbx_builtin_setvar_helper(chan, "ANSWEREDTIME", toast);
}
} else {
time(&end_time);
res = -1;
}
{
char toast[80];
snprintf(toast, sizeof(toast), "%ld", (long)(end_time - start_time));
pbx_builtin_setvar_helper(chan, "DIALEDTIME", toast);
}
if (res != AST_PBX_NO_HANGUP_PEER) {
if (!chan->_softhangup)
chan->hangupcause = peer->hangupcause;
ast_hangup(peer);
}
if (!chan->_softhangup)
chan->hangupcause = peer->hangupcause;
ast_hangup(peer);
}
out:
if (moh) {
@@ -1630,9 +1824,11 @@ out:
if (option_debug)
ast_log(LOG_DEBUG, "Exiting with DIALSTATUS=%s.\n", status);
if ((ast_test_flag(peerflags, OPT_GO_ON)) && (!chan->_softhangup) && (res != AST_PBX_KEEPALIVE))
if (ast_test_flag(peerflags, OPT_GO_ON) && !chan->_softhangup) {
if (calldurationlimit)
chan->whentohangup = 0;
res = 0;
}
done:
ast_module_user_remove(u);
return res;
@@ -1641,8 +1837,10 @@ done:
static int dial_exec(struct ast_channel *chan, void *data)
{
struct ast_flags peerflags;
memset(&peerflags, 0, sizeof(peerflags));
return dial_exec_full(chan, data, &peerflags);
return dial_exec_full(chan, data, &peerflags, NULL);
}
static int retrydial_exec(struct ast_channel *chan, void *data)
@@ -1666,7 +1864,7 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
if ((dialdata = strchr(announce, '|'))) {
*dialdata++ = '\0';
if ((sleep = atoi(dialdata))) {
if (sscanf(dialdata, "%30d", &sleep) == 1) {
sleep *= 1000;
} else {
ast_log(LOG_ERROR, "%s requires the numerical argument <sleep>\n",rapp);
@@ -1674,14 +1872,14 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
}
if ((dialdata = strchr(dialdata, '|'))) {
*dialdata++ = '\0';
if (!(loops = atoi(dialdata))) {
if (sscanf(dialdata, "%30d", &loops) != 1) {
ast_log(LOG_ERROR, "%s requires the numerical argument <loops>\n",rapp);
goto done;
}
}
}
if ((dialdata = strchr(dialdata, '|'))) {
if (dialdata && (dialdata = strchr(dialdata, '|'))) {
*dialdata++ = '\0';
} else {
ast_log(LOG_ERROR, "%s requires more arguments\n",rapp);
@@ -1698,26 +1896,42 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
res = 0;
while (loops) {
int continue_exec;
chan->data = "Retrying";
if (ast_test_flag(chan, AST_FLAG_MOH))
ast_moh_stop(chan);
if ((res = dial_exec_full(chan, dialdata, &peerflags)) == 0) {
res = dial_exec_full(chan, dialdata, &peerflags, &continue_exec);
if (continue_exec)
break;
if (res == 0) {
if (ast_test_flag(&peerflags, OPT_DTMF_EXIT)) {
if (!(res = ast_streamfile(chan, announce, chan->language)))
res = ast_waitstream(chan, AST_DIGIT_ANY);
if (!ast_strlen_zero(announce)) {
if (ast_fileexists(announce, NULL, chan->language) > 0) {
if(!(res = ast_streamfile(chan, announce, chan->language)))
ast_waitstream(chan, AST_DIGIT_ANY);
} else
ast_log(LOG_WARNING, "Announce file \"%s\" specified in Retrydial does not exist\n", announce);
}
if (!res && sleep) {
if (!ast_test_flag(chan, AST_FLAG_MOH))
ast_moh_start(chan, NULL, NULL);
res = ast_waitfordigit(chan, sleep);
}
} else {
if (!(res = ast_streamfile(chan, announce, chan->language)))
res = ast_waitstream(chan, "");
if (!ast_strlen_zero(announce)) {
if (ast_fileexists(announce, NULL, chan->language) > 0) {
if (!(res = ast_streamfile(chan, announce, chan->language)))
res = ast_waitstream(chan, "");
} else
ast_log(LOG_WARNING, "Announce file \"%s\" specified in Retrydial does not exist\n", announce);
}
if (sleep) {
if (!ast_test_flag(chan, AST_FLAG_MOH))
ast_moh_start(chan, NULL, NULL);
if (!res)
if (!res)
res = ast_waitfordigit(chan, sleep);
}
}
@@ -1735,10 +1949,12 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
}
if (loops == 0)
res = 0;
else if (res == 1)
res = 0;
if (ast_test_flag(chan, AST_FLAG_MOH))
ast_moh_stop(chan);
done:
done:
ast_module_user_remove(u);
return res;
}

View File

@@ -267,7 +267,8 @@ static int dictate_exec(struct ast_channel *chan, void *data)
if (lastop != DFLAG_PLAY) {
lastop = DFLAG_PLAY;
ast_closestream(fs);
fs = ast_openstream(chan, path, chan->language);
if (!(fs = ast_openstream(chan, path, chan->language)))
break;
ast_seekstream(fs, samples, SEEK_SET);
chan->stream = NULL;
}
@@ -330,7 +331,7 @@ static int dictate_exec(struct ast_channel *chan, void *data)
ast_set_read_format(chan, oldr);
}
ast_module_user_remove(u);
return res;
return 0;
}
static int unload_module(void)

View File

@@ -41,6 +41,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/module.h"
#include "asterisk/lock.h"
#include "asterisk/app.h"
#include "asterisk/options.h"
#define PICKUPMARK "PICKUPMARK"
@@ -50,101 +51,114 @@ static const char *descrip =
" Pickup(extension[@context][&extension2@context...]): This application can pickup any ringing channel\n"
"that is calling the specified extension. If no context is specified, the current\n"
"context will be used. If you use the special string \"PICKUPMARK\" for the context parameter, for example\n"
"10@PICKUPMARK, this application tries to find a channel which has defined a channel variable with the same context\n"
"10@PICKUPMARK, this application tries to find a channel which has defined a channel variable with the same content\n"
"as \"extension\".";
/* Perform actual pickup between two channels */
static int pickup_do(struct ast_channel *chan, struct ast_channel *target)
{
int res = 0;
if (option_debug)
ast_log(LOG_DEBUG, "Call pickup on '%s' by '%s'\n", target->name, chan->name);
if ((res = ast_answer(chan))) {
ast_log(LOG_WARNING, "Unable to answer '%s'\n", chan->name);
return -1;
}
if ((res = ast_queue_control(chan, AST_CONTROL_ANSWER))) {
ast_log(LOG_WARNING, "Unable to queue answer on '%s'\n", chan->name);
return -1;
}
if ((res = ast_channel_masquerade(target, chan))) {
ast_log(LOG_WARNING, "Unable to masquerade '%s' into '%s'\n", chan->name, target->name);
return -1;
}
return res;
}
/* Helper function that determines whether a channel is capable of being picked up */
static int can_pickup(struct ast_channel *chan)
{
if (!chan->pbx && (chan->_state == AST_STATE_RINGING || chan->_state == AST_STATE_RING || chan->_state == AST_STATE_DOWN))
return 1;
else
return 0;
}
/* Attempt to pick up specified extension with context */
static int pickup_by_exten(struct ast_channel *chan, char *exten, char *context)
{
int res = -1;
struct ast_channel *target = NULL;
while ((target = ast_channel_walk_locked(target))) {
if ((!strcasecmp(target->macroexten, exten) || !strcasecmp(target->exten, exten)) &&
!strcasecmp(target->dialcontext, context) &&
can_pickup(target)) {
res = pickup_do(chan, target);
ast_channel_unlock(target);
break;
}
ast_channel_unlock(target);
}
return res;
}
/* Attempt to pick up specified mark */
static int pickup_by_mark(struct ast_channel *chan, char *mark)
{
int res = -1;
const char *tmp = NULL;
struct ast_channel *target = NULL;
while ((target = ast_channel_walk_locked(target))) {
if ((tmp = pbx_builtin_getvar_helper(target, PICKUPMARK)) &&
!strcasecmp(tmp, mark) &&
can_pickup(target)) {
res = pickup_do(chan, target);
ast_channel_unlock(target);
break;
}
ast_channel_unlock(target);
}
return res;
}
/* Main application entry point */
static int pickup_exec(struct ast_channel *chan, void *data)
{
int res = 0;
struct ast_module_user *u = NULL;
struct ast_channel *origin = NULL, *target = NULL;
char *tmp = NULL, *exten = NULL, *context = NULL, *rest=data;
char workspace[256] = "";
const char *tmp2 = NULL;
char *tmp = ast_strdupa(data);
char *exten = NULL, *context = NULL;
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "Pickup requires an argument (extension) !\n");
ast_log(LOG_WARNING, "Pickup requires an argument (extension)!\n");
return -1;
}
u = ast_module_user_add(chan);
while (!target && (exten = rest) ) {
res = 0;
rest = strchr(exten, '&');
if (rest)
*rest++ = 0;
/* Get the extension and context if present */
context = strchr(exten, '@');
if (context)
/* Parse extension (and context if there) */
while (!ast_strlen_zero(tmp) && (exten = strsep(&tmp, "&"))) {
if ((context = strchr(exten, '@')))
*context++ = '\0';
/* If the context is the pickup mark, iterate through all channels finding the right origin one */
if (context && !strcmp(context, PICKUPMARK)) {
while ((origin = ast_channel_walk_locked(origin))) {
if (origin) {
tmp2 = pbx_builtin_getvar_helper(origin, PICKUPMARK);
if (tmp2 && !strcmp(tmp2, exten))
break;
ast_mutex_unlock(&origin->lock);
}
}
} else {
/* Use the classic mode of searching */
origin = ast_get_channel_by_exten_locked(exten, context);
}
if (origin) {
ast_cdr_getvar(origin->cdr, "dstchannel", &tmp, workspace,
sizeof(workspace), 0, 0);
if (tmp) {
/* We have a possible channel... now we need to find it! */
target = ast_get_channel_by_name_locked(tmp);
} else {
ast_log(LOG_NOTICE, "No target channel found for %s.\n", exten);
res = -1;
}
ast_mutex_unlock(&origin->lock);
} else {
ast_log(LOG_DEBUG, "No originating channel found.\n");
}
if (res)
continue;
if (target && (!target->pbx) && ((target->_state == AST_STATE_RINGING) || (target->_state == AST_STATE_RING) ) ) {
ast_log(LOG_DEBUG, "Call pickup on chan '%s' by '%s'\n", target->name,
chan->name);
res = ast_answer(chan);
if (res) {
ast_log(LOG_WARNING, "Unable to answer '%s'\n", chan->name);
res = -1;
if (context && !strcasecmp(context, PICKUPMARK)) {
if (!pickup_by_mark(chan, exten))
break;
}
res = ast_queue_control(chan, AST_CONTROL_ANSWER);
if (res) {
ast_log(LOG_WARNING, "Unable to queue answer on '%s'\n",
chan->name);
res = -1;
break;
}
res = ast_channel_masquerade(target, chan);
if (res) {
ast_log(LOG_WARNING, "Unable to masquerade '%s' into '%s'\n", chan->name, target->name);
res = -1;
break;
}
} else {
ast_log(LOG_NOTICE, "No call pickup possible for %s...\n", exten);
res = -1;
if (!pickup_by_exten(chan, exten, context ? context : chan->context))
break;
}
ast_log(LOG_NOTICE, "No target channel found for %s.\n", exten);
}
if (target)
ast_mutex_unlock(&target->lock);
ast_module_user_remove(u);
return res;

View File

@@ -45,7 +45,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/utils.h"
#include "asterisk/app.h"
#ifdef USE_ODBC_STORAGE
#ifdef ODBC_STORAGE
#include <errno.h>
#include <sys/mman.h>
#include "asterisk/res_odbc.h"
@@ -88,23 +88,54 @@ static char *descrip =
#define NUMDIGITS 3
#ifdef USE_ODBC_STORAGE
#ifdef ODBC_STORAGE
struct generic_prepare_struct {
const char *sql;
const char *param;
};
static SQLHSTMT generic_prepare(struct odbc_obj *obj, void *data)
{
struct generic_prepare_struct *gps = data;
SQLHSTMT stmt;
int res;
res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Alloc Handle failed!\n");
return NULL;
}
res = SQLPrepare(stmt, (unsigned char *)gps->sql, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", (char *)gps->sql);
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
return NULL;
}
if (!ast_strlen_zero(gps->param))
SQLBindParameter(stmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(gps->param), 0, (void *)gps->param, 0, NULL);
return stmt;
}
static void retrieve_file(char *dir)
{
int x = 0;
int res;
int fd=-1;
size_t fdlen = 0;
void *fdm=NULL;
void *fdm = MAP_FAILED;
SQLHSTMT stmt;
char sql[256];
char fmt[80]="";
char fmt[80]="", empty[10] = "";
char *c;
SQLLEN colsize;
char full_fn[256];
struct odbc_obj *obj;
struct generic_prepare_struct gps = { .sql = sql, .param = dir };
odbc_obj *obj;
obj = fetch_odbc_obj(odbc_database, 0);
obj = ast_odbc_request_obj(odbc_database, 1);
if (obj) {
do {
ast_copy_string(fmt, vmfmts, sizeof(fmt));
@@ -114,23 +145,11 @@ static void retrieve_file(char *dir)
if (!strcasecmp(fmt, "wav49"))
strcpy(fmt, "WAV");
snprintf(full_fn, sizeof(full_fn), "%s.%s", dir, fmt);
res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Alloc Handle failed!\n");
break;
}
snprintf(sql, sizeof(sql), "SELECT recording FROM %s WHERE dir=? AND msgnum=-1", odbc_table);
res = SQLPrepare(stmt, (unsigned char *)sql, SQL_NTS);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
break;
}
SQLBindParameter(stmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(dir), 0, (void *)dir, 0, NULL);
res = odbc_smart_execute(obj, stmt);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, &gps);
if (!stmt) {
ast_log(LOG_WARNING, "SQL Execute error!\n[%s]\n\n", sql);
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
break;
}
res = SQLFetch(stmt);
@@ -149,7 +168,7 @@ static void retrieve_file(char *dir)
break;
}
res = SQLGetData(stmt, 1, SQL_BINARY, NULL, 0, &colsize);
res = SQLGetData(stmt, 1, SQL_BINARY, empty, 0, &colsize);
fdlen = colsize;
if (fd > -1) {
char tmp[1]="";
@@ -162,7 +181,7 @@ static void retrieve_file(char *dir)
if (fd > -1)
fdm = mmap(NULL, fdlen, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
}
if (fdm) {
if (fdm != MAP_FAILED) {
memset(fdm, 0, fdlen);
res = SQLGetData(stmt, x + 1, SQL_BINARY, fdm, fdlen, &colsize);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
@@ -173,9 +192,10 @@ static void retrieve_file(char *dir)
}
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
} while (0);
ast_odbc_release_obj(obj);
} else
ast_log(LOG_WARNING, "Failed to obtain database object for '%s'!\n", odbc_database);
if (fdm)
if (fdm != MAP_FAILED)
munmap(fdm, fdlen);
if (fd > -1)
close(fd);
@@ -268,7 +288,7 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context,
/* Check for the VoiceMail2 greeting first */
snprintf(fn, sizeof(fn), "%s/voicemail/%s/%s/greet",
ast_config_AST_SPOOL_DIR, context, ext);
#ifdef USE_ODBC_STORAGE
#ifdef ODBC_STORAGE
retrieve_file(fn);
#endif
@@ -277,8 +297,8 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context,
snprintf(fn, sizeof(fn), "%s/vm/%s/greet",
ast_config_AST_SPOOL_DIR, ext);
}
#ifdef USE_ODBC_STORAGE
retrieve_file(fn2);
#ifdef ODBC_STORAGE
retrieve_file(fn);
#endif
if (ast_fileexists(fn, NULL, chan->language) > 0) {
@@ -296,9 +316,8 @@ static int play_mailbox_owner(struct ast_channel *chan, char *context,
res = ast_say_character_str(chan, ext, AST_DIGIT_ANY, chan->language);
}
}
#ifdef USE_ODBC_STORAGE
#ifdef ODBC_STORAGE
ast_filedelete(fn, NULL);
ast_filedelete(fn2, NULL);
#endif
for (loop = 3 ; loop > 0; loop--) {
@@ -370,6 +389,9 @@ static struct ast_config *realtime_directory(char *context)
if (!cat) {
ast_log(LOG_WARNING, "Out of memory\n");
ast_config_destroy(cfg);
if (rtdata) {
ast_config_destroy(rtdata);
}
return NULL;
}
ast_category_append(cfg, cat);
@@ -404,6 +426,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, struct
int lastuserchoice = 0;
char *start, *conv, *stringp = NULL;
const char *pos;
int breakout = 0;
if (ast_strlen_zero(context)) {
ast_log(LOG_WARNING,
@@ -456,7 +479,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, struct
pos = strrchr(pos, ' ') + 1;
conv = convert(pos);
if (conv) {
if (!strcmp(conv, ext)) {
if (!strncmp(conv, ext, strlen(ext))) {
/* Match! */
found++;
free(conv);
@@ -527,6 +550,7 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, struct
* user hungup
*/
lastuserchoice = 0;
breakout = 1;
break;
case '1':
/* user pressed '1' and extensions exists;
@@ -534,19 +558,24 @@ static int do_directory(struct ast_channel *chan, struct ast_config *cfg, struct
a goto() on the channel
*/
lastuserchoice = res;
breakout = 1;
break;
case '*':
/* user pressed '*' to skip something found */
lastuserchoice = res;
breakout = 0;
res = 0;
break;
default:
breakout = 1;
break;
}
free(conv);
break;
if (breakout)
break;
}
free(conv);
else
free(conv);
}
}
}
@@ -653,9 +682,9 @@ static int unload_module(void)
static int load_module(void)
{
#ifdef USE_ODBC_STORAGE
#ifdef ODBC_STORAGE
struct ast_config *cfg = ast_config_load(VOICEMAIL_CONFIG);
char *tmp;
const char *tmp;
if (cfg) {
if ((tmp = ast_variable_retrieve(cfg, "general", "odbcstorage"))) {

View File

@@ -240,7 +240,7 @@ static int disa_exec(struct ast_channel *chan, void *data)
if (!(k&1)) { /* if in password state */
if (j == '#') { /* end of password */
/* see if this is an integer */
if (sscanf(args.passcode,"%d",&j) < 1) { /* nope, it must be a filename */
if (sscanf(args.passcode,"%30d",&j) < 1) { /* nope, it must be a filename */
fp = fopen(args.passcode,"r");
if (!fp) {
ast_log(LOG_WARNING,"DISA password file %s not found on chan %s\n",args.passcode,chan->name);
@@ -266,7 +266,7 @@ static int disa_exec(struct ast_channel *chan, void *data)
ast_log(LOG_DEBUG, "Mailbox: %s\n",args.mailbox);
/* password must be in valid format (numeric) */
if (sscanf(args.passcode,"%d", &j) < 1)
if (sscanf(args.passcode,"%30d", &j) < 1)
continue;
/* if we got it */
if (!strcmp(exten,args.passcode)) {
@@ -297,6 +297,16 @@ static int disa_exec(struct ast_channel *chan, void *data)
ast_log(LOG_DEBUG,"Successful DISA log-in on chan %s\n", chan->name);
continue;
}
} else {
if (j == '#') { /* end of extension .. maybe */
if (i == 0 &&
(ast_matchmore_extension(chan, args.context, "#", 1, chan->cid.cid_num) ||
ast_exists_extension(chan, args.context, "#", 1, chan->cid.cid_num)) ) {
/* Let the # be the part of, or the entire extension */
} else {
break;
}
}
}
exten[i++] = j; /* save digit */

View File

@@ -69,19 +69,14 @@ static int echo_exec(struct ast_channel *chan, void *data)
break;
f->delivery.tv_sec = 0;
f->delivery.tv_usec = 0;
switch (f->frametype) {
case AST_FRAME_DTMF:
if (f->subclass == '#') {
res = 0;
ast_frfree(f);
goto end;
}
/* fall through */
default:
if (ast_write(chan, f)) {
ast_frfree(f);
goto end;
}
if (ast_write(chan, f)) {
ast_frfree(f);
goto end;
}
if ((f->frametype == AST_FRAME_DTMF) && (f->subclass == '#')) {
res = 0;
ast_frfree(f);
goto end;
}
ast_frfree(f);
}

View File

@@ -183,7 +183,7 @@ static int execif_exec(struct ast_channel *chan, void *data)
if ((app = pbx_findapp(myapp))) {
res = pbx_exec(chan, app, mydata);
} else {
ast_log(LOG_WARNING, "Count not find application! (%s)\n", myapp);
ast_log(LOG_WARNING, "Could not find application! (%s)\n", myapp);
res = -1;
}
}

View File

@@ -31,6 +31,10 @@
* \ingroup applications
*/
/*** MODULEINFO
<depend>working_fork</depend>
***/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -40,6 +44,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#ifdef HAVE_CAP
#include <sys/capability.h>
#endif /* HAVE_CAP */
#include "asterisk/lock.h"
#include "asterisk/file.h"
@@ -57,7 +65,7 @@ static const char *app = "ExternalIVR";
static const char *synopsis = "Interfaces with an external IVR application";
static const char *descrip =
" ExternalIVR(command[|arg[|arg...]]): Forks an process to run the supplied command,\n"
" ExternalIVR(command[|arg[|arg...]]): Forks a process to run the supplied command,\n"
"and starts a generator on the channel. The generator's play list is\n"
"controlled by the external application, which can add and clear entries\n"
"via simple commands issued over its stdout. The external application\n"
@@ -152,7 +160,7 @@ static int gen_nextfile(struct gen_state *state)
if (state->current) {
file_to_stream = state->current->filename;
} else {
file_to_stream = "silence-10";
file_to_stream = "silence/10";
u->playing_silence = 1;
}
@@ -248,6 +256,7 @@ static int app_exec(struct ast_channel *chan, void *data)
int child_stdout[2] = { 0,0 };
int child_stderr[2] = { 0,0 };
int res = -1;
int test_available_fd = -1;
int gen_active = 0;
int pid;
char *argv[32];
@@ -261,9 +270,13 @@ static int app_exec(struct ast_channel *chan, void *data)
.finishlist = AST_LIST_HEAD_INIT_VALUE,
};
struct ivr_localuser *u = &foo;
sigset_t fullset, oldset;
lu = ast_module_user_add(chan);
sigfillset(&fullset);
pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
u->abort_current_sound = 0;
u->chan = chan;
@@ -311,6 +324,18 @@ static int app_exec(struct ast_channel *chan, void *data)
if (!pid) {
/* child process */
int i;
#ifdef HAVE_CAP
cap_t cap = cap_from_text("cap_net_admin-eip");
if (cap_set_proc(cap)) {
/* Careful with order! Logging cannot happen after we close FDs */
ast_log(LOG_WARNING, "Unable to remove capabilities.\n");
}
cap_free(cap);
#endif
signal(SIGPIPE, SIG_DFL);
pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
if (ast_opt_high_priority)
ast_set_priority(0);
@@ -322,7 +347,7 @@ static int app_exec(struct ast_channel *chan, void *data)
close(i);
execv(argv[0], argv);
fprintf(stderr, "Failed to execute '%s': %s\n", argv[0], strerror(errno));
exit(1);
_exit(1);
} else {
/* parent process */
int child_events_fd = child_stdin[1];
@@ -335,6 +360,8 @@ static int app_exec(struct ast_channel *chan, void *data)
int waitfds[2] = { child_errors_fd, child_commands_fd };
struct ast_channel *rchan;
pthread_sigmask(SIG_SETMASK, &oldset, NULL);
close(child_stdin[0]);
child_stdin[0] = 0;
close(child_stdout[1]);
@@ -357,6 +384,8 @@ static int app_exec(struct ast_channel *chan, void *data)
goto exit;
}
test_available_fd = open("/dev/null", O_RDONLY);
setvbuf(child_events, NULL, _IONBF, 0);
setvbuf(child_commands, NULL, _IONBF, 0);
setvbuf(child_errors, NULL, _IONBF, 0);
@@ -445,7 +474,7 @@ static int app_exec(struct ast_channel *chan, void *data)
continue;
if (input[0] == 'S') {
if (ast_fileexists(&input[2], NULL, NULL) == -1) {
if (ast_fileexists(&input[2], NULL, u->chan->language) == -1) {
ast_chan_log(LOG_WARNING, chan, "Unknown file requested '%s'\n", &input[2]);
send_child_event(child_events, 'Z', NULL, chan);
strcpy(&input[2], "exception");
@@ -464,7 +493,7 @@ static int app_exec(struct ast_channel *chan, void *data)
AST_LIST_INSERT_TAIL(&u->playlist, entry, list);
AST_LIST_UNLOCK(&u->playlist);
} else if (input[0] == 'A') {
if (ast_fileexists(&input[2], NULL, NULL) == -1) {
if (ast_fileexists(&input[2], NULL, u->chan->language) == -1) {
ast_chan_log(LOG_WARNING, chan, "Unknown file requested '%s'\n", &input[2]);
send_child_event(child_events, 'Z', NULL, chan);
strcpy(&input[2], "exception");
@@ -490,7 +519,7 @@ static int app_exec(struct ast_channel *chan, void *data)
} else if (ready_fd == child_errors_fd) {
char input[1024];
if (exception || feof(child_errors)) {
if (exception || (dup2(child_commands_fd, test_available_fd) == -1) || feof(child_errors)) {
ast_chan_log(LOG_WARNING, chan, "Child process went away\n");
res = -1;
break;
@@ -523,6 +552,10 @@ static int app_exec(struct ast_channel *chan, void *data)
if (child_errors)
fclose(child_errors);
if (test_available_fd > -1) {
close(test_available_fd);
}
if (child_stdin[0])
close(child_stdin[0]);

View File

@@ -25,6 +25,10 @@
* \ingroup applications
*/
/*** MODULEINFO
<depend>working_fork</depend>
***/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -45,6 +49,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <unistd.h>
#include <fcntl.h>
#include <ctype.h>
#include <errno.h>
#ifdef HAVE_CAP
#include <sys/capability.h>
#endif /* HAVE_CAP */
#include "asterisk/file.h"
#include "asterisk/logger.h"
@@ -130,19 +138,38 @@ static int send_waveform_to_fd(char *waveform, int length, int fd) {
#ifdef __PPC__
char c;
#endif
sigset_t fullset, oldset;
#ifdef HAVE_CAP
cap_t cap;
#endif
res = fork();
if (res < 0)
ast_log(LOG_WARNING, "Fork failed\n");
if (res)
return res;
for (x=0;x<256;x++) {
if (x != fd)
close(x);
}
sigfillset(&fullset);
pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
res = fork();
if (res < 0)
ast_log(LOG_WARNING, "Fork failed\n");
if (res) {
pthread_sigmask(SIG_SETMASK, &oldset, NULL);
return res;
}
#ifdef HAVE_CAP
cap = cap_from_text("cap_net_admin-eip");
if (cap_set_proc(cap)) {
/* Careful with order! Logging cannot happen after we close FDs */
ast_log(LOG_WARNING, "Unable to remove capabilities.\n");
}
cap_free(cap);
#endif
for (x=0;x<256;x++) {
if (x != fd)
close(x);
}
if (ast_opt_high_priority)
ast_set_priority(0);
signal(SIGPIPE, SIG_DFL);
pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
/*IAS */
#ifdef __PPC__
for( x=0; x<length; x+=2)
@@ -153,7 +180,9 @@ static int send_waveform_to_fd(char *waveform, int length, int fd) {
}
#endif
write(fd,waveform,length);
if (write(fd,waveform,length) < 0) {
ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno));
}
close(fd);
exit(0);
}
@@ -171,7 +200,9 @@ static int send_waveform_to_channel(struct ast_channel *chan, char *waveform, in
struct ast_frame f;
char offset[AST_FRIENDLY_OFFSET];
char frdata[2048];
} myf;
} myf = {
.f = { 0, },
};
if (pipe(fds)) {
ast_log(LOG_WARNING, "Unable to create pipe\n");
@@ -231,7 +262,6 @@ static int send_waveform_to_channel(struct ast_channel *chan, char *waveform, in
myf.f.subclass = AST_FORMAT_SLINEAR;
myf.f.datalen = res;
myf.f.samples = res / 2;
myf.f.mallocd = 0;
myf.f.offset = AST_FRIENDLY_OFFSET;
myf.f.src = __PRETTY_FUNCTION__;
myf.f.data = myf.frdata;
@@ -423,17 +453,25 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
writecache=1;
strln=strlen((char *)data);
ast_log(LOG_DEBUG,"line length : %d\n",strln);
write(fdesc,&strln,sizeof(int));
write(fdesc,data,strln);
if (write(fdesc,&strln,sizeof(int)) < 0) {
ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno));
}
if (write(fdesc,data,strln) < 0) {
ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno));
}
seekpos=lseek(fdesc,0,SEEK_CUR);
ast_log(LOG_DEBUG,"Seek position : %d\n",seekpos);
}
} else {
read(fdesc,&strln,sizeof(int));
if (read(fdesc,&strln,sizeof(int)) != sizeof(int)) {
ast_log(LOG_WARNING, "read() failed: %s\n", strerror(errno));
}
ast_log(LOG_DEBUG,"Cache file exists, strln=%d, strlen=%d\n",strln,(int)strlen((char *)data));
if (strlen((char *)data)==strln) {
ast_log(LOG_DEBUG,"Size OK\n");
read(fdesc,&bigstring,strln);
if (read(fdesc,&bigstring,strln) != strln) {
ast_log(LOG_WARNING, "read() failed: %s\n", strerror(errno));
}
bigstring[strln] = 0;
if (strcmp(bigstring,data)==0) {
readcache=1;
@@ -462,7 +500,9 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
if (writecache==1) {
ast_log(LOG_DEBUG,"Writing result to cache...\n");
while ((strln=read(fd,buffer,16384))!=0) {
write(fdesc,buffer,strln);
if (write(fdesc,buffer,strln) < 0) {
ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno));
}
}
close(fd);
close(fdesc);
@@ -485,7 +525,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
* */
if ( read_data == -1 )
{
ast_log(LOG_WARNING,"Unable to read from cache/festival fd");
ast_log(LOG_WARNING,"Unable to read from cache/festival fd\n");
close(fd);
ast_config_destroy(cfg);
ast_module_user_remove(u);

View File

@@ -18,7 +18,7 @@
/*! \file
*
* \brief App to flash a zap trunk
* \brief App to flash a DAHDI trunk
*
* \author Mark Spencer <markster@digium.com>
*
@@ -26,7 +26,7 @@
*/
/*** MODULEINFO
<depend>zaptel</depend>
<depend>dahdi</depend>
***/
#include "asterisk.h"
@@ -38,7 +38,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <zaptel/zaptel.h>
#include "asterisk/lock.h"
#include "asterisk/file.h"
@@ -50,23 +49,33 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/image.h"
#include "asterisk/options.h"
#include "asterisk/dahdi_compat.h"
static char *app = "Flash";
static char *synopsis = "Flashes a Zap Trunk";
static char *dahdi_synopsis = "Flashes a DAHDI trunk";
static char *descrip =
" Flash(): Sends a flash on a zap trunk. This is only a hack for\n"
"people who want to perform transfers and such via AGI and is generally\n"
"quite useless oths application will only work on Zap trunks.\n";
static char *dahdi_descrip =
"Performs a flash on a DAHDI trunk. This can be used\n"
"to access features provided on an incoming analogue circuit\n"
"such as conference and call waiting. Use with SendDTMF() to\n"
"perform external transfers\n";
static char *zap_synopsis = "Flashes a Zap trunk";
static char *zap_descrip =
"Performs a flash on a Zap trunk. This can be used\n"
"to access features provided on an incoming analogue circuit\n"
"such as conference and call waiting. Use with SendDTMF() to\n"
"perform external transfers\n";
static inline int zt_wait_event(int fd)
{
/* Avoid the silly zt_waitevent which ignores a bunch of events */
int i,j=0;
i = ZT_IOMUX_SIGEVENT;
if (ioctl(fd, ZT_IOMUX, &i) == -1) return -1;
if (ioctl(fd, ZT_GETEVENT, &j) == -1) return -1;
i = DAHDI_IOMUX_SIGEVENT;
if (ioctl(fd, DAHDI_IOMUX, &i) == -1) return -1;
if (ioctl(fd, DAHDI_GETEVENT, &j) == -1) return -1;
return j;
}
@@ -75,15 +84,15 @@ static int flash_exec(struct ast_channel *chan, void *data)
int res = -1;
int x;
struct ast_module_user *u;
struct zt_params ztp;
struct dahdi_params ztp;
u = ast_module_user_add(chan);
if (!strcasecmp(chan->tech->type, "Zap")) {
if (!strcasecmp(chan->tech->type, dahdi_chan_name)) {
memset(&ztp, 0, sizeof(ztp));
res = ioctl(chan->fds[0], ZT_GET_PARAMS, &ztp);
res = ioctl(chan->fds[0], DAHDI_GET_PARAMS, &ztp);
if (!res) {
if (ztp.sigtype & __ZT_SIG_FXS) {
x = ZT_FLASH;
res = ioctl(chan->fds[0], ZT_HOOK, &x);
if (ztp.sigtype & __DAHDI_SIG_FXS) {
x = DAHDI_FLASH;
res = ioctl(chan->fds[0], DAHDI_HOOK, &x);
if (!res || (errno == EINPROGRESS)) {
if (res) {
/* Wait for the event to finish */
@@ -99,7 +108,7 @@ static int flash_exec(struct ast_channel *chan, void *data)
} else
ast_log(LOG_WARNING, "Unable to get parameters of %s: %s\n", chan->name, strerror(errno));
} else
ast_log(LOG_WARNING, "%s is not a Zap channel\n", chan->name);
ast_log(LOG_WARNING, "%s is not a DAHDI channel\n", chan->name);
ast_module_user_remove(u);
return res;
}
@@ -117,8 +126,11 @@ static int unload_module(void)
static int load_module(void)
{
return ast_register_application(app, flash_exec, synopsis, descrip);
if (*dahdi_chan_mode == CHAN_ZAP_MODE) {
return ast_register_application(app, flash_exec, zap_synopsis, zap_descrip);
} else {
return ast_register_application(app, flash_exec, dahdi_synopsis, dahdi_descrip);
}
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Flash channel application");

View File

@@ -28,6 +28,10 @@
* \ingroup applications
*/
/*** MODULEINFO
<depend>chan_local</depend>
***/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -78,6 +82,7 @@ static char *descrip =
struct number {
char number[512]; /*!< Phone Number(s) and/or Extension(s) */
long timeout; /*!< Dial Timeout, if used. */
char language[MAX_LANGUAGE]; /*!< The language to be used on this dial, if used. */
int order; /*!< The order to dial in */
AST_LIST_ENTRY(number) entry; /*!< Next Number record */
};
@@ -147,7 +152,6 @@ AST_APP_OPTIONS(followme_opts, {
});
static int ynlongest = 0;
static time_t start_time, answer_time, end_time;
static const char *featuredigittostr;
static int featuredigittimeout = 5000; /*!< Feature Digit Timeout */
@@ -255,7 +259,7 @@ static void profile_set_param(struct call_followme *f, const char *param, const
}
/*! \brief Add a new number */
static struct number *create_followme_number(char *number, int timeout, int numorder)
static struct number *create_followme_number(char *number, char *language, int timeout, int numorder)
{
struct number *cur;
char *tmp;
@@ -268,6 +272,7 @@ static struct number *create_followme_number(char *number, int timeout, int numo
if ((tmp = strchr(number, ',')))
*tmp = '\0';
ast_copy_string(cur->number, number, sizeof(cur->number));
ast_copy_string(cur->language, language, sizeof(cur->language));
cur->order = numorder;
if (option_debug)
ast_log(LOG_DEBUG, "Created a number, %s, order of , %d, with a timeout of %ld.\n", cur->number, cur->order, cur->timeout);
@@ -310,7 +315,7 @@ static int reload_followme(void)
featuredigittostr = ast_variable_retrieve(cfg, "general", "featuredigittimeout");
if (!ast_strlen_zero(featuredigittostr)) {
if (!sscanf(featuredigittostr, "%d", &featuredigittimeout))
if (!sscanf(featuredigittostr, "%30d", &featuredigittimeout))
featuredigittimeout = 5000;
}
@@ -402,7 +407,7 @@ static int reload_followme(void)
idx++;
numorder = idx;
}
cur = create_followme_number(numberstr, timeout, numorder);
cur = create_followme_number(numberstr, "", timeout, numorder);
AST_LIST_INSERT_TAIL(&f->numbers, cur, entry);
} else {
profile_set_param(f, var->name, var->value, var->lineno, 1);
@@ -667,6 +672,10 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
if (option_verbose > 2)
ast_verbose ( VERBOSE_PREFIX_3 "%s requested a video update, passing it to %s\n", winner->name, caller->name);
break;
case AST_CONTROL_SRCUPDATE:
if (option_verbose > 2)
ast_verbose ( VERBOSE_PREFIX_3 "%s requested a source update, passing it to %s\n", winner->name, caller->name);
break;
case AST_CONTROL_PROCEEDING:
if (option_verbose > 2)
ast_verbose ( VERBOSE_PREFIX_3 "%s is proceeding passing it to %s\n", winner->name,caller->name);
@@ -795,7 +804,6 @@ static void findmeexec(struct fm_args *tpargs)
if (option_debug > 1)
ast_log(LOG_DEBUG, "Number %s timeout %ld\n", nm->number,nm->timeout);
time(&start_time);
number = ast_strdupa(nm->number);
if (option_debug > 2)
@@ -808,9 +816,9 @@ static void findmeexec(struct fm_args *tpargs)
}
if (!strcmp(tpargs->context, ""))
sprintf(dialarg, "%s", number);
snprintf(dialarg, sizeof(dialarg), "%s", number);
else
sprintf(dialarg, "%s@%s", number, tpargs->context);
snprintf(dialarg, sizeof(dialarg), "%s@%s", number, tpargs->context);
tmpuser = ast_calloc(1, sizeof(*tmpuser));
if (!tmpuser) {
@@ -866,22 +874,22 @@ static void findmeexec(struct fm_args *tpargs)
status = 0;
if (!AST_LIST_EMPTY(findme_user_list))
winner = wait_for_winner(findme_user_list, nm, caller, tpargs->namerecloc, &status, tpargs);
AST_LIST_TRAVERSE_SAFE_BEGIN(findme_user_list, fmuser, entry) {
if (!fmuser->cleared && fmuser->ochan != winner)
clear_caller(fmuser);
AST_LIST_REMOVE_CURRENT(findme_user_list, entry);
free(fmuser);
}
AST_LIST_TRAVERSE_SAFE_END
AST_LIST_TRAVERSE_SAFE_END;
fmuser = NULL;
tmpuser = NULL;
headuser = NULL;
if (winner)
break;
if (!caller) {
if (!caller || ast_check_hangup(caller)) {
tpargs->status = 1;
free(findme_user_list);
return;
@@ -906,9 +914,35 @@ static void findmeexec(struct fm_args *tpargs)
}
static void end_bridge_callback (void *data)
{
char buf[80];
time_t end;
struct ast_channel *chan = data;
time(&end);
ast_channel_lock(chan);
if (chan->cdr->answer.tv_sec) {
snprintf(buf, sizeof(buf), "%ld", end - chan->cdr->answer.tv_sec);
pbx_builtin_setvar_helper(chan, "ANSWEREDTIME", buf);
}
if (chan->cdr->start.tv_sec) {
snprintf(buf, sizeof(buf), "%ld", end - chan->cdr->start.tv_sec);
pbx_builtin_setvar_helper(chan, "DIALEDTIME", buf);
}
ast_channel_unlock(chan);
}
static void end_bridge_callback_data_fixup(struct ast_bridge_config *bconfig, struct ast_channel *originator, struct ast_channel *terminator)
{
bconfig->end_bridge_callback_data = originator;
}
static int app_exec(struct ast_channel *chan, void *data)
{
struct fm_args targs;
struct fm_args targs = { 0, };
struct ast_bridge_config config;
struct call_followme *f;
struct number *nm, *newnm;
@@ -916,32 +950,36 @@ static int app_exec(struct ast_channel *chan, void *data)
struct ast_module_user *u;
char *argstr;
char namerecloc[255];
char *fname = NULL;
int duration = 0;
struct ast_channel *caller;
struct ast_channel *outbound;
static char toast[80];
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(followmeid);
AST_APP_ARG(options);
);
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "%s requires an argument (followmeid)\n",app);
return -1;
}
if (!(argstr = ast_strdupa((char *)data))) {
ast_log(LOG_ERROR, "Out of memory!\n");
return -1;
}
if (!data) {
ast_log(LOG_WARNING, "%s requires an argument (followmeid)\n",app);
AST_STANDARD_APP_ARGS(args, argstr);
if (ast_strlen_zero(args.followmeid)) {
ast_log(LOG_WARNING, "%s requires an argument (followmeid)\n", app);
return -1;
}
u = ast_module_user_add(chan);
AST_STANDARD_APP_ARGS(args, argstr);
if (!ast_strlen_zero(args.followmeid))
AST_LIST_LOCK(&followmes);
AST_LIST_LOCK(&followmes);
AST_LIST_TRAVERSE(&followmes, f, entry) {
if (!strcasecmp(f->name, args.followmeid) && (f->active))
break;
@@ -951,8 +989,8 @@ static int app_exec(struct ast_channel *chan, void *data)
if (option_debug)
ast_log(LOG_DEBUG, "New profile %s.\n", args.followmeid);
if (!f) {
ast_log(LOG_WARNING, "Profile requested, %s, not found in the configuration.", args.followmeid);
res = -1;
ast_log(LOG_WARNING, "Profile requested, %s, not found in the configuration.\n", args.followmeid);
res = 0;
} else {
/* XXX TODO: Reinsert the db check value to see whether or not follow-me is on or off */
@@ -976,27 +1014,23 @@ static int app_exec(struct ast_channel *chan, void *data)
(and locked) while we're trying to do a follow-me */
AST_LIST_HEAD_INIT_NOLOCK(&targs.cnumbers);
AST_LIST_TRAVERSE(&f->numbers, nm, entry) {
newnm = create_followme_number(nm->number, nm->timeout, nm->order);
newnm = create_followme_number(nm->number, "", nm->timeout, nm->order);
AST_LIST_INSERT_TAIL(&targs.cnumbers, newnm, entry);
}
ast_mutex_unlock(&f->lock);
if (targs.followmeflags.flags & FOLLOWMEFLAG_STATUSMSG)
if (ast_test_flag(&targs.followmeflags, FOLLOWMEFLAG_STATUSMSG))
ast_stream_and_wait(chan, targs.statusprompt, chan->language, "");
snprintf(namerecloc,sizeof(namerecloc),"%s/followme.%s",ast_config_AST_SPOOL_DIR,chan->uniqueid);
duration = 5;
if (targs.followmeflags.flags & FOLLOWMEFLAG_RECORDNAME)
if (ast_test_flag(&targs.followmeflags, FOLLOWMEFLAG_RECORDNAME))
if (ast_play_and_record(chan, "vm-rec-name", namerecloc, 5, "sln", &duration, 128, 0, NULL) < 0)
goto outrun;
/* The following call looks like we're going to playback the file, but we're actually */
/* just checking to see if we *can* play it. */
if (ast_streamfile(chan, namerecloc, chan->language))
if (!ast_fileexists(namerecloc, NULL, chan->language))
ast_copy_string(namerecloc, "", sizeof(namerecloc));
else
ast_stopstream(chan);
if (ast_streamfile(chan, targs.plsholdprompt, chan->language))
goto outrun;
@@ -1015,13 +1049,9 @@ static int app_exec(struct ast_channel *chan, void *data)
free(nm);
}
AST_LIST_TRAVERSE_SAFE_END
if (!ast_strlen_zero(namerecloc))
unlink(namerecloc);
if (targs.status != 100) {
ast_moh_stop(chan);
if (targs.followmeflags.flags & FOLLOWMEFLAG_UNREACHABLEMSG)
if (ast_test_flag(&targs.followmeflags, FOLLOWMEFLAG_UNREACHABLEMSG))
ast_stream_and_wait(chan, targs.sorryprompt, chan->language, "");
res = 0;
} else {
@@ -1033,7 +1063,11 @@ static int app_exec(struct ast_channel *chan, void *data)
ast_set_flag(&(config.features_callee), AST_FEATURE_REDIRECT);
ast_set_flag(&(config.features_callee), AST_FEATURE_AUTOMON);
ast_set_flag(&(config.features_caller), AST_FEATURE_AUTOMON);
config.end_bridge_callback = end_bridge_callback;
config.end_bridge_callback_data = chan;
config.end_bridge_callback_data_fixup = end_bridge_callback_data_fixup;
ast_moh_stop(caller);
/* Be sure no generators are left on it */
ast_deactivate_generator(caller);
@@ -1044,19 +1078,18 @@ static int app_exec(struct ast_channel *chan, void *data)
ast_hangup(outbound);
goto outrun;
}
time(&answer_time);
res = ast_bridge_call(caller,outbound,&config);
time(&end_time);
snprintf(toast, sizeof(toast), "%ld", (long)(end_time - start_time));
pbx_builtin_setvar_helper(caller, "DIALEDTIME", toast);
snprintf(toast, sizeof(toast), "%ld", (long)(end_time - answer_time));
pbx_builtin_setvar_helper(caller, "ANSWEREDTIME", toast);
if (outbound)
ast_hangup(outbound);
res = 1;
}
}
outrun:
if (!ast_strlen_zero(namerecloc)){
fname = alloca(strlen(namerecloc) + 5);
sprintf(fname, "%s.sln", namerecloc);
unlink(fname);
}
ast_module_user_remove(u);

View File

@@ -40,6 +40,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/cdr.h"
#include "asterisk/app.h"
#include "asterisk/module.h"
static char *app = "ForkCDR";
@@ -47,11 +48,118 @@ static char *synopsis =
"Forks the Call Data Record";
static char *descrip =
" ForkCDR([options]): Causes the Call Data Record to fork an additional\n"
"cdr record starting from the time of the fork call\n"
"If the option 'v' is passed all cdr variables will be passed along also.\n";
"cdr record starting from the time of the fork call. This new cdr record will\n"
"be linked to end of the list of cdr records attached to the channel. The original CDR is\n"
"has a LOCKED flag set, which forces most cdr operations to skip it, except\n"
"for the functions that set the answer and end times, which ignore the LOCKED\n"
"flag. This allows all the cdr records in the channel to be 'ended' together\n"
"when the channel is closed.\n"
"The CDR() func (when setting CDR values) normally ignores the LOCKED flag also,\n"
"but has options to vary its behavior. The 'T' option (described below), can\n"
"override this behavior, but beware the risks.\n"
"\n"
"Detailed Behavior Description:\n"
"First, this app finds the last cdr record in the list, and makes\n"
"a copy of it. This new copy will be the newly forked cdr record.\n"
"Next, this new record is linked to the end of the cdr record list.\n"
"Next, The new cdr record is RESET (unless you use an option to prevent this)\n"
"This means that:\n"
" 1. All flags are unset on the cdr record\n"
" 2. the start, end, and answer times are all set to zero.\n"
" 3. the billsec and duration fields are set to zero.\n"
" 4. the start time is set to the current time.\n"
" 5. the disposition is set to NULL.\n"
"Next, unless you specified the 'v' option, all variables will be\n"
"removed from the original cdr record. Thus, the 'v' option allows\n"
"any CDR variables to be replicated to all new forked cdr records.\n"
"Without the 'v' option, the variables on the original are effectively\n"
"moved to the new forked cdr record.\n"
"Next, if the 's' option is set, the provided variable and value\n"
"are set on the original cdr record.\n"
"Next, if the 'a' option is given, and the original cdr record has an\n"
"answer time set, then the new forked cdr record will have its answer\n"
"time set to its start time. If the old answer time were carried forward,\n"
"the answer time would be earlier than the start time, giving strange\n"
"duration and billsec times.\n"
"Next, if the 'd' option was specified, the disposition is copied from\n"
"the original cdr record to the new forked cdr.\n"
"Next, if the 'D' option was specified, the destination channel field\n"
"in the new forked CDR is erased.\n"
"Next, if the 'e' option was specified, the 'end' time for the original\n"
"cdr record is set to the current time. Future hang-up or ending events\n"
"will not override this time stamp.\n"
"Next, If the 'A' option is specified, the original cdr record will have\n"
"it ANS_LOCKED flag set, which prevent future answer events\n"
"from updating the original cdr record's disposition. Normally, an\n"
"'ANSWERED' event would mark all cdr records in the chain as 'ANSWERED'.\n"
"Next, if the 'T' option is specified, the original cdr record will have\n"
"its 'DONT_TOUCH' flag set, which will force the cdr_answer, cdr_end, and\n"
"cdr_setvar functions to leave that cdr record alone.\n"
"And, last but not least, the original cdr record has its LOCKED flag\n"
"set. Almost all internal CDR functions (except for the funcs that set\n"
"the end, and answer times, and set a variable) will honor this flag\n"
"and leave a LOCKED cdr record alone.\n"
"This means that the newly created forked cdr record will affected\n"
"by events transpiring within Asterisk, with the previously noted\n"
"exceptions.\n"
" Options:\n"
" a - update the answer time on the NEW CDR just after it's been inited..\n"
" The new CDR may have been answered already, the reset that forkcdr.\n"
" does will erase the answer time. This will bring it back, but\n"
" the answer time will be a copy of the fork/start time. It will.\n"
" only do this if the initial cdr was indeed already answered..\n"
" A - Lock the original CDR against the answer time being updated.\n"
" This will allow the disposition on the original CDR to remain the same.\n"
" d - Copy the disposition forward from the old cdr, after the .\n"
" init..\n"
" D - Clear the dstchannel on the new CDR after reset..\n"
" e - end the original CDR. Do this after all the necc. data.\n"
" is copied from the original CDR to the new forked CDR..\n"
" R - do NOT reset the new cdr..\n"
" s(name=val) - Set the CDR var 'name' in the original CDR, with value.\n"
" 'val'.\n"
" T - Mark the original CDR with a DONT_TOUCH flag. setvar, answer, and end\n"
" cdr funcs will obey this flag; normally they don't honor the LOCKED\n"
" flag set on the original CDR record.\n"
" Beware-- using this flag may cause CDR's not to have their end times\n"
" updated! It is suggested that if you specify this flag, you might\n"
" wish to use the 'e' flag as well!\n"
" v - When the new CDR is forked, it gets a copy of the vars attached\n"
" to the current CDR. The vars attached to the original CDR are removed\n"
" unless this option is specified.\n";
static void ast_cdr_fork(struct ast_channel *chan)
enum {
OPT_SETANS = (1 << 0),
OPT_SETDISP = (1 << 1),
OPT_RESETDEST = (1 << 2),
OPT_ENDCDR = (1 << 3),
OPT_NORESET = (1 << 4),
OPT_KEEPVARS = (1 << 5),
OPT_VARSET = (1 << 6),
OPT_ANSLOCK = (1 << 7),
OPT_DONTOUCH = (1 << 8),
};
enum {
OPT_ARG_VARSET = 0,
/* note: this entry _MUST_ be the last one in the enum */
OPT_ARG_ARRAY_SIZE,
};
AST_APP_OPTIONS(forkcdr_exec_options, {
AST_APP_OPTION('a', OPT_SETANS),
AST_APP_OPTION('A', OPT_ANSLOCK),
AST_APP_OPTION('d', OPT_SETDISP),
AST_APP_OPTION('D', OPT_RESETDEST),
AST_APP_OPTION('e', OPT_ENDCDR),
AST_APP_OPTION('R', OPT_NORESET),
AST_APP_OPTION_ARG('s', OPT_VARSET, OPT_ARG_VARSET),
AST_APP_OPTION('T', OPT_DONTOUCH),
AST_APP_OPTION('v', OPT_KEEPVARS),
});
static void ast_cdr_fork(struct ast_channel *chan, struct ast_flags optflags, char *set)
{
struct ast_cdr *cdr;
struct ast_cdr *newcdr;
@@ -66,11 +174,41 @@ static void ast_cdr_fork(struct ast_channel *chan)
return;
ast_cdr_append(cdr, newcdr);
ast_cdr_reset(newcdr, &flags);
if (!ast_test_flag(&optflags, OPT_NORESET))
ast_cdr_reset(newcdr, &flags);
if (!ast_test_flag(cdr, AST_CDR_FLAG_KEEP_VARS))
ast_cdr_free_vars(cdr, 0);
if (!ast_strlen_zero(set)) {
char *varname = ast_strdupa(set), *varval;
varval = strchr(varname,'=');
if (varval) {
*varval = 0;
varval++;
ast_cdr_setvar(cdr, varname, varval, 0);
}
}
if (ast_test_flag(&optflags, OPT_SETANS) && !ast_tvzero(cdr->answer))
newcdr->answer = newcdr->start;
if (ast_test_flag(&optflags, OPT_SETDISP))
newcdr->disposition = cdr->disposition;
if (ast_test_flag(&optflags, OPT_RESETDEST))
newcdr->dstchannel[0] = 0;
if (ast_test_flag(&optflags, OPT_ENDCDR))
ast_cdr_end(cdr);
if (ast_test_flag(&optflags, OPT_ANSLOCK))
ast_set_flag(cdr, AST_CDR_FLAG_ANSLOCKED);
if (ast_test_flag(&optflags, OPT_DONTOUCH))
ast_set_flag(cdr, AST_CDR_FLAG_DONT_TOUCH);
ast_set_flag(cdr, AST_CDR_FLAG_CHILD | AST_CDR_FLAG_LOCKED);
}
@@ -78,6 +216,12 @@ static int forkcdr_exec(struct ast_channel *chan, void *data)
{
int res = 0;
struct ast_module_user *u;
char *argcopy = NULL;
struct ast_flags flags = {0};
char *opts[OPT_ARG_ARRAY_SIZE];
AST_DECLARE_APP_ARGS(arglist,
AST_APP_ARG(options);
);
if (!chan->cdr) {
ast_log(LOG_WARNING, "Channel does not have a CDR\n");
@@ -86,10 +230,19 @@ static int forkcdr_exec(struct ast_channel *chan, void *data)
u = ast_module_user_add(chan);
if (!ast_strlen_zero(data))
ast_set2_flag(chan->cdr, strchr(data, 'v'), AST_CDR_FLAG_KEEP_VARS);
argcopy = ast_strdupa(data);
AST_STANDARD_APP_ARGS(arglist, argcopy);
opts[OPT_ARG_VARSET] = 0;
if (!ast_strlen_zero(arglist.options))
ast_app_parse_options(forkcdr_exec_options, &flags, opts, arglist.options);
ast_cdr_fork(chan);
if (!ast_strlen_zero(data))
ast_set2_flag(chan->cdr, ast_test_flag(&flags, OPT_KEEPVARS), AST_CDR_FLAG_KEEP_VARS);
ast_cdr_fork(chan, flags, opts[OPT_ARG_VARSET]);
ast_module_user_remove(u);
return res;

View File

@@ -49,7 +49,7 @@ static char *synopsis = "Get ADSI CPE ID";
static char *descrip =
" GetCPEID: Obtains and displays ADSI CPE ID and other information in order\n"
"to properly setup zapata.conf for on-hook operations.\n";
"to properly setup chan_dahdi.conf for on-hook operations.\n";
static int cpeid_setstatus(struct ast_channel *chan, char *stuff[], int voice)
@@ -71,21 +71,20 @@ static int cpeid_exec(struct ast_channel *chan, void *idata)
int gotgeometry = 0;
int gotcpeid = 0;
int width, height, buttons;
char data[4][80];
char *stuff[4];
char *data[4];
unsigned int x;
u = ast_module_user_add(chan);
stuff[0] = data[0];
stuff[1] = data[1];
stuff[2] = data[2];
stuff[3] = data[3];
memset(data, 0, sizeof(data));
strncpy(stuff[0], "** CPE Info **", sizeof(data[0]) - 1);
strncpy(stuff[1], "Identifying CPE...", sizeof(data[1]) - 1);
strncpy(stuff[2], "Please wait...", sizeof(data[2]) - 1);
for (x = 0; x < 4; x++)
data[x] = alloca(80);
strcpy(data[0], "** CPE Info **");
strcpy(data[1], "Identifying CPE...");
strcpy(data[2], "Please wait...");
res = ast_adsi_load_session(chan, NULL, 0, 1);
if (res > 0) {
cpeid_setstatus(chan, stuff, 0);
cpeid_setstatus(chan, data, 0);
res = ast_adsi_get_cpeid(chan, cpeid, 0);
if (res > 0) {
gotcpeid = 1;
@@ -93,9 +92,9 @@ static int cpeid_exec(struct ast_channel *chan, void *idata)
ast_verbose(VERBOSE_PREFIX_3 "Got CPEID of '%02x:%02x:%02x:%02x' on '%s'\n", cpeid[0], cpeid[1], cpeid[2], cpeid[3], chan->name);
}
if (res > -1) {
strncpy(stuff[1], "Measuring CPE...", sizeof(data[1]) - 1);
strncpy(stuff[2], "Please wait...", sizeof(data[2]) - 1);
cpeid_setstatus(chan, stuff, 0);
strcpy(data[1], "Measuring CPE...");
strcpy(data[2], "Please wait...");
cpeid_setstatus(chan, data, 0);
res = ast_adsi_get_cpeinfo(chan, &width, &height, &buttons, 0);
if (res > -1) {
if (option_verbose > 2)
@@ -105,15 +104,15 @@ static int cpeid_exec(struct ast_channel *chan, void *idata)
}
if (res > -1) {
if (gotcpeid)
snprintf(stuff[1], sizeof(data[1]), "CPEID: %02x:%02x:%02x:%02x", cpeid[0], cpeid[1], cpeid[2], cpeid[3]);
snprintf(data[1], 80, "CPEID: %02x:%02x:%02x:%02x", cpeid[0], cpeid[1], cpeid[2], cpeid[3]);
else
strncpy(stuff[1], "CPEID Unknown", sizeof(data[1]) - 1);
strcpy(data[1], "CPEID Unknown");
if (gotgeometry)
snprintf(stuff[2], sizeof(data[2]), "Geom: %dx%d, %d buttons", width, height, buttons);
snprintf(data[2], 80, "Geom: %dx%d, %d buttons", width, height, buttons);
else
strncpy(stuff[2], "Geometry unknown", sizeof(data[2]) - 1);
strncpy(stuff[3], "Press # to exit", sizeof(data[3]) - 1);
cpeid_setstatus(chan, stuff, 1);
strcpy(data[2], "Geometry unknown");
strcpy(data[3], "Press # to exit");
cpeid_setstatus(chan, data, 1);
for(;;) {
res = ast_waitfordigit(chan, 1000);
if (res < 0)

View File

@@ -63,7 +63,8 @@ static char *hasvoicemail_descrip =
" 'j' -- jump to priority n+101, if there is voicemail in the folder indicated.\n"
" This application sets the following channel variable upon completion:\n"
" HASVMSTATUS The result of the voicemail check returned as a text string as follows\n"
" <# of messages in the folder, 0 for NONE>\n";
" <# of messages in the folder, 0 for NONE>\n"
"\nThis application has been deprecated in favor of the VMCOUNT() function\n";
static char *app_hasnewvoicemail = "HasNewVoicemail";
static char *hasnewvoicemail_synopsis = "Conditionally branches to priority + 101 with the right options set";
@@ -75,7 +76,8 @@ static char *hasnewvoicemail_descrip =
" 'j' -- jump to priority n+101, if there is new voicemail in folder 'folder' or INBOX\n"
" This application sets the following channel variable upon completion:\n"
" HASVMSTATUS The result of the new voicemail check returned as a text string as follows\n"
" <# of messages in the folder, 0 for NONE>\n";
" <# of messages in the folder, 0 for NONE>\n"
"\nThis application has been deprecated in favor of the VMCOUNT() function\n";
static int hasvoicemail_exec(struct ast_channel *chan, void *data)
@@ -159,6 +161,9 @@ static int acf_vmcount_exec(struct ast_channel *chan, char *cmd, char *argsstr,
AST_APP_ARG(folder);
);
if (ast_strlen_zero(argsstr))
return -1;
u = ast_module_user_add(chan);
buf[0] = '\0';

View File

@@ -25,6 +25,10 @@
* \ingroup applications
*/
/*** MODULEINFO
<depend>working_fork</depend>
***/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -37,6 +41,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <fcntl.h>
#include <sys/time.h>
#include <errno.h>
#ifdef HAVE_CAP
#include <sys/capability.h>
#endif /* HAVE_CAP */
#include "asterisk/lock.h"
#include "asterisk/file.h"
@@ -48,8 +55,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/translate.h"
#include "asterisk/options.h"
#define ICES "/usr/bin/ices"
#define LOCAL_ICES "/usr/local/bin/ices"
#define path_BIN "/usr/bin/"
#define path_LOCAL "/usr/local/bin/"
static char *app = "ICES";
@@ -58,33 +65,68 @@ static char *synopsis = "Encode and stream using 'ices'";
static char *descrip =
" ICES(config.xml) Streams to an icecast server using ices\n"
"(available separately). A configuration file must be supplied\n"
"for ices (see examples/asterisk-ices.conf). \n";
"for ices (see contrib/asterisk-ices.xml). \n";
static int icesencode(char *filename, int fd)
{
int res;
int x;
sigset_t fullset, oldset;
#ifdef HAVE_CAP
cap_t cap;
#endif
sigfillset(&fullset);
pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
res = fork();
if (res < 0)
ast_log(LOG_WARNING, "Fork failed\n");
if (res)
if (res) {
pthread_sigmask(SIG_SETMASK, &oldset, NULL);
return res;
}
/* Stop ignoring PIPE */
signal(SIGPIPE, SIG_DFL);
pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
#ifdef HAVE_CAP
cap = cap_from_text("cap_net_admin-eip");
if (cap_set_proc(cap)) {
/* Careful with order! Logging cannot happen after we close FDs */
ast_log(LOG_WARNING, "Unable to remove capabilities.\n");
}
cap_free(cap);
#endif
if (ast_opt_high_priority)
ast_set_priority(0);
dup2(fd, STDIN_FILENO);
for (x=STDERR_FILENO + 1;x<256;x++) {
for (x=STDERR_FILENO + 1;x<1024;x++) {
if ((x != STDIN_FILENO) && (x != STDOUT_FILENO))
close(x);
}
/* Most commonly installed in /usr/local/bin */
execl(ICES, "ices", filename, (char *)NULL);
/* But many places has it in /usr/bin */
execl(LOCAL_ICES, "ices", filename, (char *)NULL);
/* As a last-ditch effort, try to use PATH */
/* Most commonly installed in /usr/local/bin
* But many places has it in /usr/bin
* As a last-ditch effort, try to use PATH
*/
execl(path_LOCAL "ices2", "ices", filename, (char *)NULL);
execl(path_BIN "ices2", "ices", filename, (char *)NULL);
execlp("ices2", "ices", filename, (char *)NULL);
if (option_debug)
ast_log(LOG_DEBUG, "Couldn't find ices version 2, attempting to use ices version 1.");
execl(path_LOCAL "ices", "ices", filename, (char *)NULL);
execl(path_BIN "ices", "ices", filename, (char *)NULL);
execlp("ices", "ices", filename, (char *)NULL);
ast_log(LOG_WARNING, "Execute of ices failed\n");
return -1;
ast_log(LOG_WARNING, "Execute of ices failed, could not be found.\n");
close(fd);
_exit(0);
}
static int ices_exec(struct ast_channel *chan, void *data)
@@ -141,7 +183,7 @@ static int ices_exec(struct ast_channel *chan, void *data)
return -1;
}
if (((char *)data)[0] == '/')
strncpy(filename, (char *)data, sizeof(filename) - 1);
ast_copy_string(filename, (char *) data, sizeof(filename));
else
snprintf(filename, sizeof(filename), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, (char *)data);
/* Placeholder for options */
@@ -149,7 +191,6 @@ static int ices_exec(struct ast_channel *chan, void *data)
if (c)
*c = '\0';
res = icesencode(filename, fds[0]);
close(fds[0]);
if (res >= 0) {
pid = res;
for (;;) {
@@ -180,6 +221,7 @@ static int ices_exec(struct ast_channel *chan, void *data)
ast_frfree(f);
}
}
close(fds[0]);
close(fds[1]);
if (pid > -1)

View File

@@ -59,7 +59,9 @@ static char *descrip =
"This application sets the following channel variable upon completion:\n"
" LOOKUPBLSTATUS The status of the Blacklist lookup as a text string, one of\n"
" FOUND | NOTFOUND\n"
"Example: exten => 1234,1,LookupBlacklist()\n";
"Example: exten => 1234,1,LookupBlacklist()\n\n"
"This application is deprecated and may be removed from a future release.\n"
"Please use the dialplan function BLACKLIST() instead.\n";
static int blacklist_read(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len)

View File

@@ -55,7 +55,9 @@ static char *descrip =
"Caller*ID name. Does nothing if no Caller*ID was received on the\n"
"channel. This is useful if you do not subscribe to Caller*ID\n"
"name delivery, or if you want to change the names on some incoming\n"
"calls.\n";
"calls.\n\n"
"LookupCIDName is deprecated. Please use ${DB(cidname/${CALLERID(num)})}\n"
"instead.\n";
static int lookupcidname_exec (struct ast_channel *chan, void *data)

View File

@@ -60,7 +60,24 @@ static char *descrip =
"If you Goto out of the Macro context, the Macro will terminate and control\n"
"will be returned at the location of the Goto.\n"
"If ${MACRO_OFFSET} is set at termination, Macro will attempt to continue\n"
"at priority MACRO_OFFSET + N + 1 if such a step exists, and N + 1 otherwise.\n";
"at priority MACRO_OFFSET + N + 1 if such a step exists, and N + 1 otherwise.\n"
"WARNING: Because of the way Macro is implemented (it executes the priorities\n"
" contained within it via sub-engine), and a fixed per-thread\n"
" memory stack allowance, macros are limited to 7 levels\n"
" of nesting (macro calling macro calling macro, etc.); It\n"
" may be possible that stack-intensive applications in deeply nested\n"
" macros could cause asterisk to crash earlier than this limit.\n"
"NOTE: a bug existed in earlier versions of Asterisk that caused Macro not\n"
"to reset its context and extension correctly upon exit. This meant that\n"
"the 'h' extension within a Macro sometimes would execute, when the dialplan\n"
"exited while that Macro was running. However, since this bug has been in\n"
"Asterisk for so long, users started to depend upon this behavior. Therefore,\n"
"when a channel hangs up when in the midst of executing a Macro, the macro\n"
"context will first be checked for an 'h' extension, followed by the main\n"
"context from which the Macro was originally called. This behavior in 1.4\n"
"exists only for compatibility with earlier versions. You are strongly\n"
"encouraged to make use of the 'h' extension only in the context from which\n"
"Macro was originally called.\n";
static char *if_descrip =
" MacroIf(<expr>?macroname_a[|arg1][:macroname_b[|arg1]])\n"
@@ -92,32 +109,93 @@ static char *if_synopsis = "Conditional Macro Implementation";
static char *exclusive_synopsis = "Exclusive Macro Implementation";
static char *exit_synopsis = "Exit From Macro";
static void macro_fixup(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan);
struct ast_datastore_info macro_ds_info = {
.type = "MACRO",
.chan_fixup = macro_fixup,
};
static void macro_fixup(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)
{
int i;
char varname[10];
pbx_builtin_setvar_helper(new_chan, "MACRO_DEPTH", "0");
pbx_builtin_setvar_helper(new_chan, "MACRO_CONTEXT", NULL);
pbx_builtin_setvar_helper(new_chan, "MACRO_EXTEN", NULL);
pbx_builtin_setvar_helper(new_chan, "MACRO_PRIORITY", NULL);
pbx_builtin_setvar_helper(new_chan, "MACRO_OFFSET", NULL);
for (i = 1; i < 100; i++) {
snprintf(varname, sizeof(varname), "ARG%d", i);
while (pbx_builtin_getvar_helper(new_chan, varname)) {
/* Kill all levels of arguments */
pbx_builtin_setvar_helper(new_chan, varname, NULL);
}
}
}
static struct ast_exten *find_matching_priority(struct ast_context *c, const char *exten, int priority, const char *callerid)
{
struct ast_exten *e;
struct ast_include *i;
struct ast_context *c2;
for (e=ast_walk_context_extensions(c, NULL); e; e=ast_walk_context_extensions(c, e)) {
if (ast_extension_match(ast_get_extension_name(e), exten)) {
int needmatch = ast_get_extension_matchcid(e);
if ((needmatch && ast_extension_match(ast_get_extension_cidmatch(e), callerid)) ||
(!needmatch)) {
/* This is the matching extension we want */
struct ast_exten *p;
for (p=ast_walk_extension_priorities(e, NULL); p; p=ast_walk_extension_priorities(e, p)) {
if (priority != ast_get_extension_priority(p))
continue;
return p;
}
}
}
}
/* No match; run through includes */
for (i=ast_walk_context_includes(c, NULL); i; i=ast_walk_context_includes(c, i)) {
for (c2=ast_walk_contexts(NULL); c2; c2=ast_walk_contexts(c2)) {
if (!strcmp(ast_get_context_name(c2), ast_get_include_name(i))) {
e = find_matching_priority(c2, exten, priority, callerid);
if (e)
return e;
}
}
}
return NULL;
}
static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
{
const char *s;
char *tmp;
char *cur, *rest;
char *macro;
char fullmacro[80];
char varname[80];
char runningapp[80], runningdata[1024];
char *oldargs[MAX_ARGS + 1] = { NULL, };
int argc, x;
int res=0;
char oldexten[256]="";
int oldpriority;
int oldpriority, gosub_level = 0;
char pc[80], depthc[12];
char oldcontext[AST_MAX_CONTEXT] = "";
const char *inhangupc;
int offset, depth = 0, maxdepth = 7;
int setmacrocontext=0;
int autoloopflag, dead = 0;
int autoloopflag, inhangup = 0;
char *save_macro_exten;
char *save_macro_context;
char *save_macro_priority;
char *save_macro_offset;
struct ast_module_user *u;
struct ast_datastore *macro_store = ast_channel_datastore_find(chan, &macro_ds_info, NULL);
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "Macro() requires arguments. See \"show application macro\" for help.\n");
@@ -126,15 +204,35 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
u = ast_module_user_add(chan);
do {
if (macro_store) {
break;
}
if (!(macro_store = ast_channel_datastore_alloc(&macro_ds_info, NULL))) {
ast_log(LOG_WARNING, "Unable to allocate new datastore.\n");
break;
}
/* Just the existence of this datastore is enough. */
macro_store->inheritance = DATASTORE_INHERIT_FOREVER;
ast_channel_datastore_add(chan, macro_store);
} while (0);
/* does the user want a deeper rabbit hole? */
s = pbx_builtin_getvar_helper(chan, "MACRO_RECURSION");
if (s)
sscanf(s, "%d", &maxdepth);
sscanf(s, "%30d", &maxdepth);
/* Count how many levels deep the rabbit hole goes */
s = pbx_builtin_getvar_helper(chan, "MACRO_DEPTH");
if (s)
sscanf(s, "%d", &depth);
sscanf(s, "%30d", &depth);
/* Used for detecting whether to return when a Macro is called from another Macro after hangup */
if (strcmp(chan->exten, "h") == 0)
pbx_builtin_setvar_helper(chan, "MACRO_IN_HANGUP", "1");
inhangupc = pbx_builtin_getvar_helper(chan, "MACRO_IN_HANGUP");
if (!ast_strlen_zero(inhangupc))
sscanf(inhangupc, "%30d", &inhangup);
if (depth >= maxdepth) {
ast_log(LOG_ERROR, "Macro(): possible infinite loop detected. Returning early.\n");
ast_module_user_remove(u);
@@ -221,8 +319,36 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
autoloopflag = ast_test_flag(chan, AST_FLAG_IN_AUTOLOOP);
ast_set_flag(chan, AST_FLAG_IN_AUTOLOOP);
while(ast_exists_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num)) {
struct ast_context *c;
struct ast_exten *e;
runningapp[0] = '\0';
runningdata[0] = '\0';
/* What application will execute? */
if (ast_rdlock_contexts()) {
ast_log(LOG_WARNING, "Failed to lock contexts list\n");
} else {
for (c = ast_walk_contexts(NULL), e = NULL; c; c = ast_walk_contexts(c)) {
if (!strcmp(ast_get_context_name(c), chan->context)) {
if (ast_lock_context(c)) {
ast_log(LOG_WARNING, "Unable to lock context?\n");
} else {
e = find_matching_priority(c, chan->exten, chan->priority, chan->cid.cid_num);
if (e) { /* This will only be undefined for pbx_realtime, which is majorly broken. */
ast_copy_string(runningapp, ast_get_extension_app(e), sizeof(runningapp));
ast_copy_string(runningdata, ast_get_extension_app_data(e), sizeof(runningdata));
}
ast_unlock_context(c);
}
break;
}
}
}
ast_unlock_contexts();
/* Reset the macro depth, if it was changed in the last iteration */
pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
if ((res = ast_spawn_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num))) {
/* Something bad happened, or a hangup has been requested. */
if (((res >= '0') && (res <= '9')) || ((res >= 'A') && (res <= 'F')) ||
@@ -241,23 +367,78 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
else if (option_verbose > 1)
ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited KEEPALIVE in macro '%s' on '%s'\n", chan->context, chan->exten, chan->priority, macro, chan->name);
goto out;
break;
default:
if (option_debug)
ast_log(LOG_DEBUG, "Spawn extension (%s,%s,%d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
else if (option_verbose > 1)
ast_verbose( VERBOSE_PREFIX_2 "Spawn extension (%s, %s, %d) exited non-zero on '%s' in macro '%s'\n", chan->context, chan->exten, chan->priority, chan->name, macro);
dead = 1;
goto out;
}
}
if (strcasecmp(chan->context, fullmacro)) {
ast_log(LOG_DEBUG, "Executed application: %s\n", runningapp);
if (!strcasecmp(runningapp, "GOSUB")) {
gosub_level++;
ast_log(LOG_DEBUG, "Incrementing gosub_level\n");
} else if (!strcasecmp(runningapp, "GOSUBIF")) {
char tmp2[1024] = "", *cond, *app, *app2 = tmp2;
pbx_substitute_variables_helper(chan, runningdata, tmp2, sizeof(tmp2) - 1);
cond = strsep(&app2, "?");
app = strsep(&app2, ":");
if (pbx_checkcondition(cond)) {
if (!ast_strlen_zero(app)) {
gosub_level++;
ast_log(LOG_DEBUG, "Incrementing gosub_level\n");
}
} else {
if (!ast_strlen_zero(app2)) {
gosub_level++;
ast_log(LOG_DEBUG, "Incrementing gosub_level\n");
}
}
} else if (!strcasecmp(runningapp, "RETURN")) {
gosub_level--;
ast_log(LOG_DEBUG, "Decrementing gosub_level\n");
} else if (!strcasecmp(runningapp, "STACKPOP")) {
gosub_level--;
ast_log(LOG_DEBUG, "Decrementing gosub_level\n");
} else if (!strncasecmp(runningapp, "EXEC", 4)) {
/* Must evaluate args to find actual app */
char tmp2[1024] = "", *tmp3 = NULL;
pbx_substitute_variables_helper(chan, runningdata, tmp2, sizeof(tmp2) - 1);
if (!strcasecmp(runningapp, "EXECIF")) {
tmp3 = strchr(tmp2, '|');
if (tmp3)
*tmp3++ = '\0';
if (!pbx_checkcondition(tmp2))
tmp3 = NULL;
} else
tmp3 = tmp2;
if (tmp3)
ast_log(LOG_DEBUG, "Last app: %s\n", tmp3);
if (tmp3 && !strncasecmp(tmp3, "GOSUB", 5)) {
gosub_level++;
ast_log(LOG_DEBUG, "Incrementing gosub_level\n");
} else if (tmp3 && !strncasecmp(tmp3, "RETURN", 6)) {
gosub_level--;
ast_log(LOG_DEBUG, "Decrementing gosub_level\n");
} else if (tmp3 && !strncasecmp(tmp3, "STACKPOP", 8)) {
gosub_level--;
ast_log(LOG_DEBUG, "Decrementing gosub_level\n");
}
}
if (gosub_level == 0 && strcasecmp(chan->context, fullmacro)) {
if (option_verbose > 1)
ast_verbose(VERBOSE_PREFIX_2 "Channel '%s' jumping out of macro '%s'\n", chan->name, macro);
break;
}
/* don't stop executing extensions when we're in "h" */
if (chan->_softhangup && strcasecmp(oldexten,"h") && strcasecmp(chan->macroexten,"h")) {
if (chan->_softhangup && !inhangup) {
ast_log(LOG_DEBUG, "Extension %s, macroexten %s, priority %d returned normally even though call was hung up\n",
chan->exten, chan->macroexten, chan->priority);
goto out;
@@ -265,31 +446,30 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
chan->priority++;
}
out:
/* Don't let the channel change now. */
ast_channel_lock(chan);
/* Reset the depth back to what it was when the routine was entered (like if we called Macro recursively) */
snprintf(depthc, sizeof(depthc), "%d", depth);
if (!dead) {
pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
}
pbx_builtin_setvar_helper(chan, "MACRO_DEPTH", depthc);
ast_set2_flag(chan, autoloopflag, AST_FLAG_IN_AUTOLOOP);
for (x = 1; x < argc; x++) {
/* Restore old arguments and delete ours */
snprintf(varname, sizeof(varname), "ARG%d", x);
if (oldargs[x]) {
if (!dead)
pbx_builtin_setvar_helper(chan, varname, oldargs[x]);
pbx_builtin_setvar_helper(chan, varname, oldargs[x]);
free(oldargs[x]);
} else if (!dead) {
} else {
pbx_builtin_setvar_helper(chan, varname, NULL);
}
}
/* Restore macro variables */
if (!dead) {
pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", save_macro_exten);
pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", save_macro_context);
pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority);
}
pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", save_macro_exten);
pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", save_macro_context);
pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority);
if (save_macro_exten)
free(save_macro_exten);
if (save_macro_context)
@@ -297,13 +477,30 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
if (save_macro_priority)
free(save_macro_priority);
if (!dead && setmacrocontext) {
if (setmacrocontext) {
chan->macrocontext[0] = '\0';
chan->macroexten[0] = '\0';
chan->macropriority = 0;
}
if (!dead && !strcasecmp(chan->context, fullmacro)) {
/*!\note
* This section is used to restore a behavior that we mistakenly
* changed in issue #6176, then mistakenly reverted in #13962 and
* #13363. A corresponding change is made in main/pbx.c, where we
* check this variable for existence, then look for the "h" extension
* in that context.
*/
if (ast_check_hangup(chan) || res < 0) {
/* Don't need to lock the channel, as we aren't dereferencing emc.
* The intent here is to grab the deepest context, without overwriting
* in any above context. */
const char *emc = pbx_builtin_getvar_helper(chan, "EXIT_MACRO_CONTEXT");
if (!emc) {
pbx_builtin_setvar_helper(chan, "EXIT_MACRO_CONTEXT", fullmacro);
}
}
if (!strcasecmp(chan->context, fullmacro)) {
/* If we're leaving the macro normally, restore original information */
chan->priority = oldpriority;
ast_copy_string(chan->context, oldcontext, sizeof(chan->context));
@@ -314,7 +511,7 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
if ((offsets = pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"))) {
/* Handle macro offset if it's set by checking the availability of step n + offset + 1, otherwise continue
normally if there is any problem */
if (sscanf(offsets, "%d", &offset) == 1) {
if (sscanf(offsets, "%30d", &offset) == 1) {
if (ast_exists_extension(chan, chan->context, chan->exten, chan->priority + offset + 1, chan->cid.cid_num)) {
chan->priority += offset;
}
@@ -323,8 +520,7 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
}
}
if (!dead)
pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset);
pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset);
if (save_macro_offset)
free(save_macro_offset);
@@ -336,6 +532,7 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
res = 0;
}
}
ast_channel_unlock(chan);
ast_module_user_remove(u);
@@ -373,9 +570,9 @@ static int macroif_exec(struct ast_channel *chan, void *data)
label_b++;
}
if (pbx_checkcondition(expr))
macro_exec(chan, label_a);
res = macro_exec(chan, label_a);
else if (label_b)
macro_exec(chan, label_b);
res = macro_exec(chan, label_b);
} else
ast_log(LOG_WARNING, "Invalid Syntax.\n");

File diff suppressed because it is too large Load Diff

View File

@@ -25,6 +25,10 @@
* \ingroup applications
*/
/*** MODULEINFO
<depend>res_indications</depend>
***/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -45,10 +49,14 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
static char *app = "Milliwatt";
static char *synopsis = "Generate a Constant 1000Hz tone at 0dbm (mu-law)";
static char *synopsis = "Generate a Constant 1004Hz tone at 0dbm (mu-law)";
static char *descrip =
"Milliwatt(): Generate a Constant 1000Hz tone at 0dbm (mu-law)\n";
" Milliwatt([options]): Generate a Constant 1004Hz tone at 0dbm.\n"
"Previous versions of this application generated the tone at 1000Hz. If for\n"
"some reason you would prefer that behavior, supply the 'o' option to get the\n"
"old behavior.\n"
"";
static char digital_milliwatt[] = {0x1e,0x0b,0x0b,0x1e,0x9e,0x8b,0x8b,0x9e} ;
@@ -87,51 +95,84 @@ static int milliwatt_generate(struct ast_channel *chan, void *data, int len, int
ast_log(LOG_WARNING, "Only doing %d samples (%d requested)\n", maxsamples, samples);
samples = maxsamples;
}
len = samples * sizeof (buf[0]);
wf.datalen = len;
wf.samples = samples;
/* create a buffer containing the digital milliwatt pattern */
for(i = 0; i < len; i++)
{
for (i = 0; i < len; i++) {
buf[AST_FRIENDLY_OFFSET + i] = digital_milliwatt[(*indexp)++];
*indexp &= 7;
}
if (ast_write(chan,&wf) < 0)
{
if (ast_write(chan,&wf) < 0) {
ast_log(LOG_WARNING,"Failed to write frame to '%s': %s\n",chan->name,strerror(errno));
return -1;
}
return 0;
}
static struct ast_generator milliwattgen =
{
static struct ast_generator milliwattgen = {
alloc: milliwatt_alloc,
release: milliwatt_release,
generate: milliwatt_generate,
} ;
};
static int old_milliwatt_exec(struct ast_channel *chan)
{
ast_set_write_format(chan, AST_FORMAT_ULAW);
ast_set_read_format(chan, AST_FORMAT_ULAW);
if (chan->_state != AST_STATE_UP) {
ast_answer(chan);
}
if (ast_activate_generator(chan,&milliwattgen,"milliwatt") < 0) {
ast_log(LOG_WARNING,"Failed to activate generator on '%s'\n",chan->name);
return -1;
}
while (!ast_safe_sleep(chan, 10000))
;
ast_deactivate_generator(chan);
return -1;
}
static int milliwatt_exec(struct ast_channel *chan, void *data)
{
const char *options = data;
struct ast_app *playtones_app;
struct ast_module_user *u;
int res = -1;
u = ast_module_user_add(chan);
ast_set_write_format(chan, AST_FORMAT_ULAW);
ast_set_read_format(chan, AST_FORMAT_ULAW);
if (chan->_state != AST_STATE_UP)
{
ast_answer(chan);
if (!ast_strlen_zero(options) && strchr(options, 'o')) {
res = old_milliwatt_exec(chan);
goto exit_app;
}
if (ast_activate_generator(chan,&milliwattgen,"milliwatt") < 0)
{
ast_log(LOG_WARNING,"Failed to activate generator on '%s'\n",chan->name);
ast_module_user_remove(u);
return -1;
if (!(playtones_app = pbx_findapp("Playtones"))) {
ast_log(LOG_ERROR, "The Playtones application is required to run Milliwatt()\n");
goto exit_app;
}
while(!ast_safe_sleep(chan, 10000));
ast_deactivate_generator(chan);
res = pbx_exec(chan, playtones_app, "1004/1000");
while (!res) {
res = ast_safe_sleep(chan, 10000);
}
res = 0;
exit_app:
ast_module_user_remove(u);
return -1;
return res;
}
static int unload_module(void)

View File

@@ -45,7 +45,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/file.h"
#include "asterisk/logger.h"
#include "asterisk/channel.h"
#include "asterisk/chanspy.h"
#include "asterisk/audiohook.h"
#include "asterisk/pbx.h"
#include "asterisk/module.h"
#include "asterisk/lock.h"
@@ -64,18 +64,24 @@ static const char *desc = ""
"Records the audio on the current channel to the specified file.\n"
"If the filename is an absolute path, uses that path, otherwise\n"
"creates the file in the configured monitoring directory from\n"
"asterisk.conf.\n\n"
"asterisk.conf. Use of StopMixMonitor is required to guarantee\n"
"the audio file is available for processing during dialplan execution.\n\n"
"Valid options:\n"
" a - Append to the file instead of overwriting it.\n"
" b - Only save audio to the file while the channel is bridged.\n"
" Note: does not include conferences.\n"
" Note: Does not include conferences or sounds played to each bridged\n"
" party.\n"
" Note: If you utilize this option inside a Local channel, you must\n"
" make sure the Local channel is not optimized away. To do this,\n"
" be sure to call your Local channel with the '/n' option.\n"
" For example: Dial(Local/start@mycontext/n)\n"
" v(<x>) - Adjust the heard volume by a factor of <x> (range -4 to 4)\n"
" V(<x>) - Adjust the spoken volume by a factor of <x> (range -4 to 4)\n"
" W(<x>) - Adjust the both heard and spoken volumes by a factor of <x>\n"
" (range -4 to 4)\n\n"
"<command> will be executed when the recording is over\n"
"Any strings matching ^{X} will be unescaped to ${X} and \n"
"all variables will be evaluated at that time.\n"
"Any strings matching ^{X} will be unescaped to ${X}.\n"
"All variables will be evaluated at the time MixMonitor is called.\n"
"The variable MIXMONITOR_FILENAME will contain the filename used to record.\n"
"";
@@ -83,8 +89,7 @@ static const char *stop_app = "StopMixMonitor";
static const char *stop_synopsis = "Stop recording a call through MixMonitor";
static const char *stop_desc = ""
" StopMixMonitor()\n\n"
"Stops the audio recording that was started with a call to MixMonitor()\n"
"on the current channel.\n"
"Stop recording a call through MixMonitor, and free the recording's file handle.\n"
"";
struct module_symbols *me;
@@ -92,11 +97,12 @@ struct module_symbols *me;
static const char *mixmonitor_spy_type = "MixMonitor";
struct mixmonitor {
struct ast_channel_spy spy;
struct ast_filestream *fs;
struct ast_audiohook audiohook;
char *filename;
char *post_process;
char *name;
unsigned int flags;
struct mixmonitor_ds *mixmonitor_ds;
};
enum {
@@ -122,7 +128,69 @@ AST_APP_OPTIONS(mixmonitor_opts, {
AST_APP_OPTION_ARG('W', MUXFLAG_VOLUME, OPT_ARG_VOLUME),
});
static int startmon(struct ast_channel *chan, struct ast_channel_spy *spy)
/* This structure is used as a means of making sure that our pointer to
* the channel we are monitoring remains valid. This is very similar to
* what is used in app_chanspy.c.
*/
struct mixmonitor_ds {
struct ast_channel *chan;
/* These condition variables are used to be sure that the channel
* hangup code completes before the mixmonitor thread attempts to
* free this structure. The combination of a bookean flag and a
* ast_cond_t ensure that no matter what order the threads run in,
* we are guaranteed to never have the waiting thread block forever
* in the case that the signaling thread runs first.
*/
unsigned int destruction_ok;
ast_cond_t destruction_condition;
ast_mutex_t lock;
/* The filestream is held in the datastore so it can be stopped
* immediately during stop_mixmonitor or channel destruction. */
int fs_quit;
struct ast_filestream *fs;
};
static void mixmonitor_ds_close_fs(struct mixmonitor_ds *mixmonitor_ds)
{
ast_mutex_lock(&mixmonitor_ds->lock);
if (mixmonitor_ds->fs) {
ast_closestream(mixmonitor_ds->fs);
mixmonitor_ds->fs = NULL;
mixmonitor_ds->fs_quit = 1;
if (option_verbose > 1)
ast_verbose(VERBOSE_PREFIX_2 "MixMonitor close filestream\n");
}
ast_mutex_unlock(&mixmonitor_ds->lock);
}
static void mixmonitor_ds_destroy(void *data)
{
struct mixmonitor_ds *mixmonitor_ds = data;
ast_mutex_lock(&mixmonitor_ds->lock);
mixmonitor_ds->chan = NULL;
mixmonitor_ds->destruction_ok = 1;
ast_cond_signal(&mixmonitor_ds->destruction_condition);
ast_mutex_unlock(&mixmonitor_ds->lock);
}
static void mixmonitor_ds_chan_fixup(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan)
{
struct mixmonitor_ds *mixmonitor_ds = data;
ast_mutex_lock(&mixmonitor_ds->lock);
mixmonitor_ds->chan = new_chan;
ast_mutex_unlock(&mixmonitor_ds->lock);
}
static struct ast_datastore_info mixmonitor_ds_info = {
.type = "mixmonitor",
.destroy = mixmonitor_ds_destroy,
.chan_fixup = mixmonitor_ds_chan_fixup,
};
static int startmon(struct ast_channel *chan, struct ast_audiohook *audiohook)
{
struct ast_channel *peer;
int res;
@@ -130,9 +198,7 @@ static int startmon(struct ast_channel *chan, struct ast_channel_spy *spy)
if (!chan)
return -1;
ast_channel_lock(chan);
res = ast_channel_spy_add(chan, spy);
ast_channel_unlock(chan);
res = ast_audiohook_attach(chan, audiohook);
if (!res && ast_test_flag(chan, AST_FLAG_NBRIDGE) && (peer = ast_bridged_channel(chan)))
ast_softhangup(peer, AST_SOFTHANGUP_UNBRIDGE);
@@ -142,78 +208,146 @@ static int startmon(struct ast_channel *chan, struct ast_channel_spy *spy)
#define SAMPLES_PER_FRAME 160
static void mixmonitor_free(struct mixmonitor *mixmonitor)
{
if (mixmonitor) {
if (mixmonitor->mixmonitor_ds) {
ast_mutex_destroy(&mixmonitor->mixmonitor_ds->lock);
ast_cond_destroy(&mixmonitor->mixmonitor_ds->destruction_condition);
ast_free(mixmonitor->mixmonitor_ds);
}
ast_free(mixmonitor);
}
}
static void *mixmonitor_thread(void *obj)
{
struct mixmonitor *mixmonitor = obj;
struct ast_frame *f = NULL;
struct ast_filestream **fs = NULL;
unsigned int oflags;
char *ext;
int errflag = 0;
if (option_verbose > 1)
ast_verbose(VERBOSE_PREFIX_2 "Begin MixMonitor Recording %s\n", mixmonitor->name);
ast_mutex_lock(&mixmonitor->spy.lock);
while (mixmonitor->spy.chan) {
struct ast_frame *next;
int write;
ast_audiohook_lock(&mixmonitor->audiohook);
ast_channel_spy_trigger_wait(&mixmonitor->spy);
if (!mixmonitor->spy.chan || mixmonitor->spy.status != CHANSPY_RUNNING)
fs = &mixmonitor->mixmonitor_ds->fs;
while (mixmonitor->audiohook.status == AST_AUDIOHOOK_STATUS_RUNNING && !mixmonitor->mixmonitor_ds->fs_quit) {
struct ast_frame *fr = NULL;
ast_audiohook_trigger_wait(&mixmonitor->audiohook);
if (mixmonitor->audiohook.status != AST_AUDIOHOOK_STATUS_RUNNING)
break;
while (1) {
if (!(f = ast_channel_spy_read_frame(&mixmonitor->spy, SAMPLES_PER_FRAME)))
break;
write = (!ast_test_flag(mixmonitor, MUXFLAG_BRIDGED) ||
ast_bridged_channel(mixmonitor->spy.chan));
if (!(fr = ast_audiohook_read_frame(&mixmonitor->audiohook, SAMPLES_PER_FRAME, AST_AUDIOHOOK_DIRECTION_BOTH, AST_FORMAT_SLINEAR)))
continue;
/* it is possible for ast_channel_spy_read_frame() to return a chain
of frames if a queue flush was necessary, so process them
*/
for (; f; f = next) {
next = AST_LIST_NEXT(f, frame_list);
if (write)
ast_writestream(mixmonitor->fs, f);
ast_frame_free(f, 0);
ast_mutex_lock(&mixmonitor->mixmonitor_ds->lock);
if (!ast_test_flag(mixmonitor, MUXFLAG_BRIDGED) || (mixmonitor->mixmonitor_ds->chan && ast_bridged_channel(mixmonitor->mixmonitor_ds->chan))) {
ast_mutex_unlock(&mixmonitor->mixmonitor_ds->lock);
/* Initialize the file if not already done so */
if (!*fs && !errflag && !mixmonitor->mixmonitor_ds->fs_quit) {
oflags = O_CREAT | O_WRONLY;
oflags |= ast_test_flag(mixmonitor, MUXFLAG_APPEND) ? O_APPEND : O_TRUNC;
if ((ext = strrchr(mixmonitor->filename, '.')))
*(ext++) = '\0';
else
ext = "raw";
if (!(*fs = ast_writefile(mixmonitor->filename, ext, NULL, oflags, 0, 0644))) {
ast_log(LOG_ERROR, "Cannot open %s.%s\n", mixmonitor->filename, ext);
errflag = 1;
}
}
/* Write out the frame(s) */
if (*fs) {
struct ast_frame *cur;
for (cur = fr; cur; cur = AST_LIST_NEXT(cur, frame_list)) {
ast_writestream(*fs, cur);
}
}
} else {
ast_mutex_unlock(&mixmonitor->mixmonitor_ds->lock);
}
/* All done! free it. */
ast_frame_free(fr, 0);
}
ast_mutex_unlock(&mixmonitor->spy.lock);
ast_audiohook_detach(&mixmonitor->audiohook);
ast_audiohook_unlock(&mixmonitor->audiohook);
ast_audiohook_destroy(&mixmonitor->audiohook);
ast_channel_spy_free(&mixmonitor->spy);
if (option_verbose > 1)
ast_verbose(VERBOSE_PREFIX_2 "End MixMonitor Recording %s\n", mixmonitor->name);
mixmonitor_ds_close_fs(mixmonitor->mixmonitor_ds);
if (mixmonitor->post_process) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_2 "Executing [%s]\n", mixmonitor->post_process);
ast_safe_system(mixmonitor->post_process);
}
ast_closestream(mixmonitor->fs);
free(mixmonitor);
ast_mutex_lock(&mixmonitor->mixmonitor_ds->lock);
if (!mixmonitor->mixmonitor_ds->destruction_ok) {
ast_cond_wait(&mixmonitor->mixmonitor_ds->destruction_condition, &mixmonitor->mixmonitor_ds->lock);
}
ast_mutex_unlock(&mixmonitor->mixmonitor_ds->lock);
if (option_verbose > 1)
ast_verbose(VERBOSE_PREFIX_2 "End MixMonitor Recording %s\n", mixmonitor->name);
mixmonitor_free(mixmonitor);
return NULL;
}
static int setup_mixmonitor_ds(struct mixmonitor *mixmonitor, struct ast_channel *chan)
{
struct ast_datastore *datastore = NULL;
struct mixmonitor_ds *mixmonitor_ds;
if (!(mixmonitor_ds = ast_calloc(1, sizeof(*mixmonitor_ds)))) {
return -1;
}
ast_mutex_init(&mixmonitor_ds->lock);
ast_cond_init(&mixmonitor_ds->destruction_condition, NULL);
if (!(datastore = ast_channel_datastore_alloc(&mixmonitor_ds_info, NULL))) {
ast_mutex_destroy(&mixmonitor_ds->lock);
ast_cond_destroy(&mixmonitor_ds->destruction_condition);
ast_free(mixmonitor_ds);
return -1;
}
/* No need to lock mixmonitor_ds since this is still operating in the channel's thread */
mixmonitor_ds->chan = chan;
datastore->data = mixmonitor_ds;
ast_channel_lock(chan);
ast_channel_datastore_add(chan, datastore);
ast_channel_unlock(chan);
mixmonitor->mixmonitor_ds = mixmonitor_ds;
return 0;
}
static void launch_monitor_thread(struct ast_channel *chan, const char *filename, unsigned int flags,
int readvol, int writevol, const char *post_process)
{
pthread_attr_t attr;
pthread_t thread;
struct mixmonitor *mixmonitor;
char *file_name, *ext;
char postprocess2[1024] = "";
unsigned int oflags;
size_t len;
len = sizeof(*mixmonitor) + strlen(chan->name) + 1;
len = sizeof(*mixmonitor) + strlen(chan->name) + strlen(filename) + 2;
/* If a post process system command is given attach it to the structure */
if (!ast_strlen_zero(post_process)) {
@@ -238,63 +372,46 @@ static void launch_monitor_thread(struct ast_channel *chan, const char *filename
/* Copy over flags and channel name */
mixmonitor->flags = flags;
if (setup_mixmonitor_ds(mixmonitor, chan)) {
mixmonitor_free(mixmonitor);
return;
}
mixmonitor->name = (char *) mixmonitor + sizeof(*mixmonitor);
strcpy(mixmonitor->name, chan->name);
if (!ast_strlen_zero(postprocess2)) {
mixmonitor->post_process = mixmonitor->name + strlen(mixmonitor->name) + 1;
mixmonitor->post_process = mixmonitor->name + strlen(mixmonitor->name) + strlen(filename) + 2;
strcpy(mixmonitor->post_process, postprocess2);
}
/* Determine creation flags and filename plus extension for filestream */
oflags = O_CREAT | O_WRONLY;
oflags |= ast_test_flag(mixmonitor, MUXFLAG_APPEND) ? O_APPEND : O_TRUNC;
file_name = ast_strdupa(filename);
if ((ext = strrchr(file_name, '.'))) {
*(ext++) = '\0';
} else {
ext = "raw";
}
mixmonitor->filename = (char *) mixmonitor + sizeof(*mixmonitor) + strlen(chan->name) + 1;
strcpy(mixmonitor->filename, filename);
/* Move onto actually creating the filestream */
mixmonitor->fs = ast_writefile(file_name, ext, NULL, oflags, 0, 0644);
if (!mixmonitor->fs) {
ast_log(LOG_ERROR, "Cannot open %s.%s\n", file_name, ext);
/* Setup the actual spy before creating our thread */
if (ast_audiohook_init(&mixmonitor->audiohook, AST_AUDIOHOOK_TYPE_SPY, mixmonitor_spy_type)) {
free(mixmonitor);
return;
}
ast_set_flag(&mixmonitor->audiohook, AST_AUDIOHOOK_TRIGGER_SYNC);
if (readvol)
mixmonitor->audiohook.options.read_volume = readvol;
if (writevol)
mixmonitor->audiohook.options.write_volume = writevol;
/* Setup the actual spy before creating our thread */
ast_set_flag(&mixmonitor->spy, CHANSPY_FORMAT_AUDIO);
ast_set_flag(&mixmonitor->spy, CHANSPY_MIXAUDIO);
mixmonitor->spy.type = mixmonitor_spy_type;
mixmonitor->spy.status = CHANSPY_RUNNING;
mixmonitor->spy.read_queue.format = AST_FORMAT_SLINEAR;
mixmonitor->spy.write_queue.format = AST_FORMAT_SLINEAR;
if (readvol) {
ast_set_flag(&mixmonitor->spy, CHANSPY_READ_VOLADJUST);
mixmonitor->spy.read_vol_adjustment = readvol;
}
if (writevol) {
ast_set_flag(&mixmonitor->spy, CHANSPY_WRITE_VOLADJUST);
mixmonitor->spy.write_vol_adjustment = writevol;
}
ast_mutex_init(&mixmonitor->spy.lock);
if (startmon(chan, &mixmonitor->spy)) {
if (startmon(chan, &mixmonitor->audiohook)) {
ast_log(LOG_WARNING, "Unable to add '%s' spy to channel '%s'\n",
mixmonitor->spy.type, chan->name);
mixmonitor_spy_type, chan->name);
/* Since we couldn't add ourselves - bail out! */
ast_mutex_destroy(&mixmonitor->spy.lock);
ast_closestream(mixmonitor->fs);
ast_audiohook_destroy(&mixmonitor->audiohook);
free(mixmonitor);
return;
}
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
ast_pthread_create(&thread, &attr, mixmonitor_thread, mixmonitor);
ast_pthread_create_background(&thread, &attr, mixmonitor_thread, mixmonitor);
pthread_attr_destroy(&attr);
}
static int mixmonitor_exec(struct ast_channel *chan, void *data)
@@ -334,7 +451,7 @@ static int mixmonitor_exec(struct ast_channel *chan, void *data)
if (ast_test_flag(&flags, MUXFLAG_READVOLUME)) {
if (ast_strlen_zero(opts[OPT_ARG_READVOLUME])) {
ast_log(LOG_WARNING, "No volume level was provided for the heard volume ('v') option.\n");
} else if ((sscanf(opts[OPT_ARG_READVOLUME], "%d", &x) != 1) || (x < -4) || (x > 4)) {
} else if ((sscanf(opts[OPT_ARG_READVOLUME], "%2d", &x) != 1) || (x < -4) || (x > 4)) {
ast_log(LOG_NOTICE, "Heard volume must be a number between -4 and 4, not '%s'\n", opts[OPT_ARG_READVOLUME]);
} else {
readvol = get_volfactor(x);
@@ -344,7 +461,7 @@ static int mixmonitor_exec(struct ast_channel *chan, void *data)
if (ast_test_flag(&flags, MUXFLAG_WRITEVOLUME)) {
if (ast_strlen_zero(opts[OPT_ARG_WRITEVOLUME])) {
ast_log(LOG_WARNING, "No volume level was provided for the spoken volume ('V') option.\n");
} else if ((sscanf(opts[OPT_ARG_WRITEVOLUME], "%d", &x) != 1) || (x < -4) || (x > 4)) {
} else if ((sscanf(opts[OPT_ARG_WRITEVOLUME], "%2d", &x) != 1) || (x < -4) || (x > 4)) {
ast_log(LOG_NOTICE, "Spoken volume must be a number between -4 and 4, not '%s'\n", opts[OPT_ARG_WRITEVOLUME]);
} else {
writevol = get_volfactor(x);
@@ -354,7 +471,7 @@ static int mixmonitor_exec(struct ast_channel *chan, void *data)
if (ast_test_flag(&flags, MUXFLAG_VOLUME)) {
if (ast_strlen_zero(opts[OPT_ARG_VOLUME])) {
ast_log(LOG_WARNING, "No volume level was provided for the combined volume ('W') option.\n");
} else if ((sscanf(opts[OPT_ARG_VOLUME], "%d", &x) != 1) || (x < -4) || (x > 4)) {
} else if ((sscanf(opts[OPT_ARG_VOLUME], "%2d", &x) != 1) || (x < -4) || (x > 4)) {
ast_log(LOG_NOTICE, "Combined volume must be a number between -4 and 4, not '%s'\n", opts[OPT_ARG_VOLUME]);
} else {
readvol = writevol = get_volfactor(x);
@@ -382,12 +499,17 @@ static int mixmonitor_exec(struct ast_channel *chan, void *data)
static int stop_mixmonitor_exec(struct ast_channel *chan, void *data)
{
struct ast_module_user *u;
struct ast_datastore *datastore = NULL;
/* closing the filestream here guarantees the file is avaliable to the dialplan
* after calling StopMixMonitor */
if ((datastore = ast_channel_datastore_find(chan, &mixmonitor_ds_info, NULL))) {
mixmonitor_ds_close_fs(datastore->data);
}
u = ast_module_user_add(chan);
ast_channel_lock(chan);
ast_channel_spy_stop_by_type(chan, mixmonitor_spy_type);
ast_channel_unlock(chan);
ast_audiohook_detach_source(chan, mixmonitor_spy_type);
ast_module_user_remove(u);
@@ -409,7 +531,7 @@ static int mixmonitor_cli(int fd, int argc, char **argv)
if (!strcasecmp(argv[1], "start"))
mixmonitor_exec(chan, argv[3]);
else if (!strcasecmp(argv[1], "stop"))
ast_channel_spy_stop_by_type(chan, mixmonitor_spy_type);
ast_audiohook_detach_source(chan, mixmonitor_spy_type);
ast_channel_unlock(chan);

View File

@@ -123,22 +123,23 @@ static int morsecode_exec(struct ast_channel *chan, void *data)
/* Use variable MORESEDITLEN, if set (else 80) */
ditlenc = pbx_builtin_getvar_helper(chan, "MORSEDITLEN");
if (ast_strlen_zero(ditlenc) || (sscanf(ditlenc, "%d", &ditlen) != 1)) {
if (ast_strlen_zero(ditlenc) || (sscanf(ditlenc, "%30d", &ditlen) != 1)) {
ditlen = 80;
}
/* Use variable MORSETONE, if set (else 800) */
tonec = pbx_builtin_getvar_helper(chan, "MORSETONE");
if (ast_strlen_zero(tonec) || (sscanf(tonec, "%d", &tone) != 1)) {
if (ast_strlen_zero(tonec) || (sscanf(tonec, "%30d", &tone) != 1)) {
tone = 800;
}
for (digit = data; *digit; digit++) {
int digit2 = *digit;
char *dahdit;
if (*digit < 0) {
if (digit2 < 0) {
continue;
}
for (dahdit = morsecode[(int)*digit]; *dahdit; dahdit++) {
for (dahdit = morsecode[digit2]; *dahdit; dahdit++) {
if (*dahdit == '-') {
playtone(chan, tone, 3 * ditlen);
} else if (*dahdit == '.') {

View File

@@ -25,6 +25,10 @@
* \ingroup applications
*/
/*** MODULEINFO
<depend>working_fork</depend>
***/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -36,6 +40,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <unistd.h>
#include <fcntl.h>
#include <sys/time.h>
#ifdef HAVE_CAP
#include <sys/capability.h>
#endif /* HAVE_CAP */
#include "asterisk/lock.h"
#include "asterisk/file.h"
@@ -64,17 +71,38 @@ static int mp3play(char *filename, int fd)
{
int res;
int x;
sigset_t fullset, oldset;
#ifdef HAVE_CAP
cap_t cap;
#endif
sigfillset(&fullset);
pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
res = fork();
if (res < 0)
ast_log(LOG_WARNING, "Fork failed\n");
if (res)
if (res) {
pthread_sigmask(SIG_SETMASK, &oldset, NULL);
return res;
}
#ifdef HAVE_CAP
cap = cap_from_text("cap_net_admin-eip");
if (cap_set_proc(cap)) {
/* Careful with order! Logging cannot happen after we close FDs */
ast_log(LOG_WARNING, "Unable to remove capabilities.\n");
}
cap_free(cap);
#endif
if (ast_opt_high_priority)
ast_set_priority(0);
signal(SIGPIPE, SIG_DFL);
pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
dup2(fd, STDOUT_FILENO);
for (x=0;x<256;x++) {
if (x != STDOUT_FILENO)
close(x);
for (x=STDERR_FILENO + 1;x<256;x++) {
close(x);
}
/* Execute mpg123, but buffer if it's a net connection */
if (!strncasecmp(filename, "http://", 7)) {
@@ -94,7 +122,7 @@ static int mp3play(char *filename, int fd)
execlp("mpg123", "mpg123", "-q", "-s", "-f", "8192", "--mono", "-r", "8000", filename, (char *)NULL);
}
ast_log(LOG_WARNING, "Execute of mpg123 failed\n");
return -1;
_exit(0);
}
static int timed_read(int fd, void *data, int datalen, int timeout)
@@ -103,7 +131,7 @@ static int timed_read(int fd, void *data, int datalen, int timeout)
struct pollfd fds[1];
fds[0].fd = fd;
fds[0].events = POLLIN;
res = poll(fds, 1, timeout);
res = ast_poll(fds, 1, timeout);
if (res < 1) {
ast_log(LOG_NOTICE, "Poll timed out/errored out with %d\n", res);
return -1;

View File

@@ -25,6 +25,10 @@
* \ingroup applications
*/
/*** MODULEINFO
<depend>working_fork</depend>
***/
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -37,6 +41,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <fcntl.h>
#include <sys/time.h>
#include <sys/socket.h>
#ifdef HAVE_CAP
#include <sys/capability.h>
#endif /* HAVE_CAP */
#include "asterisk/lock.h"
#include "asterisk/file.h"
@@ -68,16 +75,38 @@ static int NBScatplay(int fd)
{
int res;
int x;
sigset_t fullset, oldset;
#ifdef HAVE_CAP
cap_t cap;
#endif
sigfillset(&fullset);
pthread_sigmask(SIG_BLOCK, &fullset, &oldset);
res = fork();
if (res < 0)
ast_log(LOG_WARNING, "Fork failed\n");
if (res)
if (res) {
pthread_sigmask(SIG_SETMASK, &oldset, NULL);
return res;
}
signal(SIGPIPE, SIG_DFL);
pthread_sigmask(SIG_UNBLOCK, &fullset, NULL);
#ifdef HAVE_CAP
cap = cap_from_text("cap_net_admin-eip");
if (cap_set_proc(cap)) {
/* Careful with order! Logging cannot happen after we close FDs */
ast_log(LOG_WARNING, "Unable to remove capabilities.\n");
}
cap_free(cap);
#endif
if (ast_opt_high_priority)
ast_set_priority(0);
dup2(fd, STDOUT_FILENO);
for (x=0;x<256;x++) {
for (x = STDERR_FILENO + 1; x < 1024; x++) {
if (x != STDOUT_FILENO)
close(x);
}
@@ -85,7 +114,7 @@ static int NBScatplay(int fd)
execl(NBSCAT, "nbscat8k", "-d", (char *)NULL);
execl(LOCAL_NBSCAT, "nbscat8k", "-d", (char *)NULL);
ast_log(LOG_WARNING, "Execute of nbscat8k failed\n");
return -1;
_exit(0);
}
static int timed_read(int fd, void *data, int datalen)
@@ -94,7 +123,7 @@ static int timed_read(int fd, void *data, int datalen)
struct pollfd fds[1];
fds[0].fd = fd;
fds[0].events = POLLIN;
res = poll(fds, 1, 2000);
res = ast_poll(fds, 1, 2000);
if (res < 1) {
ast_log(LOG_NOTICE, "Selected timed out/errored out with %d\n", res);
return -1;

View File

@@ -208,7 +208,7 @@ static int osp_create_provider(struct ast_config* cfg, const char* provider)
ast_log(LOG_WARNING, "OSP: Too many Service Points at line %d\n", v->lineno);
}
} else if (!strcasecmp(v->name, "maxconnections")) {
if ((sscanf(v->value, "%d", &t) == 1) && (t >= OSP_MIN_MAXCONNECTIONS) && (t <= OSP_MAX_MAXCONNECTIONS)) {
if ((sscanf(v->value, "%30d", &t) == 1) && (t >= OSP_MIN_MAXCONNECTIONS) && (t <= OSP_MAX_MAXCONNECTIONS)) {
p->maxconnections = t;
ast_log(LOG_DEBUG, "OSP: maxconnections '%d'\n", t);
} else {
@@ -216,7 +216,7 @@ static int osp_create_provider(struct ast_config* cfg, const char* provider)
OSP_MIN_MAXCONNECTIONS, OSP_MAX_MAXCONNECTIONS, v->value, v->lineno);
}
} else if (!strcasecmp(v->name, "retrydelay")) {
if ((sscanf(v->value, "%d", &t) == 1) && (t >= OSP_MIN_RETRYDELAY) && (t <= OSP_MAX_RETRYDELAY)) {
if ((sscanf(v->value, "%30d", &t) == 1) && (t >= OSP_MIN_RETRYDELAY) && (t <= OSP_MAX_RETRYDELAY)) {
p->retrydelay = t;
ast_log(LOG_DEBUG, "OSP: retrydelay '%d'\n", t);
} else {
@@ -224,7 +224,7 @@ static int osp_create_provider(struct ast_config* cfg, const char* provider)
OSP_MIN_RETRYDELAY, OSP_MAX_RETRYDELAY, v->value, v->lineno);
}
} else if (!strcasecmp(v->name, "retrylimit")) {
if ((sscanf(v->value, "%d", &t) == 1) && (t >= OSP_MIN_RETRYLIMIT) && (t <= OSP_MAX_RETRYLIMIT)) {
if ((sscanf(v->value, "%30d", &t) == 1) && (t >= OSP_MIN_RETRYLIMIT) && (t <= OSP_MAX_RETRYLIMIT)) {
p->retrylimit = t;
ast_log(LOG_DEBUG, "OSP: retrylimit '%d'\n", t);
} else {
@@ -232,7 +232,7 @@ static int osp_create_provider(struct ast_config* cfg, const char* provider)
OSP_MIN_RETRYLIMIT, OSP_MAX_RETRYLIMIT, v->value, v->lineno);
}
} else if (!strcasecmp(v->name, "timeout")) {
if ((sscanf(v->value, "%d", &t) == 1) && (t >= OSP_MIN_TIMEOUT) && (t <= OSP_MAX_TIMEOUT)) {
if ((sscanf(v->value, "%30d", &t) == 1) && (t >= OSP_MIN_TIMEOUT) && (t <= OSP_MAX_TIMEOUT)) {
p->timeout = t;
ast_log(LOG_DEBUG, "OSP: timeout '%d'\n", t);
} else {
@@ -243,7 +243,7 @@ static int osp_create_provider(struct ast_config* cfg, const char* provider)
ast_copy_string(p->source, v->value, sizeof(p->source));
ast_log(LOG_DEBUG, "OSP: source '%s'\n", p->source);
} else if (!strcasecmp(v->name, "authpolicy")) {
if ((sscanf(v->value, "%d", &t) == 1) && ((t == OSP_AUTH_NO) || (t == OSP_AUTH_YES) || (t == OSP_AUTH_EXCLUSIVE))) {
if ((sscanf(v->value, "%30d", &t) == 1) && ((t == OSP_AUTH_NO) || (t == OSP_AUTH_YES) || (t == OSP_AUTH_EXCLUSIVE))) {
p->authpolicy = t;
ast_log(LOG_DEBUG, "OSP: authpolicy '%d'\n", t);
} else {
@@ -397,6 +397,26 @@ static int osp_create_transaction(const char* provider, int* transaction, unsign
return res;
}
/*!
* \brief Convert address to "[x.x.x.x]" or "host.domain" format
* \param src Source address string
* \param dst Destination address string
* \param buffersize Size of dst buffer
*/
static void osp_convert_address(
const char* src,
char* dst,
int buffersize)
{
struct in_addr inp;
if (inet_aton(src, &inp) != 0) {
snprintf(dst, buffersize, "[%s]", src);
} else {
snprintf(dst, buffersize, "%s", src);
}
}
/*!
* \brief Validate OSP token of inbound call
* \param transaction OSP transaction handle
@@ -413,14 +433,18 @@ static int osp_validate_token(int transaction, const char* source, const char* d
int res;
int tokenlen;
unsigned char tokenstr[OSP_TOKSTR_SIZE];
char src[OSP_NORSTR_SIZE];
char dst[OSP_NORSTR_SIZE];
unsigned int authorised;
unsigned int dummy = 0;
int error;
tokenlen = ast_base64decode(tokenstr, token, strlen(token));
osp_convert_address(source, src, sizeof(src));
osp_convert_address(dest, dst, sizeof(dst));
error = OSPPTransactionValidateAuthorisation(
transaction,
source, dest, NULL, NULL,
src, dst, NULL, NULL,
calling ? calling : "", OSPC_E164,
called, OSPC_E164,
0, NULL,
@@ -622,6 +646,8 @@ static int osp_lookup(const char* provider, const char* srcdev, const char* call
char destination[OSP_NORSTR_SIZE];
unsigned int tokenlen;
char token[OSP_TOKSTR_SIZE];
char src[OSP_NORSTR_SIZE];
char dev[OSP_NORSTR_SIZE];
unsigned int dummy = 0;
enum OSPEFAILREASON reason;
int error;
@@ -643,8 +669,10 @@ static int osp_lookup(const char* provider, const char* srcdev, const char* call
return -1;
}
osp_convert_address(source, src, sizeof(src));
osp_convert_address(srcdev, dev, sizeof(dev));
result->numresults = OSP_DEF_DESTINATIONS;
error = OSPPTransactionRequestAuthorisation(result->outhandle, source, srcdev, calling ? calling : "",
error = OSPPTransactionRequestAuthorisation(result->outhandle, src, dev, calling ? calling : "",
OSPC_E164, called, OSPC_E164, NULL, 0, NULL, NULL, &result->numresults, &dummy, NULL);
if (error != OSPC_ERR_NO_ERROR) {
ast_log(LOG_DEBUG, "OSP: Unable to request authorization\n");
@@ -1023,11 +1051,11 @@ static int osplookup_exec(struct ast_channel* chan, void* data)
headp = &chan->varshead;
AST_LIST_TRAVERSE(headp, current, entries) {
if (!strcasecmp(ast_var_name(current), "OSPINHANDLE")) {
if (sscanf(ast_var_value(current), "%d", &result.inhandle) != 1) {
if (sscanf(ast_var_value(current), "%30d", &result.inhandle) != 1) {
result.inhandle = OSP_INVALID_HANDLE;
}
} else if (!strcasecmp(ast_var_name(current), "OSPINTIMELIMIT")) {
if (sscanf(ast_var_value(current), "%d", &result.intimelimit) != 1) {
if (sscanf(ast_var_value(current), "%30d", &result.intimelimit) != 1) {
result.intimelimit = OSP_DEF_TIMELIMIT;
}
} else if (!strcasecmp(ast_var_name(current), "OSPPEERIP")) {
@@ -1149,7 +1177,7 @@ static int ospnext_exec(struct ast_channel* chan, void* data)
AST_STANDARD_APP_ARGS(args, tmp);
if (!ast_strlen_zero(args.cause) && sscanf(args.cause, "%d", &cause) != 1) {
if (!ast_strlen_zero(args.cause) && sscanf(args.cause, "%30d", &cause) != 1) {
cause = 0;
}
ast_log(LOG_DEBUG, "OSPNext: cause '%d'\n", cause);
@@ -1167,19 +1195,19 @@ static int ospnext_exec(struct ast_channel* chan, void* data)
headp = &chan->varshead;
AST_LIST_TRAVERSE(headp, current, entries) {
if (!strcasecmp(ast_var_name(current), "OSPINHANDLE")) {
if (sscanf(ast_var_value(current), "%d", &result.inhandle) != 1) {
if (sscanf(ast_var_value(current), "%30d", &result.inhandle) != 1) {
result.inhandle = OSP_INVALID_HANDLE;
}
} else if (!strcasecmp(ast_var_name(current), "OSPOUTHANDLE")) {
if (sscanf(ast_var_value(current), "%d", &result.outhandle) != 1) {
if (sscanf(ast_var_value(current), "%30d", &result.outhandle) != 1) {
result.outhandle = OSP_INVALID_HANDLE;
}
} else if (!strcasecmp(ast_var_name(current), "OSPINTIMELIMIT")) {
if (sscanf(ast_var_value(current), "%d", &result.intimelimit) != 1) {
if (sscanf(ast_var_value(current), "%30d", &result.intimelimit) != 1) {
result.intimelimit = OSP_DEF_TIMELIMIT;
}
} else if (!strcasecmp(ast_var_name(current), "OSPRESULTS")) {
if (sscanf(ast_var_value(current), "%d", &result.numresults) != 1) {
if (sscanf(ast_var_value(current), "%30d", &result.numresults) != 1) {
result.numresults = 0;
}
}
@@ -1294,11 +1322,11 @@ static int ospfinished_exec(struct ast_channel* chan, void* data)
headp = &chan->varshead;
AST_LIST_TRAVERSE(headp, current, entries) {
if (!strcasecmp(ast_var_name(current), "OSPINHANDLE")) {
if (sscanf(ast_var_value(current), "%d", &inhandle) != 1) {
if (sscanf(ast_var_value(current), "%30d", &inhandle) != 1) {
inhandle = OSP_INVALID_HANDLE;
}
} else if (!strcasecmp(ast_var_name(current), "OSPOUTHANDLE")) {
if (sscanf(ast_var_value(current), "%d", &outhandle) != 1) {
if (sscanf(ast_var_value(current), "%30d", &outhandle) != 1) {
outhandle = OSP_INVALID_HANDLE;
}
} else if (!recorded &&
@@ -1315,7 +1343,7 @@ static int ospfinished_exec(struct ast_channel* chan, void* data)
ast_log(LOG_DEBUG, "OSPFinish: OSPOUTHANDLE '%d'\n", outhandle);
ast_log(LOG_DEBUG, "OSPFinish: recorded '%d'\n", recorded);
if (!ast_strlen_zero(args.cause) && sscanf(args.cause, "%d", &cause) != 1) {
if (!ast_strlen_zero(args.cause) && sscanf(args.cause, "%30d", &cause) != 1) {
cause = 0;
}
ast_log(LOG_DEBUG, "OSPFinish: cause '%d'\n", cause);
@@ -1407,7 +1435,7 @@ static int osp_load(void)
t = ast_variable_retrieve(cfg, OSP_GENERAL_CAT, "tokenformat");
if (t) {
if ((sscanf(t, "%d", &v) == 1) &&
if ((sscanf(t, "%30d", &v) == 1) &&
((v == TOKEN_ALGO_SIGNED) || (v == TOKEN_ALGO_UNSIGNED) || (v == TOKEN_ALGO_BOTH)))
{
osp_tokenformat = v;

View File

@@ -26,7 +26,8 @@
*/
/*** MODULEINFO
<depend>zaptel</depend>
<depend>dahdi</depend>
<depend>app_meetme</depend>
***/
#include "asterisk.h"
@@ -48,6 +49,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/app.h"
#include "asterisk/chanvars.h"
#include "asterisk/utils.h"
#include "asterisk/dial.h"
#include "asterisk/devicestate.h"
static const char *app_page= "Page";
@@ -60,10 +63,9 @@ static const char *page_descrip =
"caller is dumped into the conference as a speaker and the room is\n"
"destroyed when the original caller leaves. Valid options are:\n"
" d - full duplex audio\n"
" q - quiet, do not play beep to caller\n"
" q - quiet, do not play beep to caller\n"
" r - record the page into a file (see 'r' for app_meetme)\n";
enum {
PAGE_DUPLEX = (1 << 0),
PAGE_QUIET = (1 << 1),
@@ -76,82 +78,18 @@ AST_APP_OPTIONS(page_opts, {
AST_APP_OPTION('r', PAGE_RECORD),
});
struct calloutdata {
char cidnum[64];
char cidname[64];
char tech[64];
char resource[256];
char meetmeopts[64];
struct ast_variable *variables;
};
static void *page_thread(void *data)
{
struct calloutdata *cd = data;
ast_pbx_outgoing_app(cd->tech, AST_FORMAT_SLINEAR, cd->resource, 30000,
"MeetMe", cd->meetmeopts, NULL, 0, cd->cidnum, cd->cidname, cd->variables, NULL, NULL);
free(cd);
return NULL;
}
static void launch_page(struct ast_channel *chan, const char *meetmeopts, const char *tech, const char *resource)
{
struct calloutdata *cd;
const char *varname;
struct ast_variable *lastvar = NULL;
struct ast_var_t *varptr;
pthread_t t;
pthread_attr_t attr;
if ((cd = ast_calloc(1, sizeof(*cd)))) {
ast_copy_string(cd->cidnum, chan->cid.cid_num ? chan->cid.cid_num : "", sizeof(cd->cidnum));
ast_copy_string(cd->cidname, chan->cid.cid_name ? chan->cid.cid_name : "", sizeof(cd->cidname));
ast_copy_string(cd->tech, tech, sizeof(cd->tech));
ast_copy_string(cd->resource, resource, sizeof(cd->resource));
ast_copy_string(cd->meetmeopts, meetmeopts, sizeof(cd->meetmeopts));
AST_LIST_TRAVERSE(&chan->varshead, varptr, entries) {
if (!(varname = ast_var_full_name(varptr)))
continue;
if (varname[0] == '_') {
struct ast_variable *newvar = NULL;
if (varname[1] == '_') {
newvar = ast_variable_new(varname, ast_var_value(varptr));
} else {
newvar = ast_variable_new(&varname[1], ast_var_value(varptr));
}
if (newvar) {
if (lastvar)
lastvar->next = newvar;
else
cd->variables = newvar;
lastvar = newvar;
}
}
}
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
if (ast_pthread_create(&t, &attr, page_thread, cd)) {
ast_log(LOG_WARNING, "Unable to create paging thread: %s\n", strerror(errno));
free(cd);
}
}
}
static int page_exec(struct ast_channel *chan, void *data)
{
struct ast_module_user *u;
char *options;
char *tech, *resource;
char meetmeopts[80];
char *options, *tech, *resource, *tmp, *tmp2;
char meetmeopts[88], originator[AST_CHANNEL_NAME];
struct ast_flags flags = { 0 };
unsigned int confid = ast_random();
struct ast_app *app;
char *tmp;
int res=0;
char originator[AST_CHANNEL_NAME];
int res = 0, pos = 0, i = 0;
struct ast_dial **dial_list;
unsigned int num_dials;
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "This application requires at least one argument (destination(s) to page)\n");
@@ -176,20 +114,58 @@ static int page_exec(struct ast_channel *chan, void *data)
if (options)
ast_app_parse_options(page_opts, &flags, NULL, options);
snprintf(meetmeopts, sizeof(meetmeopts), "%ud|%s%sqxdw(5)", confid, (ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "m"),
snprintf(meetmeopts, sizeof(meetmeopts), "MeetMe|%ud|%s%sqxdw(5)", confid, (ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "m"),
(ast_test_flag(&flags, PAGE_RECORD) ? "r" : "") );
/* Count number of extensions in list by number of ampersands + 1 */
num_dials = 1;
tmp2 = tmp;
while (*tmp2) {
if (*tmp2 == '&') {
num_dials++;
}
tmp2++;
}
if (!(dial_list = ast_calloc(num_dials, sizeof(struct ast_dial *)))) {
ast_log(LOG_ERROR, "Can't allocate %ld bytes for dial list\n", (long)(sizeof(struct ast_dial *) * num_dials));
ast_module_user_remove(u);
return -1;
}
/* Go through parsing/calling each device */
while ((tech = strsep(&tmp, "&"))) {
struct ast_dial *dial = NULL;
/* don't call the originating device */
if (!strcasecmp(tech, originator))
continue;
if ((resource = strchr(tech, '/'))) {
*resource++ = '\0';
launch_page(chan, meetmeopts, tech, resource);
} else {
/* If no resource is available, continue on */
if (!(resource = strchr(tech, '/'))) {
ast_log(LOG_WARNING, "Incomplete destination '%s' supplied.\n", tech);
continue;
}
*resource++ = '\0';
/* Create a dialing structure */
if (!(dial = ast_dial_create())) {
ast_log(LOG_WARNING, "Failed to create dialing structure.\n");
continue;
}
/* Append technology and resource */
ast_dial_append(dial, tech, resource);
/* Set ANSWER_EXEC as global option */
ast_dial_option_global_enable(dial, AST_DIAL_OPTION_ANSWER_EXEC, meetmeopts);
/* Run this dial in async mode */
ast_dial_run(dial, chan, 1);
/* Put in our dialing array */
dial_list[pos++] = dial;
}
if (!ast_test_flag(&flags, PAGE_QUIET)) {
@@ -197,12 +173,28 @@ static int page_exec(struct ast_channel *chan, void *data)
if (!res)
res = ast_waitstream(chan, "");
}
if (!res) {
snprintf(meetmeopts, sizeof(meetmeopts), "%ud|A%s%sqxd", confid, (ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "t"),
(ast_test_flag(&flags, PAGE_RECORD) ? "r" : "") );
pbx_exec(chan, app, meetmeopts);
}
/* Go through each dial attempt cancelling, joining, and destroying */
for (i = 0; i < pos; i++) {
struct ast_dial *dial = dial_list[i];
/* We have to wait for the async thread to exit as it's possible Meetme won't throw them out immediately */
ast_dial_join(dial);
/* Hangup all channels */
ast_dial_hangup(dial);
/* Destroy dialing structure */
ast_dial_destroy(dial);
}
ast_free(dial_list);
ast_module_user_remove(u);
return -1;

View File

@@ -76,15 +76,14 @@ static char *descrip =
static int parkandannounce_exec(struct ast_channel *chan, void *data)
{
int res=0;
char *return_context;
int l, lot, timeout = 0, dres;
int lot, timeout = 0, dres;
char *working, *context, *exten, *priority, *dial, *dialtech, *dialstr;
char *template, *tpl_working, *tpl_current;
char *tmp[100];
char buf[13];
int looptemp=0,i=0;
char *s,*orig_s;
int looptemp = 0,i = 0, res = 0;
char *s;
struct ast_channel *dchan;
struct outgoing_helper oh;
@@ -99,18 +98,11 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data)
u = ast_module_user_add(chan);
l=strlen(data)+2;
if (!(orig_s = ast_malloc(l))) {
ast_module_user_remove(u);
return -1;
}
s=orig_s;
strncpy(s,data,l);
s = ast_strdupa(data);
template=strsep(&s,"|");
template = strsep(&s,"|");
if(! template) {
ast_log(LOG_WARNING, "PARK: An announce template must be defined\n");
free(orig_s);
ast_module_user_remove(u);
return -1;
}
@@ -119,15 +111,14 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data)
timeout = atoi(strsep(&s, "|"));
timeout *= 1000;
}
dial=strsep(&s, "|");
dial = strsep(&s, "|");
if(!dial) {
ast_log(LOG_WARNING, "PARK: A dial resource must be specified i.e: Console/dsp or Zap/g1/5551212\n");
free(orig_s);
ast_module_user_remove(u);
return -1;
} else {
dialtech=strsep(&dial, "/");
dialstr=dial;
dialtech = strsep(&dial, "/");
dialstr = dial;
ast_verbose( VERBOSE_PREFIX_3 "Dial Tech,String: (%s,%s)\n", dialtech,dialstr);
}
@@ -155,16 +146,15 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data)
}
if(atoi(priority) < 0) {
ast_log(LOG_WARNING, "Priority '%s' must be a number > 0\n", priority);
free(orig_s);
ast_module_user_remove(u);
return -1;
}
/* At this point we have a priority and maybe an extension and a context */
chan->priority = atoi(priority);
if (exten)
strncpy(chan->exten, exten, sizeof(chan->exten)-1);
ast_copy_string(chan->exten, exten, sizeof(chan->exten));
if (context)
strncpy(chan->context, context, sizeof(chan->context)-1);
ast_copy_string(chan->context, context, sizeof(chan->context));
} else { /* increment the priority by default*/
chan->priority++;
}
@@ -179,9 +169,10 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data)
/* we are using masq_park here to protect * from touching the channel once we park it. If the channel comes out of timeout
before we are done announcing and the channel is messed with, Kablooeee. So we use Masq to prevent this. */
ast_masq_park_call(chan, NULL, timeout, &lot);
res=-1;
res = ast_masq_park_call(chan, NULL, timeout, &lot);
if (res == -1) {
goto finish;
}
ast_verbose( VERBOSE_PREFIX_3 "Call Parking Called, lot: %d, timeout: %d, context: %s\n", lot, timeout, return_context);
@@ -202,13 +193,11 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data)
ast_verbose(VERBOSE_PREFIX_4 "Channel %s was never answered.\n", dchan->name);
ast_log(LOG_WARNING, "PARK: Channel %s was never answered for the announce.\n", dchan->name);
ast_hangup(dchan);
free(orig_s);
ast_module_user_remove(u);
return -1;
}
} else {
ast_log(LOG_WARNING, "PARK: Unable to allocate announce channel.\n");
free(orig_s);
ast_module_user_remove(u);
return -1;
}
@@ -220,15 +209,15 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data)
ast_verbose(VERBOSE_PREFIX_4 "Announce Template:%s\n", template);
tpl_working = template;
tpl_current=strsep(&tpl_working, ":");
tpl_current = strsep(&tpl_working, ":");
while(tpl_current && looptemp < sizeof(tmp)) {
while(tpl_current && looptemp < ARRAY_LEN(tmp)) {
tmp[looptemp]=tpl_current;
looptemp++;
tpl_current=strsep(&tpl_working,":");
tpl_current = strsep(&tpl_working,":");
}
for(i=0; i<looptemp; i++) {
for(i = 0; i < looptemp; i++) {
ast_verbose(VERBOSE_PREFIX_4 "Announce:%s\n", tmp[i]);
if(!strcmp(tmp[i], "PARKED")) {
ast_say_digits(dchan, lot, "", dchan->language);
@@ -245,10 +234,9 @@ static int parkandannounce_exec(struct ast_channel *chan, void *data)
ast_stopstream(dchan);
ast_hangup(dchan);
free(orig_s);
finish:
ast_module_user_remove(u);
return res;
}

View File

@@ -65,10 +65,12 @@ static char *descrip =
"This application sets the following channel variable upon completion:\n"
" PLAYBACKSTATUS The status of the playback attempt as a text string, one of\n"
" SUCCESS | FAILED\n"
"See Also: Background (application) -- for playing soundfiles that are interruptible\n"
" WaitExten (application) -- wait for digits from caller, optionally play music on hold\n"
;
static struct ast_config *say_cfg;
static struct ast_config *say_cfg = NULL;
/* save the say' api calls.
* The first entry is NULL if we have the standard source,
* otherwise we are sourcing from here.
@@ -152,16 +154,17 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
struct varshead head = { .first = NULL, .last = NULL };
struct ast_var_t *n;
ast_log(LOG_WARNING, "string <%s> depth <%d>\n", s, depth);
if (depth++ > 10) {
ast_log(LOG_WARNING, "recursion too deep, exiting\n");
return -1;
} else if (!say_cfg) {
ast_log(LOG_WARNING, "no say.conf, cannot spell '%s'\n", s);
return -1;
}
/* scan languages same as in file.c */
if (a->language == NULL)
a->language = "en"; /* default */
ast_log(LOG_WARNING, "try <%s> in <%s>\n", s, a->language);
lang = ast_strdupa(a->language);
for (;;) {
for (v = ast_variable_browse(say_cfg, lang); v ; v = v->next) {
@@ -187,12 +190,11 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
s = x + 1;
if ( (x = strchr(s, ':')) )
s = x + 1;
ast_log(LOG_WARNING, "value is <%s>\n", s);
n = ast_var_assign("SAY", s);
AST_LIST_INSERT_HEAD(&head, n, entries);
/* scan the body, one piece at a time */
while ( ret <= 0 && (x = strsep(&rule, ",")) ) { /* exit on key */
while ( !ret && (x = strsep(&rule, ",")) ) { /* exit on key */
char fn[128];
const char *p, *fmt, *data; /* format and data pointers */
@@ -203,7 +205,6 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
/* replace variables */
memset(fn, 0, sizeof(fn)); /* XXX why isn't done in pbx_substitute_variables_helper! */
pbx_substitute_variables_varshead(&head, x, fn, sizeof(fn));
ast_log(LOG_WARNING, "doing [%s]\n", fn);
/* locate prefix and data, if any */
fmt = index(fn, ':');
@@ -242,6 +243,10 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
strcpy(fn2 + l, data);
ret = do_say(a, fn2, options, depth);
}
if (ret) {
break;
}
}
}
ast_var_delete(n);
@@ -253,11 +258,6 @@ static int say_full(struct ast_channel *chan, const char *string,
int audiofd, int ctrlfd)
{
say_args_t a = { chan, ints, lang, audiofd, ctrlfd };
if (!say_cfg) {
ast_log(LOG_WARNING, "no say.conf, cannot spell '%s'\n", string);
return -1;
}
return do_say(&a, string, options, 0);
}
@@ -341,7 +341,7 @@ static int __say_init(int fd, int argc, char *argv[])
return RESULT_SHOWUSAGE;
mode = argv[2];
ast_log(LOG_WARNING, "init say.c from %s to %s", old_mode, mode);
ast_log(LOG_WARNING, "init say.c from %s to %s\n", old_mode, mode);
if (!strcmp(mode, old_mode)) {
ast_log(LOG_WARNING, "say mode is %s already\n", mode);
@@ -374,12 +374,13 @@ static int __say_init(int fd, int argc, char *argv[])
static struct ast_cli_entry cli_playback[] = {
{ { "say", "load", NULL },
__say_init, "set/show the say mode",
"say load new|old" },
"Usage: say load [new|old]\n Set/show the say mode\n" },
};
static int playback_exec(struct ast_channel *chan, void *data)
{
int res = 0;
int mres = 0;
struct ast_module_user *u;
char *tmp;
int option_skip=0;
@@ -422,11 +423,11 @@ static int playback_exec(struct ast_channel *chan, void *data)
res = ast_answer(chan);
}
if (!res) {
int mres = 0;
char *back = args.filenames;
char *front;
ast_stopstream(chan);
while (!res && (front = strsep(&tmp, "&"))) {
while (!res && (front = strsep(&back, "&"))) {
if (option_say)
res = say_full(chan, front, "", chan->language, NULL, -1, -1);
else
@@ -442,9 +443,9 @@ static int playback_exec(struct ast_channel *chan, void *data)
mres = 1;
}
}
pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", mres ? "FAILED" : "SUCCESS");
}
done:
pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", mres ? "FAILED" : "SUCCESS");
ast_module_user_remove(u);
return res;
}
@@ -469,6 +470,8 @@ static int unload_module(void)
res = ast_unregister_application(app);
ast_cli_unregister_multiple(cli_playback, sizeof(cli_playback) / sizeof(struct ast_cli_entry));
ast_module_user_hangup_all();
if (say_cfg)
@@ -479,7 +482,7 @@ static int unload_module(void)
static int load_module(void)
{
reload();
say_cfg = ast_config_load("say.conf");
ast_cli_register_multiple(cli_playback, sizeof(cli_playback) / sizeof(struct ast_cli_entry));
return ast_register_application(app, playback_exec, synopsis, descrip);
}

View File

@@ -115,13 +115,13 @@ static int privacy_exec (struct ast_channel *chan, void *data)
AST_STANDARD_APP_ARGS(args, parse);
if (args.maxretries) {
if (sscanf(args.maxretries, "%d", &x) == 1)
if (sscanf(args.maxretries, "%30d", &x) == 1)
maxretries = x;
else
ast_log(LOG_WARNING, "Invalid max retries argument\n");
}
if (args.minlength) {
if (sscanf(args.minlength, "%d", &x) == 1)
if (sscanf(args.minlength, "%30d", &x) == 1)
minlength = x;
else
ast_log(LOG_WARNING, "Invalid min length argument\n");
@@ -138,14 +138,14 @@ static int privacy_exec (struct ast_channel *chan, void *data)
cfg = ast_config_load(PRIV_CONFIG);
if (cfg && (s = ast_variable_retrieve(cfg, "general", "maxretries"))) {
if (sscanf(s, "%d", &x) == 1)
if (sscanf(s, "%30d", &x) == 1)
maxretries = x;
else
ast_log(LOG_WARNING, "Invalid max retries argument\n");
}
if (cfg && (s = ast_variable_retrieve(cfg, "general", "minlength"))) {
if (sscanf(s, "%d", &x) == 1)
if (sscanf(s, "%30d", &x) == 1)
minlength = x;
else
ast_log(LOG_WARNING, "Invalid min length argument\n");

File diff suppressed because it is too large Load Diff

View File

@@ -71,7 +71,7 @@ static int random_exec(struct ast_channel *chan, void *data)
s = ast_strdupa(data);
prob = strsep(&s,":");
if ((!prob) || (sscanf(prob, "%d", &probint) != 1))
if ((!prob) || (sscanf(prob, "%30d", &probint) != 1))
probint = 0;
if (!deprecated) {

View File

@@ -80,7 +80,7 @@ static int readfile_exec(struct ast_channel *chan, void *data)
}
if (length) {
if ((sscanf(length, "%d", &len) != 1) || (len < 0)) {
if ((sscanf(length, "%30d", &len) != 1) || (len < 0)) {
ast_log(LOG_WARNING, "%s is not a positive number, defaulting length to max\n", length);
len = 0;
}

View File

@@ -72,22 +72,24 @@ static char *udesc = "Use the RealTime config handler system to update a value\n
static int cli_realtime_load(int fd, int argc, char **argv)
{
char *header_format = "%30s %-30s\n";
struct ast_variable *var=NULL;
struct ast_variable *var = NULL, *save = NULL;
if(argc<5) {
if (argc < 5) {
ast_cli(fd, "You must supply a family name, a column to match on, and a value to match to.\n");
return RESULT_FAILURE;
}
var = ast_load_realtime(argv[2], argv[3], argv[4], NULL);
if(var) {
if (var) {
save = var;
ast_cli(fd, header_format, "Column Name", "Column Value");
ast_cli(fd, header_format, "--------------------", "--------------------");
while(var) {
while (var) {
ast_cli(fd, header_format, var->name, var->value);
var = var->next;
}
ast_variables_destroy(save);
} else {
ast_cli(fd, "No rows found matching search criteria.\n");
}

View File

@@ -67,8 +67,9 @@ static char *descrip =
" 'x' : ignore all terminator keys (DTMF) and keep recording until hangup\n"
"\n"
"If filename contains '%d', these characters will be replaced with a number\n"
"incremented by one each time the file is recorded. \n\n"
"Use 'show file formats' to see the available formats on your system\n\n"
"incremented by one each time the file is recorded. A channel variable\n"
"named RECORDED_FILE will also be set, which contains the final filemname.\n\n"
"Use 'core show file formats' to see the available formats on your system\n\n"
"User can press '#' to terminate the recording and continue to the next priority.\n\n"
"If the user should hangup during a recording, all data will be lost and the\n"
"application will teminate. \n";
@@ -139,7 +140,7 @@ static int record_exec(struct ast_channel *chan, void *data)
return -1;
}
if (silstr) {
if ((sscanf(silstr, "%d", &i) == 1) && (i > -1)) {
if ((sscanf(silstr, "%30d", &i) == 1) && (i > -1)) {
silence = i * 1000;
} else if (!ast_strlen_zero(silstr)) {
ast_log(LOG_WARNING, "'%s' is not a valid silence duration\n", silstr);
@@ -147,7 +148,7 @@ static int record_exec(struct ast_channel *chan, void *data)
}
if (maxstr) {
if ((sscanf(maxstr, "%d", &i) == 1) && (i > -1))
if ((sscanf(maxstr, "%30d", &i) == 1) && (i > -1))
/* Convert duration to milliseconds */
maxduration = i * 1000;
else if (!ast_strlen_zero(maxstr))
@@ -212,7 +213,7 @@ static int record_exec(struct ast_channel *chan, void *data)
} while (ast_fileexists(tmp, ext, chan->language) > 0);
pbx_builtin_setvar_helper(chan, "RECORDED_FILE", tmp);
} else
strncpy(tmp, filename, sizeof(tmp)-1);
ast_copy_string(tmp, filename, sizeof(tmp));
/* end of routine mentioned */

File diff suppressed because it is too large Load Diff

View File

@@ -94,18 +94,17 @@ static char mandescr_playdtmf[] =
" Channel: Channel name to send digit to\n"
" Digit: The dtmf digit to play\n";
static int manager_play_dtmf(struct mansession *s, struct message *m)
static int manager_play_dtmf(struct mansession *s, const struct message *m)
{
char *channel = astman_get_header(m, "Channel");
char *digit = astman_get_header(m, "Digit");
const char *channel = astman_get_header(m, "Channel");
const char *digit = astman_get_header(m, "Digit");
struct ast_channel *chan = ast_get_channel_by_name_locked(channel);
if (!chan) {
astman_send_error(s, m, "Channel not specified");
ast_mutex_unlock(&chan->lock);
return 0;
}
if (!digit) {
if (ast_strlen_zero(digit)) {
astman_send_error(s, m, "No digit specified");
ast_mutex_unlock(&chan->lock);
return 0;

View File

@@ -78,7 +78,9 @@ static int sendtext_exec(struct ast_channel *chan, void *data)
u = ast_module_user_add(chan);
if (ast_strlen_zero(data)) {
/* NOT ast_strlen_zero, because some protocols (e.g. SIP) MUST be able to
* send a zero-length message. */
if (!data) {
ast_log(LOG_WARNING, "SendText requires an argument (text[|options])\n");
ast_module_user_remove(u);
return -1;
@@ -95,6 +97,7 @@ static int sendtext_exec(struct ast_channel *chan, void *data)
ast_channel_lock(chan);
if (!chan->tech->send_text) {
ast_channel_unlock(chan);
pbx_builtin_setvar_helper(chan, "SENDTEXTSTATUS", status);
/* Does not support transport */
if (priority_jump || ast_opt_priority_jumping)
ast_goto_if_exists(chan, chan->context, chan->exten, chan->priority + 101);

View File

@@ -70,8 +70,11 @@ static int setcallerid_pres_exec(struct ast_channel *chan, void *data)
int pres = -1;
u = ast_module_user_add(chan);
pres = ast_parse_caller_presentation(data);
/* For interface consistency, permit the argument to be specified as a number */
if (sscanf(data, "%30d", &pres) != 1 || pres < 0 || pres > 255 || (pres & 0x9c)) {
pres = ast_parse_caller_presentation(data);
}
if (pres < 0) {
ast_log(LOG_WARNING, "'%s' is not a valid presentation (see 'show application SetCallerPres')\n",

View File

@@ -52,7 +52,8 @@ static char *setcdruserfield_descrip =
" can use for data not stored anywhere else in the record.\n"
" CDR records can be used for billing or storing other arbitrary data\n"
" (I.E. telephone survey responses)\n"
" Also see AppendCDRUserField().\n";
" Also see AppendCDRUserField().\n"
"\nThis application is deprecated in favor of Set(CDR(userfield)=...)\n";
static char *setcdruserfield_app = "SetCDRUserField";
@@ -67,18 +68,19 @@ static char *appendcdruserfield_descrip =
" can use for data not stored anywhere else in the record.\n"
" CDR records can be used for billing or storing other arbitrary data\n"
" (I.E. telephone survey responses)\n"
" Also see SetCDRUserField().\n";
" Also see SetCDRUserField().\n"
"\nThis application is deprecated in favor of Set(CDR(userfield)=...)\n";
static char *appendcdruserfield_app = "AppendCDRUserField";
static char *appendcdruserfield_synopsis = "Append to the CDR user field";
static int action_setcdruserfield(struct mansession *s, struct message *m)
static int action_setcdruserfield(struct mansession *s, const struct message *m)
{
struct ast_channel *c = NULL;
char *userfield = astman_get_header(m, "UserField");
char *channel = astman_get_header(m, "Channel");
char *append = astman_get_header(m, "Append");
const char *userfield = astman_get_header(m, "UserField");
const char *channel = astman_get_header(m, "Channel");
const char *append = astman_get_header(m, "Append");
if (ast_strlen_zero(channel)) {
astman_send_error(s, m, "No Channel specified");

View File

@@ -66,6 +66,7 @@ static char *descrip =
" DIGITAL_W_TONES : 0x11 - Unrestricted digital information with tones/announcements\n"
" VIDEO : 0x18 - Video\n"
"\n"
"This application is deprecated in favor of Set(CHANNEL(transfercapability)=...)\n"
;
static int settransfercapability_exec(struct ast_channel *chan, void *data)

View File

@@ -467,7 +467,7 @@ static time_t unpackdate (unsigned char *i)
t.tm_min += 15 * ((i[6] & 0x7) * 10 + (i[6] >> 4));
else
t.tm_min -= 15 * ((i[6] & 0x7) * 10 + (i[6] >> 4));
return mktime (&t);
return ast_mktime(&t, NULL);
}
/*! \brief unpacks bytes (7 bit encoding) at i, len l septets,
@@ -662,7 +662,9 @@ static void sms_log (sms_t * h, char status)
*p++ = h->ud[n];
*p++ = '\n';
*p = 0;
write (o, line, strlen (line));
if (write (o, line, strlen (line)) < 0) {
ast_log(LOG_WARNING, "write() failed: %s\n", strerror(errno));
}
close (o);
}
*h->oa = *h->da = h->udl = 0;
@@ -745,7 +747,7 @@ static void sms_readfile (sms_t * h, char *fn)
H,
M,
S;
if (sscanf (p, "%d-%d-%dT%d:%d:%d", &Y, &m, &d, &H, &M, &S) == 6)
if (sscanf (p, "%30d-%30d-%30dT%30d:%30d:%30d", &Y, &m, &d, &H, &M, &S) == 6)
{
struct tm t;
t.tm_year = Y - 1900;
@@ -755,7 +757,7 @@ static void sms_readfile (sms_t * h, char *fn)
t.tm_min = M;
t.tm_sec = S;
t.tm_isdst = -1;
h->scts = mktime (&t);
h->scts = ast_mktime(&t, NULL);
if (h->scts == (time_t) - 1)
ast_log (LOG_WARNING, "Bad date/timein %s: %s", fn, p);
}
@@ -1046,7 +1048,7 @@ static void sms_nextoutgoing (sms_t * h)
unsigned char p = 2;
h->omsg[0] = 0x91; /* SMS_DATA */
if (h->smsc) { /* deliver */
h->omsg[p++] = (more ? 4 : 0);
h->omsg[p++] = (more ? 4 : 0) + ((h->udhl > 0) ? 0x40 : 0);
p += packaddress (h->omsg + p, h->oa);
h->omsg[p++] = h->pid;
h->omsg[p++] = h->dcs;
@@ -1198,7 +1200,7 @@ static int sms_generate (struct ast_channel *chan, void *data, int len, int samp
#else
f.subclass = AST_FORMAT_SLINEAR;
#endif
f.datalen = len;
f.datalen = samples * SAMPLE2LEN;
f.offset = AST_FRIENDLY_OFFSET;
f.mallocd = 0;
f.data = buf;
@@ -1389,7 +1391,7 @@ static int sms_exec (struct ast_channel *chan, void *data)
ast_module_user_remove(u);
return -1;
}
strncpy (h.queue, (char *)d, p - d);
strncpy(h.queue, (char *)d, p - d);
if (*p == '|')
p++;
d = p;

View File

@@ -74,7 +74,7 @@ static int softhangup_exec(struct ast_channel *chan, void *data)
all = options && strchr(options,'a');
c = ast_channel_walk_locked(NULL);
while (c) {
strncpy(name, c->name, sizeof(name)-1);
ast_copy_string(name, c->name, sizeof(name));
ast_mutex_unlock(&c->lock);
/* XXX watch out, i think it is wrong to access c-> after unlocking! */
if (all) {

View File

@@ -126,19 +126,31 @@ static struct ast_speech *find_speech(struct ast_channel *chan)
return speech;
}
/* Helper function to find a specific speech recognition result by number */
static struct ast_speech_result *find_result(struct ast_speech_result *results, int num)
/* Helper function to find a specific speech recognition result by number and nbest alternative */
static struct ast_speech_result *find_result(struct ast_speech_result *results, char *result_num)
{
struct ast_speech_result *result = NULL;
int i = 0;
struct ast_speech_result *result = results;
char *tmp = NULL;
int nbest_num = 0, wanted_num = 0, i = 0;
result = results;
while (result) {
if (i == num)
if (!result)
return NULL;
if ((tmp = strchr(result_num, '/'))) {
*tmp++ = '\0';
nbest_num = atoi(result_num);
wanted_num = atoi(tmp);
} else {
wanted_num = atoi(result_num);
}
do {
if (result->nbest_num != nbest_num)
continue;
if (i == wanted_num)
break;
i++;
result = result->next;
}
} while ((result = result->next));
return result;
}
@@ -151,7 +163,7 @@ static int speech_score(struct ast_channel *chan, char *cmd, char *data,
struct ast_speech *speech = find_speech(chan);
char tmp[128] = "";
if (data == NULL || speech == NULL || !(result = find_result(speech->results, atoi(data))))
if (data == NULL || speech == NULL || !(result = find_result(speech->results, data)))
return -1;
snprintf(tmp, sizeof(tmp), "%d", result->score);
@@ -164,7 +176,7 @@ static int speech_score(struct ast_channel *chan, char *cmd, char *data,
static struct ast_custom_function speech_score_function = {
.name = "SPEECH_SCORE",
.synopsis = "Gets the confidence score of a result.",
.syntax = "SPEECH_SCORE(result number)",
.syntax = "SPEECH_SCORE([nbest number/]result number)",
.desc =
"Gets the confidence score of a result.\n",
.read = speech_score,
@@ -178,11 +190,14 @@ static int speech_text(struct ast_channel *chan, char *cmd, char *data,
struct ast_speech_result *result = NULL;
struct ast_speech *speech = find_speech(chan);
if (data == NULL || speech == NULL || !(result = find_result(speech->results, atoi(data))))
if (data == NULL || speech == NULL || !(result = find_result(speech->results, data)))
return -1;
if (result->text != NULL)
if (result->text != NULL) {
ast_copy_string(buf, result->text, len);
} else {
buf[0] = '\0';
}
return 0;
}
@@ -190,7 +205,7 @@ static int speech_text(struct ast_channel *chan, char *cmd, char *data,
static struct ast_custom_function speech_text_function = {
.name = "SPEECH_TEXT",
.synopsis = "Gets the recognized text of a result.",
.syntax = "SPEECH_TEXT(result number)",
.syntax = "SPEECH_TEXT([nbest number/]result number)",
.desc =
"Gets the recognized text of a result.\n",
.read = speech_text,
@@ -204,11 +219,14 @@ static int speech_grammar(struct ast_channel *chan, char *cmd, char *data,
struct ast_speech_result *result = NULL;
struct ast_speech *speech = find_speech(chan);
if (data == NULL || speech == NULL || !(result = find_result(speech->results, atoi(data))))
if (data == NULL || speech == NULL || !(result = find_result(speech->results, data)))
return -1;
if (result->grammar != NULL)
if (result->grammar != NULL) {
ast_copy_string(buf, result->grammar, len);
} else {
buf[0] = '\0';
}
return 0;
}
@@ -216,7 +234,7 @@ static int speech_grammar(struct ast_channel *chan, char *cmd, char *data,
static struct ast_custom_function speech_grammar_function = {
.name = "SPEECH_GRAMMAR",
.synopsis = "Gets the matched grammar of a result if available.",
.syntax = "SPEECH_GRAMMAR(result number)",
.syntax = "SPEECH_GRAMMAR([nbest number/]result number)",
.desc =
"Gets the matched grammar of a result if available.\n",
.read = speech_grammar,
@@ -246,6 +264,32 @@ static struct ast_custom_function speech_engine_function = {
.write = speech_engine_write,
};
/*! \brief SPEECH_RESULTS_TYPE() Dialplan Function */
static int speech_results_type_write(struct ast_channel *chan, char *cmd, char *data, const char *value)
{
struct ast_speech *speech = find_speech(chan);
if (data == NULL || speech == NULL)
return -1;
if (!strcasecmp(value, "normal"))
ast_speech_change_results_type(speech, AST_SPEECH_RESULTS_TYPE_NORMAL);
else if (!strcasecmp(value, "nbest"))
ast_speech_change_results_type(speech, AST_SPEECH_RESULTS_TYPE_NBEST);
return 0;
}
static struct ast_custom_function speech_results_type_function = {
.name = "SPEECH_RESULTS_TYPE",
.synopsis = "Sets the type of results that will be returned.",
.syntax = "SPEECH_RESULTS_TYPE()=results type",
.desc =
"Sets the type of results that will be returned. Valid options are normal or nbest.",
.read = NULL,
.write = speech_results_type_write,
};
/*! \brief SPEECH() Dialplan Function */
static int speech_read(struct ast_channel *chan, char *cmd, char *data,
char *buf, size_t len)
@@ -284,6 +328,8 @@ static int speech_read(struct ast_channel *chan, char *cmd, char *data,
}
snprintf(tmp, sizeof(tmp), "%d", results);
ast_copy_string(buf, tmp, len);
} else {
buf[0] = '\0';
}
return 0;
@@ -332,6 +378,8 @@ static int speech_create(struct ast_channel *chan, void *data)
datastore->data = speech;
ast_channel_datastore_add(chan, datastore);
pbx_builtin_setvar_helper(chan, "ERROR", NULL);
ast_module_user_remove(u);
return 0;
@@ -487,31 +535,24 @@ static int speech_processing_sound(struct ast_channel *chan, void *data)
/*! \brief Helper function used by speech_background to playback a soundfile */
static int speech_streamfile(struct ast_channel *chan, const char *filename, const char *preflang)
{
struct ast_filestream *fs;
struct ast_filestream *vfs=NULL;
struct ast_filestream *fs = NULL;
fs = ast_openstream(chan, filename, preflang);
if (fs)
vfs = ast_openvstream(chan, filename, preflang);
if (fs){
if (ast_applystream(chan, fs))
return -1;
if (vfs && ast_applystream(chan, vfs))
return -1;
if (ast_playstream(fs))
return -1;
if (vfs && ast_playstream(vfs))
return -1;
return 0;
}
return -1;
if (!(fs = ast_openstream(chan, filename, preflang)))
return -1;
if (ast_applystream(chan, fs))
return -1;
ast_playstream(fs);
return 0;
}
/*! \brief SpeechBackground(Sound File|Timeout) Dialplan Application */
static int speech_background(struct ast_channel *chan, void *data)
{
unsigned int timeout = 0;
int res = 0, done = 0, argc = 0, started = 0;
int res = 0, done = 0, argc = 0, started = 0, quieted = 0, max_dtmf_len = 0;
struct ast_module_user *u = NULL;
struct ast_speech *speech = find_speech(chan);
struct ast_frame *f = NULL;
@@ -519,7 +560,8 @@ static int speech_background(struct ast_channel *chan, void *data)
char dtmf[AST_MAX_EXTENSION] = "";
time_t start, current;
struct ast_datastore *datastore = NULL;
char *argv[2], *args = NULL, *filename = NULL, tmp[2] = "";
char *argv[2], *args = NULL, *filename_tmp = NULL, *filename = NULL, tmp[2] = "", dtmf_terminator = '#';
const char *tmp2 = NULL;
args = ast_strdupa(data);
@@ -549,18 +591,25 @@ static int speech_background(struct ast_channel *chan, void *data)
argc = ast_app_separate_args(args, '|', argv, sizeof(argv) / sizeof(argv[0]));
if (argc > 0) {
/* Yay sound file */
filename = argv[0];
if (argv[1] != NULL)
timeout = atoi(argv[1]);
filename_tmp = ast_strdupa(argv[0]);
if (!ast_strlen_zero(argv[1])) {
if ((timeout = atoi(argv[1])) == 0)
timeout = -1;
} else
timeout = 0;
}
/* Start streaming the file if possible and specified */
if (filename != NULL && ast_streamfile(chan, filename, chan->language)) {
/* An error occured while streaming */
ast_set_read_format(chan, oldreadformat);
ast_module_user_remove(u);
return -1;
}
/* See if the maximum DTMF length variable is set... we use a variable in case they want to carry it through their entire dialplan */
if ((tmp2 = pbx_builtin_getvar_helper(chan, "SPEECH_DTMF_MAXLEN")) && !ast_strlen_zero(tmp2))
max_dtmf_len = atoi(tmp2);
/* See if a terminator is specified */
if ((tmp2 = pbx_builtin_getvar_helper(chan, "SPEECH_DTMF_TERMINATOR"))) {
if (ast_strlen_zero(tmp2))
dtmf_terminator = '\0';
else
dtmf_terminator = tmp2[0];
}
/* Before we go into waiting for stuff... make sure the structure is ready, if not - start it again */
if (speech->state == AST_SPEECH_STATE_NOT_READY || speech->state == AST_SPEECH_STATE_DONE) {
@@ -568,8 +617,19 @@ static int speech_background(struct ast_channel *chan, void *data)
ast_speech_start(speech);
}
/* Ensure no streams are currently running */
ast_stopstream(chan);
/* Okay it's streaming so go into a loop grabbing frames! */
while (done == 0) {
/* If the filename is null and stream is not running, start up a new sound file */
if (!quieted && (chan->streamid == -1 && chan->timingfunc == NULL) && (filename = strsep(&filename_tmp, "&"))) {
/* Discard old stream information */
ast_stopstream(chan);
/* Start new stream */
speech_streamfile(chan, filename, chan->language);
}
/* Run scheduled stuff */
ast_sched_runq(chan->sched);
@@ -590,7 +650,7 @@ static int speech_background(struct ast_channel *chan, void *data)
}
/* Do timeout check (shared between audio/dtmf) */
if (started == 1) {
if ((!quieted || strlen(dtmf)) && started == 1) {
time(&current);
if ((current-start) >= timeout) {
done = 1;
@@ -602,9 +662,11 @@ static int speech_background(struct ast_channel *chan, void *data)
/* Do checks on speech structure to see if it's changed */
ast_mutex_lock(&speech->lock);
if (ast_test_flag(speech, AST_SPEECH_QUIET) && chan->stream != NULL) {
ast_stopstream(chan);
if (ast_test_flag(speech, AST_SPEECH_QUIET)) {
if (chan->stream)
ast_stopstream(chan);
ast_clear_flag(speech, AST_SPEECH_QUIET);
quieted = 1;
}
/* Check state so we can see what to do */
switch (speech->state) {
@@ -612,43 +674,53 @@ static int speech_background(struct ast_channel *chan, void *data)
/* If audio playback has stopped do a check for timeout purposes */
if (chan->streamid == -1 && chan->timingfunc == NULL)
ast_stopstream(chan);
if (chan->stream == NULL && timeout > 0 && started == 0) {
if (!quieted && chan->stream == NULL && timeout && started == 0 && !filename_tmp) {
if (timeout == -1) {
done = 1;
if (f)
ast_frfree(f);
break;
}
time(&start);
started = 1;
}
/* Deal with audio frames if present */
if (f != NULL && f->frametype == AST_FRAME_VOICE) {
/* Write audio frame out to speech engine if no DTMF has been received */
if (!strlen(dtmf) && f != NULL && f->frametype == AST_FRAME_VOICE) {
ast_speech_write(speech, f->data, f->datalen);
}
break;
case AST_SPEECH_STATE_WAIT:
/* Cue up waiting sound if not already playing */
if (chan->stream == NULL) {
if (speech->processing_sound != NULL) {
if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound,"none")) {
speech_streamfile(chan, speech->processing_sound, chan->language);
}
}
} else if (chan->streamid == -1 && chan->timingfunc == NULL) {
ast_stopstream(chan);
if (speech->processing_sound != NULL) {
if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound,"none")) {
speech_streamfile(chan, speech->processing_sound, chan->language);
}
}
}
if (!strlen(dtmf)) {
if (chan->stream == NULL) {
if (speech->processing_sound != NULL) {
if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound,"none")) {
speech_streamfile(chan, speech->processing_sound, chan->language);
}
}
} else if (chan->streamid == -1 && chan->timingfunc == NULL) {
ast_stopstream(chan);
if (speech->processing_sound != NULL) {
if (strlen(speech->processing_sound) > 0 && strcasecmp(speech->processing_sound,"none")) {
speech_streamfile(chan, speech->processing_sound, chan->language);
}
}
}
}
break;
case AST_SPEECH_STATE_DONE:
/* Copy to speech structure the results, if available */
speech->results = ast_speech_results_get(speech);
/* Now that we are done... let's switch back to not ready state */
/* Now that we are done... let's switch back to not ready state */
ast_speech_change_state(speech, AST_SPEECH_STATE_NOT_READY);
/* Break out of our background too */
done = 1;
/* Stop audio playback */
if (chan->stream != NULL) {
ast_stopstream(chan);
}
if (!strlen(dtmf)) {
/* Copy to speech structure the results, if available */
speech->results = ast_speech_results_get(speech);
/* Break out of our background too */
done = 1;
/* Stop audio playback */
if (chan->stream != NULL) {
ast_stopstream(chan);
}
}
break;
default:
break;
@@ -660,18 +732,23 @@ static int speech_background(struct ast_channel *chan, void *data)
/* Free the frame we received */
switch (f->frametype) {
case AST_FRAME_DTMF:
if (f->subclass == '#') {
if (dtmf_terminator != '\0' && f->subclass == dtmf_terminator) {
done = 1;
} else {
if (chan->stream != NULL) {
ast_stopstream(chan);
}
if (!started) {
/* Change timeout to be 5 seconds for DTMF input */
timeout = 5;
time(&start);
timeout = (chan->pbx && chan->pbx->dtimeout) ? chan->pbx->dtimeout : 5;
started = 1;
}
time(&start);
snprintf(tmp, sizeof(tmp), "%c", f->subclass);
strncat(dtmf, tmp, sizeof(dtmf));
strncat(dtmf, tmp, sizeof(dtmf) - strlen(dtmf) - 1);
/* If the maximum length of the DTMF has been reached, stop now */
if (max_dtmf_len && strlen(dtmf) == max_dtmf_len)
done = 1;
}
break;
case AST_FRAME_CONTROL:
@@ -690,14 +767,16 @@ static int speech_background(struct ast_channel *chan, void *data)
}
}
if (strlen(dtmf) > 0 && speech->results == NULL) {
if (strlen(dtmf)) {
/* We sort of make a results entry */
speech->results = ast_calloc(1, sizeof(*speech->results));
if (speech->results != NULL) {
ast_speech_dtmf(speech, dtmf);
speech->results->score = 1000;
speech->results->text = strdup(dtmf);
speech->results->grammar = strdup("dtmf");
}
ast_speech_change_state(speech, AST_SPEECH_STATE_NOT_READY);
}
/* See if it was because they hung up */
@@ -765,6 +844,7 @@ static int unload_module(void)
res |= ast_custom_function_unregister(&speech_text_function);
res |= ast_custom_function_unregister(&speech_grammar_function);
res |= ast_custom_function_unregister(&speech_engine_function);
res |= ast_custom_function_unregister(&speech_results_type_function);
ast_module_user_hangup_all();
@@ -789,6 +869,7 @@ static int load_module(void)
res |= ast_custom_function_register(&speech_text_function);
res |= ast_custom_function_register(&speech_grammar_function);
res |= ast_custom_function_register(&speech_engine_function);
res |= ast_custom_function_register(&speech_results_type_function);
return res;
}

View File

@@ -138,10 +138,10 @@ static int gosubif_exec(struct ast_channel *chan, void *data)
label2 = args;
if (pbx_checkcondition(condition)) {
if (label1) {
if (!ast_strlen_zero(label1)) {
res = gosub_exec(chan, label1);
}
} else if (label2) {
} else if (!ast_strlen_zero(label2)) {
res = gosub_exec(chan, label2);
}

View File

@@ -95,6 +95,8 @@ static int system_exec_helper(struct ast_channel *chan, void *data, int failmode
u = ast_module_user_add(chan);
ast_autoservice_start(chan);
/* Do our thing here */
res = ast_safe_system((char *)data);
if ((res < 0) && (errno != ECHILD)) {
@@ -118,6 +120,8 @@ static int system_exec_helper(struct ast_channel *chan, void *data, int failmode
res = 0;
}
ast_autoservice_stop(chan);
ast_module_user_remove(u);
return res;

View File

@@ -89,15 +89,15 @@ static int background_detect_exec(struct ast_channel *chan, void *data)
strsep(&stringp, "|");
options = strsep(&stringp, "|");
if (options) {
if ((sscanf(options, "%d", &x) == 1) && (x > 0))
if ((sscanf(options, "%30d", &x) == 1) && (x > 0))
sil = x;
options = strsep(&stringp, "|");
if (options) {
if ((sscanf(options, "%d", &x) == 1) && (x > 0))
if ((sscanf(options, "%30d", &x) == 1) && (x > 0))
min = x;
options = strsep(&stringp, "|");
if (options) {
if ((sscanf(options, "%d", &x) == 1) && (x > 0))
if ((sscanf(options, "%30d", &x) == 1) && (x > 0))
max = x;
}
}

View File

@@ -48,13 +48,13 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/pbx.h"
#include "asterisk/utils.h"
static char *tests_descrip =
static char *tests_descrip =
"TestServer(): Perform test server function and write call report.\n"
"Results stored in /var/log/asterisk/testreports/<testid>-server.txt";
static char *tests_app = "TestServer";
static char *tests_synopsis = "Execute Interface Test Server";
static char *testc_descrip =
static char *testc_descrip =
"TestClient(testid): Executes test client with given testid.\n"
"Results stored in /var/log/asterisk/testreports/<testid>-client.txt";
@@ -116,7 +116,7 @@ static int measurenoise(struct ast_channel *chan, int ms, char *who)
return (noise / samples);
}
static int sendnoise(struct ast_channel *chan, int ms)
static int sendnoise(struct ast_channel *chan, int ms)
{
int res;
res = ast_tonepair_start(chan, 1537, 2195, ms, 8192);
@@ -124,7 +124,7 @@ static int sendnoise(struct ast_channel *chan, int ms)
res = ast_waitfordigit(chan, ms);
ast_tonepair_stop(chan);
}
return res;
return res;
}
static int testclient_exec(struct ast_channel *chan, void *data)
@@ -135,18 +135,18 @@ static int testclient_exec(struct ast_channel *chan, void *data)
char fn[80];
char serverver[80];
FILE *f;
/* Check for test id */
if (ast_strlen_zero(testid)) {
ast_log(LOG_WARNING, "TestClient requires an argument - the test id\n");
return -1;
}
u = ast_module_user_add(chan);
if (chan->_state != AST_STATE_UP)
res = ast_answer(chan);
/* Wait a few just to be sure things get started */
res = ast_safe_sleep(chan, 3000);
/* Transmit client version */
@@ -154,27 +154,25 @@ static int testclient_exec(struct ast_channel *chan, void *data)
res = ast_dtmf_stream(chan, NULL, "8378*1#", 0);
if (option_debug)
ast_log(LOG_DEBUG, "Transmit client version\n");
/* Read server version */
if (option_debug)
ast_log(LOG_DEBUG, "Read server version\n");
if (!res)
if (!res)
res = ast_app_getdata(chan, NULL, serverver, sizeof(serverver) - 1, 0);
if (res > 0)
res = 0;
if (option_debug)
ast_log(LOG_DEBUG, "server version: %s\n", serverver);
if (res > 0)
res = 0;
if (!res)
res = ast_safe_sleep(chan, 1000);
/* Send test id */
if (!res)
res = ast_dtmf_stream(chan, NULL, testid, 0);
if (!res)
res = ast_dtmf_stream(chan, NULL, "#", 0);
if (!res)
res = ast_dtmf_stream(chan, NULL, testid, 0);
if (!res)
res = ast_dtmf_stream(chan, NULL, "#", 0);
if (option_debug)
ast_log(LOG_DEBUG, "send test identifier: %s\n", testid);
@@ -189,7 +187,7 @@ static int testclient_exec(struct ast_channel *chan, void *data)
fprintf(f, "CLIENTTEST ID: %s\n", testid);
fprintf(f, "ANSWER: PASS\n");
res = 0;
if (!res) {
/* Step 1: Wait for "1" */
if (option_debug)
@@ -201,8 +199,9 @@ static int testclient_exec(struct ast_channel *chan, void *data)
else
res = -1;
}
if (!res)
if (!res) {
res = ast_safe_sleep(chan, 1000);
}
if (!res) {
/* Step 2: Send "2" */
if (option_debug)
@@ -220,7 +219,7 @@ static int testclient_exec(struct ast_channel *chan, void *data)
fprintf(f, "WAIT 1 SEC: %s\n", (res < 0) ? "FAIL" : "PASS");
if (res > 0)
res = 0;
}
}
if (!res) {
/* Step 4: Measure noise */
if (option_debug)
@@ -272,7 +271,7 @@ static int testclient_exec(struct ast_channel *chan, void *data)
if (!res) {
/* Step 9: Measure noise */
if (option_debug)
ast_log(LOG_DEBUG, "TestClient: 6. Measure tone\n");
ast_log(LOG_DEBUG, "TestClient: 9. Measure tone\n");
res = measurenoise(chan, 4000, "TestClient");
fprintf(f, "MEASURETONE: %s (%d)\n", (res < 0) ? "FAIL" : "PASS", res);
if (res > 0)
@@ -281,7 +280,7 @@ static int testclient_exec(struct ast_channel *chan, void *data)
if (!res) {
/* Step 10: Send "7" */
if (option_debug)
ast_log(LOG_DEBUG, "TestClient: 7. Send DTMF 7\n");
ast_log(LOG_DEBUG, "TestClient: 10. Send DTMF 7\n");
res = ast_dtmf_stream(chan, NULL, "7", 0);
fprintf(f, "SEND DTMF 7: %s\n", (res < 0) ? "FAIL" : "PASS");
if (res > 0)
@@ -298,6 +297,9 @@ static int testclient_exec(struct ast_channel *chan, void *data)
else
res = -1;
}
if (!res) {
res = ast_safe_sleep(chan, 1000);
}
if (option_debug && !res ) {
/* Step 12: Hangup! */
ast_log(LOG_DEBUG, "TestClient: 12. Hangup\n");
@@ -331,7 +333,7 @@ static int testserver_exec(struct ast_channel *chan, void *data)
/* Read version */
if (option_debug)
ast_log(LOG_DEBUG, "Read client version\n");
if (!res)
if (!res)
res = ast_app_getdata(chan, NULL, testid, sizeof(testid) - 1, 0);
if (res > 0)
res = 0;
@@ -345,9 +347,9 @@ static int testserver_exec(struct ast_channel *chan, void *data)
if (res > 0)
res = 0;
if (!res)
res = ast_app_getdata(chan, NULL, testid, sizeof(testid) - 1, 0);
if (option_debug)
if (!res)
res = ast_app_getdata(chan, NULL, testid, sizeof(testid) - 1, 0);
if (option_debug)
ast_log(LOG_DEBUG, "read test identifier: %s\n", testid);
/* Check for sneakyness */
if (strchr(testid, '/'))
@@ -367,7 +369,7 @@ static int testserver_exec(struct ast_channel *chan, void *data)
res = ast_safe_sleep(chan, 1000);
if (!res) {
/* Step 1: Send "1" */
if (option_debug)
if (option_debug)
ast_log(LOG_DEBUG, "TestServer: 1. Send DTMF 1\n");
res = ast_dtmf_stream(chan, NULL, "1", 0);
fprintf(f, "SEND DTMF 1: %s\n", (res < 0) ? "FAIL" : "PASS");
@@ -376,7 +378,7 @@ static int testserver_exec(struct ast_channel *chan, void *data)
}
if (!res) {
/* Step 2: Wait for "2" */
if (option_debug)
if (option_debug)
ast_log(LOG_DEBUG, "TestServer: 2. Wait DTMF 2\n");
res = ast_waitfordigit(chan, 3000);
fprintf(f, "WAIT DTMF 2: %s\n", (res != '2') ? "FAIL" : "PASS");
@@ -387,7 +389,7 @@ static int testserver_exec(struct ast_channel *chan, void *data)
}
if (!res) {
/* Step 3: Measure noise */
if (option_debug)
if (option_debug)
ast_log(LOG_DEBUG, "TestServer: 3. Measure noise\n");
res = measurenoise(chan, 6000, "TestServer");
fprintf(f, "MEASURENOISE: %s (%d)\n", (res < 0) ? "FAIL" : "PASS", res);
@@ -396,37 +398,34 @@ static int testserver_exec(struct ast_channel *chan, void *data)
}
if (!res) {
/* Step 4: Send "4" */
if (option_debug)
if (option_debug)
ast_log(LOG_DEBUG, "TestServer: 4. Send DTMF 4\n");
res = ast_dtmf_stream(chan, NULL, "4", 0);
fprintf(f, "SEND DTMF 4: %s\n", (res < 0) ? "FAIL" : "PASS");
if (res > 0)
res = 0;
}
if (!res) {
/* Step 5: Wait one second */
if (option_debug)
if (option_debug)
ast_log(LOG_DEBUG, "TestServer: 5. Wait one second\n");
res = ast_safe_sleep(chan, 1000);
fprintf(f, "WAIT 1 SEC: %s\n", (res < 0) ? "FAIL" : "PASS");
if (res > 0)
res = 0;
}
if (!res) {
/* Step 6: Measure noise */
if (option_debug)
if (option_debug)
ast_log(LOG_DEBUG, "TestServer: 6. Measure tone\n");
res = measurenoise(chan, 4000, "TestServer");
fprintf(f, "MEASURETONE: %s (%d)\n", (res < 0) ? "FAIL" : "PASS", res);
if (res > 0)
res = 0;
}
if (!res) {
/* Step 7: Send "5" */
if (option_debug)
if (option_debug)
ast_log(LOG_DEBUG, "TestServer: 7. Send DTMF 5\n");
res = ast_dtmf_stream(chan, NULL, "5", 0);
fprintf(f, "SEND DTMF 5: %s\n", (res < 0) ? "FAIL" : "PASS");
@@ -436,15 +435,15 @@ static int testserver_exec(struct ast_channel *chan, void *data)
if (!res) {
/* Step 8: Transmit tone noise */
if (option_debug)
if (option_debug)
ast_log(LOG_DEBUG, "TestServer: 8. Transmit tone\n");
res = sendnoise(chan, 6000);
fprintf(f, "SENDTONE: %s\n", (res < 0) ? "FAIL" : "PASS");
}
if (!res || (res == '7')) {
/* Step 9: Wait for "7" */
if (option_debug)
if (option_debug)
ast_log(LOG_DEBUG, "TestServer: 9. Wait DTMF 7\n");
if (!res)
res = ast_waitfordigit(chan, 3000);
@@ -454,11 +453,12 @@ static int testserver_exec(struct ast_channel *chan, void *data)
else
res = -1;
}
if (!res)
if (!res) {
res = ast_safe_sleep(chan, 1000);
}
if (!res) {
/* Step 10: Send "8" */
if (option_debug)
if (option_debug)
ast_log(LOG_DEBUG, "TestServer: 10. Send DTMF 8\n");
res = ast_dtmf_stream(chan, NULL, "8", 0);
fprintf(f, "SEND DTMF 8: %s\n", (res < 0) ? "FAIL" : "PASS");
@@ -467,7 +467,7 @@ static int testserver_exec(struct ast_channel *chan, void *data)
}
if (!res) {
/* Step 11: Wait for hangup to arrive! */
if (option_debug)
if (option_debug)
ast_log(LOG_DEBUG, "TestServer: 11. Waiting for hangup\n");
res = ast_safe_sleep(chan, 10000);
fprintf(f, "WAIT HANGUP: %s\n", (res < 0) ? "PASS" : "FAIL");
@@ -496,7 +496,7 @@ static int unload_module(void)
ast_module_user_hangup_all();
return res;
return res;
}
static int load_module(void)

View File

@@ -53,20 +53,18 @@ static char *descrip =
"Result is returned in the SENDURLSTATUS channel variable:\n"
" SUCCESS URL successfully sent to client\n"
" FAILURE Failed to send URL\n"
" NOLOAD Clien failed to load URL (wait enabled)\n"
" NOLOAD Client failed to load URL (wait enabled)\n"
" UNSUPPORTED Channel does not support URL transport\n"
"\n"
"If the option 'wait' is specified, execution will wait for an\n"
"acknowledgement that the URL has been loaded before continuing\n"
"and will return -1 if the peer is unable to load the URL\n"
"\n"
"Old behaviour (deprecated): \n"
" If the client does not support Asterisk \"html\" transport, \n"
" and there exists a step with priority n + 101, then execution will\n"
" continue at that step.\n"
" Otherwise, execution will continue at the next priority level.\n"
" SendURL only returns 0 if the URL was sent correctly or if\n"
" the channel does not support HTML transport, and -1 otherwise.\n";
"If jumping is specified as an option (the 'j' flag), the client does not\n"
"support Asterisk \"html\" transport, and there exists a step with priority\n"
"n + 101, then execution will continue at that step.\n"
"\n"
"SendURL continues normally if the URL was sent correctly or if the channel\n"
"does not support HTML transport. Otherwise, the channel is hung up.\n";
static int sendurl_exec(struct ast_channel *chan, void *data)

View File

@@ -59,7 +59,7 @@ static int userevent_exec(struct ast_channel *chan, void *data)
{
struct ast_module_user *u;
char *parse, buf[2048] = "";
int x, buflen = 0;
int x, buflen = 0, xlen;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(eventname);
AST_APP_ARG(extra)[100];
@@ -77,13 +77,18 @@ static int userevent_exec(struct ast_channel *chan, void *data)
AST_STANDARD_APP_ARGS(args, parse);
for (x = 0; x < args.argc - 1; x++) {
ast_copy_string(buf + buflen, args.extra[x], sizeof(buf) - buflen - 2);
buflen += strlen(args.extra[x]);
/* Stop once a header comes up that exceeds our buffer. */
if (sizeof(buf) <= buflen + (xlen = strlen(args.extra[x])) + 3) {
ast_log(LOG_WARNING, "UserEvent exceeds our buffer length! Truncating.\n");
break;
}
ast_copy_string(buf + buflen, args.extra[x], sizeof(buf) - buflen - 3);
buflen += xlen;
ast_copy_string(buf + buflen, "\r\n", 3);
buflen += 2;
}
manager_event(EVENT_FLAG_USER, "UserEvent", "UserEvent: %s\r\n%s\r\n", args.eventname, buf);
manager_event(EVENT_FLAG_USER, "UserEvent", "UserEvent: %s\r\n%s", args.eventname, buf);
ast_module_user_remove(u);

View File

@@ -65,7 +65,7 @@ static int verbose_exec(struct ast_channel *chan, void *data)
vtext = ast_strdupa(data);
tmp = strsep(&vtext, "|");
if (vtext) {
if (sscanf(tmp, "%d", &vsize) != 1) {
if (sscanf(tmp, "%30d", &vsize) != 1) {
vsize = 0;
ast_log(LOG_WARNING, "'%s' is not a verboser number\n", vtext);
}

File diff suppressed because it is too large Load Diff

View File

@@ -60,7 +60,7 @@ static int waitforring_exec(struct ast_channel *chan, void *data)
int res = 0;
int ms;
if (!data || (sscanf(data, "%d", &ms) != 1)) {
if (!data || (sscanf(data, "%30d", &ms) != 1)) {
ast_log(LOG_WARNING, "WaitForRing requires an argument (minimum seconds)\n");
return 0;
}

View File

@@ -107,13 +107,13 @@ static int do_waiting(struct ast_channel *chan, int silencereqd, time_t waitstar
res = ast_waitfor(chan, silencereqd);
/* Must have gotten a hangup; let's exit */
if (res <= 0) {
if (res < 0) {
f = NULL;
break;
}
/* We waited and got no frame; sounds like digital silence or a muted digital channel */
if (!res) {
if (res == 0) {
dspsilence = silencereqd;
} else {
/* Looks like we did get a frame, so let's check it out */
@@ -122,6 +122,8 @@ static int do_waiting(struct ast_channel *chan, int silencereqd, time_t waitstar
break;
if (f && f->frametype == AST_FRAME_VOICE) {
ast_dsp_silence(sildet, f, &dspsilence);
}
if (f) {
ast_frfree(f);
}
}
@@ -165,9 +167,9 @@ static int waitforsilence_exec(struct ast_channel *chan, void *data)
res = ast_answer(chan); /* Answer the channel */
if (!data || ( (sscanf(data, "%d|%d|%d", &silencereqd, &iterations, &timeout) != 3) &&
(sscanf(data, "%d|%d", &silencereqd, &iterations) != 2) &&
(sscanf(data, "%d", &silencereqd) != 1) ) ) {
if (!data || ( (sscanf(data, "%30d|%30d|%30d", &silencereqd, &iterations, &timeout) != 3) &&
(sscanf(data, "%30d|%30d", &silencereqd, &iterations) != 2) &&
(sscanf(data, "%30d", &silencereqd) != 1) ) ) {
ast_log(LOG_WARNING, "Using default value of 1000ms, 1 iteration, no timeout\n");
}

View File

@@ -181,12 +181,16 @@ static int _while_exec(struct ast_channel *chan, void *data, int end)
u = ast_module_user_add(chan);
#if 0
/* dont want run away loops if the chan isn't even up
this is up for debate since it slows things down a tad ......
Debate is over... this prevents While/EndWhile from working
within the "h" extension. Not good.
*/
if (ast_waitfordigit(chan,1) < 0)
ALL_DONE(u,-1);
#endif
for (x=0;;x++) {
if (get_index(chan, prefix, x)) {
@@ -231,8 +235,8 @@ static int _while_exec(struct ast_channel *chan, void *data, int end)
pbx_builtin_setvar_helper(chan, my_name, NULL);
snprintf(end_varname,VAR_SIZE,"END_%s",varname);
if ((goto_str=pbx_builtin_getvar_helper(chan, end_varname))) {
pbx_builtin_setvar_helper(chan, end_varname, NULL);
ast_parseable_goto(chan, goto_str);
pbx_builtin_setvar_helper(chan, end_varname, NULL);
} else {
int pri = find_matching_endwhile(chan);
if (pri > 0) {

View File

@@ -85,7 +85,7 @@ static int zapateller_exec(struct ast_channel *chan, void *data)
res = ast_safe_sleep(chan, 500);
}
}
if (chan->cid.cid_num && nocallerid) {
if (!ast_strlen_zero(chan->cid.cid_num) && nocallerid) {
ast_module_user_remove(u);
return res;
}

View File

@@ -0,0 +1,87 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Release Summary - asterisk-1.4.26.2</title></head>
<body>
<h1 align="center"><a name="top">Release Summary</a></h1>
<h3 align="center">asterisk-1.4.26.2</h3>
<h3 align="center">Date: 2009-09-03</h3>
<h3 align="center">&lt;asteriskteam@digium.com&gt;</h3>
<hr/>
<h2 align="center">Table of Contents</h2>
<ol>
<li><a href="#summary">Summary</a></li>
<li><a href="#contributors">Contributors</a></li>
<li><a href="#issues">Closed Issues</a></li>
<li><a href="#commits">Other Changes</a></li>
<li><a href="#diffstat">Diffstat</a></li>
</ol>
<hr/>
<a name="summary"><h2 align="center">Summary</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This release has been made to address one or more security vulnerabilities that have been identified. A security advisory document has been published for each vulnerability that includes additional information. Users of versions of Asterisk that are affected are strongly encouraged to review the advisories and determine what action they should take to protect their systems from these issues.</p>
<p>Security Advisories: <a href="http://downloads.asterisk.org/pub/security/AST-2009-006.html">AST-2009-006</a></p>
<p>The data in this summary reflects changes that have been made since the previous release, asterisk-1.4.26.1.</p>
<hr/>
<a name="contributors"><h2 align="center">Contributors</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This table lists the people who have submitted code, those that have tested patches, as well as those that reported issues on the issue tracker that were resolved in this release. For coders, the number is how many of their patches (of any size) were committed into this release. For testers, the number is the number of times their name was listed as assisting with testing a patch. Finally, for reporters, the number is the number of issues that they reported that were closed by commits that went into this release.</p>
<table width="100%" border="0">
<tr>
<td width="33%"><h3>Coders</h3></td>
<td width="33%"><h3>Testers</h3></td>
<td width="33%"><h3>Reporters</h3></td>
</tr>
<tr valign="top">
<td>
3 lmadsen<br/>
1 dvossel<br/>
</td>
<td>
1 dbrooks<br/>
1 dvossel<br/>
1 russell<br/>
1 tilghman<br/>
</td>
<td>
1 rathaus<br/>
</td>
</tr>
</table>
<hr/>
<a name="issues"><h2 align="center">Closed Issues</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all issues from the issue tracker that were closed by changes that went into this release.</p>
<h3>Category: Channels/chan_iax2</h3><br/>
<a href="https://issues.asterisk.org/view.php?id=12912">#12912</a>: An issue with the IAX2 channel allows anonymous connections to cause resource starvation<br/>
Revision: <a href="http://svn.digium.com/view/asterisk/tags/1.4.26.2?view=revision&revision=216015">216015</a><br/>
Reporter: rathaus<br/>
Testers: tilghman, russell, dvossel, dbrooks<br/>
Coders: dvossel<br/>
<br/>
<hr/>
<a name="commits"><h2 align="center">Commits Not Associated with an Issue</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all changes that went into this release that did not directly close an issue from the issue tracker. The commits may have been marked as being related to an issue. If that is the case, the issue numbers are listed here, as well.</p>
<table width="100%" border="1">
<tr><td><b>Revision</b></td><td><b>Author</b></td><td><b>Summary</b></td><td><b>Issues Referenced</b></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.4.26.2?view=revision&revision=215942">215942</a></td><td>lmadsen</td><td>Create 1.4.26.2 from 1.4.26.1.</td>
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.4.26.2?view=revision&revision=215947">215947</a></td><td>lmadsen</td><td>Update .version and ChangeLog files.</td>
<td></td></tr><tr><td><a href="http://svn.digium.com/view/asterisk/tags/1.4.26.2?view=revision&revision=215953">215953</a></td><td>lmadsen</td><td>Importing release summary for 1.4.26.2 release.</td>
<td></td></tr></table>
<hr/>
<a name="diffstat"><h2 align="center">Diffstat Results</h2></a>
<center><a href="#top">[Back to Top]</a></center><br/><p>This is a summary of the changes to the source code that went into this release that was generated using the diffstat utility.</p>
<pre>
.version | 2
ChangeLog | 6
asterisk-1.4.26.2-summary.html | 58 +
asterisk-1.4.26.2-summary.txt | 88 ++
channels/chan_iax2.c | 1338 +++++++++++++++++++++++++++++++++++++----
channels/iax2-parser.c | 10
channels/iax2-parser.h | 2
channels/iax2.h | 3
configs/iax.conf.sample | 56 +
include/asterisk/acl.h | 12
include/asterisk/astobj2.h | 10
main/acl.c | 12
main/astobj2.c | 19
13 files changed, 1476 insertions(+), 140 deletions(-)
</pre><br/>
<hr/>
</body>
</html>

View File

@@ -0,0 +1,124 @@
Release Summary
asterisk-1.4.26.2
Date: 2009-09-03
<asteriskteam@digium.com>
----------------------------------------------------------------------
Table of Contents
1. Summary
2. Contributors
3. Closed Issues
4. Other Changes
5. Diffstat
----------------------------------------------------------------------
Summary
[Back to Top]
This release has been made to address one or more security vulnerabilities
that have been identified. A security advisory document has been published
for each vulnerability that includes additional information. Users of
versions of Asterisk that are affected are strongly encouraged to review
the advisories and determine what action they should take to protect their
systems from these issues.
Security Advisories: AST-2009-006
The data in this summary reflects changes that have been made since the
previous release, asterisk-1.4.26.1.
----------------------------------------------------------------------
Contributors
[Back to Top]
This table lists the people who have submitted code, those that have
tested patches, as well as those that reported issues on the issue tracker
that were resolved in this release. For coders, the number is how many of
their patches (of any size) were committed into this release. For testers,
the number is the number of times their name was listed as assisting with
testing a patch. Finally, for reporters, the number is the number of
issues that they reported that were closed by commits that went into this
release.
Coders Testers Reporters
3 lmadsen 1 dbrooks 1 rathaus
1 dvossel 1 dvossel
1 russell
1 tilghman
----------------------------------------------------------------------
Closed Issues
[Back to Top]
This is a list of all issues from the issue tracker that were closed by
changes that went into this release.
Category: Channels/chan_iax2
#12912: An issue with the IAX2 channel allows anonymous connections to
cause resource starvation
Revision: 216015
Reporter: rathaus
Testers: tilghman, russell, dvossel, dbrooks
Coders: dvossel
----------------------------------------------------------------------
Commits Not Associated with an Issue
[Back to Top]
This is a list of all changes that went into this release that did not
directly close an issue from the issue tracker. The commits may have been
marked as being related to an issue. If that is the case, the issue
numbers are listed here, as well.
+------------------------------------------------------------------------+
| Revision | Author | Summary | Issues Referenced |
|----------+---------+-------------------------------+-------------------|
| 215942 | lmadsen | Create 1.4.26.2 from | |
| | | 1.4.26.1. | |
|----------+---------+-------------------------------+-------------------|
| 215947 | lmadsen | Update .version and ChangeLog | |
| | | files. | |
|----------+---------+-------------------------------+-------------------|
| 215953 | lmadsen | Importing release summary for | |
| | | 1.4.26.2 release. | |
+------------------------------------------------------------------------+
----------------------------------------------------------------------
Diffstat Results
[Back to Top]
This is a summary of the changes to the source code that went into this
release that was generated using the diffstat utility.
.version | 2
ChangeLog | 6
asterisk-1.4.26.2-summary.html | 58 +
asterisk-1.4.26.2-summary.txt | 88 ++
channels/chan_iax2.c | 1338 +++++++++++++++++++++++++++++++++++++----
channels/iax2-parser.c | 10
channels/iax2-parser.h | 2
channels/iax2.h | 3
configs/iax.conf.sample | 56 +
include/asterisk/acl.h | 12
include/asterisk/astobj2.h | 10
main/acl.c | 12
main/astobj2.c | 19
13 files changed, 1476 insertions(+), 140 deletions(-)
----------------------------------------------------------------------

242
autoconf/acx_pthread.m4 Normal file
View File

@@ -0,0 +1,242 @@
dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
dnl
dnl @summary figure out how to build C programs using POSIX threads
dnl
dnl This macro figures out how to build C programs using POSIX threads.
dnl It sets the PTHREAD_LIBS output variable to the threads library and
dnl linker flags, and the PTHREAD_CFLAGS output variable to any special
dnl C compiler flags that are needed. (The user can also force certain
dnl compiler flags/libs to be tested by setting these environment
dnl variables.)
dnl
dnl Also sets PTHREAD_CC to any special C compiler that is needed for
dnl multi-threaded programs (defaults to the value of CC otherwise).
dnl (This is necessary on AIX to use the special cc_r compiler alias.)
dnl
dnl NOTE: You are assumed to not only compile your program with these
dnl flags, but also link it with them as well. e.g. you should link
dnl with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
dnl $LIBS
dnl
dnl If you are only building threads programs, you may wish to use
dnl these variables in your default LIBS, CFLAGS, and CC:
dnl
dnl LIBS="$PTHREAD_LIBS $LIBS"
dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
dnl CC="$PTHREAD_CC"
dnl
dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
dnl
dnl ACTION-IF-FOUND is a list of shell commands to run if a threads
dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to
dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the
dnl default action will define HAVE_PTHREAD.
dnl
dnl Please let the authors know if this macro fails on any platform, or
dnl if you have any other suggestions or comments. This macro was based
dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with
dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros
dnl posted by Alejandro Forero Cuervo to the autoconf macro repository.
dnl We are also grateful for the helpful feedback of numerous users.
dnl
dnl @category InstalledPackages
dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
dnl @version 2006-05-29
dnl @license GPLWithACException
AC_DEFUN([ACX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_SAVE
AC_LANG_C
acx_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on True64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
AC_MSG_RESULT($acx_pthread_ok)
if test x"$acx_pthread_ok" = xno; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
fi
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all, and "pthread-config"
# which is a program returning the flags for the Pth emulation library.
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -pthreads: Solaris/gcc
# -mthreads: Mingw32/gcc, Lynx/gcc
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# ... -mt is also the pthreads flag for HP/aCC
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
case "${host_cpu}-${host_os}" in
*solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
;;
esac
if test x"$acx_pthread_ok" = xno; then
for flag in $acx_pthread_flags; do
case $flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $flag])
PTHREAD_CFLAGS="$flag"
;;
pthread-config)
AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
if test x"$acx_pthread_config" = xno; then continue; fi
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$flag])
PTHREAD_LIBS="-l$flag"
;;
esac
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_TRY_LINK([#include <pthread.h>],
[pthread_t th; pthread_join(th, 0);
pthread_attr_init(0); pthread_cleanup_push(0, 0);
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
[acx_pthread_ok=yes])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($acx_pthread_ok)
if test "x$acx_pthread_ok" = xyes; then
break;
fi
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Various other checks:
if test "x$acx_pthread_ok" = xyes; then
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
AC_MSG_CHECKING([for joinable pthread attribute])
attr_name=unknown
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
[attr_name=$attr; break])
done
AC_MSG_RESULT($attr_name)
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
fi
AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no
case "${host_cpu}-${host_os}" in
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
esac
AC_MSG_RESULT(${flag})
if test "x$flag" != xno; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
# More AIX lossage: must compile with xlc_r or cc_r
if test x"$GCC" != xyes; then
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
else
PTHREAD_CC=$CC
fi
else
PTHREAD_CC="$CC"
fi
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_CC)
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$acx_pthread_ok" = xyes; then
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
:
else
acx_pthread_ok=no
$2
fi
AC_LANG_RESTORE
])dnl ACX_PTHREAD

View File

@@ -0,0 +1,31 @@
# AST_C_COMPILE_CHECK can be used for testing for various items in header files
# AST_C_COMPILE_CHECK([package], [expression], [header file], [version], [description])
AC_DEFUN([AST_C_COMPILE_CHECK],
[
if test "x${PBX_$1}" != "x1" -a "${USE_$1}" != "no"; then
if test "x$5" != "x"; then
AC_MSG_CHECKING([for $5])
else
AC_MSG_CHECKING([if "$2" compiles using $3])
fi
saved_cppflags="${CPPFLAGS}"
if test "x${$1_DIR}" != "x"; then
$1_INCLUDE="-I${$1_DIR}/include"
fi
CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM( [#include <$3>],
[ $2; ]
)],
[ AC_MSG_RESULT(yes)
PBX_$1=1
AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])
],
[ AC_MSG_RESULT(no) ]
)
CPPFLAGS="${saved_cppflags}"
fi
])

View File

@@ -0,0 +1,33 @@
# Check if a given macro is defined in a certain header.
# AST_C_DEFINE_CHECK([package], [macro name], [header file], [version])
AC_DEFUN([AST_C_DEFINE_CHECK],
[
if test "x${PBX_$1}" != "x1"; then
AC_MSG_CHECKING([for $2 in $3])
saved_cppflags="${CPPFLAGS}"
if test "x${$1_DIR}" != "x"; then
$1_INCLUDE="-I${$1_DIR}/include"
fi
CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
AC_COMPILE_IFELSE(
[ AC_LANG_PROGRAM( [#include <$3>],
[#if defined($2)
int foo = 0;
#else
int foo = bar;
#endif
0
])],
[ AC_MSG_RESULT(yes)
PBX_$1=1
AC_DEFINE([HAVE_$1], 1, [Define if your system has the $1 headers.])
AC_DEFINE([HAVE_$1_VERSION], $4, [Define $1 headers version])
],
[ AC_MSG_RESULT(no) ]
)
CPPFLAGS="${saved_cppflags}"
fi
AC_SUBST(PBX_$1)
])

View File

@@ -0,0 +1,20 @@
AC_DEFUN([AST_CHECK_GNU_MAKE], [AC_CACHE_CHECK([for GNU make], [ac_cv_GNU_MAKE],
ac_cv_GNU_MAKE='Not Found' ;
ac_cv_GNU_MAKE_VERSION_MAJOR=0 ;
ac_cv_GNU_MAKE_VERSION_MINOR=0 ;
for a in make gmake gnumake ; do
if test -z "$a" ; then continue ; fi ;
if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
ac_cv_GNU_MAKE=$a ;
ac_cv_GNU_MAKE_VERSION_MAJOR=`$ac_cv_GNU_MAKE --version | grep "GNU Make" | cut -f3 -d' ' | cut -f1 -d'.'`
ac_cv_GNU_MAKE_VERSION_MINOR=`$ac_cv_GNU_MAKE --version | grep "GNU Make" | cut -f2 -d'.' | cut -c1-2`
break;
fi
done ;
) ;
if test "x$ac_cv_GNU_MAKE" = "xNot Found" ; then
AC_MSG_ERROR( *** Please install GNU make. It is required to build Asterisk!)
exit 1
fi
AC_SUBST([GNU_MAKE], [$ac_cv_GNU_MAKE])
])

View File

@@ -0,0 +1,130 @@
AC_DEFUN([AST_CHECK_OPENH323], [
OPENH323_INCDIR=
OPENH323_LIBDIR=
AC_LANG_PUSH([C++])
if test "${OPENH323DIR:-unset}" != "unset" ; then
AC_CHECK_HEADER(${OPENH323DIR}/version.h, HAS_OPENH323=1, )
fi
if test "${HAS_OPENH323:-unset}" = "unset" ; then
AC_CHECK_HEADER(${PWLIBDIR}/../openh323/version.h, OPENH323DIR="${PWLIBDIR}/../openh323"; HAS_OPENH323=1, )
if test "${HAS_OPENH323:-unset}" != "unset" ; then
OPENH323DIR="${PWLIBDIR}/../openh323"
saved_cppflags="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} -I${PWLIB_INCDIR}/openh323 -I${PWLIB_INCDIR}"
AC_CHECK_HEADER(${OPENH323DIR}/include/h323.h, , OPENH323_INCDIR="${PWLIB_INCDIR}/openh323"; OPENH323_LIBDIR="${PWLIB_LIBDIR}", [#include <ptlib.h>])
CPPFLAGS="${saved_cppflags}"
else
saved_cppflags="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} -I${HOME}/openh323/include -I${PWLIB_INCDIR}"
AC_CHECK_HEADER(${HOME}/openh323/include/h323.h, HAS_OPENH323=1, , [#include <ptlib.h>])
CPPFLAGS="${saved_cppflags}"
if test "${HAS_OPENH323:-unset}" != "unset" ; then
OPENH323DIR="${HOME}/openh323"
else
saved_cppflags="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} -I/usr/local/include/openh323 -I${PWLIB_INCDIR}"
AC_CHECK_HEADER(/usr/local/include/openh323/h323.h, HAS_OPENH323=1, , [#include <ptlib.h>])
CPPFLAGS="${saved_cppflags}"
if test "${HAS_OPENH323:-unset}" != "unset" ; then
OPENH323DIR="/usr/local/share/openh323"
OPENH323_INCDIR="/usr/local/include/openh323"
if test "x$LIB64" != "x" && test -d "/usr/local/lib64"; then
OPENH323_LIBDIR="/usr/local/lib64"
else
OPENH323_LIBDIR="/usr/local/lib"
fi
else
saved_cppflags="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} -I/usr/include/openh323 -I${PWLIB_INCDIR}"
AC_CHECK_HEADER(/usr/include/openh323/h323.h, HAS_OPENH323=1, , [#include <ptlib.h>])
CPPFLAGS="${saved_cppflags}"
if test "${HAS_OPENH323:-unset}" != "unset" ; then
OPENH323DIR="/usr/share/openh323"
OPENH323_INCDIR="/usr/include/openh323"
if test "x$LIB64" != "x" && test -d "/usr/local/lib64"; then
OPENH323_LIBDIR="/usr/lib64"
else
OPENH323_LIBDIR="/usr/lib"
fi
fi
fi
fi
fi
fi
if test "${HAS_OPENH323:-unset}" != "unset" ; then
if test "${OPENH323_INCDIR:-unset}" = "unset"; then
OPENH323_INCDIR="${OPENH323DIR}/include"
fi
if test "${OPENH323_LIBDIR:-unset}" = "unset"; then
OPENH323_LIBDIR="${OPENH323DIR}/lib"
fi
OPENH323_LIBDIR="`cd ${OPENH323_LIBDIR}; pwd`"
OPENH323_INCDIR="`cd ${OPENH323_INCDIR}; pwd`"
OPENH323DIR="`cd ${OPENH323DIR}; pwd`"
AC_SUBST([OPENH323DIR])
AC_SUBST([OPENH323_INCDIR])
AC_SUBST([OPENH323_LIBDIR])
fi
AC_LANG_POP([C++])
])
AC_DEFUN([AST_CHECK_OPENH323_BUILD], [
if test "${HAS_OPENH323:-unset}" != "unset"; then
AC_MSG_CHECKING(OpenH323 build option)
OPENH323_SUFFIX=
prefixes="h323_${PWLIB_PLATFORM}_ h323_ openh323"
for pfx in $prefixes; do
files=`ls -l ${OPENH323_LIBDIR}/lib${pfx}*.so* 2>/dev/null`
if test -z "$files"; then
# check the default location
files=`ls -l /usr/local/lib/lib${pfx}*.so* 2>/dev/null`
fi
libfile=
if test -n "$files"; then
for f in $files; do
if test -f $f -a ! -L $f; then
libfile=`basename $f`
break;
fi
done
fi
if test -n "$libfile"; then
OPENH323_PREFIX=$pfx
break;
fi
done
if test "${libfile:-unset}" != "unset"; then
OPENH323_SUFFIX=`eval "echo ${libfile} | sed -e 's/lib${OPENH323_PREFIX}\(@<:@^.@:>@*\)\..*/\1/'"`
fi
case "${OPENH323_SUFFIX}" in
n)
OPENH323_BUILD="notrace";;
r)
OPENH323_BUILD="opt";;
d)
OPENH323_BUILD="debug";;
*)
if test "${OPENH323_PREFIX:-undef}" = "openh323"; then
notrace=`eval "grep NOTRACE ${OPENH323DIR}/openh323u.mak | grep = | sed -e 's/@<:@A-Z0-9_@:>@*@<:@ @:>@*=@<:@ @:>@*//'"`
if test "x$notrace" = "x"; then
notrace="0"
fi
if test "$notrace" -ne 0; then
OPENH323_BUILD="notrace"
else
OPENH323_BUILD="opt"
fi
OPENH323_LIB="-l${OPENH323_PREFIX}"
else
OPENH323_BUILD="notrace"
fi
;;
esac
AC_MSG_RESULT(${OPENH323_BUILD})
AC_SUBST([OPENH323_SUFFIX])
AC_SUBST([OPENH323_BUILD])
fi
])

264
autoconf/ast_check_pwlib.m4 Normal file
View File

@@ -0,0 +1,264 @@
AC_DEFUN([AST_CHECK_PWLIB_PLATFORM], [
PWLIB_OSTYPE=
case "$host_os" in
linux*) PWLIB_OSTYPE=linux ;
;;
freebsd* ) PWLIB_OSTYPE=FreeBSD ;
;;
openbsd* ) PWLIB_OSTYPE=OpenBSD ;
ENDLDLIBS="-lossaudio" ;
;;
netbsd* ) PWLIB_OSTYPE=NetBSD ;
ENDLDLIBS="-lossaudio" ;
;;
solaris* | sunos* ) PWLIB_OSTYPE=solaris ;
;;
darwin* ) PWLIB_OSTYPE=Darwin ;
;;
beos*) PWLIB_OSTYPE=beos ;
STDCCFLAGS="$STDCCFLAGS -D__BEOS__"
;;
cygwin*) PWLIB_OSTYPE=cygwin ;
;;
mingw*) PWLIB_OSTYPE=mingw ;
STDCCFLAGS="$STDCCFLAGS -mms-bitfields" ;
ENDLDLIBS="-lwinmm -lwsock32 -lsnmpapi -lmpr -lcomdlg32 -lgdi32 -lavicap32" ;
;;
* ) PWLIB_OSTYPE="$host_os" ;
AC_MSG_WARN("OS $PWLIB_OSTYPE not recognized - proceed with caution!") ;
;;
esac
PWLIB_MACHTYPE=
case "$host_cpu" in
x86 | i686 | i586 | i486 | i386 ) PWLIB_MACHTYPE=x86
;;
x86_64) PWLIB_MACHTYPE=x86_64 ;
P_64BIT=1 ;
LIB64=1 ;
;;
alpha | alphaev56 | alphaev6 | alphaev67 | alphaev7) PWLIB_MACHTYPE=alpha ;
P_64BIT=1 ;
;;
sparc ) PWLIB_MACHTYPE=sparc ;
;;
powerpc ) PWLIB_MACHTYPE=ppc ;
;;
ppc ) PWLIB_MACHTYPE=ppc ;
;;
powerpc64 ) PWLIB_MACHTYPE=ppc64 ;
P_64BIT=1 ;
LIB64=1 ;
;;
ppc64 ) PWLIB_MACHTYPE=ppc64 ;
P_64BIT=1 ;
LIB64=1 ;
;;
ia64) PWLIB_MACHTYPE=ia64 ;
P_64BIT=1 ;
;;
s390x) PWLIB_MACHTYPE=s390x ;
P_64BIT=1 ;
LIB64=1 ;
;;
s390) PWLIB_MACHTYPE=s390 ;
;;
* ) PWLIB_MACHTYPE="$host_cpu";
AC_MSG_WARN("CPU $PWLIB_MACHTYPE not recognized - proceed with caution!") ;;
esac
PWLIB_PLATFORM="${PWLIB_OSTYPE}_${PWLIB_MACHTYPE}"
AC_SUBST([PWLIB_PLATFORM])
])
AC_DEFUN([AST_CHECK_PWLIB], [
PWLIB_INCDIR=
PWLIB_LIBDIR=
AC_LANG_PUSH([C++])
if test "${PWLIBDIR:-unset}" != "unset" ; then
AC_CHECK_HEADER(${PWLIBDIR}/version.h, HAS_PWLIB=1, )
fi
if test "${HAS_PWLIB:-unset}" = "unset" ; then
if test "${OPENH323DIR:-unset}" != "unset"; then
AC_CHECK_HEADER(${OPENH323DIR}/../pwlib/version.h, HAS_PWLIB=1, )
fi
if test "${HAS_PWLIB:-unset}" != "unset" ; then
PWLIBDIR="${OPENH323DIR}/../pwlib"
else
AC_CHECK_HEADER(${HOME}/pwlib/include/ptlib.h, HAS_PWLIB=1, )
if test "${HAS_PWLIB:-unset}" != "unset" ; then
PWLIBDIR="${HOME}/pwlib"
else
AC_CHECK_HEADER(/usr/local/include/ptlib.h, HAS_PWLIB=1, )
if test "${HAS_PWLIB:-unset}" != "unset" ; then
AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/bin$PATH_SEPARATOR/usr/local/share/pwlib/make)
PWLIB_INCDIR="/usr/local/include"
PWLIB_LIBDIR=`${PTLIB_CONFIG} --pwlibdir 2>/dev/null`
if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
PWLIB_LIBDIR=`${PTLIB_CONFIG} --ptlibdir 2>/dev/null`
fi
if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
if test "x$LIB64" != "x"; then
PWLIB_LIBDIR="/usr/local/lib64"
else
PWLIB_LIBDIR="/usr/local/lib"
fi
fi
PWLIB_LIB=`${PTLIB_CONFIG} --ldflags --libs`
PWLIB_LIB="-L${PWLIB_LIBDIR} `echo ${PWLIB_LIB}`"
else
AC_CHECK_HEADER(/usr/include/ptlib.h, HAS_PWLIB=1, )
if test "${HAS_PWLIB:-unset}" != "unset" ; then
AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/bin$PATH_SEPARATOR/usr/share/pwlib/make)
PWLIB_INCDIR="/usr/include"
PWLIB_LIBDIR=`${PTLIB_CONFIG} --pwlibdir 2>/dev/null`
if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
PWLIB_LIBDIR=`${PTLIB_CONFIG} --ptlibdir 2>/dev/null`
fi
if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
if test "x$LIB64" != "x"; then
PWLIB_LIBDIR="/usr/lib64"
else
PWLIB_LIBDIR="/usr/lib"
fi
fi
PWLIB_LIB=`${PTLIB_CONFIG} --ldflags --libs`
PWLIB_LIB="-L${PWLIB_LIBDIR} `echo ${PWLIB_LIB}`"
fi
fi
fi
fi
fi
#if test "${HAS_PWLIB:-unset}" = "unset" ; then
# echo "Cannot find pwlib - please install or set PWLIBDIR and try again"
# exit
#fi
if test "${HAS_PWLIB:-unset}" != "unset" ; then
if test "${PWLIBDIR:-unset}" = "unset" ; then
if test "${PTLIB_CONFIG:-unset}" != "unset" ; then
PWLIBDIR=`$PTLIB_CONFIG --prefix`
else
echo "Cannot find ptlib-config - please install and try again"
exit
fi
fi
if test "x$PWLIBDIR" = "x/usr" -o "x$PWLIBDIR" = "x/usr/"; then
PWLIBDIR="/usr/share/pwlib"
PWLIB_INCDIR="/usr/include"
if test "x$LIB64" != "x"; then
PWLIB_LIBDIR="/usr/lib64"
else
PWLIB_LIBDIR="/usr/lib"
fi
fi
if test "x$PWLIBDIR" = "x/usr/local" -o "x$PWLIBDIR" = "x/usr/"; then
PWLIBDIR="/usr/local/share/pwlib"
PWLIB_INCDIR="/usr/local/include"
if test "x$LIB64" != "x"; then
PWLIB_LIBDIR="/usr/local/lib64"
else
PWLIB_LIBDIR="/usr/local/lib"
fi
fi
if test "${PWLIB_INCDIR:-unset}" = "unset"; then
PWLIB_INCDIR="${PWLIBDIR}/include"
fi
if test "${PWLIB_LIBDIR:-unset}" = "unset"; then
PWLIB_LIBDIR="${PWLIBDIR}/lib"
fi
AC_SUBST([PWLIBDIR])
AC_SUBST([PWLIB_INCDIR])
AC_SUBST([PWLIB_LIBDIR])
fi
AC_LANG_POP([C++])
])
AC_DEFUN([AST_CHECK_PWLIB_VERSION], [
if test "x$7" != "x"; then
VNAME="$7"
else
VNAME="$2_VERSION"
fi
if test "${HAS_$2:-unset}" != "unset"; then
$2_VERSION=`grep "$VNAME" ${$2_INCDIR}/$3 | sed -e 's/[[[:space:]]]\{1,\}/ /g' | cut -f3 -d ' ' | sed -e 's/"//g'`
$2_MAJOR_VERSION=`echo ${$2_VERSION} | cut -f1 -d.`
$2_MINOR_VERSION=`echo ${$2_VERSION} | cut -f2 -d.`
$2_BUILD_NUMBER=`echo ${$2_VERSION} | cut -f3 -d.`
let $2_VER=${$2_MAJOR_VERSION}*10000+${$2_MINOR_VERSION}*100+${$2_BUILD_NUMBER}
let $2_REQ=$4*10000+$5*100+$6
AC_MSG_CHECKING(if $1 version ${$2_VERSION} is compatible with chan_h323)
if test ${$2_VER} -lt ${$2_REQ}; then
AC_MSG_RESULT(no)
unset HAS_$2
else
AC_MSG_RESULT(yes)
fi
fi
])
AC_DEFUN([AST_CHECK_PWLIB_BUILD], [
if test "${HAS_$2:-unset}" != "unset"; then
AC_MSG_CHECKING($1 installation validity)
saved_cppflags="${CPPFLAGS}"
saved_libs="${LIBS}"
if test "${$2_LIB:-unset}" != "unset"; then
LIBS="${LIBS} ${$2_LIB} $7"
else
LIBS="${LIBS} -L${$2_LIBDIR} -l${PLATFORM_$2} $7"
fi
CPPFLAGS="${CPPFLAGS} -I${$2_INCDIR} $6"
AC_LANG_PUSH([C++])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([$4],[$5])],
[ AC_MSG_RESULT(yes)
ac_cv_lib_$2="yes"
],
[ AC_MSG_RESULT(no)
ac_cv_lib_$2="no"
]
)
AC_LANG_POP([C++])
LIBS="${saved_libs}"
CPPFLAGS="${saved_cppflags}"
if test "${ac_cv_lib_$2}" = "yes"; then
if test "${$2_LIB:-undef}" = "undef"; then
if test "${$2_LIBDIR}" != "" -a "${$2_LIBDIR}" != "/usr/lib"; then
$2_LIB="-L${$2_LIBDIR} -l${PLATFORM_$2}"
else
$2_LIB="-l${PLATFORM_$2}"
fi
fi
if test "${$2_INCDIR}" != "" -a "${$2_INCDIR}" != "/usr/include"; then
$2_INCLUDE="-I${$2_INCDIR}"
fi
PBX_$2=1
AC_DEFINE([HAVE_$2], 1, [$3])
fi
fi
])

82
autoconf/ast_ext_lib.m4 Normal file
View File

@@ -0,0 +1,82 @@
# AST_EXT_LIB_SETUP([package symbol name], [package friendly name], [package option name], [additional help text])
AC_DEFUN([AST_EXT_LIB_SETUP],
[
$1_DESCRIP="$2"
$1_OPTION="$3"
AC_ARG_WITH([$3], AC_HELP_STRING([--with-$3=PATH],[use $2 files in PATH $4]),[
case ${withval} in
n|no)
USE_$1=no
;;
y|ye|yes)
$1_MANDATORY="yes"
;;
*)
$1_DIR="${withval}"
$1_MANDATORY="yes"
;;
esac
])
PBX_$1=0
AC_SUBST([$1_LIB])
AC_SUBST([$1_INCLUDE])
AC_SUBST([$1_DIR])
AC_SUBST([PBX_$1])
])
# AST_EXT_LIB_CHECK([package symbol name], [package library name], [function to check], [package header], [additional LIB data], [additional INCLUDE data])
AC_DEFUN([AST_EXT_LIB_CHECK],
[
if test "${USE_$1}" != "no"; then
pbxlibdir=""
if test "x${$1_DIR}" != "x"; then
if test -d ${$1_DIR}/lib; then
pbxlibdir="-L${$1_DIR}/lib"
else
pbxlibdir="-L${$1_DIR}"
fi
fi
AC_CHECK_LIB([$2], [$3], [AST_$1_FOUND=yes], [AST_$1_FOUND=no], ${pbxlibdir} $5)
if test "${AST_$1_FOUND}" = "yes"; then
$1_LIB="-l$2 $5"
$1_HEADER_FOUND="1"
if test "x${$1_DIR}" != "x"; then
$1_LIB="${pbxlibdir} ${$1_LIB}"
$1_INCLUDE="-I${$1_DIR}/include"
fi
$1_INCLUDE="${$1_INCLUDE} $6"
saved_cppflags="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
if test "x$4" != "x" ; then
AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
fi
CPPFLAGS="${saved_cppflags}"
if test "x${$1_HEADER_FOUND}" = "x0" ; then
if test -n "${$1_MANDATORY}" ;
then
AC_MSG_NOTICE([***])
AC_MSG_NOTICE([*** It appears that you do not have the $2 development package installed.])
AC_MSG_NOTICE([*** Please install it to include ${$1_DESCRIP} support, or re-run configure])
AC_MSG_NOTICE([*** without explicitly specifying --with-${$1_OPTION}])
exit 1
fi
$1_LIB=""
$1_INCLUDE=""
PBX_$1=0
else
PBX_$1=1
AC_DEFINE_UNQUOTED([HAVE_$1], 1, [Define to indicate the ${$1_DESCRIP} library])
fi
elif test -n "${$1_MANDATORY}";
then
AC_MSG_NOTICE([***])
AC_MSG_NOTICE([*** The ${$1_DESCRIP} installation on this system appears to be broken.])
AC_MSG_NOTICE([*** Either correct the installation, or run configure])
AC_MSG_NOTICE([*** without explicitly specifying --with-${$1_OPTION}])
exit 1
fi
fi
])

61
autoconf/ast_func_fork.m4 Normal file
View File

@@ -0,0 +1,61 @@
# AST_FUNC_FORK
# -------------
AN_FUNCTION([fork], [AST_FUNC_FORK])
AN_FUNCTION([vfork], [AST_FUNC_FORK])
AC_DEFUN([AST_FUNC_FORK],
[AC_REQUIRE([AC_TYPE_PID_T])dnl
AC_CHECK_HEADERS(vfork.h)
AC_CHECK_FUNCS(fork vfork)
if test "x$ac_cv_func_fork" = xyes; then
_AST_FUNC_FORK
else
ac_cv_func_fork_works=$ac_cv_func_fork
fi
if test "x$ac_cv_func_fork_works" = xcross; then
case $host in
*-*-amigaos* | *-*-msdosdjgpp* | *-*-uclinux* | *-*-linux-uclibc* )
# Override, as these systems have only a dummy fork() stub
ac_cv_func_fork_works=no
;;
*)
ac_cv_func_fork_works=yes
;;
esac
AC_MSG_WARN([result $ac_cv_func_fork_works guessed because of cross compilation])
fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
if test "x$ac_cv_func_vfork" = xyes; then
_AC_FUNC_VFORK
fi;
if test "x$ac_cv_func_fork_works" = xcross; then
ac_cv_func_vfork_works=$ac_cv_func_vfork
AC_MSG_WARN([result $ac_cv_func_vfork_works guessed because of cross compilation])
fi
if test "x$ac_cv_func_vfork_works" = xyes; then
AC_DEFINE(HAVE_WORKING_VFORK, 1, [Define to 1 if `vfork' works.])
else
AC_DEFINE(vfork, fork, [Define as `fork' if `vfork' does not work.])
fi
if test "x$ac_cv_func_fork_works" = xyes; then
AC_DEFINE(HAVE_WORKING_FORK, 1, [Define to 1 if `fork' works.])
PBX_WORKING_FORK=1
AC_SUBST(PBX_WORKING_FORK)
fi
])# AST_FUNC_FORK
# _AST_FUNC_FORK
# -------------
AC_DEFUN([_AST_FUNC_FORK],
[AC_CACHE_CHECK(for working fork, ac_cv_func_fork_works,
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[
/* By Ruediger Kuhlmann. */
return fork () < 0;
])],
[ac_cv_func_fork_works=yes],
[ac_cv_func_fork_works=no],
[ac_cv_func_fork_works=cross])])]
)# _AST_FUNC_FORK

View File

@@ -0,0 +1,16 @@
# AST_GCC_ATTRIBUTE([attribute name])
AC_DEFUN([AST_GCC_ATTRIBUTE],
[
AC_MSG_CHECKING(for compiler 'attribute $1' support)
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror"
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM([static void __attribute__(($1)) *test(void *muffin, ...) {}],
[]),
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]),
AC_MSG_RESULT(no))
]
CFLAGS="$saved_CFLAGS"
)

View File

@@ -0,0 +1,11 @@
# AST_PROG_EGREP
# -------------
m4_ifndef([AST_PROG_EGREP], [AC_DEFUN([AST_PROG_EGREP],
[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
[if echo a | (grep -E '(a|b)') >/dev/null 2>&1
then ac_cv_prog_egrep='grep -E'
else ac_cv_prog_egrep='egrep'
fi])
EGREP=$ac_cv_prog_egrep
AC_SUBST([EGREP])
])]) # AST_PROG_EGREP

Some files were not shown because too many files have changed in this diff Show More