aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_dahdi.c
AgeCommit message (Collapse)AuthorFilesLines
2009-12-02Do not modify the gain settings on data calls.jpeeler1-1/+5
(The digital flag actually represents a data call.) (closes issue #15972) Reported by: udosw Patches: transcap_digital_fix.diff.txt uploaded by alecdavis (license 585) Tested by: alecdavis git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@232090 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-03Make sure the outgoing flag is cleared if a new channel fails to get created ↵rmudgett1-0/+3
for outgoing calls. This is the relevant portion of asterisk/trunk -r226648 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@227275 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-17Fix stale caller id data from being reported in AMI NewChannel eventjpeeler1-2/+9
The problem here is that chan_dahdi is designed in such a way to set certain values in the dahdi_pvt only once. One of those such values is the configured caller id data in chan_dahdi.conf. For PRI, the configured caller id data could be overwritten during a call. Instead of saving the data and restoring, it was decided that for all non-analog channels it was simply best to not set the configured caller id in the first place and also clear it at the end of the call. (closes issue #15883) Reported by: jsmith git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@224330 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-16Never released PRI channels when using Busy() or Congestion() dialplan apps.rmudgett1-4/+12
When the Busy() or Congestion() application is used towards ISDN (an ISDN progress is sent), the responding ISDN Disconnect or Release may contain the ISDN cause user busy or one of the congestion causes. In chan_dahdi.c these causes will only set the needbusy or needcongestion flags and not activate the softhangup procedure. Unfortunately only the latter can interrupt the endless wait loop of Busy()/Congestion(). Result: PRI channels staying in state busy for the rest of asterisk life or until the other end times out and forces the call to clear. (in issue 0014292) Reported by: tomaso Patches: disc_rel_userbusy.patch uploaded by tomaso (license 564) (This patch is unrelated to the issue.) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@224260 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-13Fix PRI timer T309 operationjeang1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@223955 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-06Add missing unlock(s) in dahdi_readjpeeler1-1/+4
(two cases in trunk) (closes issue #15683) Reported by: alecdavis git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@222462 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-06Fix potential crash when entire span request is received.jpeeler1-2/+2
The variable index used in this scenario for accessing the dahdi_pvts was wrong and was most likely copied from the several other places it is used correctly. (closes issue #15998) Reported by: tsearle Patches: dahdi_reset_crash.patch uploaded by tsearle (license 373) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@222393 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-15Fix small memory leak in handle_init_event by always destroying the pthreadjpeeler1-0/+3
attr before returning. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@218623 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-14Fix handling of DAHDI_EVENT_REMOVED event to prevent crash in do_monitor.jpeeler1-16/+25
After talking to rmudgett about some of his recent iflist locking changes, it was determined that the only place that would destroy a channel without being explicitly to do so was in handle_init_event. The loop to walk the interface list has been modified to wait to destroy the channel until the dahdi_pvt of the channel to be destroyed is no longer needed. (closes issue #15378) Reported by: samy git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@218401 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-17Fix uninitialized variable.rmudgett1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@212430 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-10AST-2009-005tilghman1-17/+17
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@211528 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-05Dialplan starts execution before the channel setup is complete.rmudgett1-45/+59
* 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: http://svn.digium.com/svn/asterisk/branches/1.4@210575 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-03Fixes dialplan wildcard extension taking precedence over call pickup code.dbrooks1-29/+29
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: http://svn.digium.com/svn/asterisk/branches/1.4@210067 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-23Only set the priindication setting when not performing a reloadjpeeler1-1/+1
(closes issue #14696) Reported by: fdecher git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@208380 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-21Wait for wink before dialing when using E&M wink signalingjpeeler1-3/+3
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: http://svn.digium.com/svn/asterisk/branches/1.4@207827 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-21Revert r207573, this approach could potentially block for an unacceptable jpeeler1-55/+1
amount of time. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@207786 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-20Wait for wink before dialing when using E&M wink signalingjpeeler1-1/+55
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: http://svn.digium.com/svn/asterisk/branches/1.4@207573 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-17Fix format specifier to print out an unsigned long long.jpeeler1-1/+1
Yep, it's even ifdefed out code. But it made it to the RR list... (closes issue #14726) Reported by: lmadsen git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@207155 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-17Enhance configuration option for overlapdial allowing direction choicejpeeler1-11/+29
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: http://svn.digium.com/svn/asterisk/branches/1.4@207092 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-09No audio on calls from Asterisk to various ISDN devices until DTMF sent by ↵rmudgett1-0/+1
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: http://svn.digium.com/svn/asterisk/branches/1.4@205728 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-27The ISDN CPE side should not exclusively pick B channels normally.rmudgett1-8/+5
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: http://svn.digium.com/svn/asterisk/branches/1.4@203908 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-26Make sure to recreate the dahdi pseudo channel after dahdi restartjpeeler1-1/+1
(closes issue #14477) Reported by: timking git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@203848 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-24Improved chan_dahdi.conf pritimer error checking.rmudgett1-15/+26
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: http://svn.digium.com/svn/asterisk/branches/1.4@203036 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-17Fix a situation where the DAHDI channel private structure lock was not ↵file1-0/+1
unlocked when it should have been. (issue AST-210) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@188937 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-15National prefix inserted even when caller ID not availabledvossel1-0/+7
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: http://svn.digium.com/svn/asterisk/branches/1.4@188646 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-10Support "signaling" in addition to "signalling".russell1-2/+2
The sample configuration file has references to both spellings. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@187865 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-03Fix a bug where DAHDI/Zaptel channels would not properly switch formats when ↵kpfleming1-1/+1
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: http://svn.digium.com/svn/asterisk/branches/1.4@186458 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-02ensure that the buffer passed to DAHDI_SET_BUFINFO is fully initializedkpfleming1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@186081 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-02the DAHDI_GETCONF, DAHDI_SETCONF and DAHDI_GET_PARAMS ioctls were recently ↵kpfleming1-11/+19
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: http://svn.digium.com/svn/asterisk/branches/1.4@185952 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-19Reordering, to change prior to unlockingtilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@183342 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-19Delay signalling progress until a PRI channel really signals progress.tilghman1-0/+9
(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: http://svn.digium.com/svn/asterisk/branches/1.4@183319 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18fix another symbol namespace issue (reported by Andrew on asterisk-dev)kpfleming1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@182882 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-17Allow dahdichanname to work as advertised.qwell1-1/+1
(closes issue #14056) Reported by: dsedivec Patches: load_from_zapata_conf.patch uploaded by dsedivec (license 638) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@182652 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-03Make sure we still support zapchan in users.conf, in addition to dahdichan.qwell1-3/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@180010 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-02channels/chan_dahdi.crmudgett1-35/+359
* 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: http://svn.digium.com/svn/asterisk/branches/1.4@172962 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-28Clarify log message (suggested by manxpower on #asterisk-dev)tilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@171963 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-22Fix a deadlock relating to channel locks and autoservicemmichelson1-1/+12
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: http://svn.digium.com/svn/asterisk/branches/1.4@166380 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-19(closes issue #13480)jpeeler1-42/+10
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: http://svn.digium.com/svn/asterisk/branches/1.4@165991 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-22(closes issue #13786)jpeeler1-1/+1
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: http://svn.digium.com/svn/asterisk/branches/1.4@158629 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-03somehow missed a bunch of gcc 4.3.x warnings in this branch on the first passkpfleming1-1/+3
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@153823 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-01fix a bunch of potential problems found by gcc 4.3.x, primarily bare strings ↵kpfleming1-4/+10
being passed to printf()-like functions and ignored results from read()/write() and friends git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@153337 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-27Buffer policy setting for half is not needed.jpeeler1-2/+0
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@152286 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-17Correctly allow chan_dahdi to compile against older versions of Zaptel.qwell1-2/+2
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: http://svn.digium.com/svn/asterisk/branches/1.4@150557 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-08when parsing a text configuration option, ensure that the buffer on the ↵kpfleming1-2/+3
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: http://svn.digium.com/svn/asterisk/branches/1.4@147681 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-07revert this change until i can understand why it results in locking order ↵kpfleming1-20/+14
changes git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@147430 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-07don't start a PBX on incoming PRI call channels until after we're done ↵kpfleming1-14/+20
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: http://svn.digium.com/svn/asterisk/branches/1.4@147429 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-06ensure that the private structure for pseudo channels is created without ↵kpfleming1-7/+6
'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: http://svn.digium.com/svn/asterisk/branches/1.4@146643 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-26add HAVE_PRI if define around dahdi_close_pri_fdjpeeler1-1/+3
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@140115 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-26(closes issue #12071)jpeeler1-58/+31
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: http://svn.digium.com/svn/asterisk/branches/1.4@140056 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-26correct a file location in an error messagekpfleming1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@140029 f38db490-d61c-443f-a65b-d21fe96a405b