mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
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
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,12 @@
|
||||
* the GNU General Public License
|
||||
*/
|
||||
|
||||
/*! \file
|
||||
* \brief Interface to mISDN
|
||||
*
|
||||
* \author Christian Richter <crich@beronet.com>
|
||||
*/
|
||||
|
||||
#ifndef TE_LIB
|
||||
#define TE_LIB
|
||||
|
||||
@@ -21,9 +27,9 @@
|
||||
/** end of init usage **/
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
* uncomment the following to make chan_misdn create
|
||||
* record files in /tmp/misdn-{rx|tx}-PortChannel format
|
||||
* record files in /tmp/misdn-{rx|tx}-PortChannel format
|
||||
* */
|
||||
|
||||
/*#define MISDN_SAVE_DATA*/
|
||||
@@ -44,9 +50,9 @@ beroec_t *beroec_new(int tail, enum beroec_type type, int anti_howl,
|
||||
int tonedisable, int zerocoeff, int adapt, int nlp);
|
||||
|
||||
void beroec_destroy(beroec_t *ec);
|
||||
int beroec_cancel_alaw_chunk(beroec_t *ec,
|
||||
char *send,
|
||||
char *receive ,
|
||||
int beroec_cancel_alaw_chunk(beroec_t *ec,
|
||||
char *send,
|
||||
char *receive,
|
||||
int len);
|
||||
|
||||
int beroec_version(void);
|
||||
@@ -97,7 +103,7 @@ enum mISDN_NUMBER_PLAN {
|
||||
NUMPLAN_NATIONAL=0x2,
|
||||
NUMPLAN_SUBSCRIBER=0x4,
|
||||
NUMPLAN_UNKNOWN=0x0
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
enum event_response_e {
|
||||
@@ -152,7 +158,7 @@ enum event_e {
|
||||
EVENT_PORT_ALARM,
|
||||
EVENT_NEW_CHANNEL,
|
||||
EVENT_UNKNOWN
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
enum ie_name_e {
|
||||
@@ -186,7 +192,7 @@ enum { /* progress indicators */
|
||||
enum { /*CODECS*/
|
||||
INFO_CODEC_ULAW=2,
|
||||
INFO_CODEC_ALAW=3
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
enum layer_e {
|
||||
@@ -194,85 +200,173 @@ enum layer_e {
|
||||
L2,
|
||||
L1,
|
||||
UNKNOWN
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct misdn_bchannel {
|
||||
/*! \brief B channel send locking structure */
|
||||
struct send_lock *send_lock;
|
||||
|
||||
/*! \brief TRUE if this is a dummy BC record */
|
||||
int dummy;
|
||||
|
||||
/*! \brief TRUE if NT side of protocol (TE otherwise) */
|
||||
int nt;
|
||||
|
||||
/*! \brief TRUE if ISDN-PRI (ISDN-BRI otherwise) */
|
||||
int pri;
|
||||
|
||||
/*! \brief Logical Layer 1 port associated with this B channel */
|
||||
int port;
|
||||
|
||||
/** init stuff **/
|
||||
/*! \brief B Channel mISDN driver stack ID */
|
||||
int b_stid;
|
||||
|
||||
/* int b_addr; */
|
||||
|
||||
/*! \brief B Channel mISDN driver layer ID from mISDN_new_layer() */
|
||||
int layer_id;
|
||||
|
||||
/*! \brief B channel layer; set to 3 or 4 */
|
||||
int layer;
|
||||
|
||||
/*state stuff*/
|
||||
|
||||
/* state stuff */
|
||||
/*! \brief TRUE if DISCONNECT needs to be sent to clear a call */
|
||||
int need_disconnect;
|
||||
|
||||
/*! \brief TRUE if RELEASE needs to be sent to clear a call */
|
||||
int need_release;
|
||||
|
||||
/*! \brief TRUE if RELEASE_COMPLETE needs to be sent to clear a call */
|
||||
int need_release_complete;
|
||||
|
||||
/*! \brief TRUE if allocate higher B channels first */
|
||||
int dec;
|
||||
/** var stuff**/
|
||||
|
||||
/* var stuff */
|
||||
/*! \brief Layer 3 process ID */
|
||||
int l3_id;
|
||||
|
||||
/*! \brief B channel process ID (1-5000) */
|
||||
int pid;
|
||||
|
||||
/*! \brief Not used. Saved mISDN stack CONNECT_t ces value */
|
||||
int ces;
|
||||
|
||||
/*! \brief B channel to restart if received a RESTART message */
|
||||
int restart_channel;
|
||||
|
||||
/*! \brief Assigned B channel number B1, B2... 0 if not assigned */
|
||||
int channel;
|
||||
|
||||
/*! \brief TRUE if the B channel number is preselected */
|
||||
int channel_preselected;
|
||||
|
||||
|
||||
/*! \brief TRUE if B channel record is in use */
|
||||
int in_use;
|
||||
|
||||
/*! \brief Time when empty_bc() last called on this record */
|
||||
struct timeval last_used;
|
||||
|
||||
/*! \brief TRUE if call waiting */
|
||||
int cw;
|
||||
|
||||
/*! \brief B Channel mISDN driver layer ID from mISDN_get_layerid() */
|
||||
int addr;
|
||||
|
||||
char * bframe;
|
||||
/*! \brief B channel speech sample data buffer */
|
||||
char *bframe;
|
||||
|
||||
/*! \brief B channel speech sample data buffer size */
|
||||
int bframe_len;
|
||||
int time_usec;
|
||||
|
||||
|
||||
int time_usec; /* Not used */
|
||||
|
||||
/*! \brief Not used. Contents are setup but not used. */
|
||||
void *astbuf;
|
||||
|
||||
void *misdnbuf;
|
||||
void *misdnbuf; /* Not used */
|
||||
|
||||
/*! \brief TRUE if the TE side should choose the B channel to use
|
||||
* \note This value is user configurable in /etc/asterisk/misdn.conf
|
||||
*/
|
||||
int te_choose_channel;
|
||||
|
||||
/*! \brief TRUE if the call progress indicators can indicate an inband audio message for the user to listen to
|
||||
* \note This value is user configurable in /etc/asterisk/misdn.conf
|
||||
*/
|
||||
int early_bconnect;
|
||||
|
||||
/* dtmf digit */
|
||||
|
||||
/*! \brief Last decoded DTMF digit from mISDN driver */
|
||||
int dtmf;
|
||||
|
||||
/*! \brief TRUE if we should produce DTMF tones ourselves
|
||||
* \note This value is user configurable in /etc/asterisk/misdn.conf
|
||||
*/
|
||||
int send_dtmf;
|
||||
|
||||
/* get setup ack */
|
||||
/*! \brief TRUE if we send SETUP_ACKNOWLEDGE on incoming calls anyway (instead of PROCEEDING).
|
||||
*
|
||||
* This requests additional INFORMATION messages, so we can
|
||||
* wait for digits without issues.
|
||||
* \note This value is user configurable in /etc/asterisk/misdn.conf
|
||||
*/
|
||||
int need_more_infos;
|
||||
|
||||
/* may there be more infos ?*/
|
||||
/*! \brief TRUE if all digits necessary to complete the call are available.
|
||||
* No more INFORMATION messages are needed.
|
||||
*/
|
||||
int sending_complete;
|
||||
|
||||
|
||||
/* wether we should use jollys dsp or not */
|
||||
/*! \brief TRUE if we will not use jollys dsp */
|
||||
int nodsp;
|
||||
|
||||
/* wether we should use our jitter buf system or not */
|
||||
|
||||
/*! \brief TRUE if we will not use the jitter buffer system */
|
||||
int nojitter;
|
||||
|
||||
|
||||
/*! \brief Type-of-number in ISDN terms for the dialed/called number
|
||||
* \note This value is set to "dialplan" in /etc/asterisk/misdn.conf for outgoing calls
|
||||
*/
|
||||
enum mISDN_NUMBER_PLAN dnumplan;
|
||||
|
||||
/*! \brief Type-of-number in ISDN terms for the redirecting number which a call diversion or transfer was invoked.
|
||||
* \note Collected from the incoming SETUP message but not used.
|
||||
*/
|
||||
enum mISDN_NUMBER_PLAN rnumplan;
|
||||
|
||||
/*! \brief Type-of-number in ISDN terms for the originating/calling number (Caller-ID)
|
||||
* \note This value is set to "localdialplan" in /etc/asterisk/misdn.conf for outgoing calls
|
||||
*/
|
||||
enum mISDN_NUMBER_PLAN onumplan;
|
||||
|
||||
/*! \brief Type-of-number in ISDN terms for the connected party number
|
||||
* \note This value is set to "cpndialplan" in /etc/asterisk/misdn.conf for outgoing calls
|
||||
*/
|
||||
enum mISDN_NUMBER_PLAN cpnnumplan;
|
||||
|
||||
/*! \brief Progress Indicator IE coding standard field.
|
||||
* \note Collected from the incoming messages but not used.
|
||||
*/
|
||||
int progress_coding;
|
||||
|
||||
/*! \brief Progress Indicator IE location field.
|
||||
* \note Collected from the incoming messages but not used.
|
||||
*/
|
||||
int progress_location;
|
||||
|
||||
/*! \brief Progress Indicator IE progress description field.
|
||||
* Used to determine if there is an inband audio message present.
|
||||
*/
|
||||
int progress_indicator;
|
||||
|
||||
/*! \brief Inbound FACILITY message function type and contents */
|
||||
struct FacParm fac_in;
|
||||
|
||||
/*! \brief Outbound FACILITY message function type and contents.
|
||||
* \note Filled in by misdn facility commands before FACILITY message sent.
|
||||
*/
|
||||
struct FacParm fac_out;
|
||||
|
||||
/* storing the current AOCD info here */
|
||||
@@ -281,102 +375,205 @@ struct misdn_bchannel {
|
||||
struct FacAOCDCurrency currency;
|
||||
struct FacAOCDChargingUnit chargingUnit;
|
||||
} AOCD;
|
||||
|
||||
enum event_e evq;
|
||||
|
||||
/*** CRYPTING STUFF ***/
|
||||
|
||||
int crypt;
|
||||
int curprx;
|
||||
int curptx;
|
||||
char crypt_key[255];
|
||||
|
||||
int crypt_state;
|
||||
|
||||
/*char ast_dtmf_buf[255];
|
||||
char misdn_dtmf_buf[255]; */
|
||||
|
||||
/*** CRYPTING STUFF END***/
|
||||
|
||||
int active;
|
||||
int upset;
|
||||
|
||||
/*! \brief Event waiting for Layer 1 to come up */
|
||||
enum event_e evq;
|
||||
|
||||
/*** CRYPTING STUFF ***/
|
||||
int crypt; /* Initialized, Not used */
|
||||
int curprx; /* Initialized, Not used */
|
||||
int curptx; /* Initialized, Not used */
|
||||
|
||||
/*! \brief Blowfish encryption key string (secret) */
|
||||
char crypt_key[255];
|
||||
|
||||
int crypt_state; /* Not used */
|
||||
/*** CRYPTING STUFF END***/
|
||||
|
||||
/*! \brief Seems to have been intended for something to do with the jitter buffer.
|
||||
* \note Used as a boolean. Only initialized to 0 and referenced in a couple places
|
||||
*/
|
||||
int active;
|
||||
int upset; /* Not used */
|
||||
|
||||
/*! \brief TRUE if tone generator allowed to start */
|
||||
int generate_tone;
|
||||
|
||||
/*! \brief Number of tone samples to generate */
|
||||
int tone_cnt;
|
||||
|
||||
|
||||
/*! \brief Current B Channel state */
|
||||
enum bchannel_state bc_state;
|
||||
|
||||
/*! \brief This is used as a pending bridge join request for when bc_state becomes BCHAN_ACTIVATED */
|
||||
enum bchannel_state next_bc_state;
|
||||
|
||||
/*! \brief Bridging conference ID */
|
||||
int conf_id;
|
||||
|
||||
|
||||
/*! \brief TRUE if this channel is on hold */
|
||||
int holded;
|
||||
|
||||
/*! \brief TRUE if this channel is on the misdn_stack->holding list
|
||||
* \note If TRUE this implies that the structure is also malloced.
|
||||
*/
|
||||
int stack_holder;
|
||||
|
||||
/*! \brief Caller ID presentation restriction code
|
||||
* 0=Allowed, 1=Restricted, 2=Unavailable
|
||||
* \note It is settable by the misdn_set_opt() application.
|
||||
*/
|
||||
int pres;
|
||||
|
||||
/*! \brief Caller ID screening code
|
||||
* 0=Unscreened, 1=Passed Screen, 2=Failed Screen, 3=Network Number
|
||||
*/
|
||||
int screen;
|
||||
|
||||
|
||||
/*! \brief SETUP message bearer capability field code value */
|
||||
int capability;
|
||||
|
||||
/*! \brief Companding ALaw/uLaw encoding (INFO_CODEC_ALAW / INFO_CODEC_ULAW) */
|
||||
int law;
|
||||
/** V110 Stuff **/
|
||||
|
||||
/* V110 Stuff */
|
||||
/*! \brief Q.931 Bearer Capability IE Information Transfer Rate field. Initialized to 0x10 (64kbit). Altered by incoming SETUP messages. */
|
||||
int rate;
|
||||
|
||||
/*! \brief Q.931 Bearer Capability IE Transfer Mode field. Initialized to 0 (Circuit). Altered by incoming SETUP messages. */
|
||||
int mode;
|
||||
|
||||
/*! \brief Q.931 Bearer Capability IE User Information Layer 1 Protocol field code.
|
||||
* \note Collected from the incoming SETUP message but not used.
|
||||
*/
|
||||
int user1;
|
||||
|
||||
/*! \brief Q.931 Bearer Capability IE Layer 1 User Rate field.
|
||||
* \note Collected from the incoming SETUP message and exported to Asterisk variable MISDN_URATE.
|
||||
*/
|
||||
int urate;
|
||||
|
||||
/*! \brief TRUE if call made in digital HDLC mode
|
||||
* \note This value is user configurable in /etc/asterisk/misdn.conf.
|
||||
* It is also settable by the misdn_set_opt() application.
|
||||
*/
|
||||
int hdlc;
|
||||
/* V110 */
|
||||
|
||||
|
||||
/*! \brief Display message that can be displayed by the user phone.
|
||||
* \note Maximum displayable length is 34 or 82 octets.
|
||||
* It is also settable by the misdn_set_opt() application.
|
||||
*/
|
||||
char display[84];
|
||||
|
||||
/*! \brief Not used. Contents are setup but not used. */
|
||||
char msn[32];
|
||||
|
||||
/*! \brief Originating/Calling Phone Number (Address)
|
||||
* \note This value can be set to "callerid" in /etc/asterisk/misdn.conf for outgoing calls
|
||||
*/
|
||||
char oad[32];
|
||||
|
||||
/*! \brief Redirecting Phone Number (Address) where a call diversion or transfer was invoked */
|
||||
char rad[32];
|
||||
|
||||
/*! \brief Dialed/Called Phone Number (Address) */
|
||||
char dad[32];
|
||||
|
||||
/*! \brief Connected Party/Line Phone Number (Address) */
|
||||
char cad[32];
|
||||
|
||||
/*! \brief Original Dialed/Called Phone Number (Address) before national/international dialing prefix added.
|
||||
* \note Not used. Contents are setup but not used.
|
||||
*/
|
||||
char orig_dad[32];
|
||||
|
||||
/*! \brief Q.931 Keypad Facility IE contents
|
||||
* \note Contents exported and imported to Asterisk variable MISDN_KEYPAD
|
||||
*/
|
||||
char keypad[32];
|
||||
|
||||
/*! \brief Current overlap dialing digits to/from INFORMATION messages */
|
||||
char info_dad[64];
|
||||
|
||||
/*! \brief Collected digits to go into info_dad[] while waiting for a SETUP_ACKNOWLEDGE to come in. */
|
||||
char infos_pending[64];
|
||||
|
||||
/* unsigned char info_keypad[32]; */
|
||||
/* unsigned char clisub[24]; */
|
||||
/* unsigned char cldsub[24]; */
|
||||
|
||||
/*! \brief User-User information string.
|
||||
* \note Contents exported and imported to Asterisk variable MISDN_USERUSER
|
||||
* \note We only support ASCII strings (IA5 characters).
|
||||
*/
|
||||
char uu[256];
|
||||
|
||||
/*! \brief User-User information string length in uu[] */
|
||||
int uulen;
|
||||
|
||||
|
||||
/*! \brief Q.931 Cause for disconnection code (received)
|
||||
* \note Need to use the AST_CAUSE_xxx code definitions in causes.h
|
||||
*/
|
||||
int cause;
|
||||
|
||||
/*! \brief Q.931 Cause for disconnection code (sent)
|
||||
* \note Need to use the AST_CAUSE_xxx code definitions in causes.h
|
||||
* \note -1 is used to suppress including the cause code in the RELEASE message.
|
||||
*/
|
||||
int out_cause;
|
||||
|
||||
|
||||
/* struct misdn_bchannel hold_bc; */
|
||||
|
||||
|
||||
/** list stuf **/
|
||||
|
||||
#ifdef MISDN_1_2
|
||||
/*! \brief The configuration string for the mISDN dsp pipeline in /etc/asterisk/misdn.conf. */
|
||||
char pipeline[128];
|
||||
#else
|
||||
/*! \brief TRUE if the echo cancellor is enabled */
|
||||
int ec_enable;
|
||||
|
||||
/*! \brief Number of taps in the echo cancellor when enabled.
|
||||
* \note This value is user configurable in /etc/asterisk/misdn.conf (echocancel)
|
||||
*/
|
||||
int ec_deftaps;
|
||||
#endif
|
||||
|
||||
|
||||
/*! \brief TRUE if the channel was allocated from the available B channels */
|
||||
int channel_found;
|
||||
|
||||
|
||||
/*! \brief Who originated the call (ORG_AST, ORG_MISDN)
|
||||
* \note Set but not used when the misdn_set_opt() application enables echo cancellation.
|
||||
*/
|
||||
int orig;
|
||||
|
||||
/*! \brief Tx gain setting (range -8 to 8)
|
||||
* \note This value is user configurable in /etc/asterisk/misdn.conf.
|
||||
* It is also settable by the misdn_set_opt() application.
|
||||
*/
|
||||
int txgain;
|
||||
|
||||
/*! \brief Rx gain setting (range -8 to 8)
|
||||
* \note This value is user configurable in /etc/asterisk/misdn.conf.
|
||||
* It is also settable by the misdn_set_opt() application.
|
||||
*/
|
||||
int rxgain;
|
||||
|
||||
|
||||
/*! \brief Next node in the misdn_stack.holding list */
|
||||
struct misdn_bchannel *next;
|
||||
};
|
||||
|
||||
|
||||
enum event_response_e (*cb_event) (enum event_e event, struct misdn_bchannel *bc, void *user_data);
|
||||
void (*cb_log) (int level, int port, char *tmpl, ...);
|
||||
void (*cb_log) (int level, int port, char *tmpl, ...)
|
||||
__attribute__ ((format (printf, 3, 4)));
|
||||
int (*cb_jb_empty)(struct misdn_bchannel *bc, char *buffer, int len);
|
||||
|
||||
struct misdn_lib_iface {
|
||||
enum event_response_e (*cb_event)(enum event_e event, struct misdn_bchannel *bc, void *user_data);
|
||||
void (*cb_log)(int level, int port, char *tmpl, ...);
|
||||
void (*cb_log)(int level, int port, char *tmpl, ...)
|
||||
__attribute__ ((format (printf, 3, 4)));
|
||||
int (*cb_jb_empty)(struct misdn_bchannel *bc, char *buffer, int len);
|
||||
};
|
||||
|
||||
@@ -429,7 +626,7 @@ int misdn_lib_port_up(int port, int notcheck);
|
||||
int misdn_lib_get_port_down(int port);
|
||||
|
||||
int misdn_lib_get_port_up (int port) ;
|
||||
|
||||
|
||||
int misdn_lib_maxports_get(void) ;
|
||||
|
||||
void misdn_lib_release(struct misdn_bchannel *bc);
|
||||
|
@@ -26,8 +26,8 @@
|
||||
#endif
|
||||
|
||||
|
||||
ibuffer_t *astbuf;
|
||||
ibuffer_t *misdnbuf;
|
||||
ibuffer_t *astbuf; /* Not used */
|
||||
ibuffer_t *misdnbuf; /* Not used */
|
||||
|
||||
struct send_lock {
|
||||
pthread_mutex_t lock;
|
||||
@@ -36,15 +36,14 @@ struct send_lock {
|
||||
|
||||
struct isdn_msg {
|
||||
unsigned long misdn_msg;
|
||||
|
||||
|
||||
enum layer_e layer;
|
||||
enum event_e event;
|
||||
|
||||
|
||||
void (*msg_parser)(struct isdn_msg *msgs, msg_t *msg, struct misdn_bchannel *bc, int nt);
|
||||
msg_t *(*msg_builder)(struct isdn_msg *msgs, struct misdn_bchannel *bc, int nt);
|
||||
char *info;
|
||||
|
||||
} ;
|
||||
} ;
|
||||
|
||||
/* for isdn_msg_parser.c */
|
||||
msg_t *create_l3msg(int prim, int mt, int dinfo , int size, int nt);
|
||||
@@ -55,57 +54,78 @@ struct misdn_stack {
|
||||
/** is first element because &nst equals &mISDNlist **/
|
||||
net_stack_t nst;
|
||||
manager_t mgr;
|
||||
|
||||
|
||||
/*! \brief D Channel mISDN driver stack ID (Parent stack ID) */
|
||||
int d_stid;
|
||||
|
||||
|
||||
/*! /brief Number of B channels supported by this port */
|
||||
int b_num;
|
||||
|
||||
|
||||
/*! \brief B Channel mISDN driver stack IDs (Child stack IDs) */
|
||||
int b_stids[MAX_BCHANS + 1];
|
||||
|
||||
|
||||
/*! \brief TRUE if Point-To-Point(PTP) (Point-To-Multipoint(PTMP) otherwise) */
|
||||
int ptp;
|
||||
|
||||
/*! \brief Number of consecutive times PTP Layer 2 declared down */
|
||||
int l2upcnt;
|
||||
|
||||
int l2_id;
|
||||
int lower_id;
|
||||
int upper_id;
|
||||
|
||||
int l2_id; /* Not used */
|
||||
|
||||
/*! \brief Lower layer mISDN ID (addr) (Layer 1/3) */
|
||||
int lower_id;
|
||||
|
||||
/*! \brief Upper layer mISDN ID (addr) (Layer 2/4) */
|
||||
int upper_id;
|
||||
|
||||
/*! \brief TRUE if port is blocked */
|
||||
int blocked;
|
||||
|
||||
/*! \brief TRUE if Layer 2 is UP */
|
||||
int l2link;
|
||||
|
||||
time_t l2establish;
|
||||
|
||||
|
||||
time_t l2establish; /* Not used */
|
||||
|
||||
/*! \brief TRUE if Layer 1 is UP */
|
||||
int l1link;
|
||||
|
||||
/*! \brief TRUE if restart has been sent to the other side after stack startup */
|
||||
int restart_sent;
|
||||
|
||||
/*! \brief mISDN device handle returned by mISDN_open() */
|
||||
int midev;
|
||||
|
||||
int nt;
|
||||
|
||||
int pri;
|
||||
|
||||
|
||||
/*! \brief TRUE if NT side of protocol (TE otherwise) */
|
||||
int nt;
|
||||
|
||||
/*! \brief TRUE if ISDN-PRI (ISDN-BRI otherwise) */
|
||||
int pri;
|
||||
|
||||
/*! \brief CR Process ID allocation table. TRUE if ID allocated */
|
||||
int procids[0x100+1];
|
||||
|
||||
/*! \brief Queue of Event messages to send to mISDN */
|
||||
msg_queue_t downqueue;
|
||||
msg_queue_t upqueue;
|
||||
int busy;
|
||||
|
||||
msg_queue_t upqueue; /* No code puts anything on this queue */
|
||||
int busy; /* Not used */
|
||||
|
||||
/*! \brief Logical Layer 1 port associated with this stack */
|
||||
int port;
|
||||
|
||||
/*! \brief B Channel record pool array */
|
||||
struct misdn_bchannel bc[MAX_BCHANS + 1];
|
||||
|
||||
struct misdn_bchannel* bc_list;
|
||||
|
||||
|
||||
struct misdn_bchannel* bc_list; /* Not used */
|
||||
|
||||
/*! \brief Array of B channels in use (a[0] = B1). TRUE if B channel in use */
|
||||
int channels[MAX_BCHANS + 1];
|
||||
|
||||
|
||||
struct misdn_bchannel *holding; /* Queue which holds holded channels :) */
|
||||
|
||||
/*! \brief List of holded channels */
|
||||
struct misdn_bchannel *holding;
|
||||
|
||||
/*! \brief Next stack in the list of stacks */
|
||||
struct misdn_stack *next;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
struct misdn_stack* get_stack_by_bc(struct misdn_bchannel *bc);
|
||||
|
@@ -196,19 +196,19 @@ static const struct misdn_cfg_spec port_spec[] = {
|
||||
{ "presentation", MISDN_CFG_PRES, MISDN_CTYPE_INT, "-1", NONE,
|
||||
"These (presentation and screen) are the exact isdn screening and presentation\n"
|
||||
"\tindicators.\n"
|
||||
"\tIf -1 is given for both values, the presentation indicators are used from\n"
|
||||
"\tAsterisks SetCallerPres application.\n"
|
||||
"\tIf -1 is given for either value, the presentation indicators are used from\n"
|
||||
"\tAsterisk's SetCallerPres application.\n"
|
||||
"\n"
|
||||
"\tscreen=0, presentation=0 -> callerid presented not screened\n"
|
||||
"\tscreen=1, presentation=1 -> callerid presented but screened (the remote end doesn't see it!)" },
|
||||
"\tscreen=0, presentation=0 -> callerid presented\n"
|
||||
"\tscreen=1, presentation=1 -> callerid restricted (the remote end doesn't see it!)" },
|
||||
{ "screen", MISDN_CFG_SCREEN, MISDN_CTYPE_INT, "-1", NONE,
|
||||
"These (presentation and screen) are the exact isdn screening and presentation\n"
|
||||
"\tindicators.\n"
|
||||
"\tIf -1 is given for both values, the presentation indicators are used from\n"
|
||||
"\tAsterisks SetCallerPres application.\n"
|
||||
"\tIf -1 is given for either value, the presentation indicators are used from\n"
|
||||
"\tAsterisk's SetCallerPres application.\n"
|
||||
"\n"
|
||||
"\tscreen=0, presentation=0 -> callerid presented not screened\n"
|
||||
"\tscreen=1, presentation=1 -> callerid presented but screened (the remote end doesn't see it!)" },
|
||||
"\tscreen=0, presentation=0 -> callerid presented\n"
|
||||
"\tscreen=1, presentation=1 -> callerid restricted (the remote end doesn't see it!)" },
|
||||
{ "always_immediate", MISDN_CFG_ALWAYS_IMMEDIATE, MISDN_CTYPE_BOOL, "no", NONE,
|
||||
"Enable this to get into the s dialplan-extension.\n"
|
||||
"\tThere you can use DigitTimeout if you can't or don't want to use\n"
|
||||
|
@@ -345,10 +345,10 @@ nodialtone=no
|
||||
|
||||
;
|
||||
; these are the exact isdn screening and presentation indicators
|
||||
; if -1 is given for both values the presentation indicators are used
|
||||
; if -1 is given for either value the presentation indicators are used
|
||||
; from asterisks SetCallerPres application.
|
||||
; s=0, p=0 -> callerid presented not screened
|
||||
; s=1, p=1 -> callerid presented but screened (the remote end does not see it!)
|
||||
; s=0, p=0 -> callerid presented
|
||||
; s=1, p=1 -> callerid restricted (the remote end does not see it!)
|
||||
;
|
||||
; default values s=-1, p=-1
|
||||
presentation=-1
|
||||
|
144
doc/misdn.txt
144
doc/misdn.txt
@@ -2,29 +2,28 @@ mISDN Channel Driver for Asterisk PBX
|
||||
======================================
|
||||
|
||||
|
||||
This package contains the mISDN Channel Driver for the Asterisk PBX. It
|
||||
supports every mISDN Hardware and provides an interface for asterisk.
|
||||
This package contains the mISDN Channel Driver for the Asterisk PBX. It
|
||||
supports every mISDN Hardware and provides an interface for Asterisk.
|
||||
|
||||
Features:
|
||||
Features:
|
||||
---------
|
||||
|
||||
* NT and TE mode
|
||||
* PP and PMP mode
|
||||
* BRI and PRI (with BNE1 and BN2E1 Cards)
|
||||
* Hardware Bridging
|
||||
* DTMF Detection in HW+mISDNdsp
|
||||
* Display Messages on Phones (on those that support display msg)
|
||||
* Hardware bridging
|
||||
* DTMF detection in HW+mISDNdsp
|
||||
* Display messages on phones (on those that support it)
|
||||
* app_SendText
|
||||
* HOLD/RETRIEVE/TRANSFER on ISDN Phones : )
|
||||
* Screen/ Not Screen User Number
|
||||
* EchoCancellation
|
||||
* Volume Control
|
||||
* HOLD/RETRIEVE/TRANSFER on ISDN phones : )
|
||||
* Allow/restrict user number presentation
|
||||
* Volume control
|
||||
* Crypting with mISDNdsp (Blowfish)
|
||||
* Data (HDLC) callthrough
|
||||
* Data Calling (with app_ptyfork +pppd)
|
||||
* Data (HDLC) callthrough
|
||||
* Data calling (with app_ptyfork +pppd)
|
||||
* Echo cancellation
|
||||
* CallDeflection
|
||||
* Some other
|
||||
* Call deflection
|
||||
* Some others
|
||||
|
||||
Supported Hardware:
|
||||
-------------------
|
||||
@@ -49,12 +48,12 @@ Overview
|
||||
Fast Installation Guide
|
||||
-----------------------
|
||||
|
||||
It is easy to install mISDN and mISDNuser. Just fetch the newest head of the
|
||||
cvs, this can be done by:
|
||||
It is easy to install mISDN and mISDNuser. This can be done by:
|
||||
* You can download latest stable releases from http://www.misdn.org/downloads
|
||||
* Just fetch the newest head of the GIT (mISDN project moved from CVS)
|
||||
In details this process described here: http://www.misdn.org/index.php/GIT
|
||||
|
||||
cvs -d:pserver:anonymous:readonly@cvs.isdn4linux.de:/i4ldev co mISDN mISDNuser
|
||||
|
||||
the compile and install both with:
|
||||
then compile and install both with:
|
||||
|
||||
cd mISDN ;
|
||||
make && make install
|
||||
@@ -64,26 +63,25 @@ make && make install
|
||||
cd mISDNuser ;
|
||||
make && make install
|
||||
|
||||
Now you can compile chan_misdn, just by making asterisk:
|
||||
Now you can compile chan_misdn, just by making Asterisk:
|
||||
|
||||
cd asterisk ;
|
||||
make && make install
|
||||
cd asterisk ;
|
||||
./configure && make && make install
|
||||
|
||||
That's all!
|
||||
|
||||
|
||||
Follow the instructions in the mISDN Package for howto loading the Kernel
|
||||
Modules.
|
||||
Follow the instructions in the mISDN Package for how to load the Kernel
|
||||
Modules. Also install process described in http://www.misdn.org/index.php/Installing_mISDN
|
||||
|
||||
Pre-Requisites
|
||||
--------------
|
||||
|
||||
To compile and install this driver, you'll need at least one mISDN Driver and
|
||||
the mISDNuser package. Chan_misdn works with both, the current release version
|
||||
and the development (svn trunk) version of Asterisk. mISDNuser and mISDN must
|
||||
be fetched from cvs.isdn4linux.de.
|
||||
and the development (svn trunk) version of Asterisk.
|
||||
|
||||
You should use Kernels >= 2.6.9
|
||||
You should use Kernels >= 2.6.9
|
||||
|
||||
|
||||
Configuration
|
||||
@@ -98,37 +96,37 @@ script is:
|
||||
|
||||
|
||||
Now you will want to configure the misdn.conf file which resides in the
|
||||
asterisk config directory (normally /etc/asterisk).
|
||||
Asterisk config directory (normally /etc/asterisk).
|
||||
|
||||
- misdn.conf: [general]
|
||||
The misdn.conf file contains a "general" Section, and user sections which
|
||||
The misdn.conf file contains a "general" subsection, and user subsections which
|
||||
contain misdn port settings and different Asterisk contexts.
|
||||
|
||||
In the general Section you can set options that are not directly port
|
||||
In the general subsection you can set options that are not directly port
|
||||
related. There is for example the very important debug variable which you can
|
||||
set from the Asterisk cli (command line interface) or in this configuration
|
||||
file, bigger numbers will lead to more debug output. There's also a tracefile
|
||||
file, bigger numbers will lead to more debug output. There's also a trace file
|
||||
option, which takes a path+filename where debug output is written to.
|
||||
|
||||
- misdn.conf: [default] section
|
||||
- misdn.conf: [default] subsection
|
||||
|
||||
The default section is another special section which can contain all the
|
||||
options available in the user/port sections. the user/port section inherit
|
||||
their parameters from the default section.
|
||||
The default subsection is another special subsection which can contain all the
|
||||
options available in the user/port subsections. The user/port subsections inherit
|
||||
their parameters from the default subsection.
|
||||
|
||||
- misdn.conf: user/port sections
|
||||
- misdn.conf: user/port subsections
|
||||
|
||||
The user sections have names which are unequal to "general". Those sections
|
||||
The user subsections have names which are unequal to "general". Those subsections
|
||||
contain the ports variable which mean the mISDN Ports. Here you can add
|
||||
multiple ports, comma separated.
|
||||
|
||||
Espacially for TE-Mode Ports there is a msns option. This option tells the
|
||||
Especially for TE-Mode Ports there is a msns option. This option tells the
|
||||
chan_misdn driver to listen for incoming calls with the given msns, you can
|
||||
insert a '*' as single msn, which leads in getting every incoming call (if you
|
||||
want to share on PMP TE S0 with a asterisk and a phone or isdn card you should
|
||||
insert here the msns which you'll like to give the Asterisk). Finally a
|
||||
context variable resides in the user sections, which tells chan_misdn where to
|
||||
send incoming calls to in the Asterisk dial plan (extension.conf).
|
||||
insert a '*' as single msn, which leads to getting every incoming call. If you
|
||||
want to share on PMP TE S0 with Asterisk and a phone or ISDN card you should
|
||||
insert here the msns which you assign to Asterisk. Finally a context variable
|
||||
resides in the user subsections, which tells chan_misdn where to send incoming
|
||||
calls to in the Asterisk dial plan (extension.conf).
|
||||
|
||||
|
||||
Dial and Options String
|
||||
@@ -140,20 +138,32 @@ so the generic dial string looks like:
|
||||
mISDN/<port>|g:<group>/<extension>[/<OPTIONSSTRING>]
|
||||
|
||||
The Optionsstring looks Like:
|
||||
:<optchar1><OptParam1>:<optchar2><OptParam2>
|
||||
:<optchar><optarg>:<optchar><optarg>...
|
||||
|
||||
the ":" character is the delimiter.
|
||||
|
||||
The available Optchars are:
|
||||
d - Send display text on called phone, text is the optparam
|
||||
n - don't detect dtmf tones on called channel
|
||||
h - make digital outgoing call
|
||||
c - make crypted outgoing call, param is keyindex
|
||||
e - perform echo cancellation on this channel,
|
||||
takes taps as arguments (32,64,128,256)
|
||||
s - send Non Inband DTMF as inband
|
||||
vr - rxgain control
|
||||
vt - txgain control
|
||||
The available options are:
|
||||
a - Have Asterisk detect DTMF tones on called channel
|
||||
c - Make crypted outgoing call, optarg is keyindex
|
||||
d - Send display text to called phone, text is the optarg
|
||||
e - Perform echo cancelation on this channel,
|
||||
takes taps as optarg (32,64,128,256)
|
||||
e! - Disable echo cancelation on this channel
|
||||
f - Enable fax detection
|
||||
h - Make digital outgoing call
|
||||
h1 - Make HDLC mode digital outgoing call
|
||||
i - Ignore detected DTMF tones, don't signal them to Asterisk,
|
||||
they will be transported inband.
|
||||
jb - Set jitter buffer length, optarg is length
|
||||
jt - Set jitter buffer upper threshold, optarg is threshold
|
||||
jn - Disable jitter buffer
|
||||
n - Disable mISDN DSP on channel.
|
||||
Disables: echo cancel, DTMF detection, and volume control.
|
||||
p - Caller ID presentation,
|
||||
optarg is either 'allowed' or 'restricted'
|
||||
s - Send Non-inband DTMF as inband
|
||||
vr - Rx gain control, optarg is gain
|
||||
vt - Tx gain control, optarg is gain
|
||||
|
||||
|
||||
chan_misdn registers a new dial plan application "misdn_set_opt" when
|
||||
@@ -167,10 +177,10 @@ channel. When you set options with misdn_set_opt, they are set in the current
|
||||
incoming channel. So if you like to use static encryption, the scenario looks
|
||||
as follows:
|
||||
|
||||
Phone1 --> * Box 1 --> PSTN_TE
|
||||
Phone1 --> * Box 1 --> PSTN_TE
|
||||
PSTN_TE --> * Box 2 --> Phone2
|
||||
|
||||
The Encryption must be done on the PSTN sides, so the dialplan on the boxes
|
||||
The encryption must be done on the PSTN sides, so the dialplan on the boxes
|
||||
are:
|
||||
|
||||
* Box 1:
|
||||
@@ -183,20 +193,20 @@ exten => ${CRYPT_MSN},2,dial(${PHONE2})
|
||||
|
||||
|
||||
|
||||
misdn cli commands
|
||||
mISDN CLI commands
|
||||
------------------
|
||||
|
||||
At the Asterisk cli you can try to type in:
|
||||
At the Asterisk cli you can try to type in:
|
||||
|
||||
misdn <tab> <tab>
|
||||
|
||||
Now you should see the misdn cli commands:
|
||||
Now you should see the misdn cli commands:
|
||||
|
||||
- clean
|
||||
-> pid (cleans a broken call, use with care, leads often
|
||||
to a segmentation fault)
|
||||
- send
|
||||
-> display (sends a Text Message to a Asterisk channel,
|
||||
-> display (sends a Text Message to a Asterisk channel,
|
||||
this channel must be an misdn channel)
|
||||
- set
|
||||
-> debug (sets debug level)
|
||||
@@ -207,14 +217,14 @@ Now you should see the misdn cli commands:
|
||||
-> stacks (shows the current ports, their protocols and states)
|
||||
-> fullstacks (shows the current active and inactive misdn channels)
|
||||
|
||||
- restart
|
||||
- restart
|
||||
-> port (restarts given port (L2 Restart) )
|
||||
|
||||
- reload (reloads misdn.conf)
|
||||
|
||||
You can only use "misdn send display" when an Asterisk channel is created and
|
||||
isdn is in the correct state. "correct state" means that you have established a
|
||||
call to another phone (mustn't be isdn though).
|
||||
call to another phone (must not be isdn though).
|
||||
|
||||
Then you use it like this:
|
||||
|
||||
@@ -227,9 +237,9 @@ msn (callerid) of the Phone to send the text to.
|
||||
mISDN Variables
|
||||
---------------
|
||||
|
||||
mISDN Exports/Imports a few Variables:
|
||||
mISDN Exports/Imports a few Variables:
|
||||
|
||||
- MISDN_ADDRESS_COMPLETE : Is either set to 1 from the Provider, or you
|
||||
- MISDN_ADDRESS_COMPLETE : Is either set to 1 from the Provider, or you
|
||||
can set it to 1 to force a sending complete.
|
||||
|
||||
|
||||
@@ -238,8 +248,8 @@ Debugging and sending bug reports
|
||||
---------------------------------
|
||||
|
||||
If you encounter problems, you should set up the debugging flag, usually
|
||||
debug=2 should be enough. the messages are divided in asterisk and misdn
|
||||
parts. Misdn Debug messages begin with an 'I', asterisk messages begin with
|
||||
debug=2 should be enough. The messages are divided into Asterisk and mISDN
|
||||
parts. mISDN Debug messages begin with an 'I', Asterisk messages begin with
|
||||
an '*', the rest is clear I think.
|
||||
|
||||
Please take a trace of the problem and open a report in the Asterisk issue
|
||||
@@ -282,7 +292,7 @@ modules) then modprobe ztdummy, this resolves the problem.
|
||||
* I cannot hear any tone after a successful CONNECT to the other end
|
||||
|
||||
-> you forgot to load mISDNdsp, which is now needed by chan_misdn for switching
|
||||
and dtmf tone detection
|
||||
and DTMF tone detection.
|
||||
|
||||
|
||||
Changes
|
||||
|
@@ -957,16 +957,16 @@ int ast_is_shrinkable_phonenumber(const char *exten)
|
||||
return ast_is_valid_string(exten, "0123456789*#+()-.");
|
||||
}
|
||||
|
||||
/*! \brief parse string for caller id information
|
||||
\return always returns 0, as the code always returns something.
|
||||
XXX note that 'name' is not parsed consistently e.g. we have
|
||||
|
||||
input location name
|
||||
" foo bar " <123> 123 ' foo bar ' (with spaces around)
|
||||
" foo bar " NULL 'foo bar' (without spaces around)
|
||||
" foo bar <123>" 123 '" foo bar'
|
||||
The parsing of leading and trailing space/quotes should be more consistent.
|
||||
*/
|
||||
/*!
|
||||
* \brief Destructively parse instr for caller id information
|
||||
* \return always returns 0, as the code always returns something.
|
||||
* \note XXX 'name' is not parsed consistently e.g. we have
|
||||
* input location name
|
||||
* " foo bar " <123> 123 ' foo bar ' (with spaces around)
|
||||
* " foo bar " NULL 'foo bar' (without spaces around)
|
||||
* " foo bar <123>" 123 '" foo bar'
|
||||
* The parsing of leading and trailing space/quotes should be more consistent.
|
||||
*/
|
||||
int ast_callerid_parse(char *instr, char **name, char **location)
|
||||
{
|
||||
char *ns, *ne, *ls, *le;
|
||||
|
Reference in New Issue
Block a user