f552547dbb83cac0cb1898df8ff90e9cf9b57015
[lcr.git] / dss1.h
1 /*****************************************************************************\
2 **                                                                           **
3 ** PBX4Linux                                                                 **
4 **                                                                           **
5 **---------------------------------------------------------------------------**
6 ** Copyright: Andreas Eversberg                                              **
7 **                                                                           **
8 ** dss1-port header file                                                     **
9 **                                                                           **
10 \*****************************************************************************/ 
11
12 /* DSS1 port classes */
13 class Pdss1 : public PmISDN
14 {
15         public:
16         Pdss1(int type, struct mISDNport *mISDNport, char *portname, struct port_settings *settings, int channel, int exclusive);
17         ~Pdss1();
18         unsigned int p_m_d_l3id;                /* current l3 process id */
19         void message_isdn(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
20         int p_m_d_ces;                          /* ntmode: tei&sapi */
21         int handler(void);
22         int message_epoint(unsigned long epoint_id, int message, union parameter *param);
23
24         int p_m_d_ntmode;                       /* flags the nt-mode */
25         struct lcr_msg *p_m_d_queue;            /* queue for SETUP if link is down */
26         struct lcr_msg *p_m_d_notify_pending;   /* queue for NOTIFY if not connected */
27
28         int p_m_d_collect_cause;                /* collecting cause and location */
29         int p_m_d_collect_location;
30
31         void new_state(int state);              /* set new state */
32 //      void isdn_show_send_message(unsigned long prim, msg_t *msg);
33         int hunt_bchannel(int exclusive, int channel);
34         int received_first_reply_to_setup(unsigned long cmd, int channel, int exclusive);
35         void information_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
36         void setup_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
37         void setup_acknowledge_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
38         void proceeding_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
39         void alerting_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
40         void connect_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
41         void disconnect_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
42         void release_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
43         void release_complete_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
44         void disconnect_ind_i(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
45         void t312_timeout_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
46         void notify_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
47         void facility_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
48         void hold_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
49         void retrieve_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
50         void suspend_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
51         void resume_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
52         void message_information(unsigned long epoint_id, int message_id, union parameter *param);
53         void message_setup(unsigned long epoint_id, int message_id, union parameter *param);
54         void message_notify(unsigned long epoint_id, int message_id, union parameter *param);
55         void message_facility(unsigned long epoint_id, int message_id, union parameter *param);
56         void message_overlap(unsigned long epoint_id, int message_id, union parameter *param);
57         void message_proceeding(unsigned long epoint_id, int message_id, union parameter *param);
58         void message_alerting(unsigned long epoint_id, int message_id, union parameter *param);
59         void message_connect(unsigned long epoint_id, int message_id, union parameter *param);
60         void message_disconnect(unsigned long epoint_id, int message_id, union parameter *param);
61         void message_release(unsigned long epoint_id, int message_id, union parameter *param);
62
63         /* IE conversion */
64         void enc_ie_complete(struct l3_msg *l3m, int complete);
65         void dec_ie_complete(struct l3_msg *l3m, int *complete);
66         void enc_ie_bearer(struct l3_msg *l3m, int coding, int capability, int mode, int rate, int multi, int user);
67         void dec_ie_bearer(struct l3_msg *l3m, int *coding, int *capability, int *mode, int *rate, int *multi, int *user);
68         void enc_ie_call_id(struct l3_msg *l3m, unsigned char *callid, int callid_len);
69         void dec_ie_call_id(struct l3_msg *l3m, unsigned char *callid, int *callid_len);
70         void enc_ie_called_pn(struct l3_msg *l3m, int type, int plan, unsigned char *number);
71         void dec_ie_called_pn(struct l3_msg *l3m, int *type, int *plan, unsigned char *number, int number_len);
72         void enc_ie_calling_pn(struct l3_msg *l3m, int type, int plan, int present, int screen, unsigned char *number);
73         void dec_ie_calling_pn(struct l3_msg *l3m, int *type, int *plan, int *present, int *screen, unsigned char *number, int number_len);
74         void enc_ie_connected_pn(struct l3_msg *l3m, int type, int plan, int present, int screen, unsigned char *number);
75         void dec_ie_connected_pn(struct l3_msg *l3m, int *type, int *plan, int *present, int *screen, unsigned char *number, int number_len);
76         void enc_ie_cause(struct l3_msg *l3m, int location, int cause);
77         void dec_ie_cause(struct l3_msg *l3m, int *location, int *cause);
78         void enc_ie_channel_id(struct l3_msg *l3m, int exclusive, int channel);
79         void dec_ie_channel_id(struct l3_msg *l3m, int *exclusive, int *channel);
80         void enc_ie_date(struct l3_msg *l3m, time_t ti, int seconds);
81         void enc_ie_display(struct l3_msg *l3m, unsigned char *display);
82         void dec_ie_display(struct l3_msg *l3m, unsigned char *display, int display_len);
83         void enc_ie_keypad(struct l3_msg *l3m, unsigned char *keypad);
84         void dec_ie_keypad(struct l3_msg *l3m, unsigned char *keypad, int keypad_len);
85         void enc_ie_notify(struct l3_msg *l3m, int notify);
86         void dec_ie_notify(struct l3_msg *l3m, int *notify);
87         void enc_ie_progress(struct l3_msg *l3m, int coding, int location, int progress);
88         void dec_ie_progress(struct l3_msg *l3m, int *coding, int *location, int *progress);
89         void enc_ie_hlc(struct l3_msg *l3m, int coding, int interpretation, int presentation, int hlc, int exthlc);
90         void dec_ie_hlc(struct l3_msg *l3m, int *coding, int *interpretation, int *presentation, int *hlc, int *exthlc);
91         void enc_ie_redir_nr(struct l3_msg *l3m, int type, int plan, int present, int screen, int reason, unsigned char *number);
92         void dec_ie_redir_nr(struct l3_msg *l3m, int *type, int *plan, int *present, int *screen, int *reason, unsigned char *number, int number_len);
93         void enc_ie_redir_dn(struct l3_msg *l3m, int type, int plan, int present, unsigned char *number);
94         void dec_ie_redir_dn(struct l3_msg *l3m, int *type, int *plan, int *present, unsigned char *number, int number_len);
95         void enc_ie_facility(struct l3_msg *l3m, unsigned char *facility, int facility_len);
96         void dec_ie_facility(struct l3_msg *l3m, unsigned char *facility, int *facility_len);
97         void dec_facility_centrex(struct l3_msg *l3m, unsigned char *cnip, int cnip_len);
98         void enc_ie_useruser(struct l3_msg *l3m, int protocol, unsigned char *user, int user_len);
99         void dec_ie_useruser(struct l3_msg *l3m, int *protocol, unsigned char *user, int *user_len);
100
101 };
102
103