Asterisk - The Open Source Telephony Project  18.5.0
isdn_lib.h
Go to the documentation of this file.
1 /*
2  * Chan_Misdn -- Channel Driver for Asterisk
3  *
4  * Interface to mISDN
5  *
6  * Copyright (C) 2004, Christian Richter
7  *
8  * Christian Richter <[email protected]>
9  *
10  * This program is free software, distributed under the terms of
11  * the GNU General Public License
12  */
13 
14 /*! \file
15  * \brief Interface to mISDN
16  *
17  * \author Christian Richter <[email protected]>
18  */
19 
20 #ifndef TE_LIB
21 #define TE_LIB
22 
23 #include <mISDNuser/suppserv.h>
24 
25 /** For initialization usage **/
26 /* typedef int ie_nothing_t ;*/
27 /** end of init usage **/
28 
29 
30 /*
31  * uncomment the following to make chan_misdn create
32  * record files in /tmp/misdn-{rx|tx}-PortChannel format
33  * */
34 
35 /*#define MISDN_SAVE_DATA*/
36 
37 #ifdef WITH_BEROEC
38 typedef int beroec_t;
39 
40 
41 enum beroec_type {
42  BEROEC_FULLBAND=0,
43  BEROEC_SUBBAND,
44  BEROEC_FASTSUBBAND
45 };
46 
47 void beroec_init(void);
48 void beroec_exit(void);
49 beroec_t *beroec_new(int tail, enum beroec_type type, int anti_howl,
50  int tonedisable, int zerocoeff, int adapt, int nlp);
51 
52 void beroec_destroy(beroec_t *ec);
53 int beroec_cancel_alaw_chunk(beroec_t *ec,
54  char *send,
55  char *receive,
56  int len);
57 
58 int beroec_version(void);
59 #endif
60 
61 
62 
63 enum tone_e {
72 };
73 
74 
75 
76 #define MAX_BCHANS 31
77 
85 };
86 
87 
90 };
91 
94  NUMPLAN_ISDN = 0x1, /* ISDN/Telephony numbering plan E.164 */
95  NUMPLAN_DATA = 0x3, /* Data numbering plan X.121 */
96  NUMPLAN_TELEX = 0x4, /* Telex numbering plan F.69 */
99 };
100 
108 };
109 
116 };
117 
118 
119 enum event_e {
163 };
164 
165 
166 enum ie_name_e {
169 };
170 
171 enum { /* bearer capability */
179 };
180 
181 enum { /* progress indicators */
192 };
193 
194 /*!
195  * \brief Q.931 encoded redirecting reason
196  */
199  /*! Call forwarding busy or called DTE busy */
201  /*! Call forwarding no reply */
203  /*! Call deflection */
205  /*! Called DTE out of order */
207  /*! Call forwarding by the called DTE */
209  /*! Call forwarding unconditional or systematic call redirection */
211 };
212 
213 /*!
214  * \brief Notification description code enumeration
215  */
218  /*! Call is placed on hold (Q.931) */
220  /*! Call is taken off of hold (Q.931) */
222  /*! Call is diverting (EN 300 207-1 Section 7.2.1) */
224  /*! Call diversion is enabled (cfu, cfb, cfnr) (EN 300 207-1 Section 7.2.1) */
226  /*! Call transfer, alerting (EN 300 369-1 Section 7.2) */
228  /*! Call transfer, active(answered) (EN 300 369-1 Section 7.2) */
230 };
231 
232 enum { /*CODECS*/
235 };
236 
237 
238 enum layer_e {
239  L3,
240  L2,
241  L1,
243 };
244 
245 /*! Maximum phone number (address) length plus null terminator */
246 #define MISDN_MAX_NUMBER_LEN (31 + 1)
247 
248 /*! Maximum name length plus null terminator (From ECMA-164) */
249 #define MISDN_MAX_NAME_LEN (50 + 1)
250 
251 /*! Maximum subaddress length plus null terminator */
252 #define MISDN_MAX_SUBADDRESS_LEN (23 + 1)
253 
254 /*! Maximum keypad facility content length plus null terminator */
255 #define MISDN_MAX_KEYPAD_LEN (31 + 1)
256 
257 /*! \brief Dialed/Called information struct */
259  /*! \brief Type-of-number in ISDN terms for the dialed/called number */
261 
262  /*! \brief Type-of-number numbering plan. */
264 
265  /*! \brief Dialed/Called Phone Number (Address) */
267 
268  /*! \brief Dialed/Called Subaddress number */
270 };
271 
272 /*! \brief Connected-Line/Calling/Redirecting ID info struct */
274  /*! \brief Number presentation restriction code
275  * 0=Allowed, 1=Restricted, 2=Unavailable
276  */
278 
279  /*! \brief Number screening code
280  * 0=Unscreened, 1=Passed Screen, 2=Failed Screen, 3=Network Number
281  */
283 
284  /*! \brief Type-of-number in ISDN terms for the number */
286 
287  /*! \brief Type-of-number numbering plan. */
289 
290  /*! \brief Subscriber Name
291  * \note The name is currently obtained from Asterisk for
292  * potential use in display ie's since basic ISDN does
293  * not support names directly.
294  */
296 
297  /*! \brief Phone number (Address) */
299 
300  /*! \brief Subaddress number */
302 };
303 
304 /*! \brief Redirecting information struct */
306  /*! \brief Who is redirecting the call (Sent to the party the call is redirected toward) */
307  struct misdn_party_id from;
308 
309  /*! \brief Where the call is being redirected toward (Sent to the calling party) */
310  struct misdn_party_id to;
311 
312  /*! \brief Reason a call is being redirected (Q.931 field value) */
314 
315  /*! \brief Number of times the call has been redirected */
316  int count;
317 
318  /*! \brief TRUE if the redirecting.to information has changed */
320 };
321 
322 
323 /*! \brief B channel control structure */
325  /*! \brief B channel send locking structure */
327 
328 #if defined(AST_MISDN_ENHANCEMENTS)
329  /*! \brief The BC, HLC (optional) and LLC (optional) contents from the SETUP message. */
330  struct Q931_Bc_Hlc_Llc setup_bc_hlc_llc;
331 #endif /* defined(AST_MISDN_ENHANCEMENTS) */
332 
333  /*!
334  * \brief Dialed/Called information struct
335  * \note The number_type element is set to "dialplan" in /etc/asterisk/misdn.conf for outgoing calls
336  */
337  struct misdn_party_dialing dialed;
338 
339  /*! \brief Originating/Caller ID information struct
340  * \note The number_type element can be set to "localdialplan" in /etc/asterisk/misdn.conf for outgoing calls
341  * \note The number element can be set to "callerid" in /etc/asterisk/misdn.conf for outgoing calls
342  */
343  struct misdn_party_id caller;
344 
345  /*! \brief Incoming Caller ID string tag for special purpose
346  * \note The element can be set to "incoming_cid_tag" in /etc/asterisk/misdn.conf for incoming calls
347  */
348  char incoming_cid_tag[MISDN_MAX_NAME_LEN];
349 
350  /*! \brief Connected-Party/Connected-Line ID information struct
351  * \note The number_type element can be set to "cpndialplan" in /etc/asterisk/misdn.conf for outgoing calls
352  */
354 
355  /*! \brief Redirecting information struct (Where a call diversion or transfer was invoked)
356  * \note The redirecting subaddress is not defined in Q.931 so it is not used.
357  */
358  struct misdn_party_redirecting redirecting;
359 
360  /*! \brief TRUE if this is a dummy BC record */
361  int dummy;
362 
363  /*! \brief TRUE if NT side of protocol (TE otherwise) */
364  int nt;
365 
366  /*! \brief TRUE if ISDN-PRI (ISDN-BRI otherwise) */
367  int pri;
368 
369  /*! \brief Logical Layer 1 port associated with this B channel */
370  int port;
371 
372  /** init stuff **/
373  /*! \brief B Channel mISDN driver stack ID */
374  int b_stid;
375 
376  /* int b_addr; */
377 
378  /*! \brief B Channel mISDN driver layer ID from mISDN_new_layer() */
379  int layer_id;
380 
381  /*! \brief B channel layer; set to 3 or 4 */
382  int layer;
383 
384  /* state stuff */
385  /*! \brief TRUE if DISCONNECT needs to be sent to clear a call */
387 
388  /*! \brief TRUE if RELEASE needs to be sent to clear a call */
390 
391  /*! \brief TRUE if RELEASE_COMPLETE needs to be sent to clear a call */
393 
394  /*! \brief TRUE if allocate higher B channels first */
395  int dec;
396 
397  /* var stuff */
398  /*! \brief Layer 3 process ID */
399  int l3_id;
400 
401  /*! \brief B channel process ID (1-5000) */
402  int pid;
403 
404  /*! \brief Not used. Saved mISDN stack CONNECT_t ces value */
405  int ces;
406 
407  /*! \brief B channel to restart if received a RESTART message */
409 
410  /*! \brief Assigned B channel number B1, B2... 0 if not assigned */
411  int channel;
412 
413  /*! \brief TRUE if the B channel number is preselected */
415 
416  /*! \brief TRUE if the B channel is allocated from the REGISTER pool */
418 
419  /*! \brief TRUE if B channel record is in use */
420  int in_use;
421 
422  /*! \brief Time when empty_bc() last called on this record */
423  struct timeval last_used;
424 
425  /*! \brief TRUE if call waiting */
426  int cw;
427 
428  /*! \brief B Channel mISDN driver layer ID from mISDN_get_layerid() */
429  int addr;
430 
431  /*! \brief B channel speech sample data buffer */
432  char *bframe;
433 
434  /*! \brief B channel speech sample data buffer size */
436  int time_usec; /* Not used */
437 
438  /*! \brief Not used. Contents are setup but not used. */
439  void *astbuf;
440 
441  /*! \brief TRUE if the TE side should choose the B channel to use
442  * \note This value is user configurable in /etc/asterisk/misdn.conf
443  */
445 
446  /*! \brief TRUE if the call progress indicators can indicate an inband audio message for the user to listen to
447  * \note This value is user configurable in /etc/asterisk/misdn.conf
448  */
450 
451  /*! \brief Last decoded DTMF digit from mISDN driver */
452  int dtmf;
453 
454  /*! \brief TRUE if we should produce DTMF tones ourselves
455  * \note This value is user configurable in /etc/asterisk/misdn.conf
456  */
458 
459  /*! \brief TRUE if we send SETUP_ACKNOWLEDGE on incoming calls anyway (instead of PROCEEDING).
460  *
461  * This requests additional INFORMATION messages, so we can
462  * wait for digits without issues.
463  * \note This value is user configurable in /etc/asterisk/misdn.conf
464  */
466 
467  /*! \brief TRUE if all digits necessary to complete the call are available.
468  * No more INFORMATION messages are needed.
469  */
471 
472 
473  /*! \brief TRUE if we will not use jollys dsp */
474  int nodsp;
475 
476  /*! \brief TRUE if we will not use the jitter buffer system */
477  int nojitter;
478 
479  /*! \brief Progress Indicator IE coding standard field.
480  * \note Collected from the incoming messages but not used.
481  */
483 
484  /*! \brief Progress Indicator IE location field.
485  * \note Collected from the incoming messages but not used.
486  */
488 
489  /*! \brief Progress Indicator IE progress description field.
490  * Used to determine if there is an inband audio message present.
491  */
493 
494 #if defined(AST_MISDN_ENHANCEMENTS)
495  /*!
496  * \brief TRUE if waiting for DivertingLegInformation3 to queue redirecting update.
497  */
498  int div_leg_3_rx_wanted;
499 
500  /*!
501  * \brief TRUE if a DivertingLegInformation3 needs to be sent with CONNECT.
502  */
503  int div_leg_3_tx_pending;
504 #endif /* defined(AST_MISDN_ENHANCEMENTS) */
505 
506  /*! \brief Inbound FACILITY message function type and contents */
507  struct FacParm fac_in;
508 
509  /*! \brief Outbound FACILITY message function type and contents.
510  * \note Filled in by misdn facility commands before FACILITY message sent.
511  */
512  struct FacParm fac_out;
513 
514  /* storing the current AOCD info here */
515  enum FacFunction AOCDtype;
516  union {
517  struct FacAOCDCurrency currency;
518  struct FacAOCDChargingUnit chargingUnit;
519  } AOCD;
520  /*! \brief TRUE if AOCDtype and AOCD data are ready to export to Asterisk */
522 
523  /*** CRYPTING STUFF ***/
524  int crypt; /* Initialized, Not used */
525  int curprx; /* Initialized, Not used */
526  int curptx; /* Initialized, Not used */
527 
528  /*! \brief Blowfish encryption key string (secret) */
529  char crypt_key[255];
530 
531  int crypt_state; /* Not used */
532  /*** CRYPTING STUFF END***/
533 
534  /*! \brief Seems to have been intended for something to do with the jitter buffer.
535  * \note Used as a boolean. Only initialized to 0 and referenced in a couple places
536  */
537  int active;
538  int upset; /* Not used */
539 
540  /*! \brief TRUE if tone generator allowed to start */
542 
543  /*! \brief Number of tone samples to generate */
544  int tone_cnt;
545 
546  /*! \brief Current B Channel state */
547  enum bchannel_state bc_state;
548 
549  /*! \brief This is used as a pending bridge join request for when bc_state becomes BCHAN_ACTIVATED */
550  enum bchannel_state next_bc_state;
551 
552  /*! \brief Bridging conference ID */
553  int conf_id;
554 
555  /*! \brief TRUE if this channel is on hold */
556  int holded;
557 
558  /*! \brief TRUE if this channel is on the misdn_stack->holding list
559  * \note If TRUE this implies that the structure is also malloced.
560  */
562 
563  /*!
564  * \brief Put a display ie in the CONNECT message
565  * \details
566  * Put a display ie in the CONNECT message containing the following
567  * information if it is available (nt port only):
568  * 0 - Do not put the connected line information in the display ie.
569  * 1 - Put the available connected line name in the display ie.
570  * 2 - Put the available connected line number in the display ie.
571  * 3 - Put the available connected line name and number in the display ie.
572  */
574 
575  /*!
576  * \brief Put a display ie in the SETUP message
577  * \details
578  * Put a display ie in the SETUP message containing the following
579  * information if it is available (nt port only):
580  * 0 - Do not put the caller information in the display ie.
581  * 1 - Put the available caller name in the display ie.
582  * 2 - Put the available caller number in the display ie.
583  * 3 - Put the available caller name and number in the display ie.
584  */
586 
587  /*!
588  * \brief Select what to do with outgoing COLP information.
589  * \details
590  * 0 - pass (Send out COLP information unaltered.)
591  * 1 - restricted (Force COLP to restricted on all outgoing COLP information.)
592  * 2 - block (Do not send COLP information.)
593  */
595 
596  /*! \brief User set presentation restriction code
597  * 0=Allowed, 1=Restricted, 2=Unavailable
598  * \note It is settable by the misdn_set_opt() application.
599  */
601 
602  /*! \brief TRUE if the user set the presentation restriction code */
604 
605  /*! \brief Notification indicator ie description code */
606  enum mISDN_NOTIFY_CODE notify_description_code;
607 
608  /*! \brief SETUP message bearer capability field code value */
610 
611  /*! \brief Companding ALaw/uLaw encoding (INFO_CODEC_ALAW / INFO_CODEC_ULAW) */
612  int law;
613 
614  /* V110 Stuff */
615  /*! \brief Q.931 Bearer Capability IE Information Transfer Rate field. Initialized to 0x10 (64kbit). Altered by incoming SETUP messages. */
616  int rate;
617 
618  /*! \brief Q.931 Bearer Capability IE Transfer Mode field. Initialized to 0 (Circuit). Altered by incoming SETUP messages. */
619  int mode;
620 
621  /*! \brief Q.931 Bearer Capability IE User Information Layer 1 Protocol field code.
622  * \note Collected from the incoming SETUP message but not used.
623  */
624  int user1;
625 
626  /*! \brief Q.931 Bearer Capability IE Layer 1 User Rate field.
627  * \note Collected from the incoming SETUP message and exported to Asterisk variable MISDN_URATE.
628  */
629  int urate;
630 
631  /*! \brief TRUE if call made in digital HDLC mode
632  * \note This value is user configurable in /etc/asterisk/misdn.conf.
633  * It is also settable by the misdn_set_opt() application.
634  */
635  int hdlc;
636  /* V110 */
637 
638  /*! \brief Display message that can be displayed by the user phone.
639  * \note Maximum displayable length is 34 or 82 octets.
640  * It is also settable by the misdn_set_opt() application.
641  */
642  char display[84];
643 
644  /*! \brief Q.931 Keypad Facility IE contents
645  * \note Contents exported and imported to Asterisk variable MISDN_KEYPAD
646  */
647  char keypad[MISDN_MAX_KEYPAD_LEN];
648 
649  /*! \brief Current overlap dialing digits to/from INFORMATION messages */
650  char info_dad[MISDN_MAX_NUMBER_LEN];
651 
652  /*! \brief Collected digits to go into info_dad[] while waiting for a SETUP_ACKNOWLEDGE to come in. */
653  char infos_pending[MISDN_MAX_NUMBER_LEN];
654 
655 /* unsigned char info_keypad[MISDN_MAX_KEYPAD_LEN]; */
656 /* unsigned char clisub[24]; */
657 /* unsigned char cldsub[24]; */
658 
659  /*! \brief User-User information string.
660  * \note Contents exported and imported to Asterisk variable MISDN_USERUSER
661  * \note We only support ASCII strings (IA5 characters).
662  */
663  char uu[256];
664 
665  /*! \brief User-User information string length in uu[] */
666  int uulen;
667 
668  /*! \brief Q.931 Cause for disconnection code (received)
669  * \note Need to use the AST_CAUSE_xxx code definitions in causes.h
670  */
671  int cause;
672 
673  /*! \brief Q.931 Cause for disconnection code (sent)
674  * \note Need to use the AST_CAUSE_xxx code definitions in causes.h
675  * \note -1 is used to suppress including the cause code in the RELEASE message.
676  */
678 
679  /* struct misdn_bchannel hold_bc; */
680 
681  /** list stuf **/
682 
683 #ifdef MISDN_1_2
684  /*! \brief The configuration string for the mISDN dsp pipeline in /etc/asterisk/misdn.conf. */
685  char pipeline[128];
686 #else
687  /*! \brief TRUE if the echo cancellor is enabled */
689 
690  /*! \brief Number of taps in the echo cancellor when enabled.
691  * \note This value is user configurable in /etc/asterisk/misdn.conf (echocancel)
692  */
694 #endif
695 
696  /*! \brief TRUE if the channel was allocated from the available B channels */
698 
699  /*! \brief Who originated the call (ORG_AST, ORG_MISDN)
700  * \note Set but not used when the misdn_set_opt() application enables echo cancellation.
701  */
702  int orig;
703 
704  /*! \brief Tx gain setting (range -8 to 8)
705  * \note This value is user configurable in /etc/asterisk/misdn.conf.
706  * It is also settable by the misdn_set_opt() application.
707  */
708  int txgain;
709 
710  /*! \brief Rx gain setting (range -8 to 8)
711  * \note This value is user configurable in /etc/asterisk/misdn.conf.
712  * It is also settable by the misdn_set_opt() application.
713  */
714  int rxgain;
715 
716  /*! \brief Next node in the misdn_stack.holding list */
718 };
719 
720 
721 extern enum event_response_e (*cb_event) (enum event_e event, struct misdn_bchannel *bc, void *user_data);
722 
723 extern void (*cb_log) (int level, int port, char *tmpl, ...)
724  __attribute__ ((format (printf, 3, 4)));
725 
726 extern int (*cb_jb_empty)(struct misdn_bchannel *bc, char *buffer, int len);
727 
729  enum event_response_e (*cb_event)(enum event_e event, struct misdn_bchannel *bc, void *user_data);
730  void (*cb_log)(int level, int port, char *tmpl, ...)
731  __attribute__ ((format (printf, 3, 4)));
732  int (*cb_jb_empty)(struct misdn_bchannel *bc, char *buffer, int len);
733 };
734 
735 /***** USER IFACE **********/
736 
737 void misdn_lib_nt_keepcalls(int kc);
738 
739 void misdn_lib_nt_debug_init( int flags, char *file );
740 
741 int misdn_lib_init(char *portlist, struct misdn_lib_iface* iface, void *user_data);
742 int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event );
743 void misdn_lib_destroy(void);
744 
745 void misdn_lib_isdn_l1watcher(int port);
746 
747 void misdn_lib_log_ies(struct misdn_bchannel *bc);
748 
749 char *manager_isdn_get_info(enum event_e event);
750 
751 struct misdn_bchannel* misdn_lib_get_free_bc(int port, int channel, int inout, int dec);
752 #if defined(AST_MISDN_ENHANCEMENTS)
753 struct misdn_bchannel *misdn_lib_get_register_bc(int port);
754 #endif /* defined(AST_MISDN_ENHANCEMENTS) */
755 
758 
759 int misdn_lib_tx2misdn_frm(struct misdn_bchannel *bc, void *data, int len);
760 
761 void manager_ph_control(struct misdn_bchannel *bc, int c1, int c2);
762 
763 void isdn_lib_update_rxgain (struct misdn_bchannel *bc);
764 void isdn_lib_update_txgain (struct misdn_bchannel *bc);
765 void isdn_lib_update_ec (struct misdn_bchannel *bc);
766 void isdn_lib_stop_dtmf (struct misdn_bchannel *bc);
767 
768 int misdn_lib_port_restart(int port);
769 int misdn_lib_pid_restart(int pid);
770 int misdn_lib_send_restart(int port, int channel);
771 
772 int misdn_lib_get_port_info(int port);
773 
774 int misdn_lib_is_port_blocked(int port);
775 int misdn_lib_port_block(int port);
776 int misdn_lib_port_unblock(int port);
777 
778 int misdn_lib_port_is_pri(int port);
779 int misdn_lib_port_is_nt(int port);
780 
781 int misdn_lib_port_up(int port, int notcheck);
782 
783 int misdn_lib_get_port_down(int port);
784 
785 int misdn_lib_get_port_up (int port) ;
786 
787 int misdn_lib_maxports_get(void) ;
788 
789 struct misdn_bchannel *misdn_lib_find_held_bc(int port, int l3_id);
790 void misdn_lib_release(struct misdn_bchannel *bc);
791 
792 int misdn_cap_is_speech(int cap);
793 int misdn_inband_avail(struct misdn_bchannel *bc);
794 
795 void manager_ec_enable(struct misdn_bchannel *bc);
796 void manager_ec_disable(struct misdn_bchannel *bc);
797 
798 void misdn_lib_send_tone(struct misdn_bchannel *bc, enum tone_e tone);
799 
800 void get_show_stack_details(int port, char *buf);
801 
802 
805 
806 
807 void misdn_lib_bridge( struct misdn_bchannel * bc1, struct misdn_bchannel *bc2);
808 void misdn_lib_split_bridge( struct misdn_bchannel * bc1, struct misdn_bchannel *bc2);
809 
810 void misdn_lib_echo(struct misdn_bchannel *bc, int onoff);
811 
812 int misdn_lib_is_ptp(int port);
813 int misdn_lib_get_maxchans(int port);
814 
815 void misdn_lib_reinit_nt_stack(int port);
816 
817 #define PRI_TRANS_CAP_SPEECH 0x0
818 #define PRI_TRANS_CAP_DIGITAL 0x08
819 #define PRI_TRANS_CAP_RESTRICTED_DIGITAL 0x09
820 #define PRI_TRANS_CAP_3_1K_AUDIO 0x10
821 #define PRI_TRANS_CAP_7K_AUDIO 0x11
822 
823 
824 
825 char *bc_state2str(enum bchannel_state state);
826 void bc_state_change(struct misdn_bchannel *bc, enum bchannel_state state);
827 
828 void misdn_dump_chanlist(void);
829 
830 void misdn_make_dummy(struct misdn_bchannel *dummybc, int port, int l3id, int nt, int channel);
831 
832 
833 #endif /* TE_LIB */
static const char type[]
Definition: chan_ooh323.c:109
int display_setup
Put a display ie in the SETUP message.
Definition: isdn_lib.h:585
int misdn_lib_get_port_down(int port)
Definition: isdn_lib.c:1805
void misdn_lib_release(struct misdn_bchannel *bc)
Definition: isdn_lib.c:1759
int misdn_lib_get_port_up(int port)
Definition: isdn_lib.c:1781
int layer
B channel layer; set to 3 or 4.
Definition: isdn_lib.h:382
int nodsp
TRUE if we will not use jollys dsp.
Definition: isdn_lib.h:474
void misdn_lib_bridge(struct misdn_bchannel *bc1, struct misdn_bchannel *bc2)
Definition: isdn_lib.c:4728
int misdn_lib_port_up(int port, int notcheck)
Definition: isdn_lib.c:1821
struct misdn_bchannel * misdn_lib_get_free_bc(int port, int channel, int inout, int dec)
Definition: isdn_lib.c:3205
mISDN_NOTIFY_CODE
Notification description code enumeration.
Definition: isdn_lib.h:216
void isdn_lib_update_txgain(struct misdn_bchannel *bc)
Definition: isdn_lib.c:4445
int misdn_cap_is_speech(int cap)
Definition: isdn_lib.c:436
void isdn_lib_update_ec(struct misdn_bchannel *bc)
Definition: isdn_lib.c:4450
int txgain
Tx gain setting (range -8 to 8)
Definition: isdn_lib.h:708
int ec_enable
TRUE if the echo cancellor is enabled.
Definition: isdn_lib.h:688
void misdn_lib_nt_keepcalls(int kc)
Definition: isdn_lib.c:4112
int tone_cnt
Number of tone samples to generate.
Definition: isdn_lib.h:544
int presentation
User set presentation restriction code 0=Allowed, 1=Restricted, 2=Unavailable.
Definition: isdn_lib.h:600
#define bc
int uulen
User-User information string length in uu[].
Definition: isdn_lib.h:666
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
int dummy
TRUE if this is a dummy BC record.
Definition: isdn_lib.h:361
int stack_holder
TRUE if this channel is on the misdn_stack->holding list.
Definition: isdn_lib.h:561
int restart_channel
B channel to restart if received a RESTART message.
Definition: isdn_lib.h:408
int bframe_len
B channel speech sample data buffer size.
Definition: isdn_lib.h:435
int ces
Not used. Saved mISDN stack CONNECT_t ces value.
Definition: isdn_lib.h:405
int mode
Q.931 Bearer Capability IE Transfer Mode field. Initialized to 0 (Circuit). Altered by incoming SETUP...
Definition: isdn_lib.h:619
int cw
TRUE if call waiting.
Definition: isdn_lib.h:426
Connected-Line/Calling/Redirecting ID info struct.
Definition: isdn_lib.h:273
void manager_ec_disable(struct misdn_bchannel *bc)
Definition: isdn_lib.c:4677
int hdlc
TRUE if call made in digital HDLC mode.
Definition: isdn_lib.h:635
int misdn_lib_send_restart(int port, int channel)
Definition: isdn_lib.c:3943
mISDN_REDIRECTING_REASON
Q.931 encoded redirecting reason.
Definition: isdn_lib.h:197
int misdn_lib_port_block(int port)
Definition: isdn_lib.c:91
B channel control structure.
Definition: isdn_lib.h:324
int outgoing_colp
Select what to do with outgoing COLP information.
Definition: isdn_lib.h:594
int misdn_lib_maxports_get(void)
Definition: isdn_lib.c:4094
int presentation
Number presentation restriction code 0=Allowed, 1=Restricted, 2=Unavailable.
Definition: isdn_lib.h:277
int sending_complete
TRUE if all digits necessary to complete the call are available. No more INFORMATION messages are nee...
Definition: isdn_lib.h:470
Definition: astman.c:222
int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event)
Definition: isdn_lib.c:3523
void misdn_lib_log_ies(struct misdn_bchannel *bc)
Definition: isdn_lib.c:3431
struct send_lock * send_lock
B channel send locking structure.
Definition: isdn_lib.h:326
void manager_bchannel_activate(struct misdn_bchannel *bc)
Definition: isdn_lib.c:4329
int misdn_lib_port_restart(int port)
Definition: isdn_lib.c:3982
int capability
SETUP message bearer capability field code value.
Definition: isdn_lib.h:609
void misdn_lib_send_tone(struct misdn_bchannel *bc, enum tone_e tone)
Definition: isdn_lib.c:4596
Definition: muted.c:95
void * astbuf
Not used. Contents are setup but not used.
Definition: isdn_lib.h:439
#define MISDN_MAX_KEYPAD_LEN
Definition: isdn_lib.h:255
int AOCD_need_export
TRUE if AOCDtype and AOCD data are ready to export to Asterisk.
Definition: isdn_lib.h:521
mISDN_NUMBER_PLAN
Definition: isdn_lib.h:92
layer_e
Definition: isdn_lib.h:238
void(* cb_log)(int level, int port, char *tmpl,...)
Definition: isdn_lib.c:32
int progress_location
Progress Indicator IE location field.
Definition: isdn_lib.h:487
struct misdn_bchannel * next
Next node in the misdn_stack.holding list.
Definition: isdn_lib.h:717
#define MISDN_MAX_NAME_LEN
Definition: isdn_lib.h:249
Number structure.
Definition: app_followme.c:154
void misdn_lib_echo(struct misdn_bchannel *bc, int onoff)
Definition: isdn_lib.c:4771
int layer_id
B Channel mISDN driver layer ID from mISDN_new_layer()
Definition: isdn_lib.h:379
int misdn_lib_port_is_pri(int port)
Definition: isdn_lib.c:53
int set_presentation
TRUE if the user set the presentation restriction code.
Definition: isdn_lib.h:603
event_response_e
Definition: isdn_lib.h:110
void isdn_lib_stop_dtmf(struct misdn_bchannel *bc)
Definition: isdn_lib.c:4462
int pri
TRUE if ISDN-PRI (ISDN-BRI otherwise)
Definition: isdn_lib.h:367
int conf_id
Bridging conference ID.
Definition: isdn_lib.h:553
char subaddress[MISDN_MAX_SUBADDRESS_LEN]
Dialed/Called Subaddress number.
Definition: isdn_lib.h:269
int need_release_complete
TRUE if RELEASE_COMPLETE needs to be sent to clear a call.
Definition: isdn_lib.h:392
int(* cb_jb_empty)(struct misdn_bchannel *bc, char *buffer, int len)
Definition: isdn_lib.c:35
Definition: isdn_lib.h:241
void misdn_lib_nt_debug_init(int flags, char *file)
Definition: isdn_lib.c:4124
int nt
TRUE if NT side of protocol (TE otherwise)
Definition: isdn_lib.h:364
Definition: isdn_lib.h:240
int holded
TRUE if this channel is on hold.
Definition: isdn_lib.h:556
int display_connected
Put a display ie in the CONNECT message.
Definition: isdn_lib.h:573
#define MISDN_MAX_NUMBER_LEN
Definition: isdn_lib.h:246
int nojitter
TRUE if we will not use the jitter buffer system.
Definition: isdn_lib.h:477
void misdn_lib_destroy(void)
Definition: isdn_lib.c:4285
misdn_err_e
Definition: isdn_lib.h:88
int rxgain
Rx gain setting (range -8 to 8)
Definition: isdn_lib.h:714
struct misdn_bchannel * misdn_lib_find_held_bc(int port, int l3_id)
Find a held call&#39;s B channel record.
Definition: isdn_lib.c:4580
tone_e
Definition: isdn_lib.h:63
int progress_coding
Progress Indicator IE coding standard field.
Definition: isdn_lib.h:482
int b_stid
B Channel mISDN driver stack ID.
Definition: isdn_lib.h:374
int misdn_lib_get_maxchans(int port)
Definition: isdn_lib.c:137
Dialed/Called information struct.
Definition: isdn_lib.h:258
int pid
B channel process ID (1-5000)
Definition: isdn_lib.h:402
void misdn_lib_isdn_l1watcher(int port)
Definition: isdn_lib.c:3049
int dec
TRUE if allocate higher B channels first.
Definition: isdn_lib.h:395
void manager_ec_enable(struct misdn_bchannel *bc)
Definition: isdn_lib.c:4628
enum mISDN_NUMBER_TYPE number_type
Type-of-number in ISDN terms for the dialed/called number.
Definition: isdn_lib.h:260
void get_show_stack_details(int port, char *buf)
Definition: isdn_lib.c:168
int in_use
TRUE if B channel record is in use.
Definition: isdn_lib.h:420
int misdn_lib_init(char *portlist, struct misdn_lib_iface *iface, void *user_data)
Definition: isdn_lib.c:4143
bchannel_state
Definition: isdn_lib.h:78
int channel_found
TRUE if the channel was allocated from the available B channels.
Definition: isdn_lib.h:697
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
int send_dtmf
TRUE if we should produce DTMF tones ourselves.
Definition: isdn_lib.h:457
ie_name_e
Definition: isdn_lib.h:166
void misdn_lib_split_bridge(struct misdn_bchannel *bc1, struct misdn_bchannel *bc2)
Definition: isdn_lib.c:4751
enum event_response_e(* cb_event)(enum event_e event, struct misdn_bchannel *bc, void *user_data)
Definition: isdn_lib.c:30
int port
Logical Layer 1 port associated with this B channel.
Definition: isdn_lib.h:370
void manager_bchannel_deactivate(struct misdn_bchannel *bc)
Definition: isdn_lib.c:4351
int urate
Q.931 Bearer Capability IE Layer 1 User Rate field.
Definition: isdn_lib.h:629
int is_register_pool
TRUE if the B channel is allocated from the REGISTER pool.
Definition: isdn_lib.h:417
static const char name[]
Definition: cdr_mysql.c:74
int addr
B Channel mISDN driver layer ID from mISDN_get_layerid()
Definition: isdn_lib.h:429
int active
Seems to have been intended for something to do with the jitter buffer.
Definition: isdn_lib.h:537
void manager_ph_control(struct misdn_bchannel *bc, int c1, int c2)
Definition: isdn_lib.c:4419
int to_changed
TRUE if the redirecting.to information has changed.
Definition: isdn_lib.h:319
void isdn_lib_update_rxgain(struct misdn_bchannel *bc)
Definition: isdn_lib.c:4440
void misdn_dump_chanlist(void)
Definition: isdn_lib.c:483
int channel
Assigned B channel number B1, B2... 0 if not assigned.
Definition: isdn_lib.h:411
char * manager_isdn_get_info(enum event_e event)
Definition: isdn_lib.c:4324
int out_cause
Q.931 Cause for disconnection code (sent)
Definition: isdn_lib.h:677
int misdn_lib_port_unblock(int port)
Definition: isdn_lib.c:104
void misdn_make_dummy(struct misdn_bchannel *dummybc, int port, int l3id, int nt, int channel)
Definition: isdn_lib.c:77
int need_release
TRUE if RELEASE needs to be sent to clear a call.
Definition: isdn_lib.h:389
int need_more_infos
TRUE if we send SETUP_ACKNOWLEDGE on incoming calls anyway (instead of PROCEEDING).
Definition: isdn_lib.h:465
int dtmf
Last decoded DTMF digit from mISDN driver.
Definition: isdn_lib.h:452
Definition: isdn_lib.h:239
int need_disconnect
TRUE if DISCONNECT needs to be sent to clear a call.
Definition: isdn_lib.h:386
int misdn_inband_avail(struct misdn_bchannel *bc)
Definition: isdn_lib.c:444
int user1
Q.931 Bearer Capability IE User Information Layer 1 Protocol field code.
Definition: isdn_lib.h:624
mISDN_NUMBER_TYPE
Definition: isdn_lib.h:101
int progress_indicator
Progress Indicator IE progress description field. Used to determine if there is an inband audio messa...
Definition: isdn_lib.h:492
void misdn_lib_reinit_nt_stack(int port)
Definition: isdn_lib.c:4779
int rate
Q.931 Bearer Capability IE Information Transfer Rate field. Initialized to 0x10 (64kbit). Altered by incoming SETUP messages.
Definition: isdn_lib.h:616
int ec_deftaps
Number of taps in the echo cancellor when enabled.
Definition: isdn_lib.h:693
int misdn_lib_pid_restart(int pid)
Definition: isdn_lib.c:3932
int channel_preselected
TRUE if the B channel number is preselected.
Definition: isdn_lib.h:414
void misdn_lib_tone_generator_stop(struct misdn_bchannel *bc)
Definition: isdn_lib.c:2276
char * bframe
B channel speech sample data buffer.
Definition: isdn_lib.h:432
int cause
Q.931 Cause for disconnection code (received)
Definition: isdn_lib.h:671
int te_choose_channel
TRUE if the TE side should choose the B channel to use.
Definition: isdn_lib.h:444
Redirecting information struct.
Definition: isdn_lib.h:305
void bc_state_change(struct misdn_bchannel *bc, enum bchannel_state state)
Definition: isdn_lib.c:639
#define MISDN_MAX_SUBADDRESS_LEN
Definition: isdn_lib.h:252
int screening
Number screening code 0=Unscreened, 1=Passed Screen, 2=Failed Screen, 3=Network Number.
Definition: isdn_lib.h:282
char connected
Definition: eagi_proxy.c:82
int law
Companding ALaw/uLaw encoding (INFO_CODEC_ALAW / INFO_CODEC_ULAW)
Definition: isdn_lib.h:612
static snd_pcm_format_t format
Definition: chan_alsa.c:102
int orig
Who originated the call (ORG_AST, ORG_MISDN)
Definition: isdn_lib.h:702
char * bc_state2str(enum bchannel_state state)
Definition: isdn_lib.c:617
int generate_tone
TRUE if tone generator allowed to start.
Definition: isdn_lib.h:541
int misdn_lib_is_port_blocked(int port)
Definition: isdn_lib.c:117
int misdn_lib_get_port_info(int port)
Definition: isdn_lib.c:3903
int misdn_lib_port_is_nt(int port)
Definition: isdn_lib.c:65
int misdn_lib_is_ptp(int port)
Definition: isdn_lib.c:128
int misdn_lib_tx2misdn_frm(struct misdn_bchannel *bc, void *data, int len)
Definition: isdn_lib.c:4382
int count
Number of times the call has been redirected.
Definition: isdn_lib.h:316
void misdn_lib_tone_generator_start(struct misdn_bchannel *bc)
Definition: isdn_lib.c:2271
enum mISDN_NUMBER_PLAN number_plan
Type-of-number numbering plan.
Definition: isdn_lib.h:263
int l3_id
Layer 3 process ID.
Definition: isdn_lib.h:399
event_e
Definition: isdn_lib.h:119
int early_bconnect
TRUE if the call progress indicators can indicate an inband audio message for the user to listen to...
Definition: isdn_lib.h:449