Maintain states for remote socket connections
[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, int mode);
17         ~Pdss1();
18         unsigned int p_m_d_l3id;                /* current l3 process id */
19         struct lcr_work p_m_d_delete;           /* timer for audio transmission */
20         void message_isdn(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
21         int p_m_d_ces;                          /* ntmode: tei&sapi */
22         int message_epoint(unsigned int epoint_id, int message, union parameter *param);
23
24         int p_m_d_ntmode;                       /* flags the nt-mode */
25         int p_m_d_tespecial;                    /* special te-mode with all nt-mode IEs */
26         char p_m_d_queue[64];                   /* queue for dialing information (if larger than setup allows) */
27         struct lcr_msg *p_m_d_notify_pending;   /* queue for NOTIFY if not connected */
28
29         int p_m_d_collect_cause;                /* collecting cause and location */
30         int p_m_d_collect_location;
31
32         void new_state(int state);              /* set new state */
33 //      void isdn_show_send_message(unsigned int prim, msg_t *msg);
34         int hunt_bchannel(int exclusive, int channel);
35         int received_first_reply_to_setup(unsigned int cmd, int channel, int exclusive);
36         void information_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
37         void setup_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
38         void setup_acknowledge_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
39         void proceeding_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
40         void alerting_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
41         void connect_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
42         void disconnect_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
43         void release_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
44         void restart_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
45         void release_complete_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
46         void disconnect_ind_i(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
47         void t312_timeout_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
48         void notify_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
49         void facility_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
50         void progress_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
51         void hold_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
52         void retrieve_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
53         void suspend_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
54         void resume_ind(unsigned int cmd, unsigned int pid, struct l3_msg *l3m);
55         void message_information(unsigned int epoint_id, int message_id, union parameter *param);
56         void message_setup(unsigned int epoint_id, int message_id, union parameter *param);
57         void message_notify(unsigned int epoint_id, int message_id, union parameter *param);
58         void message_facility(unsigned int epoint_id, int message_id, union parameter *param);
59         void message_3pty(unsigned int epoint_id, int message_id, union parameter *param);
60         void message_overlap(unsigned int epoint_id, int message_id, union parameter *param);
61         void message_proceeding(unsigned int epoint_id, int message_id, union parameter *param);
62         void message_alerting(unsigned int epoint_id, int message_id, union parameter *param);
63         void message_connect(unsigned int epoint_id, int message_id, union parameter *param);
64         void message_disconnect(unsigned int epoint_id, int message_id, union parameter *param);
65         void message_release(unsigned int epoint_id, int message_id, union parameter *param);
66
67         /* IE conversion */
68         void enc_ie_complete(struct l3_msg *l3m, int complete);
69         void dec_ie_complete(struct l3_msg *l3m, int *complete);
70         void enc_ie_bearer(struct l3_msg *l3m, int coding, int capability, int mode, int rate, int multi, int user);
71         void dec_ie_bearer(struct l3_msg *l3m, int *coding, int *capability, int *mode, int *rate, int *multi, int *user);
72         void enc_ie_call_id(struct l3_msg *l3m, unsigned char *callid, int callid_len);
73         void dec_ie_call_id(struct l3_msg *l3m, unsigned char *callid, int *callid_len);
74         void enc_ie_called_pn(struct l3_msg *l3m, int type, int plan, unsigned char *number, int number_len);
75         void dec_ie_called_pn(struct l3_msg *l3m, int *type, int *plan, unsigned char *number, int number_len);
76         void enc_ie_calling_pn(struct l3_msg *l3m, int type, int plan, int present, int screen, unsigned char *number, int type2, int plan2, int present2, int screen2, unsigned char *number2);
77         void dec_ie_calling_pn(struct l3_msg *l3m, int *type, int *plan, int *present, int *screen, unsigned char *number, int number_len, int *type2, int *plan2, int *present2, int *screen2, unsigned char *number2, int number_len2);
78         void enc_ie_connected_pn(struct l3_msg *l3m, int type, int plan, int present, int screen, unsigned char *number);
79         void dec_ie_connected_pn(struct l3_msg *l3m, int *type, int *plan, int *present, int *screen, unsigned char *number, int number_len);
80         void enc_ie_cause(struct l3_msg *l3m, int location, int cause);
81         void dec_ie_cause(struct l3_msg *l3m, int *location, int *cause);
82         void enc_ie_channel_id(struct l3_msg *l3m, int exclusive, int channel);
83         void dec_ie_channel_id(struct l3_msg *l3m, int *exclusive, int *channel);
84         void enc_ie_date(struct l3_msg *l3m, time_t ti, int seconds);
85         void enc_ie_display(struct l3_msg *l3m, unsigned char *display);
86         void dec_ie_display(struct l3_msg *l3m, unsigned char *display, int display_len);
87         void enc_ie_keypad(struct l3_msg *l3m, unsigned char *keypad);
88         void dec_ie_keypad(struct l3_msg *l3m, unsigned char *keypad, int keypad_len);
89         void enc_ie_notify(struct l3_msg *l3m, int notify);
90         void dec_ie_notify(struct l3_msg *l3m, int *notify);
91         void enc_ie_progress(struct l3_msg *l3m, int coding, int location, int progress);
92         void dec_ie_progress(struct l3_msg *l3m, int *coding, int *location, int *progress);
93         void enc_ie_hlc(struct l3_msg *l3m, int coding, int interpretation, int presentation, int hlc, int exthlc);
94         void dec_ie_hlc(struct l3_msg *l3m, int *coding, int *interpretation, int *presentation, int *hlc, int *exthlc);
95         void enc_ie_redir_nr(struct l3_msg *l3m, int type, int plan, int present, int screen, int reason, unsigned char *number);
96         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);
97         void enc_ie_redir_dn(struct l3_msg *l3m, int type, int plan, int present, unsigned char *number);
98         void dec_ie_redir_dn(struct l3_msg *l3m, int *type, int *plan, int *present, unsigned char *number, int number_len);
99         void enc_ie_facility(struct l3_msg *l3m, unsigned char *facility, int facility_len);
100         void dec_ie_facility(struct l3_msg *l3m, unsigned char *facility, int *facility_len);
101         void dec_facility_centrex(struct l3_msg *l3m, unsigned char *cnip, int cnip_len);
102         void enc_ie_useruser(struct l3_msg *l3m, int protocol, unsigned char *user, int user_len);
103         void dec_ie_useruser(struct l3_msg *l3m, int *protocol, unsigned char *user, int *user_len);
104
105 };
106
107