isdn_lib.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. /*
  2. * Chan_Misdn -- Channel Driver for Asterisk
  3. *
  4. * Interface to mISDN
  5. *
  6. * Copyright (C) 2004, Christian Richter
  7. *
  8. * Christian Richter <crich@beronet.com>
  9. *
  10. * This program is free software, distributed under the terms of
  11. * the GNU General Public License
  12. */
  13. /*! \file
  14. * \brief Interface to mISDN
  15. *
  16. * \author Christian Richter <crich@beronet.com>
  17. */
  18. #ifndef TE_LIB
  19. #define TE_LIB
  20. #include <mISDNuser/suppserv.h>
  21. /** For initialization usage **/
  22. /* typedef int ie_nothing_t ;*/
  23. /** end of init usage **/
  24. /*
  25. * uncomment the following to make chan_misdn create
  26. * record files in /tmp/misdn-{rx|tx}-PortChannel format
  27. * */
  28. /*#define MISDN_SAVE_DATA*/
  29. #ifdef WITH_BEROEC
  30. typedef int beroec_t;
  31. enum beroec_type {
  32. BEROEC_FULLBAND=0,
  33. BEROEC_SUBBAND,
  34. BEROEC_FASTSUBBAND
  35. };
  36. void beroec_init(void);
  37. void beroec_exit(void);
  38. beroec_t *beroec_new(int tail, enum beroec_type type, int anti_howl,
  39. int tonedisable, int zerocoeff, int adapt, int nlp);
  40. void beroec_destroy(beroec_t *ec);
  41. int beroec_cancel_alaw_chunk(beroec_t *ec,
  42. char *send,
  43. char *receive,
  44. int len);
  45. int beroec_version(void);
  46. #endif
  47. enum tone_e {
  48. TONE_NONE=0,
  49. TONE_DIAL,
  50. TONE_ALERTING,
  51. TONE_FAR_ALERTING,
  52. TONE_BUSY,
  53. TONE_HANGUP,
  54. TONE_CUSTOM,
  55. TONE_FILE
  56. };
  57. #define MAX_BCHANS 31
  58. enum bchannel_state {
  59. BCHAN_CLEANED=0,
  60. BCHAN_EMPTY,
  61. BCHAN_SETUP,
  62. BCHAN_SETUPED,
  63. BCHAN_ACTIVE,
  64. BCHAN_ACTIVATED,
  65. BCHAN_BRIDGE,
  66. BCHAN_BRIDGED,
  67. BCHAN_RELEASE,
  68. BCHAN_RELEASED,
  69. BCHAN_CLEAN,
  70. BCHAN_CLEAN_REQUEST,
  71. BCHAN_ERROR
  72. };
  73. enum misdn_err_e {
  74. ENOCHAN=1
  75. };
  76. enum mISDN_NUMBER_PLAN {
  77. NUMPLAN_UNINITIALIZED=-1,
  78. NUMPLAN_INTERNATIONAL=0x1,
  79. NUMPLAN_NATIONAL=0x2,
  80. NUMPLAN_SUBSCRIBER=0x4,
  81. NUMPLAN_UNKNOWN=0x0
  82. };
  83. enum event_response_e {
  84. RESPONSE_IGNORE_SETUP_WITHOUT_CLOSE,
  85. RESPONSE_IGNORE_SETUP,
  86. RESPONSE_RELEASE_SETUP,
  87. RESPONSE_ERR,
  88. RESPONSE_OK
  89. };
  90. enum event_e {
  91. EVENT_NOTHING,
  92. EVENT_TONE_GENERATE,
  93. EVENT_BCHAN_DATA,
  94. EVENT_BCHAN_ACTIVATED,
  95. EVENT_BCHAN_ERROR,
  96. EVENT_CLEANUP,
  97. EVENT_PROCEEDING,
  98. EVENT_PROGRESS,
  99. EVENT_SETUP,
  100. EVENT_ALERTING,
  101. EVENT_CONNECT,
  102. EVENT_SETUP_ACKNOWLEDGE,
  103. EVENT_CONNECT_ACKNOWLEDGE ,
  104. EVENT_USER_INFORMATION,
  105. EVENT_SUSPEND_REJECT,
  106. EVENT_RESUME_REJECT,
  107. EVENT_HOLD,
  108. EVENT_SUSPEND,
  109. EVENT_RESUME,
  110. EVENT_HOLD_ACKNOWLEDGE,
  111. EVENT_SUSPEND_ACKNOWLEDGE,
  112. EVENT_RESUME_ACKNOWLEDGE,
  113. EVENT_HOLD_REJECT,
  114. EVENT_RETRIEVE,
  115. EVENT_RETRIEVE_ACKNOWLEDGE,
  116. EVENT_RETRIEVE_REJECT,
  117. EVENT_DISCONNECT,
  118. EVENT_RESTART,
  119. EVENT_RELEASE,
  120. EVENT_RELEASE_COMPLETE,
  121. EVENT_FACILITY,
  122. EVENT_NOTIFY,
  123. EVENT_STATUS_ENQUIRY,
  124. EVENT_INFORMATION,
  125. EVENT_STATUS,
  126. EVENT_TIMEOUT,
  127. EVENT_DTMF_TONE,
  128. EVENT_NEW_L3ID,
  129. EVENT_NEW_BC,
  130. EVENT_PORT_ALARM,
  131. EVENT_NEW_CHANNEL,
  132. EVENT_UNKNOWN
  133. };
  134. enum ie_name_e {
  135. IE_DUMMY,
  136. IE_LAST
  137. };
  138. enum { /* bearer capability */
  139. INFO_CAPABILITY_SPEECH=0,
  140. INFO_CAPABILITY_AUDIO_3_1K=0x10 ,
  141. INFO_CAPABILITY_AUDIO_7K=0x11 ,
  142. INFO_CAPABILITY_VIDEO =0x18,
  143. INFO_CAPABILITY_DIGITAL_UNRESTRICTED =0x8,
  144. INFO_CAPABILITY_DIGITAL_RESTRICTED =0x09,
  145. INFO_CAPABILITY_DIGITAL_UNRESTRICTED_TONES
  146. };
  147. enum { /* progress indicators */
  148. INFO_PI_CALL_NOT_E2E_ISDN =0x01,
  149. INFO_PI_CALLED_NOT_ISDN =0x02,
  150. INFO_PI_CALLER_NOT_ISDN =0x03,
  151. INFO_PI_CALLER_RETURNED_TO_ISDN =0x04,
  152. INFO_PI_INBAND_AVAILABLE =0x08,
  153. INFO_PI_DELAY_AT_INTERF =0x0a,
  154. INFO_PI_INTERWORKING_WITH_PUBLIC =0x10,
  155. INFO_PI_INTERWORKING_NO_RELEASE =0x11,
  156. INFO_PI_INTERWORKING_NO_RELEASE_PRE_ANSWER =0x12,
  157. INFO_PI_INTERWORKING_NO_RELEASE_POST_ANSWER =0x13
  158. };
  159. enum { /*CODECS*/
  160. INFO_CODEC_ULAW=2,
  161. INFO_CODEC_ALAW=3
  162. };
  163. enum layer_e {
  164. L3,
  165. L2,
  166. L1,
  167. UNKNOWN
  168. };
  169. struct misdn_bchannel {
  170. /*! \brief B channel send locking structure */
  171. struct send_lock *send_lock;
  172. /*! \brief TRUE if this is a dummy BC record */
  173. int dummy;
  174. /*! \brief TRUE if NT side of protocol (TE otherwise) */
  175. int nt;
  176. /*! \brief TRUE if ISDN-PRI (ISDN-BRI otherwise) */
  177. int pri;
  178. /*! \brief Logical Layer 1 port associated with this B channel */
  179. int port;
  180. /** init stuff **/
  181. /*! \brief B Channel mISDN driver stack ID */
  182. int b_stid;
  183. /* int b_addr; */
  184. /*! \brief B Channel mISDN driver layer ID from mISDN_new_layer() */
  185. int layer_id;
  186. /*! \brief B channel layer; set to 3 or 4 */
  187. int layer;
  188. /* state stuff */
  189. /*! \brief TRUE if DISCONNECT needs to be sent to clear a call */
  190. int need_disconnect;
  191. /*! \brief TRUE if RELEASE needs to be sent to clear a call */
  192. int need_release;
  193. /*! \brief TRUE if RELEASE_COMPLETE needs to be sent to clear a call */
  194. int need_release_complete;
  195. /*! \brief TRUE if allocate higher B channels first */
  196. int dec;
  197. /* var stuff */
  198. /*! \brief Layer 3 process ID */
  199. int l3_id;
  200. /*! \brief B channel process ID (1-5000) */
  201. int pid;
  202. /*! \brief Not used. Saved mISDN stack CONNECT_t ces value */
  203. int ces;
  204. /*! \brief B channel to restart if received a RESTART message */
  205. int restart_channel;
  206. /*! \brief Assigned B channel number B1, B2... 0 if not assigned */
  207. int channel;
  208. /*! \brief TRUE if the B channel number is preselected */
  209. int channel_preselected;
  210. /*! \brief TRUE if B channel record is in use */
  211. int in_use;
  212. /*! \brief Time when empty_bc() last called on this record */
  213. struct timeval last_used;
  214. /*! \brief TRUE if call waiting */
  215. int cw;
  216. /*! \brief B Channel mISDN driver layer ID from mISDN_get_layerid() */
  217. int addr;
  218. /*! \brief B channel speech sample data buffer */
  219. char *bframe;
  220. /*! \brief B channel speech sample data buffer size */
  221. int bframe_len;
  222. int time_usec; /* Not used */
  223. /*! \brief Not used. Contents are setup but not used. */
  224. void *astbuf;
  225. void *misdnbuf; /* Not used */
  226. /*! \brief TRUE if the TE side should choose the B channel to use
  227. * \note This value is user configurable in /etc/asterisk/misdn.conf
  228. */
  229. int te_choose_channel;
  230. /*! \brief TRUE if the call progress indicators can indicate an inband audio message for the user to listen to
  231. * \note This value is user configurable in /etc/asterisk/misdn.conf
  232. */
  233. int early_bconnect;
  234. /*! \brief Last decoded DTMF digit from mISDN driver */
  235. int dtmf;
  236. /*! \brief TRUE if we should produce DTMF tones ourselves
  237. * \note This value is user configurable in /etc/asterisk/misdn.conf
  238. */
  239. int send_dtmf;
  240. /*! \brief TRUE if we send SETUP_ACKNOWLEDGE on incoming calls anyway (instead of PROCEEDING).
  241. *
  242. * This requests additional INFORMATION messages, so we can
  243. * wait for digits without issues.
  244. * \note This value is user configurable in /etc/asterisk/misdn.conf
  245. */
  246. int need_more_infos;
  247. /*! \brief TRUE if all digits necessary to complete the call are available.
  248. * No more INFORMATION messages are needed.
  249. */
  250. int sending_complete;
  251. /*! \brief TRUE if we will not use jollys dsp */
  252. int nodsp;
  253. /*! \brief TRUE if we will not use the jitter buffer system */
  254. int nojitter;
  255. /*! \brief Type-of-number in ISDN terms for the dialed/called number
  256. * \note This value is set to "dialplan" in /etc/asterisk/misdn.conf for outgoing calls
  257. */
  258. enum mISDN_NUMBER_PLAN dnumplan;
  259. /*! \brief Type-of-number in ISDN terms for the redirecting number which a call diversion or transfer was invoked.
  260. * \note Collected from the incoming SETUP message but not used.
  261. */
  262. enum mISDN_NUMBER_PLAN rnumplan;
  263. /*! \brief Type-of-number in ISDN terms for the originating/calling number (Caller-ID)
  264. * \note This value is set to "localdialplan" in /etc/asterisk/misdn.conf for outgoing calls
  265. */
  266. enum mISDN_NUMBER_PLAN onumplan;
  267. /*! \brief Type-of-number in ISDN terms for the connected party number
  268. * \note This value is set to "cpndialplan" in /etc/asterisk/misdn.conf for outgoing calls
  269. */
  270. enum mISDN_NUMBER_PLAN cpnnumplan;
  271. /*! \brief Progress Indicator IE coding standard field.
  272. * \note Collected from the incoming messages but not used.
  273. */
  274. int progress_coding;
  275. /*! \brief Progress Indicator IE location field.
  276. * \note Collected from the incoming messages but not used.
  277. */
  278. int progress_location;
  279. /*! \brief Progress Indicator IE progress description field.
  280. * Used to determine if there is an inband audio message present.
  281. */
  282. int progress_indicator;
  283. /*! \brief Inbound FACILITY message function type and contents */
  284. struct FacParm fac_in;
  285. /*! \brief Outbound FACILITY message function type and contents.
  286. * \note Filled in by misdn facility commands before FACILITY message sent.
  287. */
  288. struct FacParm fac_out;
  289. /* storing the current AOCD info here */
  290. enum FacFunction AOCDtype;
  291. union {
  292. struct FacAOCDCurrency currency;
  293. struct FacAOCDChargingUnit chargingUnit;
  294. } AOCD;
  295. int AOCD_need_export;
  296. /*! \brief Event waiting for Layer 1 to come up */
  297. enum event_e evq;
  298. /*** CRYPTING STUFF ***/
  299. int crypt; /* Initialized, Not used */
  300. int curprx; /* Initialized, Not used */
  301. int curptx; /* Initialized, Not used */
  302. /*! \brief Blowfish encryption key string (secret) */
  303. char crypt_key[255];
  304. int crypt_state; /* Not used */
  305. /*** CRYPTING STUFF END***/
  306. /*! \brief Seems to have been intended for something to do with the jitter buffer.
  307. * \note Used as a boolean. Only initialized to 0 and referenced in a couple places
  308. */
  309. int active;
  310. int upset; /* Not used */
  311. /*! \brief TRUE if tone generator allowed to start */
  312. int generate_tone;
  313. /*! \brief Number of tone samples to generate */
  314. int tone_cnt;
  315. /*! \brief Current B Channel state */
  316. enum bchannel_state bc_state;
  317. /*! \brief This is used as a pending bridge join request for when bc_state becomes BCHAN_ACTIVATED */
  318. enum bchannel_state next_bc_state;
  319. /*! \brief Bridging conference ID */
  320. int conf_id;
  321. /*! \brief TRUE if this channel is on hold */
  322. int holded;
  323. /*! \brief TRUE if this channel is on the misdn_stack->holding list
  324. * \note If TRUE this implies that the structure is also malloced.
  325. */
  326. int stack_holder;
  327. /*! \brief Caller ID presentation restriction code
  328. * 0=Allowed, 1=Restricted, 2=Unavailable
  329. * \note It is settable by the misdn_set_opt() application.
  330. */
  331. int pres;
  332. /*! \brief Caller ID screening code
  333. * 0=Unscreened, 1=Passed Screen, 2=Failed Screen, 3=Network Number
  334. */
  335. int screen;
  336. /*! \brief SETUP message bearer capability field code value */
  337. int capability;
  338. /*! \brief Companding ALaw/uLaw encoding (INFO_CODEC_ALAW / INFO_CODEC_ULAW) */
  339. int law;
  340. /* V110 Stuff */
  341. /*! \brief Q.931 Bearer Capability IE Information Transfer Rate field. Initialized to 0x10 (64kbit). Altered by incoming SETUP messages. */
  342. int rate;
  343. /*! \brief Q.931 Bearer Capability IE Transfer Mode field. Initialized to 0 (Circuit). Altered by incoming SETUP messages. */
  344. int mode;
  345. /*! \brief Q.931 Bearer Capability IE User Information Layer 1 Protocol field code.
  346. * \note Collected from the incoming SETUP message but not used.
  347. */
  348. int user1;
  349. /*! \brief Q.931 Bearer Capability IE Layer 1 User Rate field.
  350. * \note Collected from the incoming SETUP message and exported to Asterisk variable MISDN_URATE.
  351. */
  352. int urate;
  353. /*! \brief TRUE if call made in digital HDLC mode
  354. * \note This value is user configurable in /etc/asterisk/misdn.conf.
  355. * It is also settable by the misdn_set_opt() application.
  356. */
  357. int hdlc;
  358. /* V110 */
  359. /*! \brief Display message that can be displayed by the user phone.
  360. * \note Maximum displayable length is 34 or 82 octets.
  361. * It is also settable by the misdn_set_opt() application.
  362. */
  363. char display[84];
  364. /*! \brief Not used. Contents are setup but not used. */
  365. char msn[32];
  366. /*! \brief Originating/Calling Phone Number (Address)
  367. * \note This value can be set to "callerid" in /etc/asterisk/misdn.conf for outgoing calls
  368. */
  369. char oad[32];
  370. /*! \brief Redirecting Phone Number (Address) where a call diversion or transfer was invoked */
  371. char rad[32];
  372. /*! \brief Dialed/Called Phone Number (Address) */
  373. char dad[32];
  374. /*! \brief Connected Party/Line Phone Number (Address) */
  375. char cad[32];
  376. /*! \brief Original Dialed/Called Phone Number (Address) before national/international dialing prefix added.
  377. * \note Not used. Contents are setup but not used.
  378. */
  379. char orig_dad[32];
  380. /*! \brief Q.931 Keypad Facility IE contents
  381. * \note Contents exported and imported to Asterisk variable MISDN_KEYPAD
  382. */
  383. char keypad[32];
  384. /*! \brief Current overlap dialing digits to/from INFORMATION messages */
  385. char info_dad[64];
  386. /*! \brief Collected digits to go into info_dad[] while waiting for a SETUP_ACKNOWLEDGE to come in. */
  387. char infos_pending[64];
  388. /* unsigned char info_keypad[32]; */
  389. /* unsigned char clisub[24]; */
  390. /* unsigned char cldsub[24]; */
  391. /*! \brief User-User information string.
  392. * \note Contents exported and imported to Asterisk variable MISDN_USERUSER
  393. * \note We only support ASCII strings (IA5 characters).
  394. */
  395. char uu[256];
  396. /*! \brief User-User information string length in uu[] */
  397. int uulen;
  398. /*! \brief Q.931 Cause for disconnection code (received)
  399. * \note Need to use the AST_CAUSE_xxx code definitions in causes.h
  400. */
  401. int cause;
  402. /*! \brief Q.931 Cause for disconnection code (sent)
  403. * \note Need to use the AST_CAUSE_xxx code definitions in causes.h
  404. * \note -1 is used to suppress including the cause code in the RELEASE message.
  405. */
  406. int out_cause;
  407. /* struct misdn_bchannel hold_bc; */
  408. /** list stuf **/
  409. #ifdef MISDN_1_2
  410. /*! \brief The configuration string for the mISDN dsp pipeline in /etc/asterisk/misdn.conf. */
  411. char pipeline[128];
  412. #else
  413. /*! \brief TRUE if the echo cancellor is enabled */
  414. int ec_enable;
  415. /*! \brief Number of taps in the echo cancellor when enabled.
  416. * \note This value is user configurable in /etc/asterisk/misdn.conf (echocancel)
  417. */
  418. int ec_deftaps;
  419. #endif
  420. /*! \brief TRUE if the channel was allocated from the available B channels */
  421. int channel_found;
  422. /*! \brief Who originated the call (ORG_AST, ORG_MISDN)
  423. * \note Set but not used when the misdn_set_opt() application enables echo cancellation.
  424. */
  425. int orig;
  426. /*! \brief Tx gain setting (range -8 to 8)
  427. * \note This value is user configurable in /etc/asterisk/misdn.conf.
  428. * It is also settable by the misdn_set_opt() application.
  429. */
  430. int txgain;
  431. /*! \brief Rx gain setting (range -8 to 8)
  432. * \note This value is user configurable in /etc/asterisk/misdn.conf.
  433. * It is also settable by the misdn_set_opt() application.
  434. */
  435. int rxgain;
  436. /*! \brief Next node in the misdn_stack.holding list */
  437. struct misdn_bchannel *next;
  438. };
  439. enum event_response_e (*cb_event) (enum event_e event, struct misdn_bchannel *bc, void *user_data);
  440. void (*cb_log) (int level, int port, char *tmpl, ...)
  441. __attribute__ ((format (printf, 3, 4)));
  442. int (*cb_jb_empty)(struct misdn_bchannel *bc, char *buffer, int len);
  443. struct misdn_lib_iface {
  444. enum event_response_e (*cb_event)(enum event_e event, struct misdn_bchannel *bc, void *user_data);
  445. void (*cb_log)(int level, int port, char *tmpl, ...)
  446. __attribute__ ((format (printf, 3, 4)));
  447. int (*cb_jb_empty)(struct misdn_bchannel *bc, char *buffer, int len);
  448. };
  449. /***** USER IFACE **********/
  450. void misdn_lib_nt_keepcalls(int kc);
  451. void misdn_lib_nt_debug_init( int flags, char *file );
  452. int misdn_lib_init(char *portlist, struct misdn_lib_iface* iface, void *user_data);
  453. int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event );
  454. void misdn_lib_destroy(void);
  455. void misdn_lib_isdn_l1watcher(int port);
  456. void misdn_lib_log_ies(struct misdn_bchannel *bc);
  457. char *manager_isdn_get_info(enum event_e event);
  458. struct misdn_bchannel* misdn_lib_get_free_bc(int port, int channel, int inout, int dec);
  459. void manager_bchannel_activate(struct misdn_bchannel *bc);
  460. void manager_bchannel_deactivate(struct misdn_bchannel * bc);
  461. int misdn_lib_tx2misdn_frm(struct misdn_bchannel *bc, void *data, int len);
  462. void manager_ph_control(struct misdn_bchannel *bc, int c1, int c2);
  463. void isdn_lib_update_rxgain (struct misdn_bchannel *bc);
  464. void isdn_lib_update_txgain (struct misdn_bchannel *bc);
  465. void isdn_lib_update_ec (struct misdn_bchannel *bc);
  466. void isdn_lib_stop_dtmf (struct misdn_bchannel *bc);
  467. int misdn_lib_port_restart(int port);
  468. int misdn_lib_pid_restart(int pid);
  469. int misdn_lib_send_restart(int port, int channel);
  470. int misdn_lib_get_port_info(int port);
  471. int misdn_lib_is_port_blocked(int port);
  472. int misdn_lib_port_block(int port);
  473. int misdn_lib_port_unblock(int port);
  474. int misdn_lib_port_is_pri(int port);
  475. int misdn_lib_port_is_nt(int port);
  476. int misdn_lib_port_up(int port, int notcheck);
  477. int misdn_lib_get_port_down(int port);
  478. int misdn_lib_get_port_up (int port) ;
  479. int misdn_lib_maxports_get(void) ;
  480. struct misdn_bchannel *misdn_lib_find_held_bc(int port, int l3_id);
  481. void misdn_lib_release(struct misdn_bchannel *bc);
  482. int misdn_cap_is_speech(int cap);
  483. int misdn_inband_avail(struct misdn_bchannel *bc);
  484. void manager_ec_enable(struct misdn_bchannel *bc);
  485. void manager_ec_disable(struct misdn_bchannel *bc);
  486. void misdn_lib_send_tone(struct misdn_bchannel *bc, enum tone_e tone);
  487. void get_show_stack_details(int port, char *buf);
  488. void misdn_lib_tone_generator_start(struct misdn_bchannel *bc);
  489. void misdn_lib_tone_generator_stop(struct misdn_bchannel *bc);
  490. void misdn_lib_setup_bc(struct misdn_bchannel *bc);
  491. void misdn_lib_bridge( struct misdn_bchannel * bc1, struct misdn_bchannel *bc2);
  492. void misdn_lib_split_bridge( struct misdn_bchannel * bc1, struct misdn_bchannel *bc2);
  493. void misdn_lib_echo(struct misdn_bchannel *bc, int onoff);
  494. int misdn_lib_is_ptp(int port);
  495. int misdn_lib_get_maxchans(int port);
  496. void misdn_lib_reinit_nt_stack(int port);
  497. #define PRI_TRANS_CAP_SPEECH 0x0
  498. #define PRI_TRANS_CAP_DIGITAL 0x08
  499. #define PRI_TRANS_CAP_RESTRICTED_DIGITAL 0x09
  500. #define PRI_TRANS_CAP_3_1K_AUDIO 0x10
  501. #define PRI_TRANS_CAP_7K_AUDIO 0x11
  502. char *bc_state2str(enum bchannel_state state);
  503. void bc_state_change(struct misdn_bchannel *bc, enum bchannel_state state);
  504. void misdn_dump_chanlist(void);
  505. void misdn_make_dummy(struct misdn_bchannel *dummybc, int port, int l3id, int nt, int channel);
  506. #endif