7dba2d99b9dd474578decc6f06e15e9cebd07712
[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         int p_m_d_l3id;                         /* current l3 process id */
19         int p_m_d_ces;                          /* ntmode: tei&sapi */
20         int handler(void);
21         int message_epoint(unsigned long epoint_id, int message, union parameter *param);
22         void message_isdn(unsigned long prim, unsigned long dinfo, void *data);
23
24         int p_m_d_ntmode;                       /* flags the nt-mode */
25         struct message *p_m_d_queue;            /* queue for SETUP if link is down */
26         struct message *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 received_first_reply_to_setup(unsigned long prim, int channel, int exclusive);
34         int hunt_bchannel(int exclusive, int channel);
35         void information_ind(unsigned long prim, unsigned long dinfo, void *data);
36         void setup_ind(unsigned long prim, unsigned long dinfo, void *data);
37         void setup_acknowledge_ind(unsigned long prim, unsigned long dinfo, void *data);
38         void proceeding_ind(unsigned long prim, unsigned long dinfo, void *data);
39         void alerting_ind(unsigned long prim, unsigned long dinfo, void *data);
40         void connect_ind(unsigned long prim, unsigned long dinfo, void *data);
41         void disconnect_ind(unsigned long prim, unsigned long dinfo, void *data);
42         void release_ind(unsigned long prim, unsigned long dinfo, void *data);
43         void release_complete_ind(unsigned long prim, unsigned long dinfo, void *data);
44         void disconnect_ind_i(unsigned long prim, unsigned long dinfo, void *data);
45         void t312_timeout(unsigned long prim, unsigned long dinfo, void *data);
46         void notify_ind(unsigned long prim, unsigned long dinfo, void *data);
47         void facility_ind(unsigned long prim, unsigned long dinfo, void *data);
48         void hold_ind(unsigned long prim, unsigned long dinfo, void *data);
49         void retrieve_ind(unsigned long prim, unsigned long dinfo, void *data);
50         void suspend_ind(unsigned long prim, unsigned long dinfo, void *data);
51         void resume_ind(unsigned long prim, unsigned long dinfo, void *data);
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 #ifdef SOCKET_MISDN
65         void enc_ie_complete(struct l3_msg *l3m, int complete);
66         void dec_ie_complete(struct l3_msg *l3m, int *complete);
67         void enc_ie_bearer(struct l3_msg *l3m, int coding, int capability, int mode, int rate, int multi, int user);
68         void dec_ie_bearer(struct l3_msg *l3m, int *coding, int *capability, int *mode, int *rate, int *multi, int *user);
69         void enc_ie_call_id(struct l3_msg *l3m, unsigned char *callid, int callid_len);
70         void dec_ie_call_id(struct l3_msg *l3m, unsigned char *callid, int *callid_len);
71         void enc_ie_called_pn(struct l3_msg *l3m, int type, int plan, unsigned char *number);
72         void dec_ie_called_pn(struct l3_msg *l3m, int *type, int *plan, unsigned char *number, int number_len);
73         void enc_ie_calling_pn(struct l3_msg *l3m, int type, int plan, int present, int screen, unsigned char *number);
74         void dec_ie_calling_pn(struct l3_msg *l3m, int *type, int *plan, int *present, int *screen, unsigned char *number, int number_len);
75         void enc_ie_connected_pn(struct l3_msg *l3m, int type, int plan, int present, int screen, unsigned char *number);
76         void dec_ie_connected_pn(struct l3_msg *l3m, int *type, int *plan, int *present, int *screen, unsigned char *number, int number_len);
77         void enc_ie_cause(struct l3_msg *l3m, int location, int cause);
78         void dec_ie_cause(struct l3_msg *l3m, int *location, int *cause);
79         void enc_ie_channel_id(struct l3_msg *l3m, int exclusive, int channel);
80         void dec_ie_channel_id(struct l3_msg *l3m, int *exclusive, int *channel);
81         void enc_ie_date(struct l3_msg *l3m, time_t ti, int seconds);
82         void enc_ie_display(struct l3_msg *l3m, unsigned char *display);
83         void dec_ie_display(struct l3_msg *l3m, unsigned char *display, int display_len);
84         void enc_ie_keypad(struct l3_msg *l3m, unsigned char *keypad);
85         void dec_ie_keypad(struct l3_msg *l3m, unsigned char *keypad, int keypad_len);
86         void enc_ie_notify(struct l3_msg *l3m, int notify);
87         void dec_ie_notify(struct l3_msg *l3m, int *notify);
88         void enc_ie_progress(struct l3_msg *l3m, int coding, int location, int progress);
89         void dec_ie_progress(struct l3_msg *l3m, int *coding, int *location, int *progress);
90         void enc_ie_hlc(struct l3_msg *l3m, int coding, int interpretation, int presentation, int hlc, int exthlc);
91         void dec_ie_hlc(struct l3_msg *l3m, int *coding, int *interpretation, int *presentation, int *hlc, int *exthlc);
92         void enc_ie_redir_nr(struct l3_msg *l3m, int type, int plan, int present, int screen, int reason, unsigned char *number);
93         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);
94         void enc_ie_redir_dn(struct l3_msg *l3m, int type, int plan, int present, unsigned char *number);
95         void dec_ie_redir_dn(struct l3_msg *l3m, int *type, int *plan, int *present, unsigned char *number, int number_len);
96         void enc_ie_facility(struct l3_msg *l3m, unsigned char *facility, int facility_len);
97         void dec_ie_facility(struct l3_msg *l3m, unsigned char *facility, int *facility_len);
98         void dec_facility_centrex(struct l3_msg *l3m, unsigned char *cnip, int cnip_len);
99         void enc_ie_useruser(struct l3_msg *l3m, int protocol, unsigned char *user, int user_len);
100         void dec_ie_useruser(struct l3_msg *l3m, int *protocol, unsigned char *user, int *user_len);
101 #else
102         void enc_ie_complete(unsigned char **ntmode, msg_t *msg, int complete);
103         void dec_ie_complete(unsigned char *p, Q931_info_t *qi, int *complete);
104         void enc_ie_bearer(unsigned char **ntmode, msg_t *msg, int coding, int capability, int mode, int rate, int multi, int user);
105         void dec_ie_bearer(unsigned char *p, Q931_info_t *qi, int *coding, int *capability, int *mode, int *rate, int *multi, int *user);
106         void enc_ie_call_id(unsigned char **ntmode, msg_t *msg, unsigned char *callid, int callid_len);
107         void dec_ie_call_id(unsigned char *p, Q931_info_t *qi, unsigned char *callid, int *callid_len);
108         void enc_ie_called_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, unsigned char *number);
109         void dec_ie_called_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, unsigned char *number, int number_len);
110         void enc_ie_calling_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, unsigned char *number);
111         void dec_ie_calling_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, unsigned char *number, int number_len);
112         void enc_ie_connected_pn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, unsigned char *number);
113         void dec_ie_connected_pn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, unsigned char *number, int number_len);
114         void enc_ie_cause(unsigned char **ntmode, msg_t *msg, int location, int cause);
115         void dec_ie_cause(unsigned char *p, Q931_info_t *qi, int *location, int *cause);
116         void enc_ie_channel_id(unsigned char **ntmode, msg_t *msg, int exclusive, int channel);
117         void dec_ie_channel_id(unsigned char *p, Q931_info_t *qi, int *exclusive, int *channel);
118         void enc_ie_date(unsigned char **ntmode, msg_t *msg, time_t ti, int seconds);
119         void enc_ie_display(unsigned char **ntmode, msg_t *msg, unsigned char *display);
120         void dec_ie_display(unsigned char *p, Q931_info_t *qi, unsigned char *display, int display_len);
121         void enc_ie_keypad(unsigned char **ntmode, msg_t *msg, unsigned char *keypad);
122         void dec_ie_keypad(unsigned char *p, Q931_info_t *qi, unsigned char *keypad, int keypad_len);
123         void enc_ie_notify(unsigned char **ntmode, msg_t *msg, int notify);
124         void dec_ie_notify(unsigned char *p, Q931_info_t *qi, int *notify);
125         void enc_ie_progress(unsigned char **ntmode, msg_t *msg, int coding, int location, int progress);
126         void dec_ie_progress(unsigned char *p, Q931_info_t *qi, int *coding, int *location, int *progress);
127         void enc_ie_hlc(unsigned char **ntmode, msg_t *msg, int coding, int interpretation, int presentation, int hlc, int exthlc);
128         void dec_ie_hlc(unsigned char *p, Q931_info_t *qi, int *coding, int *interpretation, int *presentation, int *hlc, int *exthlc);
129         void enc_ie_redir_nr(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, int screen, int reason, unsigned char *number);
130         void dec_ie_redir_nr(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, int *screen, int *reason, unsigned char *number, int number_len);
131         void enc_ie_redir_dn(unsigned char **ntmode, msg_t *msg, int type, int plan, int present, unsigned char *number);
132         void dec_ie_redir_dn(unsigned char *p, Q931_info_t *qi, int *type, int *plan, int *present, unsigned char *number, int number_len);
133         void enc_ie_facility(unsigned char **ntmode, msg_t *msg, unsigned char *facility, int facility_len);
134         void dec_ie_facility(unsigned char *p, Q931_info_t *qi, unsigned char *facility, int *facility_len);
135         void dec_facility_centrex(unsigned char *p, Q931_info_t *qi, unsigned char *cnip, int cnip_len);
136         void enc_ie_useruser(unsigned char **ntmode, msg_t *msg, int protocol, unsigned char *user, int user_len);
137         void dec_ie_useruser(unsigned char *p, Q931_info_t *qi, int *protocol, unsigned char *user, int *user_len);
138 #endif
139
140 };
141
142