2005-06-02 18:47:35 +00:00
|
|
|
(CAPI*) chan_capi a Common ISDN API 2.0 implementation for Asterisk
|
|
|
|
|
|
|
|
Copyright (C) 2005 Cytronics & Melware
|
|
|
|
Armin Schindler <armin@melware.de>
|
|
|
|
|
|
|
|
Reworked, but based on the work of
|
|
|
|
Copyright (C) 2002-2005 Junghanns.NET GmbH
|
|
|
|
Klaus-Peter Junghanns <kpj@junghanns.net>
|
|
|
|
|
|
|
|
This program is free software and may be modified and distributed under
|
|
|
|
the terms of the GNU Public License. There is _NO_ warranty for this!
|
|
|
|
|
|
|
|
Thanks go to the debuggers and bugfixers (listed in chronological order) :)
|
|
|
|
===========================================================================
|
|
|
|
Lele Forzani <lele@windmill.it>
|
|
|
|
Florian Overkamp <florian@obsimref.com>
|
|
|
|
Gareth Watts <gareth@omnipotent.net>
|
|
|
|
Jeff Noxon <jeff@planetfall.com>
|
|
|
|
Petr Michalek <petr.michalek@aca.cz>
|
|
|
|
Jan Stocker
|
2005-06-04 14:28:52 +00:00
|
|
|
Frank Sautter, levigo group
|
|
|
|
|
2005-06-02 18:47:35 +00:00
|
|
|
(...and all the others that i forgot..) :-)
|
|
|
|
|
|
|
|
This chan_capi version includes:
|
|
|
|
================================
|
|
|
|
|
2005-06-07 04:26:12 +00:00
|
|
|
- Multiple controller support
|
2005-06-02 18:47:35 +00:00
|
|
|
- CID,DNID (callling party, called party)
|
|
|
|
- CLIR/CLIP
|
2005-06-07 04:26:12 +00:00
|
|
|
- Supplementary services, CD,HOLD,RETRIEVE,ECT
|
2005-06-02 18:47:35 +00:00
|
|
|
- DTMF (dependend on card) + software DTMF support
|
2005-06-07 04:26:12 +00:00
|
|
|
- Early B3 connects (always,success,never)
|
|
|
|
- Digital audio (what did you think?)
|
|
|
|
- Incoming/outgoing calls
|
2005-07-17 19:01:14 +00:00
|
|
|
- Overlap sending (dialtone and additional digits)
|
2005-06-07 04:26:12 +00:00
|
|
|
- E(xplicit) C(all) T(ransfer) (...although it's done implicit-but don't tell!)
|
|
|
|
- Tuneable latency: you can configure the size of B3 blocks at compile time
|
2005-06-02 18:47:35 +00:00
|
|
|
(in chan_capi_pvt.h, AST_CAPI_MAX_B3_BLOCK_SIZE)
|
2005-06-07 04:26:12 +00:00
|
|
|
The default is 160 samples, for non-VoIP use you can tune it down to 130
|
|
|
|
- Use asterisks internal DSP functions for DTMF
|
|
|
|
- Alaw support
|
|
|
|
- Ulaw support!
|
2005-06-02 18:47:35 +00:00
|
|
|
- Eicon CAPI echo cancelation (echocancel=1)
|
2005-06-07 04:26:12 +00:00
|
|
|
- Reject call waiting (ACO)
|
2005-06-02 18:47:35 +00:00
|
|
|
- DID for Point to Point mode (a.k.a overlap receiving)
|
2005-06-07 04:26:12 +00:00
|
|
|
- Rx/Tx gains (rxgain=1.0)
|
|
|
|
- Call deflection on circuit busy (deflect=12345678)
|
|
|
|
- (Inter)national dialing prefix (for callerid) configurable in capi.conf
|
|
|
|
- CLI command "capi info" shows B channel status of chan_capi
|
|
|
|
- CapiECT will announce the callerID since it gets lost on most isdn pbxes
|
|
|
|
The called party can press # to drop the call
|
|
|
|
- Catch all MSN (incomingmsn=*)
|
|
|
|
- Some configuration enhancements (msn=123,124,125 and controller=1,2,3,4)
|
|
|
|
- Added accountcode=
|
|
|
|
- Echo squelching (echosquelch=1)
|
|
|
|
- Callgroup support
|
2005-07-17 19:01:14 +00:00
|
|
|
- report correct DIALSTATUS and HANGUPCAUSE.
|
2005-06-07 04:26:12 +00:00
|
|
|
- Updated to support the new frame->delivery field
|
|
|
|
- Compiles with different Asterisk versions (automatic build configuration)
|
|
|
|
- Added app_capiNoES for disabling the primitive echo suppressor, use this
|
|
|
|
before you start recording voicemail or your files may get choppy
|
|
|
|
- Added app_capiFax to receive faxes over CAPI (see below)
|
2005-07-17 19:01:14 +00:00
|
|
|
- Fixes for BSD (Jan Stocker)
|
2005-06-02 18:47:35 +00:00
|
|
|
|
2005-07-17 19:01:14 +00:00
|
|
|
The Dial string
|
|
|
|
===============
|
|
|
|
|
|
|
|
Example: Dial(CAPI/g<group>/<destination>[/<params>])
|
|
|
|
Or: Dial(CAPI/contr<controller>/<destination>[/<params>])
|
2005-07-03 12:15:14 +00:00
|
|
|
|
|
|
|
'group' can be a value, comma separated list of values or a range
|
|
|
|
using '-'. The according interface is found by searching a match with
|
|
|
|
the 'group' specified in the capi.conf for each interface.
|
|
|
|
|
2005-07-17 19:01:14 +00:00
|
|
|
'params' is an optional part to set special settings for this call.
|
|
|
|
The string consists of a list of characters with the following meaning:
|
|
|
|
'b' : early B3 always.
|
|
|
|
'B' : early B3 on successful calls only.
|
|
|
|
'o' : use overlap sending of number if number is longer than 2 digits
|
|
|
|
(This is useful, when further digits shall be send to complete the
|
|
|
|
destination address).
|
|
|
|
|
|
|
|
CLIP/CLIR uses the calling presentation of the calling channel, which can
|
|
|
|
be modified using the SetCallerPres() application. Use
|
|
|
|
SetCallerPres(prohib_not_screened) for CLIR. That is why the msn= param in
|
|
|
|
capi.conf has been removed. The callerID is also taken from the calling channel.
|
2005-06-02 18:47:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
Helper applications
|
|
|
|
===================
|
2005-06-07 04:26:12 +00:00
|
|
|
Kapejod says: "No No No, don't use those yet....!" (except maybe HOLD,ECT...)
|
2005-06-02 18:47:35 +00:00
|
|
|
|
2005-06-07 04:26:12 +00:00
|
|
|
app_capiCD.c
|
|
|
|
Forwards an unanswered call to another phone (does not rely on sservice CD)
|
|
|
|
Example:
|
|
|
|
exten => s,1,Wait,1
|
|
|
|
exten => s,2,capiCD,12345678
|
2005-06-02 18:47:35 +00:00
|
|
|
|
2005-06-07 04:26:12 +00:00
|
|
|
app_capiHOLD.c
|
|
|
|
Puts an answered call on hold, this has nothing to do with asterisk's onhold
|
|
|
|
thingie (music et al)
|
|
|
|
After putting a call onhold, never use the Wait application!
|
2005-06-02 18:47:35 +00:00
|
|
|
|
2005-06-07 04:26:12 +00:00
|
|
|
app_capiRETRIEVE.c
|
|
|
|
Gets the holded call back
|
2005-06-02 18:47:35 +00:00
|
|
|
|
2005-06-07 04:26:12 +00:00
|
|
|
app_capiECT.c
|
|
|
|
Explicit call transfer of the call on hold (must put call on hold first!)
|
|
|
|
Example:
|
|
|
|
exten => s,1,Answer
|
|
|
|
exten => s,2,capiHOLD
|
|
|
|
exten => s,3,capiECT,55:50
|
|
|
|
Will ECT the call to 50 using 55 as the callerid/outgoing MSN
|
2005-06-02 18:47:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
Using CLIR
|
|
|
|
==========
|
2005-07-13 15:07:31 +00:00
|
|
|
Use the SetCallerPres() application before you dial:
|
|
|
|
exten => _X.,1,SetCallerPres(prohib_not_screened)
|
|
|
|
exten => _X.,2,Dial(CAPI/contr1/${EXTEN})
|
|
|
|
|
2005-06-02 18:47:35 +00:00
|
|
|
|
|
|
|
Enjoying early B3 connects (inband call progress, tones and announcements)
|
|
|
|
==========================================================================
|
2005-07-17 19:01:14 +00:00
|
|
|
Early B3 is configurable in the dialstring parameters.
|
|
|
|
If you set a 'b', early B3 will always be used, also if the call fails,
|
|
|
|
because the number is unprovisioned, etc ...
|
|
|
|
If you set a 'B', early B3 will only be used on successful calls,
|
2005-06-07 04:26:12 +00:00
|
|
|
giving you ring indication,etc...
|
|
|
|
|
|
|
|
Don't use indications in the Dial command, your local exchange will do that for
|
|
|
|
you:
|
2005-07-17 19:01:14 +00:00
|
|
|
exten => _X.,1,Dial(CAPI/contr1/${EXTEN}/B,30)
|
2005-06-07 04:26:12 +00:00
|
|
|
(early B3 on success)
|
|
|
|
|
2005-07-17 19:01:14 +00:00
|
|
|
exten => _X.,1,Dial(CAPI/contr1/${EXTEN}/b,30)
|
2005-06-07 04:26:12 +00:00
|
|
|
(always early B3)
|
|
|
|
|
|
|
|
exten => _X.,1,Dial(CAPI/contr1/${EXTEN},30,r)
|
|
|
|
(no early B3, fake ring indication)
|
|
|
|
|
2005-07-17 19:01:14 +00:00
|
|
|
exten => _X.,1,Dial(CAPI/contr1/${EXTEN}/b,30,r)
|
2005-06-07 04:26:12 +00:00
|
|
|
(always early B3, fake indicatons if the exchange does not give us
|
|
|
|
indications)
|
|
|
|
|
2005-07-17 19:01:14 +00:00
|
|
|
exten => _X.,1,Dial(CAPI/contr1/${EXTEN}/B,30,r)
|
2005-06-07 04:26:12 +00:00
|
|
|
(early B3 on success, fake indicatons if the exchange does not give us
|
|
|
|
indications)
|
2005-06-02 18:47:35 +00:00
|
|
|
|
|
|
|
For normal PBX usage you would use the "b" option, always early B3.
|
|
|
|
|
|
|
|
Overlap sending (a.k.a. real dialtone)
|
|
|
|
======================================
|
2005-06-07 04:26:12 +00:00
|
|
|
When you dial an empty number, and have early B3 enabled, with:
|
2005-07-17 19:01:14 +00:00
|
|
|
Dial(CAPI/g1//b)
|
2005-06-07 04:26:12 +00:00
|
|
|
The channel will come up at once and give you the dialtone it gets from the
|
|
|
|
local exchange.
|
|
|
|
At this point the channel is like a legacy phone, now you can send DTMF digits
|
|
|
|
to dial.
|
2005-06-02 18:47:35 +00:00
|
|
|
|
|
|
|
Example context for incoming calls on MSN 12345678:
|
|
|
|
===================================================
|
|
|
|
|
|
|
|
[capi-in]
|
|
|
|
exten => 12345678,1,Dial(SIP/phone1)
|
|
|
|
exten => 12345678,2,Hangup
|
|
|
|
|
2005-06-07 04:26:12 +00:00
|
|
|
Short HOWTO of 'capiAnswerFax':
|
2005-06-04 14:28:52 +00:00
|
|
|
===============================
|
2005-06-07 04:26:12 +00:00
|
|
|
For those of you who have a CAPI card with an on-board DSP (like some Eicon and
|
|
|
|
DIVA Server), this patch allows you to receive faxes.
|
|
|
|
If you want to answer a channel in fax mode, use capiAnswerFax() instead of
|
|
|
|
Answer()
|
|
|
|
If you use Answer(), you will be in voice mode. If the hardware DSP detects
|
|
|
|
fax tone, you can switch from voice to fax mode by calling capiAnswerFax().
|
2005-06-04 14:28:52 +00:00
|
|
|
|
|
|
|
Example of use :
|
|
|
|
line number 123, play something, if a fax tone is detected, handle it
|
|
|
|
line number 124, answer directly in fax mode
|
|
|
|
|
|
|
|
[incoming]
|
|
|
|
exten => 123,1,Answer()
|
|
|
|
exten => 123,2,BackGround(jpop)
|
|
|
|
exten => 124,1,Goto(handle_fax,s,1)
|
|
|
|
exten => fax,1,Goto(handle_fax,s,1)
|
|
|
|
|
|
|
|
[handle_fax]
|
|
|
|
exten => s,1,capiAnswerFax(/tmp/${UNIQUEID})
|
|
|
|
exten => s,2,Hangup()
|
|
|
|
exten => h,1,deadagi,fax.php // Run sfftobmp and mail it.
|
|
|
|
|
|
|
|
The output of capiAnswerFax is a SFF file. Use sfftobmp to convert it.
|
2005-06-07 04:26:12 +00:00
|
|
|
With a DIVA Server, following features are provided:
|
|
|
|
- fax up to 33600
|
|
|
|
- high resolution
|
|
|
|
- Color Fax
|
2005-07-17 19:01:14 +00:00
|
|
|
- JPEG Compression is disabled (not tested yet)
|
2005-06-02 18:47:35 +00:00
|
|
|
|