2008-02-05 11:16:25 +00:00
|
|
|
chan_capi a Common ISDN API 2.0 implementation for Asterisk
|
2005-06-02 18:47:35 +00:00
|
|
|
|
2010-02-10 08:47:06 +00:00
|
|
|
Copyright (C) 2005-2010 Cytronics & Melware
|
2005-06-02 18:47:35 +00:00
|
|
|
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!
|
|
|
|
|
2005-09-11 08:39:29 +00:00
|
|
|
Thanks go to the debuggers, bugfixers and contributors :)
|
2005-06-02 18:47:35 +00:00
|
|
|
===========================================================================
|
|
|
|
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-09-11 08:39:29 +00:00
|
|
|
Hans Petter Selasky
|
2006-12-18 22:18:16 +00:00
|
|
|
Simon Peter <dn.tlp@gmx.net>
|
2007-09-28 11:57:07 +00:00
|
|
|
Mario Goegel <m.goegel@gmx.de>
|
2005-06-04 14:28:52 +00:00
|
|
|
|
2005-09-11 08:39:29 +00:00
|
|
|
(...and all the others that have been forgotten...) :-)
|
2005-06-02 18:47:35 +00:00
|
|
|
|
2006-06-24 11:53:47 +00:00
|
|
|
No support for Asterisk 1.0.x any more, you need at least
|
2008-03-17 14:08:38 +00:00
|
|
|
Asterisk 1.2.x , 1.4.x or 1.6.x.
|
2006-06-24 11:53:47 +00:00
|
|
|
|
2008-02-05 10:57:54 +00:00
|
|
|
Note:
|
2009-03-26 12:56:12 +00:00
|
|
|
Eicon DIVA Server cards are now named Dialogic(R) Diva(R) Media Boards.
|
2008-02-05 10:57:54 +00:00
|
|
|
|
2005-06-02 18:47:35 +00:00
|
|
|
This chan_capi version includes:
|
2008-02-22 17:01:46 +00:00
|
|
|
=====================================================
|
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
|
2006-12-18 22:18:16 +00:00
|
|
|
- Supplementary services: CD (deflect/reroute),HOLD,RETRIEVE,ECT,3PTY
|
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!)
|
|
|
|
- Use asterisks internal DSP functions for DTMF
|
2009-03-26 12:56:12 +00:00
|
|
|
- a-Law support
|
|
|
|
- u-Law support!
|
|
|
|
- Dialogic(R) Diva(R) software DSP echo cancellation (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)
|
2006-12-02 10:08:50 +00:00
|
|
|
- Rx/Tx gains using positive linar value (rxgain=1.0, txgain=1.0 means no change)
|
2008-07-07 20:29:19 +00:00
|
|
|
- (Inter)national/subscriber dialing prefix (for callerid) configurable in capi.conf
|
2005-06-07 04:26:12 +00:00
|
|
|
- CLI command "capi info" shows B channel status of chan_capi
|
|
|
|
- Catch all MSN (incomingmsn=*)
|
2006-06-18 20:57:56 +00:00
|
|
|
- Some configuration enhancements (msn=123,124,125)
|
2005-06-07 04:26:12 +00:00
|
|
|
- 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)
|
2008-02-22 17:01:46 +00:00
|
|
|
- receive/send faxes for CAPI (see below)
|
2005-09-11 08:39:29 +00:00
|
|
|
- Fixes and compatibility for BSD (Jan Stocker and Hans Petter Selasky)
|
2005-08-07 19:24:06 +00:00
|
|
|
- Support 'type of number'.
|
2005-09-11 08:39:29 +00:00
|
|
|
- ISDN hold.
|
2005-09-17 19:08:28 +00:00
|
|
|
- CAPI Line Interconnect.
|
2008-02-22 17:01:46 +00:00
|
|
|
- CAPI VoIP/RTP
|
2006-04-03 20:44:08 +00:00
|
|
|
- CLI command "capi show channels" shows details on channel status.
|
2007-02-10 23:18:57 +00:00
|
|
|
- Asterisk 1.4 jitterbuffer configuration.
|
2007-04-05 19:33:01 +00:00
|
|
|
- some QSIG extensions (see README.qsig)
|
2007-04-24 20:21:04 +00:00
|
|
|
- CCBS (call completion on busy subscriber)
|
2007-04-30 14:02:22 +00:00
|
|
|
- CAPI CHAT (CAPI MeetMe using onboard DSPs)
|
2007-09-02 15:41:06 +00:00
|
|
|
- KEYPAD digits detection
|
2007-10-20 08:22:53 +00:00
|
|
|
- provide DATE/TIME in NT-mode.
|
2005-06-02 18:47:35 +00:00
|
|
|
|
2005-11-20 16:15:33 +00:00
|
|
|
|
2005-07-17 19:01:14 +00:00
|
|
|
The Dial string
|
|
|
|
===============
|
|
|
|
|
2005-10-09 16:45:03 +00:00
|
|
|
Example: Dial(CAPI/g<group>/[<callerid>:]<destination>[/<params>])
|
|
|
|
Or: Dial(CAPI/contr<controller>/[<callerid>:]<destination>[/<params>])
|
|
|
|
Or: Dial(CAPI/<interface-name>/[<callerid>:]<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.
|
|
|
|
|
2009-03-26 12:56:12 +00:00
|
|
|
The optional <callerid> followed by an ':' can be used to set a caller ID
|
|
|
|
for this dial() command, without changing the original channel's caller ID.
|
2005-10-09 16:45:03 +00:00
|
|
|
|
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.
|
2009-03-26 12:56:12 +00:00
|
|
|
'd' : use the default caller ID that is set by defaultcid= in capi.conf
|
2005-10-01 17:00:56 +00:00
|
|
|
'o' : use overlap sending of number.
|
2009-03-26 12:56:12 +00:00
|
|
|
(Useful if additional digits should be send afterwards or together
|
|
|
|
with 'b' to get the dialtone and then send the number, e.g., if
|
2005-10-01 17:00:56 +00:00
|
|
|
no progress tones are available)
|
2009-03-26 12:56:12 +00:00
|
|
|
's' : activate 'stay-online': do not disconnect CAPI connection on hangup.
|
|
|
|
This is needed to give additional commands like CCBS after hangup.
|
|
|
|
To really hang up the CAPI connection, use either capicommand(hangup)
|
2008-02-22 17:01:46 +00:00
|
|
|
or wait for chan_capi/network timeout (about 20 seconds).
|
2008-08-30 09:58:27 +00:00
|
|
|
'G' : early Line-Interconnect / bridge: Use Line-Interconnect as soon as
|
2009-03-26 12:56:12 +00:00
|
|
|
both B-channels are up. Both channels must be of type the CAPI and
|
|
|
|
the incoming call may need 'capicommand(progress)' to enable Early B3
|
|
|
|
on it as well as the dial option 'b' for the outgoing channel.
|
2008-08-30 09:58:27 +00:00
|
|
|
Before Dial(), the capicommand(peerlink) must be used to signal the
|
|
|
|
dialed channel its peer.
|
2005-07-17 19:01:14 +00:00
|
|
|
|
2005-07-27 18:17:41 +00:00
|
|
|
If the <interface-name> is used in dialstring, be sure the name (specified
|
|
|
|
in capi.conf) does not start with 'contr' or 'g'.
|
|
|
|
|
2005-07-17 19:01:14 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
2007-04-30 14:02:22 +00:00
|
|
|
CLI commands
|
|
|
|
============
|
|
|
|
|
|
|
|
capi info:
|
2008-02-22 17:01:46 +00:00
|
|
|
Show chan_capi version info.
|
2007-04-30 14:02:22 +00:00
|
|
|
Show status of available B-channels.
|
|
|
|
|
|
|
|
capi debug:
|
|
|
|
Enable CAPI message verbosity.
|
|
|
|
|
|
|
|
capi no debug:
|
|
|
|
Disable CAPI message verbosity.
|
|
|
|
|
|
|
|
capi show channels:
|
|
|
|
Display detailed information on CAPI B-channels.
|
|
|
|
(Description see below)
|
|
|
|
|
|
|
|
capi chatinfo:
|
|
|
|
Show status of CAPI CHAT.
|
|
|
|
|
|
|
|
|
2005-08-13 18:21:20 +00:00
|
|
|
CAPI command application
|
2008-02-22 17:01:46 +00:00
|
|
|
========================================
|
2005-08-13 18:21:20 +00:00
|
|
|
chan_capi provides an additional Asterisk application
|
|
|
|
capicommand()
|
2009-03-26 12:56:12 +00:00
|
|
|
With this application, special CAPI commands and features can be used.
|
2005-08-13 18:21:20 +00:00
|
|
|
|
|
|
|
Call Deflection:
|
|
|
|
Forwards an unanswered call to another number.
|
|
|
|
Example:
|
|
|
|
exten => s,1,capicommand(deflect|12345678)
|
2005-08-14 12:32:18 +00:00
|
|
|
|
|
|
|
Fax receive:
|
2009-03-26 12:56:12 +00:00
|
|
|
Receives a fax using CAPI.
|
2005-08-14 12:32:18 +00:00
|
|
|
Example:
|
2009-08-05 22:25:53 +00:00
|
|
|
exten => s,1,capicommand(receivefax|/tmp/${UNIQUEID}|+49 6137 555123|Asterisk|kX)
|
2005-08-14 12:32:18 +00:00
|
|
|
(more see below)
|
|
|
|
|
2006-06-27 14:54:03 +00:00
|
|
|
Fax send:
|
2009-03-26 12:56:12 +00:00
|
|
|
Sends a fax using CAPI.
|
2006-06-27 14:54:03 +00:00
|
|
|
Example:
|
|
|
|
exten => s,1,capicommand(sendfax|/path/to/faxfile.sff|+49 6137 555123|Asterisk)
|
|
|
|
(more see below)
|
|
|
|
|
2005-08-14 13:59:16 +00:00
|
|
|
Enable/Disable echosquelch:
|
2009-03-26 12:56:12 +00:00
|
|
|
Enables or disable a very primitive echo suppressor.
|
|
|
|
Disable this option before you start recording voicemail or your files may get choppy.
|
2005-08-14 13:59:16 +00:00
|
|
|
Example:
|
|
|
|
exten => s,1,capicommand(echosquelch|yes)
|
2005-08-14 14:57:04 +00:00
|
|
|
or
|
2005-08-14 13:59:16 +00:00
|
|
|
exten => s,1,capicommand(echosquelch|no)
|
|
|
|
|
2006-05-21 12:10:53 +00:00
|
|
|
Enable/Disable echocancel:
|
2009-03-26 12:56:12 +00:00
|
|
|
Enables or disables echo-cancel provided by CAPI driver/hardware.
|
|
|
|
You might need to disable echo-cancel when the data/fax transmission is handled
|
|
|
|
by a non-CAPI application. After hangup, this setting is restored to the value
|
2006-11-25 16:13:40 +00:00
|
|
|
set in capi.conf.
|
2006-05-21 12:10:53 +00:00
|
|
|
Example:
|
|
|
|
exten => s,1,capicommand(echocancel|yes)
|
|
|
|
or
|
|
|
|
exten => s,1,capicommand(echocancel|no)
|
|
|
|
|
2010-07-17 23:30:57 +00:00
|
|
|
By default chan_capi deactivates echo-cancel for transit connections
|
|
|
|
(Dial command called from existing call). You can use 'econtransitconn'
|
2010-07-18 00:30:32 +00:00
|
|
|
configurations parameter (capi.conf) to change this behavior:
|
|
|
|
econtransitconn=0 ; Deactivate EC on transit connections
|
|
|
|
econtransitconn=1 ; Deactivate EC on secondary call of transit connection only
|
|
|
|
econtransitconn=2 ; Deactivate EC on primary call of transit connection only
|
2010-07-17 23:30:57 +00:00
|
|
|
econtransitconn=3 ; Do not deactivate EC on transit connections
|
|
|
|
|
2005-08-14 14:57:04 +00:00
|
|
|
Malicious Call Identification:
|
2009-03-26 12:56:12 +00:00
|
|
|
Reports a call of malicious nature.
|
2005-08-14 14:57:04 +00:00
|
|
|
Example:
|
|
|
|
exten => s,1,capicommand(malicious)
|
|
|
|
|
2005-08-16 18:25:03 +00:00
|
|
|
Hold:
|
2009-03-26 12:56:12 +00:00
|
|
|
Puts an answered call on hold, this has nothing to do with Asterisk's onhold
|
|
|
|
(music et al).
|
|
|
|
An optional parameter is the name of the variable, which should be set with
|
2005-08-21 10:28:43 +00:00
|
|
|
the reference ID of the call on hold.
|
2005-08-16 18:25:03 +00:00
|
|
|
Example:
|
|
|
|
exten => s,1,capicommand(hold)
|
2005-08-21 10:28:43 +00:00
|
|
|
or
|
|
|
|
exten => s,1,capicommand(hold|MYHOLDVAR)
|
2005-08-13 18:21:20 +00:00
|
|
|
|
2005-08-25 19:30:31 +00:00
|
|
|
Holdtype:
|
2009-03-26 12:56:12 +00:00
|
|
|
Sets the type of 'hold'. When Asterisk wants to put the call on hold, the specified method
|
2005-08-25 19:30:31 +00:00
|
|
|
will be used.
|
|
|
|
Example:
|
|
|
|
exten => s,1,capicommand(holdtype|local) ;no hold, Asterisk can play MOH
|
|
|
|
or
|
|
|
|
exten => s,1,capicommand(holdtype|hold) ;ISDN-HOLD
|
|
|
|
or
|
|
|
|
; not yet implemented
|
|
|
|
exten => s,1,capicommand(holdtype|notify) ;notify the peer only, Asterisk can play MOH
|
|
|
|
|
|
|
|
|
2005-08-16 18:25:03 +00:00
|
|
|
Retrieve:
|
2005-08-21 10:28:43 +00:00
|
|
|
Gets back the holded call. An optional parameter is the reference ID of the call
|
|
|
|
on hold.
|
2005-08-16 18:25:03 +00:00
|
|
|
Example:
|
|
|
|
exten => s,1,capicommand(retrieve)
|
2005-08-21 10:28:43 +00:00
|
|
|
or
|
|
|
|
exten => s,1,capicommand(retrieve|${MYHOLDVAR})
|
2005-08-13 18:21:20 +00:00
|
|
|
|
2005-08-21 15:35:44 +00:00
|
|
|
ECT:
|
2009-03-26 12:56:12 +00:00
|
|
|
Explicit Call Transfer of the call on hold (must put call on hold first!)
|
2005-08-21 15:35:44 +00:00
|
|
|
Example:
|
|
|
|
exten => s,1,capicommand(ect|${MYHOLDVAR})
|
|
|
|
or
|
|
|
|
[macro-capiect]
|
|
|
|
exten => s,1,capicommand(ect)
|
|
|
|
[default]
|
|
|
|
exten => s,1,capicommand(hold)
|
2005-09-16 12:38:16 +00:00
|
|
|
exten => s,2,Wait(1)
|
|
|
|
exten => s,3,Dial(CAPI/contr1/1234,60,M(capiect))
|
2007-04-22 11:24:25 +00:00
|
|
|
Note: Normaly a PBX needs 'implicit call transfer', which is done by default
|
|
|
|
with this command. But if the line needs real 'explicit call transfer', use
|
|
|
|
exten => s,1,capicommand(ect|x)
|
|
|
|
instead.
|
2005-06-02 18:47:35 +00:00
|
|
|
|
2006-12-18 22:18:16 +00:00
|
|
|
3PTY:
|
2009-03-26 12:56:12 +00:00
|
|
|
Initiates a Three-Party Conference (must have one call on hold and one active call!).
|
2006-12-18 22:18:16 +00:00
|
|
|
Example:
|
|
|
|
exten => s,1,capicommand(3pty_begin|${MYHOLDVAR})
|
|
|
|
or
|
|
|
|
[macro-capi3pty]
|
|
|
|
exten => s,1,capicommand(3pty_begin)
|
|
|
|
[default]
|
|
|
|
exten => s,1,capicommand(hold)
|
|
|
|
exten => s,2,Dial(CAPI/contr1/1234,,M(capi3pty))
|
|
|
|
|
2007-04-17 21:04:42 +00:00
|
|
|
Peer link creation:
|
2009-03-26 12:56:12 +00:00
|
|
|
Creates a reference for chan_capi to know who is the calling channel on Dial().
|
2007-04-17 21:04:42 +00:00
|
|
|
This is needed if you want to use CCBS/CCNR afterwards.
|
|
|
|
Example:
|
|
|
|
exten => s,1,capicommand(peerlink)
|
2005-06-02 18:47:35 +00:00
|
|
|
|
2007-04-23 18:47:49 +00:00
|
|
|
Hangup in mode 'stay-online':
|
2009-03-26 12:56:12 +00:00
|
|
|
After hangup in 'stay-online' mode, the line is not really disconnected
|
2007-04-23 18:47:49 +00:00
|
|
|
until timeout or command:
|
|
|
|
exten => s,1,capicommand(hangup)
|
|
|
|
This works after capicommand(peerlink) only.
|
|
|
|
|
2007-04-21 07:19:44 +00:00
|
|
|
Set local party to 'busy' or 'free':
|
2009-03-26 12:56:12 +00:00
|
|
|
Sets the local phone to the status 'busy' or 'free' when
|
2007-04-21 07:19:44 +00:00
|
|
|
awaiting a callback for CCBS/CCNR. If the network wants to
|
2009-03-26 12:56:12 +00:00
|
|
|
call you back for CCBS/CCNR, chan_capi normaly does not know
|
2007-04-21 07:19:44 +00:00
|
|
|
about the status of the extension who started the callback.
|
2009-03-26 12:56:12 +00:00
|
|
|
By default, chan_capi assumes 'free', but you can change that
|
2007-04-21 07:19:44 +00:00
|
|
|
with:
|
|
|
|
exten => s,1,capicommand(ccpartybusy|${CCLINKAGEID}|yes)
|
|
|
|
or
|
|
|
|
exten => s,1,capicommand(ccpartybusy|${CCLINKAGEID}|no)
|
|
|
|
|
|
|
|
Call completion on subscriber busy (CCBS):
|
|
|
|
To receive a callback when the dialed and busy party becomes free, aka
|
|
|
|
call completion on subscriber busy, you can do the following:
|
|
|
|
Example:
|
2008-02-22 17:01:46 +00:00
|
|
|
exten => s,1,capicommand(peerlink) ;to let chan_capi know who is the calling channel.
|
2007-04-21 07:19:44 +00:00
|
|
|
exten => s,2,Dial(CAPI/contr1/123456,60,g) ;'g' to go-on with the dialplan on busy.
|
|
|
|
exten => s,3,NoOp(${CCLINKAGEID}) ;if this variable now contains a number, CCBS is possible.
|
|
|
|
;here you can ask the caller if CCBS shall be activated...
|
|
|
|
exten => s,4,capicommand(ccbs|${CCLINKAGEID}|<context>|<exten>|<priority>)
|
|
|
|
exten => s,5,NoOp(${CCBSSTATUS}) ;if CCBS was successfully enabled, it is set to "ACTIVATED".
|
2009-03-26 12:56:12 +00:00
|
|
|
If the remote party becomes 'non-busy', the network initiates the callback that will be
|
2007-04-21 07:19:44 +00:00
|
|
|
sent to the provided context/exten/priority. Of course, this only happens if your local
|
|
|
|
phone is set to 'free' with capicommand(ccpartybusy), which is the default.
|
2007-04-24 20:21:04 +00:00
|
|
|
In this context/exten/priority you should just setup a callfile to initiate an outgoing
|
|
|
|
call from your extension to
|
|
|
|
exten => s,1,Dial(CAPI/ccbs/${CCLINKAGEID}/)
|
2007-04-21 07:19:44 +00:00
|
|
|
|
2007-04-21 20:32:27 +00:00
|
|
|
Deactivate CCBS:
|
2009-03-26 12:56:12 +00:00
|
|
|
To deactivate a previously activated CCBS, use the following command:
|
2007-04-21 20:32:27 +00:00
|
|
|
Example:
|
|
|
|
exten => s,1,capicommand(ccbsstop|${CCLINKAGEID})
|
2007-04-21 07:19:44 +00:00
|
|
|
|
2007-04-30 14:02:22 +00:00
|
|
|
Chat (MeetMe/Conference):
|
2009-07-24 10:10:44 +00:00
|
|
|
See also README.media for details!
|
2007-04-30 14:02:22 +00:00
|
|
|
If the CAPI card/driver supports it, the caller can be put into a chat-room:
|
2009-03-26 12:56:12 +00:00
|
|
|
(This uses the DSPs onboard a Dialogic(R) Diva(R) Rev.2 Media Board.)
|
2007-05-13 11:30:34 +00:00
|
|
|
exten => s,1,capicommand(chat|<roomname>|<options>|controller)
|
2007-04-30 14:02:22 +00:00
|
|
|
Example:
|
2007-10-22 21:37:00 +00:00
|
|
|
exten => s,1,capicommand(chat|salesmeeting|m|1,3-6)
|
|
|
|
Possible options:
|
|
|
|
'm' = The first caller will get music-on-hold until second caller arrives.
|
2009-08-03 10:40:03 +00:00
|
|
|
'h<sec>' = Hangup after <sec> seconds if caller is alone in conference.
|
2009-05-01 12:50:14 +00:00
|
|
|
'o' = The caller is operator
|
|
|
|
'l' = The caller is listener
|
2007-04-30 14:02:22 +00:00
|
|
|
|
2009-03-26 12:56:12 +00:00
|
|
|
Progress / Early-B3 on incoming calls:
|
|
|
|
Activate Early-B3 on incoming channels to signal progress tones
|
2008-08-29 11:03:54 +00:00
|
|
|
when in NT-mode or if the Telco-line supports this.
|
|
|
|
Example:
|
|
|
|
exten => s,1,capicommand(progress)
|
|
|
|
|
2009-01-06 14:15:47 +00:00
|
|
|
Get CAPI application ID:
|
2009-03-26 12:56:12 +00:00
|
|
|
To store the CAPI application ID in an Asterisk dialplan variable, use:
|
2009-01-06 14:15:47 +00:00
|
|
|
Example:
|
|
|
|
exten => s,1,capicommand(getid,CAPI_ID)
|
|
|
|
exten => s,2,NoOp(CAPI appl-id is ${CAPI_ID})
|
2007-04-30 14:02:22 +00:00
|
|
|
|
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
|
|
|
|
2009-03-26 12:56:12 +00:00
|
|
|
Enjoying Early B3 connects (inband call progress, tones and announcements)
|
2005-06-02 18:47:35 +00:00
|
|
|
==========================================================================
|
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...
|
|
|
|
|
2009-03-26 12:56:12 +00:00
|
|
|
Do not use indications in the Dial command, your local exchange will do that for
|
2005-06-07 04:26:12 +00:00
|
|
|
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
|
|
|
|
2009-03-26 12:56:12 +00:00
|
|
|
For normal PBX usage, you would use the "b" option, always Early B3.
|
2005-06-02 18:47:35 +00:00
|
|
|
|
2007-04-30 14:02:22 +00:00
|
|
|
|
2005-06-02 18:47:35 +00:00
|
|
|
Overlap sending (a.k.a. real dialtone)
|
|
|
|
======================================
|
2009-03-26 12:56: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)
|
2009-03-26 12:56:12 +00:00
|
|
|
the channel will come up at once and give you the dialtone it gets from the
|
2005-06-07 04:26:12 +00:00
|
|
|
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
|
|
|
|
2007-04-30 14:02:22 +00:00
|
|
|
|
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-08-14 12:32:18 +00:00
|
|
|
|
2006-06-27 14:54:03 +00:00
|
|
|
Short HOWTO of capicommand(receivefax...) and capicommand(sendfax...):
|
2008-02-22 17:01:46 +00:00
|
|
|
========================================================================================
|
2009-03-26 12:56:12 +00:00
|
|
|
For those of you who have a CAPI card with an on-board DSP (like Dialogic(R) Diva(R) Media Boards),
|
2008-02-05 10:57:54 +00:00
|
|
|
this allows you to receive/send faxes.
|
2006-06-27 14:54:03 +00:00
|
|
|
|
2007-04-05 19:33:01 +00:00
|
|
|
capicommand(receivefax|<filename>[|<stationid>|<headline>|<options>]):
|
2008-02-22 17:01:46 +00:00
|
|
|
-------------------------------------------------------------------------
|
2005-08-14 12:32:18 +00:00
|
|
|
If you want to answer a channel in fax mode, use capicommand(receivefax|...)
|
2009-03-26 12:56:12 +00:00
|
|
|
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 capicommand(receivefax|...).
|
2007-04-05 19:33:01 +00:00
|
|
|
The parameter <filename> is mandatory and the parameters <stationid>,
|
|
|
|
<headline> and <options> are optional.
|
|
|
|
By default, if fax reception was not successful, the file is deleted. If you want even
|
|
|
|
partly received or broken fax files, use 'k' for "keep bad fax" in the <options>:
|
|
|
|
capicommand(receivefax|/tmp/${UNIQUEID}|+123456789||k)
|
2009-08-05 22:25:53 +00:00
|
|
|
You can activate extended fax support by 'X' in the <options>:
|
|
|
|
capicommand(receivefax|/tmp/${UNIQUEID}|+123456789||X)
|
|
|
|
Please read details on extended fax options in README.Diva.fax.
|
2008-06-29 11:33:46 +00:00
|
|
|
|
2006-05-27 12:52:28 +00:00
|
|
|
To enable fax tone detection and redirect to extension 'fax', use config variable
|
2008-06-29 11:33:46 +00:00
|
|
|
'faxdetect' in capi.conf. This can be limited to the first 'n' seconds of a connection
|
|
|
|
using the setting 'faxdetecttime' in capi.conf.
|
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]
|
2007-04-05 19:33:01 +00:00
|
|
|
exten => s,1,capicommand(receivefax|/tmp/${UNIQUEID}[|<stationid>|<headline>|<options>])
|
2005-06-04 14:28:52 +00:00
|
|
|
exten => s,2,Hangup()
|
|
|
|
exten => h,1,deadagi,fax.php // Run sfftobmp and mail it.
|
|
|
|
|
2005-08-14 12:32:18 +00:00
|
|
|
The output of capicommand(receivefax|...) is a SFF file.
|
|
|
|
Use sfftobmp to convert it.
|
2009-03-26 12:56:12 +00:00
|
|
|
With a Dialogic(R) Diva(R) Media Board, the following features are provided:
|
2005-06-07 04:26:12 +00:00
|
|
|
- fax up to 33600
|
|
|
|
- high resolution
|
|
|
|
- Color Fax
|
2005-07-17 19:01:14 +00:00
|
|
|
- JPEG Compression is disabled (not tested yet)
|
2009-08-05 09:50:40 +00:00
|
|
|
See README.Diva.fax for more details and description of all options.
|
2005-06-02 18:47:35 +00:00
|
|
|
|
2009-08-06 08:49:25 +00:00
|
|
|
capicommand(sendfax|<filename>[|<stationid>|<headline>|<options>]):
|
2006-06-27 14:54:03 +00:00
|
|
|
------------------------------------------------------------
|
|
|
|
To send a fax, you can use the same mechanism like with receivefax.
|
|
|
|
Just replace the <filename> with the path to the .SFF file to send.
|
2009-08-06 08:49:25 +00:00
|
|
|
You can activate extended fax support by 'X' in the <options>:
|
|
|
|
capicommand(sendfax|/tmp/${UNIQUEID}|+123456789||X)
|
|
|
|
Please read details on extended fax options in README.Diva.fax.
|
2006-06-27 14:54:03 +00:00
|
|
|
|
|
|
|
After disconnect of a fax connection, the following variables
|
|
|
|
will be set for that channel:
|
|
|
|
FAXSTATUS : 0 = OK, 1 = Error.
|
|
|
|
FAXREASON : Value of B3 disconnect reason.
|
|
|
|
FAXREASONTEXT : Decoded text of FAXREASON value.
|
|
|
|
FAXRATE : The baud rate of the fax connection.
|
|
|
|
FAXRESOLUTION : 0 = standard, 1 = high.
|
|
|
|
FAXFORMAT : 0 = SFF.
|
|
|
|
FAXPAGES : Number of pages received.
|
|
|
|
FAXID : The ID of the remote fax maschine.
|
2005-08-25 17:35:21 +00:00
|
|
|
|
2007-09-02 15:41:06 +00:00
|
|
|
KEYPAD digits in NT-mode
|
|
|
|
========================
|
|
|
|
If the device connected to a NT-mode port sends KEYPAD digits
|
|
|
|
instead of normal digits, this call is then send to extension
|
|
|
|
'Kxxx'. Where 'xxx' stands for the KEYPAD digits sent.
|
2006-04-03 20:44:08 +00:00
|
|
|
|
|
|
|
CLI command "capi show channels"
|
2008-02-22 17:01:46 +00:00
|
|
|
==============================================
|
2006-04-03 20:44:08 +00:00
|
|
|
This CLI command shows detailed info on all CAPI channels.
|
|
|
|
Column description:
|
|
|
|
Line-Name : the name of the interface as defined in capi.conf
|
2009-03-26 12:56:12 +00:00
|
|
|
NTmode : is the line in NT-mode instead fo TE-mode
|
2006-04-03 20:44:08 +00:00
|
|
|
state : the state of the channel, like 'Conn', 'Disc', 'Dial', ...
|
|
|
|
i/o : incoming or outgoing line
|
2006-05-18 14:36:09 +00:00
|
|
|
bproto : protocol on CAPI ('fax', 'trans' or 'rtp')
|
2006-04-03 20:44:08 +00:00
|
|
|
isdnstate : a string which may consists of the following characters
|
|
|
|
* = PBX is active
|
|
|
|
G = Line-Interconnect (CAPI bridge) active
|
2009-03-26 12:56:12 +00:00
|
|
|
B = B-channel is up
|
|
|
|
b = B-channel is requested
|
2006-04-03 20:44:08 +00:00
|
|
|
P = Progress was signaled
|
|
|
|
H = this line is on hold
|
|
|
|
T = this line is in transfer (ECT) mode
|
|
|
|
S = SETUP[_ACK] was signaled
|
|
|
|
ton : type of number value
|
2009-03-26 12:56:12 +00:00
|
|
|
number : the caller number and destination number
|
2006-04-03 20:44:08 +00:00
|
|
|
|
2007-04-30 14:02:22 +00:00
|
|
|
|
2005-08-25 17:35:21 +00:00
|
|
|
Asterisk variables used/set by chan_capi
|
2008-02-22 17:01:46 +00:00
|
|
|
==========================================================
|
2005-08-25 17:35:21 +00:00
|
|
|
|
2005-10-01 15:17:10 +00:00
|
|
|
BCHANNELINFO
|
2009-03-26 12:56:12 +00:00
|
|
|
On incomming calls, this variable is set with the B-channel information value:
|
2005-10-01 15:17:10 +00:00
|
|
|
'0' : B-channel is used (default)
|
|
|
|
'1' : D-channel is used (not implemented yet)
|
2009-03-26 12:56:12 +00:00
|
|
|
'2' : neither B nor D-channel is used (e.g., call waiting)
|
2005-10-01 15:17:10 +00:00
|
|
|
Call-Waiting: an incoming call with BCHANNELINFO not '0' cannot be accepted.
|
|
|
|
Another connection must be dropped before accepting or use
|
|
|
|
capicommand(deflect|<number>) to initiate call deflection to another destination.
|
|
|
|
|
2005-08-25 17:35:21 +00:00
|
|
|
CALLEDTON
|
2009-07-22 08:18:46 +00:00
|
|
|
Incoming calls: 'type of number' value of the called number is saved in this variable on
|
2005-08-25 17:35:21 +00:00
|
|
|
incomming call.
|
2009-07-22 08:18:46 +00:00
|
|
|
Outgoing calls: Allows to specity the 'ETS 300 102-1' called party number octet 3
|
|
|
|
(0x80 is used by default)
|
|
|
|
|
|
|
|
exten => _X.,1,Answer
|
|
|
|
exten => _X.,n,Set(_CALLEDTON=${CALLEDTON}) ; Use value of incoming call for outgoing call
|
|
|
|
exten => _X.,n,Dial(CAPI/ISDN3/100,10)
|
|
|
|
|
|
|
|
exten => _X.,1,Answer
|
|
|
|
exten => _X.,n,Set(_CALLEDTON=1) ; Use new value
|
|
|
|
exten => _X.,n,Dial(CAPI/ISDN3/100,10)
|
|
|
|
|
2005-08-25 17:35:21 +00:00
|
|
|
|
2008-06-29 11:07:20 +00:00
|
|
|
CALLERTON
|
|
|
|
The 'type of number' value to overwrite for the caller number on outgoing call.
|
|
|
|
|
2005-08-25 17:35:21 +00:00
|
|
|
_CALLERHOLDID
|
2009-03-26 12:56:12 +00:00
|
|
|
If a call is put on hold (ISDN-HOLD), the reference ID is saved in this variable.
|
2005-08-25 17:35:21 +00:00
|
|
|
This variable is inherited as CALLERHOLDID to the dialed channel and will be used
|
2009-03-26 12:56:12 +00:00
|
|
|
if e.g., capicommand(ect) is used to transfer the held call.
|
2005-08-25 17:35:21 +00:00
|
|
|
|
2005-10-01 15:17:10 +00:00
|
|
|
CALLINGSUBADDRESS
|
|
|
|
If set on dial(), the calling subaddress will be set to the content.
|
|
|
|
|
|
|
|
CALLEDSUBADDRESS
|
|
|
|
If set on dial(), the called subaddress will be set to the content.
|
2007-04-17 21:04:42 +00:00
|
|
|
|
2009-03-25 12:38:46 +00:00
|
|
|
CAPI_CIP
|
|
|
|
The real CIP value, not the transformed 'transfercapability'.
|
|
|
|
Set on incoming call automatically. If set on outgoing call, it is used
|
|
|
|
instead of transfercapability.
|
|
|
|
|
2007-04-21 07:19:44 +00:00
|
|
|
CCBSSTATUS
|
|
|
|
When using capicommand(ccbs|....), this variable is set to either "ERROR" or
|
|
|
|
"ACTIVATED".
|
|
|
|
|
2007-04-17 21:04:42 +00:00
|
|
|
CCLINKAGEID
|
2009-03-26 12:56:12 +00:00
|
|
|
If a Call-Linkage-Id is received for CCBS/CCNR, this variable contains this ID.
|
2007-04-21 07:19:44 +00:00
|
|
|
But you need to use capicommand(peerlink) before dialing a CAPI channel, because
|
2008-02-22 17:01:46 +00:00
|
|
|
of a design problem in Asterisk, chan_capi is not able to set channel variables
|
2007-04-21 07:19:44 +00:00
|
|
|
of the calling channel.
|
2007-04-17 21:04:42 +00:00
|
|
|
|
2005-08-25 17:35:21 +00:00
|
|
|
CONNECTEDNUMBER
|
|
|
|
Can be set before answering and if set, the content is used for
|
|
|
|
IE 'Connected Number' on answering.
|
|
|
|
|
2010-07-22 05:31:51 +00:00
|
|
|
DISCONNECT_IND_REASON
|
|
|
|
When CAPI reports DISCONNECT_IND, some CAPI reason codes are not set
|
|
|
|
in HANGUPCAUSE, because they are not valid cause codes. To also
|
|
|
|
get those CAPI reason codes, you can check this variable on hangup.
|
|
|
|
This is e.g. useful for reason 0x3301, which tells that the ISDN
|
|
|
|
connection is physically broken (cable).
|
|
|
|
|
2005-08-25 17:35:21 +00:00
|
|
|
FAXEXTEN
|
|
|
|
If chan_capi sends the call to extensions 'fax', the original extension number
|
|
|
|
is saved in this variable.
|
|
|
|
|
|
|
|
PRI_CAUSE
|
|
|
|
If set, this value will be used as hangup cause on hangup.
|
|
|
|
|
|
|
|
REDIRECTINGNUMBER
|
2009-03-26 12:56:12 +00:00
|
|
|
On incoming calls, if the call was redirected to you by someone, the
|
2005-08-25 17:35:21 +00:00
|
|
|
number of the redirecting party is saved in this variable.
|
2005-10-01 15:17:10 +00:00
|
|
|
RDNIS is set as well.
|
2005-08-25 17:35:21 +00:00
|
|
|
|
2005-08-28 14:14:23 +00:00
|
|
|
REDIRECTREASON
|
|
|
|
If the incoming call was redirected to you, this variable is set
|
|
|
|
with the reason value.
|
2007-04-06 23:00:41 +00:00
|
|
|
|
|
|
|
REDIRECTIONNUMBER
|
|
|
|
If an outgoing call is redirected, this variable may be set to the
|
|
|
|
new destination.
|
|
|
|
|
2010-04-21 07:11:10 +00:00
|
|
|
ISDNPI1 and ISDNPI2
|
|
|
|
The two values of the information element PI (Progress Indicator).
|
2005-09-17 10:49:34 +00:00
|
|
|
|