Commit Graph

4548 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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