Review Board 1.7.16


Add ISDN Calling and Called Subaddress support functions to LIBPRI

Review Request #406 - Created Oct. 14, 2009 and submitted

Alec Davis
15604
Reviewers
asterisk-dev
mattf, rmudgett
LibPRI
Further Libpri support for subaddress, previously LIBPRI only supported receiving Calling Subaddress.

The first intentions of this are to add Transmit and Receive capabilites for Calling Subaddress and Called Subaddress.

Calling, Called, Connected and Redirecting Subaddress, now correctly supports User Specific type and the default NSAP.

Redirection and Redirecting Subaddress have been identified, but will come later.

 

Changes between revision 1 and 6

1 2 3 4 5 6 7
1 2 3 4 5 6 7

  1. /team/rmudgett/subaddr/libpri.h: Loading...
  2. /team/rmudgett/subaddr/pri.c: Loading...
  3. /team/rmudgett/subaddr/pri_internal.h: Loading...
  4. /team/rmudgett/subaddr/pri_q931.h: Loading...
  5. /team/rmudgett/subaddr/q931.c: Loading...
/team/rmudgett/subaddr/libpri.h
Diff Revision 1 Diff Revision 6
1
/*
1
/*
2
 * libpri: An implementation of Primary Rate ISDN
2
 * libpri: An implementation of Primary Rate ISDN
3
 *
3
 *
4
 * Written by Mark Spencer <markster@digium.com>
4
 * Written by Mark Spencer <markster@digium.com>
5
 *
5
 *
6
 * Copyright (C) 2001, Digium, Inc.
6
 * Copyright (C) 2001, Digium, Inc.
7
 * All Rights Reserved.
7
 * All Rights Reserved.
8
 */
8
 */
9

    
   
9

   
10
/*
10
/*
11
 * See http://www.asterisk.org for more information about
11
 * See http://www.asterisk.org for more information about
12
 * the Asterisk project. Please do not directly contact
12
 * the Asterisk project. Please do not directly contact
13
 * any of the maintainers of this project for assistance;
13
 * any of the maintainers of this project for assistance;
14
 * the project provides a web site, mailing lists and IRC
14
 * the project provides a web site, mailing lists and IRC
15
 * channels for your use.
15
 * channels for your use.
16
 *
16
 *
17
 * This program is free software, distributed under the terms of
17
 * This program is free software, distributed under the terms of
18
 * the GNU General Public License Version 2 as published by the
18
 * the GNU General Public License Version 2 as published by the
19
 * Free Software Foundation. See the LICENSE file included with
19
 * Free Software Foundation. See the LICENSE file included with
20
 * this program for more details.
20
 * this program for more details.
21
 *
21
 *
22
 * In addition, when this program is distributed with Asterisk in
22
 * In addition, when this program is distributed with Asterisk in
23
 * any form that would qualify as a 'combined work' or as a
23
 * any form that would qualify as a 'combined work' or as a
24
 * 'derivative work' (but not mere aggregation), you can redistribute
24
 * 'derivative work' (but not mere aggregation), you can redistribute
25
 * and/or modify the combination under the terms of the license
25
 * and/or modify the combination under the terms of the license
26
 * provided with that copy of Asterisk, instead of the license
26
 * provided with that copy of Asterisk, instead of the license
27
 * terms granted here.
27
 * terms granted here.
28
 */
28
 */
29

    
   
29

   
30
/*
30
/*
31
 * NOTE:
31
 * NOTE:
32
 * All new global identifiers that are added to this file MUST be
32
 * All new global identifiers that are added to this file MUST be
33
 * prefixed with PRI_ or pri_ to indicate that they are part of this
33
 * prefixed with PRI_ or pri_ to indicate that they are part of this
34
 * library and to reduce potential naming conflicts.
34
 * library and to reduce potential naming conflicts.
35
 */
35
 */
36

    
   
36

   
37
#ifndef _LIBPRI_H
37
#ifndef _LIBPRI_H
38
#define _LIBPRI_H
38
#define _LIBPRI_H
39

    
   
39

   
40
/* Node types */
40
/* Node types */
41
#define PRI_NETWORK		1
41
#define PRI_NETWORK		1
42
#define PRI_CPE			2
42
#define PRI_CPE			2
43

    
   
43

   
44
/* Debugging */
44
/* Debugging */
45
#define PRI_DEBUG_Q921_RAW		(1 << 0)	/* Show raw HDLC frames */
45
#define PRI_DEBUG_Q921_RAW		(1 << 0)	/* Show raw HDLC frames */
46
#define PRI_DEBUG_Q921_DUMP		(1 << 1)	/* Show each interpreted Q.921 frame */
46
#define PRI_DEBUG_Q921_DUMP		(1 << 1)	/* Show each interpreted Q.921 frame */
47
#define PRI_DEBUG_Q921_STATE 	(1 << 2)	/* Debug state machine changes */
47
#define PRI_DEBUG_Q921_STATE 	(1 << 2)	/* Debug state machine changes */
48
#define PRI_DEBUG_CONFIG		(1 << 3) 	/* Display error events on stdout */
48
#define PRI_DEBUG_CONFIG		(1 << 3) 	/* Display error events on stdout */
49
#define PRI_DEBUG_Q931_DUMP		(1 << 5)	/* Show interpreted Q.931 frames */
49
#define PRI_DEBUG_Q931_DUMP		(1 << 5)	/* Show interpreted Q.931 frames */
50
#define PRI_DEBUG_Q931_STATE	(1 << 6)	/* Debug Q.931 state machine changes */
50
#define PRI_DEBUG_Q931_STATE	(1 << 6)	/* Debug Q.931 state machine changes */
51
#define	PRI_DEBUG_Q931_ANOMALY 	(1 << 7)	/* Show unexpected events */
51
#define	PRI_DEBUG_Q931_ANOMALY 	(1 << 7)	/* Show unexpected events */
52
#define PRI_DEBUG_APDU			(1 << 8)	/* Debug of APDU components such as ROSE */
52
#define PRI_DEBUG_APDU			(1 << 8)	/* Debug of APDU components such as ROSE */
53
#define PRI_DEBUG_AOC			(1 << 9)	/* Debug of Advice of Charge ROSE Messages */
53
#define PRI_DEBUG_AOC			(1 << 9)	/* Debug of Advice of Charge ROSE Messages */
54

    
   
54

   
55
#define PRI_DEBUG_ALL			(0xffff)	/* Everything */
55
#define PRI_DEBUG_ALL			(0xffff)	/* Everything */
56

    
   
56

   
57
/* Switch types */
57
/* Switch types */
58
#define PRI_SWITCH_UNKNOWN 		0
58
#define PRI_SWITCH_UNKNOWN 		0
59
#define PRI_SWITCH_NI2	   		1	/* National ISDN 2 */
59
#define PRI_SWITCH_NI2	   		1	/* National ISDN 2 */
60
#define PRI_SWITCH_DMS100		2	/* DMS 100 */
60
#define PRI_SWITCH_DMS100		2	/* DMS 100 */
61
#define PRI_SWITCH_LUCENT5E		3	/* Lucent 5E */
61
#define PRI_SWITCH_LUCENT5E		3	/* Lucent 5E */
62
#define PRI_SWITCH_ATT4ESS		4	/* AT&T 4ESS */
62
#define PRI_SWITCH_ATT4ESS		4	/* AT&T 4ESS */
63
#define PRI_SWITCH_EUROISDN_E1		5	/* Standard EuroISDN (CTR4, ETSI 300-102) */
63
#define PRI_SWITCH_EUROISDN_E1		5	/* Standard EuroISDN (CTR4, ETSI 300-102) */
64
#define PRI_SWITCH_EUROISDN_T1		6	/* T1 EuroISDN variant (ETSI 300-102) */
64
#define PRI_SWITCH_EUROISDN_T1		6	/* T1 EuroISDN variant (ETSI 300-102) */
65
#define PRI_SWITCH_NI1			7	/* National ISDN 1 */
65
#define PRI_SWITCH_NI1			7	/* National ISDN 1 */
66
#define PRI_SWITCH_GR303_EOC		8	/* GR-303 Embedded Operations Channel */
66
#define PRI_SWITCH_GR303_EOC		8	/* GR-303 Embedded Operations Channel */
67
#define PRI_SWITCH_GR303_TMC		9	/* GR-303 Timeslot Management Channel */
67
#define PRI_SWITCH_GR303_TMC		9	/* GR-303 Timeslot Management Channel */
68
#define PRI_SWITCH_QSIG			10	/* QSIG Switch */
68
#define PRI_SWITCH_QSIG			10	/* QSIG Switch */
69
/* Switchtypes 11 - 20 are reserved for internal use */
69
/* Switchtypes 11 - 20 are reserved for internal use */
70

    
   
70

   
71

    
   
71

   
72
/* PRI D-Channel Events */
72
/* PRI D-Channel Events */
73
#define PRI_EVENT_DCHAN_UP		 1	/* D-channel is up */
73
#define PRI_EVENT_DCHAN_UP		 1	/* D-channel is up */
74
#define PRI_EVENT_DCHAN_DOWN	 2	/* D-channel is down */
74
#define PRI_EVENT_DCHAN_DOWN	 2	/* D-channel is down */
75
#define PRI_EVENT_RESTART		 3	/* B-channel is restarted */
75
#define PRI_EVENT_RESTART		 3	/* B-channel is restarted */
76
#define PRI_EVENT_CONFIG_ERR 	 4	/* Configuration Error Detected */
76
#define PRI_EVENT_CONFIG_ERR 	 4	/* Configuration Error Detected */
77
#define PRI_EVENT_RING			 5	/* Incoming call (SETUP) */
77
#define PRI_EVENT_RING			 5	/* Incoming call (SETUP) */
78
#define PRI_EVENT_HANGUP		 6	/* Call got hung up (RELEASE/RELEASE_COMPLETE/other) */
78
#define PRI_EVENT_HANGUP		 6	/* Call got hung up (RELEASE/RELEASE_COMPLETE/other) */
79
#define PRI_EVENT_RINGING		 7	/* Call is ringing (ALERTING) */
79
#define PRI_EVENT_RINGING		 7	/* Call is ringing (ALERTING) */
80
#define PRI_EVENT_ANSWER		 8	/* Call has been answered (CONNECT) */
80
#define PRI_EVENT_ANSWER		 8	/* Call has been answered (CONNECT) */
81
#define PRI_EVENT_HANGUP_ACK	 9	/* Call hangup has been acknowledged */
81
#define PRI_EVENT_HANGUP_ACK	 9	/* Call hangup has been acknowledged */
82
#define PRI_EVENT_RESTART_ACK	10	/* Restart complete on a given channel (RESTART_ACKNOWLEDGE) */
82
#define PRI_EVENT_RESTART_ACK	10	/* Restart complete on a given channel (RESTART_ACKNOWLEDGE) */
83
#define PRI_EVENT_FACNAME		11	/* Caller*ID Name received on Facility (DEPRECATED) */
83
#define PRI_EVENT_FACNAME		11	/* Caller*ID Name received on Facility (DEPRECATED) */
84
#define PRI_EVENT_FACILITY		11	/* Facility received (FACILITY) */
84
#define PRI_EVENT_FACILITY		11	/* Facility received (FACILITY) */
85
#define PRI_EVENT_INFO_RECEIVED 12	/* Additional info (digits) received (INFORMATION) */
85
#define PRI_EVENT_INFO_RECEIVED 12	/* Additional info (digits) received (INFORMATION) */
86
#define PRI_EVENT_PROCEEDING	13	/* When we get CALL_PROCEEDING */
86
#define PRI_EVENT_PROCEEDING	13	/* When we get CALL_PROCEEDING */
87
#define PRI_EVENT_SETUP_ACK		14	/* When we get SETUP_ACKNOWLEDGE */
87
#define PRI_EVENT_SETUP_ACK		14	/* When we get SETUP_ACKNOWLEDGE */
88
#define PRI_EVENT_HANGUP_REQ	15	/* Requesting the higher layer to hangup (DISCONNECT) */
88
#define PRI_EVENT_HANGUP_REQ	15	/* Requesting the higher layer to hangup (DISCONNECT) */
89
#define PRI_EVENT_NOTIFY		16	/* Notification received (NOTIFY) */
89
#define PRI_EVENT_NOTIFY		16	/* Notification received (NOTIFY) */
90
#define PRI_EVENT_PROGRESS		17	/* When we get PROGRESS */
90
#define PRI_EVENT_PROGRESS		17	/* When we get PROGRESS */
91
#define PRI_EVENT_KEYPAD_DIGIT	18	/* When we receive during ACTIVE state (INFORMATION) */
91
#define PRI_EVENT_KEYPAD_DIGIT	18	/* When we receive during ACTIVE state (INFORMATION) */
92
#define PRI_EVENT_SERVICE       19	/* SERVICE maintenance message */
92
#define PRI_EVENT_SERVICE       19	/* SERVICE maintenance message */
93
#define PRI_EVENT_SERVICE_ACK   20	/* SERVICE maintenance acknowledgement message */
93
#define PRI_EVENT_SERVICE_ACK   20	/* SERVICE maintenance acknowledgement message */
94

    
   
94

   
95
/* Simple states */
95
/* Simple states */
96
#define PRI_STATE_DOWN		0
96
#define PRI_STATE_DOWN		0
97
#define PRI_STATE_UP		1
97
#define PRI_STATE_UP		1
98

    
   
98

   
99
#define PRI_PROGRESS_MASK
99
#define PRI_PROGRESS_MASK
100

    
   
100

   
101
/* Progress indicator values */
101
/* Progress indicator values */
102
#define PRI_PROG_CALL_NOT_E2E_ISDN						(1 << 0)
102
#define PRI_PROG_CALL_NOT_E2E_ISDN						(1 << 0)
103
#define PRI_PROG_CALLED_NOT_ISDN						(1 << 1)
103
#define PRI_PROG_CALLED_NOT_ISDN						(1 << 1)
104
#define PRI_PROG_CALLER_NOT_ISDN						(1 << 2)
104
#define PRI_PROG_CALLER_NOT_ISDN						(1 << 2)
105
#define PRI_PROG_INBAND_AVAILABLE						(1 << 3)
105
#define PRI_PROG_INBAND_AVAILABLE						(1 << 3)
106
#define PRI_PROG_DELAY_AT_INTERF						(1 << 4)
106
#define PRI_PROG_DELAY_AT_INTERF						(1 << 4)
107
#define PRI_PROG_INTERWORKING_WITH_PUBLIC				(1 << 5)
107
#define PRI_PROG_INTERWORKING_WITH_PUBLIC				(1 << 5)
108
#define PRI_PROG_INTERWORKING_NO_RELEASE				(1 << 6)
108
#define PRI_PROG_INTERWORKING_NO_RELEASE				(1 << 6)
109
#define PRI_PROG_INTERWORKING_NO_RELEASE_PRE_ANSWER		(1 << 7)
109
#define PRI_PROG_INTERWORKING_NO_RELEASE_PRE_ANSWER		(1 << 7)
110
#define PRI_PROG_INTERWORKING_NO_RELEASE_POST_ANSWER	(1 << 8)
110
#define PRI_PROG_INTERWORKING_NO_RELEASE_POST_ANSWER	(1 << 8)
111
#define PRI_PROG_CALLER_RETURNED_TO_ISDN					(1 << 9)
111
#define PRI_PROG_CALLER_RETURNED_TO_ISDN					(1 << 9)
112

    
   
112

   
113
/* Numbering plan identifier */
113
/* Numbering plan identifier */
114
#define PRI_NPI_UNKNOWN					0x0 /*!< Unknown numbering plan */
114
#define PRI_NPI_UNKNOWN					0x0 /*!< Unknown numbering plan */
115
#define PRI_NPI_E163_E164				0x1 /*!< ISDN/telephony numbering plan (public) */
115
#define PRI_NPI_E163_E164				0x1 /*!< ISDN/telephony numbering plan (public) */
116
#define PRI_NPI_X121					0x3 /*!< Data numbering plan */
116
#define PRI_NPI_X121					0x3 /*!< Data numbering plan */
117
#define PRI_NPI_F69						0x4 /*!< Telex numbering plan */
117
#define PRI_NPI_F69						0x4 /*!< Telex numbering plan */
118
#define PRI_NPI_NATIONAL				0x8 /*!< National standard numbering plan */
118
#define PRI_NPI_NATIONAL				0x8 /*!< National standard numbering plan */
119
#define PRI_NPI_PRIVATE					0x9 /*!< Private numbering plan */
119
#define PRI_NPI_PRIVATE					0x9 /*!< Private numbering plan */
120
#define PRI_NPI_RESERVED				0xF /*!< Reserved for extension */
120
#define PRI_NPI_RESERVED				0xF /*!< Reserved for extension */
121

    
   
121

   
122
/* Type of number */
122
/* Type of number */
123
#define PRI_TON_UNKNOWN					0x0
123
#define PRI_TON_UNKNOWN					0x0
124
#define PRI_TON_INTERNATIONAL			0x1
124
#define PRI_TON_INTERNATIONAL			0x1
125
#define PRI_TON_NATIONAL				0x2
125
#define PRI_TON_NATIONAL				0x2
126
#define PRI_TON_NET_SPECIFIC			0x3
126
#define PRI_TON_NET_SPECIFIC			0x3
127
#define PRI_TON_SUBSCRIBER				0x4
127
#define PRI_TON_SUBSCRIBER				0x4
128
#define PRI_TON_ABBREVIATED				0x6
128
#define PRI_TON_ABBREVIATED				0x6
129
#define PRI_TON_RESERVED				0x7
129
#define PRI_TON_RESERVED				0x7
130

    
   
130

   
131
/* Redirection reasons */
131
/* Redirection reasons */
132
#define PRI_REDIR_UNKNOWN				0x0
132
#define PRI_REDIR_UNKNOWN				0x0
133
#define PRI_REDIR_FORWARD_ON_BUSY		0x1
133
#define PRI_REDIR_FORWARD_ON_BUSY		0x1
134
#define PRI_REDIR_FORWARD_ON_NO_REPLY	0x2
134
#define PRI_REDIR_FORWARD_ON_NO_REPLY	0x2
135
#define PRI_REDIR_DEFLECTION			0x3
135
#define PRI_REDIR_DEFLECTION			0x3
136
#define PRI_REDIR_DTE_OUT_OF_ORDER		0x9
136
#define PRI_REDIR_DTE_OUT_OF_ORDER		0x9
137
#define PRI_REDIR_FORWARDED_BY_DTE		0xA
137
#define PRI_REDIR_FORWARDED_BY_DTE		0xA
138
#define PRI_REDIR_UNCONDITIONAL			0xF
138
#define PRI_REDIR_UNCONDITIONAL			0xF
139

    
   
139

   
140
/* Dialing plan */
140
/* Dialing plan */
141
#define PRI_INTERNATIONAL_ISDN		0x11
141
#define PRI_INTERNATIONAL_ISDN		0x11
142
#define PRI_NATIONAL_ISDN			0x21
142
#define PRI_NATIONAL_ISDN			0x21
143
#define PRI_LOCAL_ISDN				0x41
143
#define PRI_LOCAL_ISDN				0x41
144
#define PRI_PRIVATE					0x49
144
#define PRI_PRIVATE					0x49
145
#define PRI_UNKNOWN					0x0
145
#define PRI_UNKNOWN					0x0
146

    
   
146

   
147
/* Presentation */
147
/* Presentation */
148
#define PRI_PRES_NUMBER_TYPE				0x03
148
#define PRI_PRES_NUMBER_TYPE				0x03
149
#define PRI_PRES_USER_NUMBER_UNSCREENED		0x00
149
#define PRI_PRES_USER_NUMBER_UNSCREENED		0x00
150
#define PRI_PRES_USER_NUMBER_PASSED_SCREEN	0x01
150
#define PRI_PRES_USER_NUMBER_PASSED_SCREEN	0x01
151
#define PRI_PRES_USER_NUMBER_FAILED_SCREEN	0x02
151
#define PRI_PRES_USER_NUMBER_FAILED_SCREEN	0x02
152
#define PRI_PRES_NETWORK_NUMBER				0x03
152
#define PRI_PRES_NETWORK_NUMBER				0x03
153

    
   
153

   
154
#define PRI_PRES_RESTRICTION				0x60
154
#define PRI_PRES_RESTRICTION				0x60
155
#define PRI_PRES_ALLOWED					0x00
155
#define PRI_PRES_ALLOWED					0x00
156
#define PRI_PRES_RESTRICTED					0x20
156
#define PRI_PRES_RESTRICTED					0x20
157
#define PRI_PRES_UNAVAILABLE				0x40
157
#define PRI_PRES_UNAVAILABLE				0x40
158
#define PRI_PRES_RESERVED					0x60
158
#define PRI_PRES_RESERVED					0x60
159

    
   
159

   
160
#define PRES_ALLOWED_USER_NUMBER_NOT_SCREENED \
160
#define PRES_ALLOWED_USER_NUMBER_NOT_SCREENED \
161
	(PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_UNSCREENED)
161
	(PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_UNSCREENED)
162

    
   
162

   
163
#define PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN \
163
#define PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN \
164
	(PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_PASSED_SCREEN)
164
	(PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_PASSED_SCREEN)
165

    
   
165

   
166
#define PRES_ALLOWED_USER_NUMBER_FAILED_SCREEN \
166
#define PRES_ALLOWED_USER_NUMBER_FAILED_SCREEN \
167
	(PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_FAILED_SCREEN)
167
	(PRI_PRES_ALLOWED | PRI_PRES_USER_NUMBER_FAILED_SCREEN)
168

    
   
168

   
169
#define PRES_ALLOWED_NETWORK_NUMBER	\
169
#define PRES_ALLOWED_NETWORK_NUMBER	\
170
	(PRI_PRES_ALLOWED | PRI_PRES_NETWORK_NUMBER)
170
	(PRI_PRES_ALLOWED | PRI_PRES_NETWORK_NUMBER)
171

    
   
171

   
172
#define PRES_PROHIB_USER_NUMBER_NOT_SCREENED \
172
#define PRES_PROHIB_USER_NUMBER_NOT_SCREENED \
173
	(PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_UNSCREENED)
173
	(PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_UNSCREENED)
174

    
   
174

   
175
#define PRES_PROHIB_USER_NUMBER_PASSED_SCREEN \
175
#define PRES_PROHIB_USER_NUMBER_PASSED_SCREEN \
176
	(PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_PASSED_SCREEN)
176
	(PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_PASSED_SCREEN)
177

    
   
177

   
178
#define PRES_PROHIB_USER_NUMBER_FAILED_SCREEN \
178
#define PRES_PROHIB_USER_NUMBER_FAILED_SCREEN \
179
	(PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_FAILED_SCREEN)
179
	(PRI_PRES_RESTRICTED | PRI_PRES_USER_NUMBER_FAILED_SCREEN)
180

    
   
180

   
181
#define PRES_PROHIB_NETWORK_NUMBER \
181
#define PRES_PROHIB_NETWORK_NUMBER \
182
	(PRI_PRES_RESTRICTED | PRI_PRES_NETWORK_NUMBER)
182
	(PRI_PRES_RESTRICTED | PRI_PRES_NETWORK_NUMBER)
183

    
   
183

   
184
#define PRES_NUMBER_NOT_AVAILABLE \
184
#define PRES_NUMBER_NOT_AVAILABLE \
185
	(PRI_PRES_UNAVAILABLE | PRI_PRES_NETWORK_NUMBER)
185
	(PRI_PRES_UNAVAILABLE | PRI_PRES_NETWORK_NUMBER)
186

    
   
186

   
187
/* Reverse Charging Indication */
187
/* Reverse Charging Indication */
188
#define PRI_REVERSECHARGE_NONE      -1
188
#define PRI_REVERSECHARGE_NONE      -1
189
#define PRI_REVERSECHARGE_REQUESTED  1
189
#define PRI_REVERSECHARGE_REQUESTED  1
190

    
   
190

   
191
/* Causes for disconnection */
191
/* Causes for disconnection */
192
#define PRI_CAUSE_UNALLOCATED					1
192
#define PRI_CAUSE_UNALLOCATED					1
193
#define PRI_CAUSE_NO_ROUTE_TRANSIT_NET			2	/* !Q.SIG */
193
#define PRI_CAUSE_NO_ROUTE_TRANSIT_NET			2	/* !Q.SIG */
194
#define PRI_CAUSE_NO_ROUTE_DESTINATION			3
194
#define PRI_CAUSE_NO_ROUTE_DESTINATION			3
195
#define PRI_CAUSE_CHANNEL_UNACCEPTABLE			6
195
#define PRI_CAUSE_CHANNEL_UNACCEPTABLE			6
196
#define PRI_CAUSE_CALL_AWARDED_DELIVERED		7	/* !Q.SIG */
196
#define PRI_CAUSE_CALL_AWARDED_DELIVERED		7	/* !Q.SIG */
197
#define PRI_CAUSE_NORMAL_CLEARING				16
197
#define PRI_CAUSE_NORMAL_CLEARING				16
198
#define PRI_CAUSE_USER_BUSY						17
198
#define PRI_CAUSE_USER_BUSY						17
199
#define PRI_CAUSE_NO_USER_RESPONSE				18
199
#define PRI_CAUSE_NO_USER_RESPONSE				18
200
#define PRI_CAUSE_NO_ANSWER						19
200
#define PRI_CAUSE_NO_ANSWER						19
201
#define PRI_CAUSE_CALL_REJECTED					21
201
#define PRI_CAUSE_CALL_REJECTED					21
202
#define PRI_CAUSE_NUMBER_CHANGED				22
202
#define PRI_CAUSE_NUMBER_CHANGED				22
203
#define PRI_CAUSE_DESTINATION_OUT_OF_ORDER		27
203
#define PRI_CAUSE_DESTINATION_OUT_OF_ORDER		27
204
#define PRI_CAUSE_INVALID_NUMBER_FORMAT			28
204
#define PRI_CAUSE_INVALID_NUMBER_FORMAT			28
205
#define PRI_CAUSE_FACILITY_REJECTED				29	/* !Q.SIG */
205
#define PRI_CAUSE_FACILITY_REJECTED				29	/* !Q.SIG */
206
#define PRI_CAUSE_RESPONSE_TO_STATUS_ENQUIRY	30
206
#define PRI_CAUSE_RESPONSE_TO_STATUS_ENQUIRY	30
207
#define PRI_CAUSE_NORMAL_UNSPECIFIED			31
207
#define PRI_CAUSE_NORMAL_UNSPECIFIED			31
208
#define PRI_CAUSE_NORMAL_CIRCUIT_CONGESTION		34
208
#define PRI_CAUSE_NORMAL_CIRCUIT_CONGESTION		34
209
#define PRI_CAUSE_NETWORK_OUT_OF_ORDER			38	/* !Q.SIG */
209
#define PRI_CAUSE_NETWORK_OUT_OF_ORDER			38	/* !Q.SIG */
210
#define PRI_CAUSE_NORMAL_TEMPORARY_FAILURE		41
210
#define PRI_CAUSE_NORMAL_TEMPORARY_FAILURE		41
211
#define PRI_CAUSE_SWITCH_CONGESTION				42	/* !Q.SIG */
211
#define PRI_CAUSE_SWITCH_CONGESTION				42	/* !Q.SIG */
212
#define PRI_CAUSE_ACCESS_INFO_DISCARDED			43	/* !Q.SIG */
212
#define PRI_CAUSE_ACCESS_INFO_DISCARDED			43	/* !Q.SIG */
213
#define PRI_CAUSE_REQUESTED_CHAN_UNAVAIL		44
213
#define PRI_CAUSE_REQUESTED_CHAN_UNAVAIL		44
214
#define PRI_CAUSE_PRE_EMPTED					45	/* !Q.SIG */
214
#define PRI_CAUSE_PRE_EMPTED					45	/* !Q.SIG */
215
#define PRI_CAUSE_FACILITY_NOT_SUBSCRIBED  		50	/* !Q.SIG */
215
#define PRI_CAUSE_FACILITY_NOT_SUBSCRIBED  		50	/* !Q.SIG */
216
#define PRI_CAUSE_OUTGOING_CALL_BARRED     		52	/* !Q.SIG */
216
#define PRI_CAUSE_OUTGOING_CALL_BARRED     		52	/* !Q.SIG */
217
#define PRI_CAUSE_INCOMING_CALL_BARRED     		54	/* !Q.SIG */
217
#define PRI_CAUSE_INCOMING_CALL_BARRED     		54	/* !Q.SIG */
218
#define PRI_CAUSE_BEARERCAPABILITY_NOTAUTH		57
218
#define PRI_CAUSE_BEARERCAPABILITY_NOTAUTH		57
219
#define PRI_CAUSE_BEARERCAPABILITY_NOTAVAIL     58
219
#define PRI_CAUSE_BEARERCAPABILITY_NOTAVAIL     58
220
#define PRI_CAUSE_SERVICEOROPTION_NOTAVAIL		63	/* Q.SIG */
220
#define PRI_CAUSE_SERVICEOROPTION_NOTAVAIL		63	/* Q.SIG */
221
#define PRI_CAUSE_BEARERCAPABILITY_NOTIMPL		65
221
#define PRI_CAUSE_BEARERCAPABILITY_NOTIMPL		65
222
#define PRI_CAUSE_CHAN_NOT_IMPLEMENTED     		66	/* !Q.SIG */
222
#define PRI_CAUSE_CHAN_NOT_IMPLEMENTED     		66	/* !Q.SIG */
223
#define PRI_CAUSE_FACILITY_NOT_IMPLEMENTED      69	/* !Q.SIG */
223
#define PRI_CAUSE_FACILITY_NOT_IMPLEMENTED      69	/* !Q.SIG */
224
#define PRI_CAUSE_INVALID_CALL_REFERENCE		81
224
#define PRI_CAUSE_INVALID_CALL_REFERENCE		81
225
#define PRI_CAUSE_IDENTIFIED_CHANNEL_NOTEXIST	82	/* Q.SIG */
225
#define PRI_CAUSE_IDENTIFIED_CHANNEL_NOTEXIST	82	/* Q.SIG */
226
#define PRI_CAUSE_INCOMPATIBLE_DESTINATION		88
226
#define PRI_CAUSE_INCOMPATIBLE_DESTINATION		88
227
#define PRI_CAUSE_INVALID_MSG_UNSPECIFIED  		95	/* !Q.SIG */
227
#define PRI_CAUSE_INVALID_MSG_UNSPECIFIED  		95	/* !Q.SIG */
228
#define PRI_CAUSE_MANDATORY_IE_MISSING			96
228
#define PRI_CAUSE_MANDATORY_IE_MISSING			96
229
#define PRI_CAUSE_MESSAGE_TYPE_NONEXIST			97
229
#define PRI_CAUSE_MESSAGE_TYPE_NONEXIST			97
230
#define PRI_CAUSE_WRONG_MESSAGE					98
230
#define PRI_CAUSE_WRONG_MESSAGE					98
231
#define PRI_CAUSE_IE_NONEXIST					99
231
#define PRI_CAUSE_IE_NONEXIST					99
232
#define PRI_CAUSE_INVALID_IE_CONTENTS			100
232
#define PRI_CAUSE_INVALID_IE_CONTENTS			100
233
#define PRI_CAUSE_WRONG_CALL_STATE				101
233
#define PRI_CAUSE_WRONG_CALL_STATE				101
234
#define PRI_CAUSE_RECOVERY_ON_TIMER_EXPIRE		102
234
#define PRI_CAUSE_RECOVERY_ON_TIMER_EXPIRE		102
235
#define PRI_CAUSE_MANDATORY_IE_LENGTH_ERROR		103	/* !Q.SIG */
235
#define PRI_CAUSE_MANDATORY_IE_LENGTH_ERROR		103	/* !Q.SIG */
236
#define PRI_CAUSE_PROTOCOL_ERROR				111
236
#define PRI_CAUSE_PROTOCOL_ERROR				111
237
#define PRI_CAUSE_INTERWORKING					127	/* !Q.SIG */
237
#define PRI_CAUSE_INTERWORKING					127	/* !Q.SIG */
238

    
   
238

   
239
/* Transmit capabilities */
239
/* Transmit capabilities */
240
#define PRI_TRANS_CAP_SPEECH					0x0
240
#define PRI_TRANS_CAP_SPEECH					0x0
241
#define PRI_TRANS_CAP_DIGITAL					0x08
241
#define PRI_TRANS_CAP_DIGITAL					0x08
242
#define PRI_TRANS_CAP_RESTRICTED_DIGITAL		0x09
242
#define PRI_TRANS_CAP_RESTRICTED_DIGITAL		0x09
243
#define PRI_TRANS_CAP_3_1K_AUDIO				0x10
243
#define PRI_TRANS_CAP_3_1K_AUDIO				0x10
244
#define PRI_TRANS_CAP_7K_AUDIO					0x11	/* Depriciated ITU Q.931 (05/1998)*/
244
#define PRI_TRANS_CAP_7K_AUDIO					0x11	/* Depriciated ITU Q.931 (05/1998)*/
245
#define PRI_TRANS_CAP_DIGITAL_W_TONES			0x11
245
#define PRI_TRANS_CAP_DIGITAL_W_TONES			0x11
246
#define PRI_TRANS_CAP_VIDEO						0x18
246
#define PRI_TRANS_CAP_VIDEO						0x18
247

    
   
247

   
248
#define PRI_LAYER_1_ITU_RATE_ADAPT	0x21
248
#define PRI_LAYER_1_ITU_RATE_ADAPT	0x21
249
#define PRI_LAYER_1_ULAW			0x22
249
#define PRI_LAYER_1_ULAW			0x22
250
#define PRI_LAYER_1_ALAW			0x23
250
#define PRI_LAYER_1_ALAW			0x23
251
#define PRI_LAYER_1_G721			0x24
251
#define PRI_LAYER_1_G721			0x24
252
#define PRI_LAYER_1_G722_G725		0x25
252
#define PRI_LAYER_1_G722_G725		0x25
253
#define PRI_LAYER_1_H223_H245		0x26
253
#define PRI_LAYER_1_H223_H245		0x26
254
#define PRI_LAYER_1_NON_ITU_ADAPT	0x27
254
#define PRI_LAYER_1_NON_ITU_ADAPT	0x27
255
#define PRI_LAYER_1_V120_RATE_ADAPT	0x28
255
#define PRI_LAYER_1_V120_RATE_ADAPT	0x28
256
#define PRI_LAYER_1_X31_RATE_ADAPT	0x29
256
#define PRI_LAYER_1_X31_RATE_ADAPT	0x29
257

    
   
257

   
258

    
   
258

   
259
/* Intermediate rates for V.110 */
259
/* Intermediate rates for V.110 */
260
#define PRI_INT_RATE_8K			1
260
#define PRI_INT_RATE_8K			1
261
#define PRI_INT_RATE_16K		2
261
#define PRI_INT_RATE_16K		2
262
#define PRI_INT_RATE_32K		3
262
#define PRI_INT_RATE_32K		3
263

    
   
263

   
264

    
   
264

   
265
/* Rate adaption for bottom 5 bits of rateadaption */
265
/* Rate adaption for bottom 5 bits of rateadaption */
266
#define PRI_RATE_USER_RATE_MASK		0x1F
266
#define PRI_RATE_USER_RATE_MASK		0x1F
267
#define PRI_RATE_ADAPT_UNSPEC		0x00
267
#define PRI_RATE_ADAPT_UNSPEC		0x00
268
#define PRI_RATE_ADAPT_0K6		0x01
268
#define PRI_RATE_ADAPT_0K6		0x01
269
#define PRI_RATE_ADAPT_1K2		0x02
269
#define PRI_RATE_ADAPT_1K2		0x02
270
#define PRI_RATE_ADAPT_2K4		0x03
270
#define PRI_RATE_ADAPT_2K4		0x03
271
#define PRI_RATE_ADAPT_3K6		0x04
271
#define PRI_RATE_ADAPT_3K6		0x04
272
#define PRI_RATE_ADAPT_4K8		0x05
272
#define PRI_RATE_ADAPT_4K8		0x05
273
#define PRI_RATE_ADAPT_7K2		0x06
273
#define PRI_RATE_ADAPT_7K2		0x06
274
#define PRI_RATE_ADAPT_8K		0x07
274
#define PRI_RATE_ADAPT_8K		0x07
275
#define PRI_RATE_ADAPT_9K6		0x08
275
#define PRI_RATE_ADAPT_9K6		0x08
276
#define PRI_RATE_ADAPT_14K4		0x09
276
#define PRI_RATE_ADAPT_14K4		0x09
277
#define PRI_RATE_ADAPT_16K		0x0A
277
#define PRI_RATE_ADAPT_16K		0x0A
278
#define PRI_RATE_ADAPT_19K2		0x0B
278
#define PRI_RATE_ADAPT_19K2		0x0B
279
#define PRI_RATE_ADAPT_32K		0x0C
279
#define PRI_RATE_ADAPT_32K		0x0C
280
#define PRI_RATE_ADAPT_38K4		0x0D
280
#define PRI_RATE_ADAPT_38K4		0x0D
281
#define PRI_RATE_ADAPT_48K		0x0E
281
#define PRI_RATE_ADAPT_48K		0x0E
282
#define PRI_RATE_ADAPT_56K		0x0F
282
#define PRI_RATE_ADAPT_56K		0x0F
283
#define PRI_RATE_ADAPT_57K6		0x12
283
#define PRI_RATE_ADAPT_57K6		0x12
284
#define PRI_RATE_ADAPT_28K8		0x13
284
#define PRI_RATE_ADAPT_28K8		0x13
285
#define PRI_RATE_ADAPT_24K		0x14
285
#define PRI_RATE_ADAPT_24K		0x14
286
#define PRI_RATE_ADAPT_0K1345		0x15
286
#define PRI_RATE_ADAPT_0K1345		0x15
287
#define PRI_RATE_ADAPT_0K1		0x16
287
#define PRI_RATE_ADAPT_0K1		0x16
288
#define PRI_RATE_ADAPT_0K075_1K2	0x17
288
#define PRI_RATE_ADAPT_0K075_1K2	0x17
289
#define PRI_RATE_ADAPT_1K2_0K075	0x18
289
#define PRI_RATE_ADAPT_1K2_0K075	0x18
290
#define PRI_RATE_ADAPT_0K05		0x19
290
#define PRI_RATE_ADAPT_0K05		0x19
291
#define PRI_RATE_ADAPT_0K075		0x1A
291
#define PRI_RATE_ADAPT_0K075		0x1A
292
#define PRI_RATE_ADAPT_0K110		0x1B
292
#define PRI_RATE_ADAPT_0K110		0x1B
293
#define PRI_RATE_ADAPT_0K150		0x1C
293
#define PRI_RATE_ADAPT_0K150		0x1C
294
#define PRI_RATE_ADAPT_0K200		0x1D
294
#define PRI_RATE_ADAPT_0K200		0x1D
295
#define PRI_RATE_ADAPT_0K300		0x1E
295
#define PRI_RATE_ADAPT_0K300		0x1E
296
#define PRI_RATE_ADAPT_12K		0x1F
296
#define PRI_RATE_ADAPT_12K		0x1F
297

    
   
297

   
298
/* in-band negotiation flag for rateadaption bit 5 */
298
/* in-band negotiation flag for rateadaption bit 5 */
299
#define PRI_RATE_ADAPT_NEGOTIATION_POSS	0x20
299
#define PRI_RATE_ADAPT_NEGOTIATION_POSS	0x20
300

    
   
300

   
301
/* async flag for rateadaption bit 6 */
301
/* async flag for rateadaption bit 6 */
302
#define PRI_RATE_ADAPT_ASYNC		0x40
302
#define PRI_RATE_ADAPT_ASYNC		0x40
303

    
   
303

   
304
/* Notifications */
304
/* Notifications */
305
#define PRI_NOTIFY_USER_SUSPENDED		0x00	/* User suspended (Q.931) (Call is placed on hold) */
305
#define PRI_NOTIFY_USER_SUSPENDED		0x00	/* User suspended (Q.931) (Call is placed on hold) */
306
#define PRI_NOTIFY_USER_RESUMED			0x01	/* User resumed (Q.931) (Call is taken off hold) */
306
#define PRI_NOTIFY_USER_RESUMED			0x01	/* User resumed (Q.931) (Call is taken off hold) */
307
#define PRI_NOTIFY_BEARER_CHANGE		0x02	/* Bearer service change (DSS1) */
307
#define PRI_NOTIFY_BEARER_CHANGE		0x02	/* Bearer service change (DSS1) */
308
#define PRI_NOTIFY_ASN1_COMPONENT		0x03	/* ASN.1 encoded component (DSS1) */
308
#define PRI_NOTIFY_ASN1_COMPONENT		0x03	/* ASN.1 encoded component (DSS1) */
309
#define PRI_NOTIFY_COMPLETION_DELAY		0x04	/* Call completion delay */
309
#define PRI_NOTIFY_COMPLETION_DELAY		0x04	/* Call completion delay */
310
#define PRI_NOTIFY_CONF_ESTABLISHED		0x42	/* Conference established */
310
#define PRI_NOTIFY_CONF_ESTABLISHED		0x42	/* Conference established */
311
#define PRI_NOTIFY_CONF_DISCONNECTED		0x43	/* Conference disconnected */
311
#define PRI_NOTIFY_CONF_DISCONNECTED		0x43	/* Conference disconnected */
312
#define PRI_NOTIFY_CONF_PARTY_ADDED		0x44	/* Other party added */
312
#define PRI_NOTIFY_CONF_PARTY_ADDED		0x44	/* Other party added */
313
#define PRI_NOTIFY_CONF_ISOLATED		0x45	/* Isolated */
313
#define PRI_NOTIFY_CONF_ISOLATED		0x45	/* Isolated */
314
#define PRI_NOTIFY_CONF_REATTACHED		0x46	/* Reattached */
314
#define PRI_NOTIFY_CONF_REATTACHED		0x46	/* Reattached */
315
#define PRI_NOTIFY_CONF_OTHER_ISOLATED		0x47	/* Other party isolated */
315
#define PRI_NOTIFY_CONF_OTHER_ISOLATED		0x47	/* Other party isolated */
316
#define PRI_NOTIFY_CONF_OTHER_REATTACHED	0x48	/* Other party reattached */
316
#define PRI_NOTIFY_CONF_OTHER_REATTACHED	0x48	/* Other party reattached */
317
#define PRI_NOTIFY_CONF_OTHER_SPLIT		0x49	/* Other party split */
317
#define PRI_NOTIFY_CONF_OTHER_SPLIT		0x49	/* Other party split */
318
#define PRI_NOTIFY_CONF_OTHER_DISCONNECTED	0x4a	/* Other party disconnected */
318
#define PRI_NOTIFY_CONF_OTHER_DISCONNECTED	0x4a	/* Other party disconnected */
319
#define PRI_NOTIFY_CONF_FLOATING		0x4b	/* Conference floating */
319
#define PRI_NOTIFY_CONF_FLOATING		0x4b	/* Conference floating */
320
#define PRI_NOTIFY_WAITING_CALL			0x60	/* Call is waiting call */
320
#define PRI_NOTIFY_WAITING_CALL			0x60	/* Call is waiting call */
321
#define PRI_NOTIFY_DIVERSION_ACTIVATED		0x68	/* Diversion activated (DSS1) (cfu, cfb, cfnr) (EN 300 207-1 Section 7.2.1) */
321
#define PRI_NOTIFY_DIVERSION_ACTIVATED		0x68	/* Diversion activated (DSS1) (cfu, cfb, cfnr) (EN 300 207-1 Section 7.2.1) */
322
#define PRI_NOTIFY_TRANSFER_ALERTING		0x69	/* Call transfer, alerting (EN 300 369-1 Section 7.2) */
322
#define PRI_NOTIFY_TRANSFER_ALERTING		0x69	/* Call transfer, alerting (EN 300 369-1 Section 7.2) */
323
#define PRI_NOTIFY_TRANSFER_ACTIVE		0x6a	/* Call transfer, active(answered) (EN 300 369-1 Section 7.2) */
323
#define PRI_NOTIFY_TRANSFER_ACTIVE		0x6a	/* Call transfer, active(answered) (EN 300 369-1 Section 7.2) */
324
#define PRI_NOTIFY_REMOTE_HOLD			0x79	/* Remote hold */
324
#define PRI_NOTIFY_REMOTE_HOLD			0x79	/* Remote hold */
325
#define PRI_NOTIFY_REMOTE_RETRIEVAL		0x7a	/* Remote retrieval */
325
#define PRI_NOTIFY_REMOTE_RETRIEVAL		0x7a	/* Remote retrieval */
326
#define PRI_NOTIFY_CALL_DIVERTING		0x7b	/* Call is diverting (EN 300 207-1 Section 7.2.1) */
326
#define PRI_NOTIFY_CALL_DIVERTING		0x7b	/* Call is diverting (EN 300 207-1 Section 7.2.1) */
327

    
   
327

   
328
#define PRI_COPY_DIGITS_CALLED_NUMBER
328
#define PRI_COPY_DIGITS_CALLED_NUMBER
329

    
   
329

   
330
/* Network Specific Facilities (AT&T) */
330
/* Network Specific Facilities (AT&T) */
331
#define PRI_NSF_NONE                   -1
331
#define PRI_NSF_NONE                   -1
332
#define PRI_NSF_SID_PREFERRED          0xB1
332
#define PRI_NSF_SID_PREFERRED          0xB1
333
#define PRI_NSF_ANI_PREFERRED          0xB2
333
#define PRI_NSF_ANI_PREFERRED          0xB2
334
#define PRI_NSF_SID_ONLY               0xB3
334
#define PRI_NSF_SID_ONLY               0xB3
335
#define PRI_NSF_ANI_ONLY               0xB4
335
#define PRI_NSF_ANI_ONLY               0xB4
336
#define PRI_NSF_CALL_ASSOC_TSC         0xB9
336
#define PRI_NSF_CALL_ASSOC_TSC         0xB9
337
#define PRI_NSF_NOTIF_CATSC_CLEARING   0xBA
337
#define PRI_NSF_NOTIF_CATSC_CLEARING   0xBA
338
#define PRI_NSF_OPERATOR               0xB5
338
#define PRI_NSF_OPERATOR               0xB5
339
#define PRI_NSF_PCCO                   0xB6
339
#define PRI_NSF_PCCO                   0xB6
340
#define PRI_NSF_SDN                    0xE1
340
#define PRI_NSF_SDN                    0xE1
341
#define PRI_NSF_TOLL_FREE_MEGACOM      0xE2
341
#define PRI_NSF_TOLL_FREE_MEGACOM      0xE2
342
#define PRI_NSF_MEGACOM                        0xE3
342
#define PRI_NSF_MEGACOM                        0xE3
343
#define PRI_NSF_ACCUNET                        0xE6
343
#define PRI_NSF_ACCUNET                        0xE6
344
#define PRI_NSF_LONG_DISTANCE_SERVICE  0xE7
344
#define PRI_NSF_LONG_DISTANCE_SERVICE  0xE7
345
#define PRI_NSF_INTERNATIONAL_TOLL_FREE        0xE8
345
#define PRI_NSF_INTERNATIONAL_TOLL_FREE        0xE8
346
#define PRI_NSF_ATT_MULTIQUEST         0xF0
346
#define PRI_NSF_ATT_MULTIQUEST         0xF0
347
#define PRI_NSF_CALL_REDIRECTION_SERVICE       0xF7
347
#define PRI_NSF_CALL_REDIRECTION_SERVICE       0xF7
348

    
   
348

   
349
typedef struct q931_call q931_call;
349
typedef struct q931_call q931_call;
350

    
   
350

   
351
/* Name character set enumeration values */
351
/* Name character set enumeration values */
352
#define PRI_CHAR_SET_UNKNOWN				0
352
#define PRI_CHAR_SET_UNKNOWN				0
353
#define PRI_CHAR_SET_ISO8859_1				1
353
#define PRI_CHAR_SET_ISO8859_1				1
354
#define PRI_CHAR_SET_WITHDRAWN				2
354
#define PRI_CHAR_SET_WITHDRAWN				2
355
#define PRI_CHAR_SET_ISO8859_2				3
355
#define PRI_CHAR_SET_ISO8859_2				3
356
#define PRI_CHAR_SET_ISO8859_3				4
356
#define PRI_CHAR_SET_ISO8859_3				4
357
#define PRI_CHAR_SET_ISO8859_4				5
357
#define PRI_CHAR_SET_ISO8859_4				5
358
#define PRI_CHAR_SET_ISO8859_5				6
358
#define PRI_CHAR_SET_ISO8859_5				6
359
#define PRI_CHAR_SET_ISO8859_7				7
359
#define PRI_CHAR_SET_ISO8859_7				7
360
#define PRI_CHAR_SET_ISO10646_BMPSTRING		8
360
#define PRI_CHAR_SET_ISO10646_BMPSTRING		8
361
#define PRI_CHAR_SET_ISO10646_UTF_8STRING	9
361
#define PRI_CHAR_SET_ISO10646_UTF_8STRING	9
362

    
   
362

   
363
/*! \brief Q.SIG name information. */
363
/*! \brief Q.SIG name information. */
364
struct pri_party_name {
364
struct pri_party_name {
365
	/*! \brief TRUE if the name information is valid/present */
365
	/*! \brief TRUE if the name information is valid/present */
366
	int valid;
366
	int valid;
367
	/*!
367
	/*!
368
	 * \brief Q.931 presentation-indicator encoded field
368
	 * \brief Q.931 presentation-indicator encoded field
369
	 * \note Must tollerate the Q.931 screening-indicator field values being present.
369
	 * \note Must tollerate the Q.931 screening-indicator field values being present.
370
	 */
370
	 */
371
	int presentation;
371
	int presentation;
372
	/*!
372
	/*!
373
	 * \brief Character set the name is using.
373
	 * \brief Character set the name is using.
374
	 * \details
374
	 * \details
375
	 * unknown(0),
375
	 * unknown(0),
376
	 * iso8859-1(1),
376
	 * iso8859-1(1),
377
	 * enum-value-withdrawn-by-ITU-T(2)
377
	 * enum-value-withdrawn-by-ITU-T(2)
378
	 * iso8859-2(3),
378
	 * iso8859-2(3),
379
	 * iso8859-3(4),
379
	 * iso8859-3(4),
380
	 * iso8859-4(5),
380
	 * iso8859-4(5),
381
	 * iso8859-5(6),
381
	 * iso8859-5(6),
382
	 * iso8859-7(7),
382
	 * iso8859-7(7),
383
	 * iso10646-BmpString(8),
383
	 * iso10646-BmpString(8),
384
	 * iso10646-utf-8String(9)
384
	 * iso10646-utf-8String(9)
385
	 * \details
385
	 * \details
386
	 * Set to iso8859-1(1) if unsure what to use.
386
	 * Set to iso8859-1(1) if unsure what to use.
387
	 */
387
	 */
388
	int char_set;
388
	int char_set;
389
	/*! \brief Name data with null terminator. */
389
	/*! \brief Name data with null terminator. */
390
	char str[64];
390
	char str[64];
391
};
391
};
392

    
   
392

   
393
struct pri_party_number {
393
struct pri_party_number {
394
	/*! \brief TRUE if the number information is valid/present */
394
	/*! \brief TRUE if the number information is valid/present */
395
	int valid;
395
	int valid;
396
	/*! \brief Q.931 presentation-indicator and screening-indicator encoded fields */
396
	/*! \brief Q.931 presentation-indicator and screening-indicator encoded fields */
397
	int presentation;
397
	int presentation;
398
	/*! \brief Q.931 Type-Of-Number and numbering-plan encoded fields */
398
	/*! \brief Q.931 Type-Of-Number and numbering-plan encoded fields */
399
	int plan;
399
	int plan;
400
	/*! \brief Number data with null terminator. */
400
	/*! \brief Number data with null terminator. */
401
	char str[64];
401
	char str[64];
402
};
402
};
403

    
   
403

   
404
/*!
404
/*!
405
 * \note This structure is a place holder for possible future subaddress support
405
 * \note This structure is a place holder for possible future subaddress support
406
 * to maintain ABI compatibility.
406
 * to maintain ABI compatibility.
407
 */
407
 */
408
struct pri_party_subaddress {
408
struct pri_party_subaddress {
409
	/*! \brief TRUE if the subaddress information is valid/present */
409
	/*! \brief TRUE if the subaddress information is valid/present */
410
	int valid;
410
	int valid;
411
	/*!
411
	/*!
412
	 * \brief Subaddress type.
412
	 * \brief Subaddress type.
413
	 * \details
413
	 * \details
414
	 * nsap(0),
414
	 * nsap(0),
415
	 * user_specified(2)
415
	 * user_specified(2)
416
	 */
416
	 */
417
	int type;
417
	int type;
418
	/*!
418
	/*!
419
	 * \brief TRUE if odd number of address signals
419
	 * \brief TRUE if odd number of address signals
420
	 * \note The odd/even indicator is used when the type of subaddress is
420
	 * \note The odd/even indicator is used when the type of subaddress is
421
	 * user_specified and the coding is BCD.
421
	 * user_specified and the coding is BCD.
422
	 */
422
	 */
423
	int odd_even_indicator;
423
	int odd_even_indicator;
424
	/*! \brief Length of the subaddress data */
424
	/*! \brief Length of the subaddress data */
425
	int length;
425
	int length;
426
	/*!
426
	/*!
427
	 * \brief Subaddress data with null terminator.
427
	 * \brief Subaddress data with null terminator.
428
	 * \note The null terminator is a convenience only since the data could be
428
	 * \note The null terminator is a convenience only since the data could be
429
	 * BCD/binary and thus have a null byte as part of the contents.
429
	 * BCD/binary and thus have a null byte as part of the contents.
430
	 */
430
	 */
431
	char data[32];
431
	unsigned char data[32];
432
};
432
};
433

    
   
433

   
434
/*! \brief Information needed to identify an endpoint in a call. */
434
/*! \brief Information needed to identify an endpoint in a call. */
435
struct pri_party_id {
435
struct pri_party_id {
436
	/*! \brief Subscriber name */
436
	/*! \brief Subscriber name */
437
	struct pri_party_name name;
437
	struct pri_party_name name;
438
	/*! \brief Subscriber phone number */
438
	/*! \brief Subscriber phone number */
439
	struct pri_party_number number;
439
	struct pri_party_number number;
440
	/*! \brief Subscriber subaddress */
440
	/*! \brief Subscriber subaddress */
441
	struct pri_party_subaddress subaddress;
441
	struct pri_party_subaddress subaddress;
442
};
442
};
443

    
   
443

   
444
/*! \brief Connected Line/Party information */
444
/*! \brief Connected Line/Party information */
445
struct pri_party_connected_line {
445
struct pri_party_connected_line {
446
	/*! Connected party ID */
446
	/*! Connected party ID */
447
	struct pri_party_id id;
447
	struct pri_party_id id;
448
};
448
};
449

    
   
449

   
450
/*!
450
/*!
451
 * \brief Redirecting Line information.
451
 * \brief Redirecting Line information.
452
 * \details
452
 * \details
453
 * RDNIS (Redirecting Directory Number Information Service)
453
 * RDNIS (Redirecting Directory Number Information Service)
454
 * Where a call diversion or transfer was invoked.
454
 * Where a call diversion or transfer was invoked.
455
 */
455
 */
456
struct pri_party_redirecting {
456
struct pri_party_redirecting {
457
	/*! Who is redirecting the call (Sent to the party the call is redirected toward) */
457
	/*! Who is redirecting the call (Sent to the party the call is redirected toward) */
458
	struct pri_party_id from;
458
	struct pri_party_id from;
459
	/*! Call is redirecting to a new party (Sent to the caller) */
459
	/*! Call is redirecting to a new party (Sent to the caller) */
460
	struct pri_party_id to;
460
	struct pri_party_id to;
461
	/*! Originally called party (in cases of multiple redirects) */
461
	/*! Originally called party (in cases of multiple redirects) */
462
	struct pri_party_id orig_called;
462
	struct pri_party_id orig_called;
463
	/*! Number of times the call was redirected */
463
	/*! Number of times the call was redirected */
464
	int count;
464
	int count;
465
	/*! Original reason for redirect (in cases of multiple redirects) */
465
	/*! Original reason for redirect (in cases of multiple redirects) */
466
	int orig_reason;
466
	int orig_reason;
467
	/*! Redirection reason */
467
	/*! Redirection reason */
468
	int reason;
468
	int reason;
469
};
469
};
470

    
   
470

   
471
/* Subcommands derived from supplementary services. */
471
/* Subcommands derived from supplementary services. */
472
#define PRI_SUBCMD_REDIRECTING		1
472
#define PRI_SUBCMD_REDIRECTING		1
473
#define PRI_SUBCMD_CONNECTED_LINE	2
473
#define PRI_SUBCMD_CONNECTED_LINE	2
474

    
   
474

   
475

    
   
475

   
476
struct pri_subcommand {
476
struct pri_subcommand {
477
	/*! PRI_SUBCMD_xxx defined values */
477
	/*! PRI_SUBCMD_xxx defined values */
478
	int cmd;
478
	int cmd;
479
	union {
479
	union {
480
		/*! Reserve room for possible expansion to maintain ABI compatibility. */
480
		/*! Reserve room for possible expansion to maintain ABI compatibility. */
481
		char reserve_space[512];
481
		char reserve_space[512];
482
		struct pri_party_connected_line connected_line;
482
		struct pri_party_connected_line connected_line;
483
		struct pri_party_redirecting redirecting;
483
		struct pri_party_redirecting redirecting;
484
	} u;
484
	} u;
485
};
485
};
486

    
   
486

   
487
/* Max number of subcommands per event message */
487
/* Max number of subcommands per event message */
488
#define PRI_MAX_SUBCOMMANDS	8
488
#define PRI_MAX_SUBCOMMANDS	8
489

    
   
489

   
490
struct pri_subcommands {
490
struct pri_subcommands {
491
	int counter_subcmd;
491
	int counter_subcmd;
492
	struct pri_subcommand subcmd[PRI_MAX_SUBCOMMANDS];
492
	struct pri_subcommand subcmd[PRI_MAX_SUBCOMMANDS];
493
};
493
};
494

    
   
494

   
495

    
   
495

   
496
/*
496
/*
497
 * Event channel parameter encoding:
497
 * Event channel parameter encoding:
498
 * 3322 2222 2222 1111 1111 1100 0000 0000
498
 * 3322 2222 2222 1111 1111 1100 0000 0000
499
 * 1098 7654 3210 9876 5432 1098 7654 3210
499
 * 1098 7654 3210 9876 5432 1098 7654 3210
500
 * xxxx xxxx xxxx xxDC BBBBBBBBB AAAAAAAAA
500
 * xxxx xxxx xxxx xxDC BBBBBBBBB AAAAAAAAA
501
 *
501
 *
502
 * Bit field
502
 * Bit field
503
 * A - B channel
503
 * A - B channel
504
 * B - Span (DS1) (0 - 127)
504
 * B - Span (DS1) (0 - 127)
505
 * C - DS1 Explicit bit
505
 * C - DS1 Explicit bit
506
 * D - D channel (cis_call) bit (status only)
506
 * D - D channel (cis_call) bit (status only)
507
 *
507
 *
508
 * B channel values:
508
 * B channel values:
509
 * 0     - No channel (ISDN uses for call waiting feature)
509
 * 0     - No channel (ISDN uses for call waiting feature)
510
 * 1-127 - B channel #
510
 * 1-127 - B channel #
511
 * 0xFF  - Any channel (Also if whole channel value is -1 in event)
511
 * 0xFF  - Any channel (Also if whole channel value is -1 in event)
512
 */
512
 */
513

    
   
513

   
514

    
   
514

   
515
typedef struct pri_event_generic {
515
typedef struct pri_event_generic {
516
	/* Events with no additional information fall in this category */
516
	/* Events with no additional information fall in this category */
517
	int e;
517
	int e;
518
} pri_event_generic;
518
} pri_event_generic;
519

    
   
519

   
520
typedef struct pri_event_error {
520
typedef struct pri_event_error {
521
	int e;
521
	int e;
522
	char err[256];
522
	char err[256];
523
} pri_event_error;
523
} pri_event_error;
524

    
   
524

   
525
typedef struct pri_event_restart {
525
typedef struct pri_event_restart {
526
	int e;
526
	int e;
527
	int channel;
527
	int channel;
528
} pri_event_restart;
528
} pri_event_restart;
529

    
   
529

   
530
typedef struct pri_event_ringing {
530
typedef struct pri_event_ringing {
531
	int e;
531
	int e;
532
	int channel;
532
	int channel;
533
	int cref;
533
	int cref;
534
	int progress;
534
	int progress;
535
	int progressmask;
535
	int progressmask;
536
	q931_call *call;
536
	q931_call *call;
537
	char useruserinfo[260];		/* User->User info */
537
	char useruserinfo[260];		/* User->User info */
538
	struct pri_subcommands *subcmds;
538
	struct pri_subcommands *subcmds;
539
} pri_event_ringing;
539
} pri_event_ringing;
540

    
   
540

   
541
typedef struct pri_event_answer {
541
typedef struct pri_event_answer {
542
	int e;
542
	int e;
543
	int channel;
543
	int channel;
544
	int cref;
544
	int cref;
545
	int progress;
545
	int progress;
546
	int progressmask;
546
	int progressmask;
547
	q931_call *call;
547
	q931_call *call;
548
	char useruserinfo[260];		/* User->User info */
548
	char useruserinfo[260];		/* User->User info */
549
	struct pri_subcommands *subcmds;
549
	struct pri_subcommands *subcmds;
550
} pri_event_answer;
550
} pri_event_answer;
551

    
   
551

   
552
/*! Deprecated replaced by struct pri_event_facility. */
552
/*! Deprecated replaced by struct pri_event_facility. */
553
typedef struct pri_event_facname {
553
typedef struct pri_event_facname {
554
	int e;
554
	int e;
555
	char callingname[256];
555
	char callingname[256];
556
	char callingnum[256];
556
	char callingnum[256];
557
	int channel;
557
	int channel;
558
	int cref;
558
	int cref;
559
	q931_call *call;
559
	q931_call *call;
560
	int callingpres;			/* Presentation of Calling CallerID */
560
	int callingpres;			/* Presentation of Calling CallerID */
561
	int callingplan;			/* Dialing plan of Calling entity */
561
	int callingplan;			/* Dialing plan of Calling entity */
562
} pri_event_facname;
562
} pri_event_facname;
563

    
   
563

   
564
struct pri_event_facility {
564
struct pri_event_facility {
565
	int e;
565
	int e;
566
	char callingname[256];		/*!< Deprecated, preserved for struct pri_event_facname compatibility */
566
	char callingname[256];		/*!< Deprecated, preserved for struct pri_event_facname compatibility */
567
	char callingnum[256];		/*!< Deprecated, preserved for struct pri_event_facname compatibility */
567
	char callingnum[256];		/*!< Deprecated, preserved for struct pri_event_facname compatibility */
568
	int channel;
568
	int channel;
569
	int cref;
569
	int cref;
570
	q931_call *call;
570
	q931_call *call;
571
	int callingpres;			/*!< Presentation of Calling CallerID (Deprecated, preserved for struct pri_event_facname compatibility) */
571
	int callingpres;			/*!< Presentation of Calling CallerID (Deprecated, preserved for struct pri_event_facname compatibility) */
572
	int callingplan;			/*!< Dialing plan of Calling entity (Deprecated, preserved for struct pri_event_facname compatibility) */
572
	int callingplan;			/*!< Dialing plan of Calling entity (Deprecated, preserved for struct pri_event_facname compatibility) */
573
	struct pri_subcommands *subcmds;
573
	struct pri_subcommands *subcmds;
574
};
574
};
575

    
   
575

   
576
#define PRI_CALLINGPLANANI
576
#define PRI_CALLINGPLANANI
577
#define PRI_CALLINGPLANRDNIS
577
#define PRI_CALLINGPLANRDNIS
578
typedef struct pri_event_ring {
578
typedef struct pri_event_ring {
579
	int e;
579
	int e;
580
	int channel;				/* Channel requested */
580
	int channel;				/* Channel requested */
581
	int callingpres;			/* Presentation of Calling CallerID */
581
	int callingpres;			/* Presentation of Calling CallerID */
582
	int callingplanani;			/* Dialing plan of Calling entity ANI */
582
	int callingplanani;			/* Dialing plan of Calling entity ANI */
583
	int callingplan;			/* Dialing plan of Calling entity */
583
	int callingplan;			/* Dialing plan of Calling entity */
584
	char callingani[256];		/* Calling ANI */
584
	char callingani[256];		/* Calling ANI */
585
	char callingnum[256];		/* Calling number */
585
	char callingnum[256];		/* Calling number */
586
	char callingname[256];		/* Calling name (if provided) */
586
	char callingname[256];		/* Calling name (if provided) */
587
	int calledplan;				/* Dialing plan of Called number */
587
	int calledplan;				/* Dialing plan of Called number */
588
	int ani2;                   /* ANI II */
588
	int ani2;                   /* ANI II */
589
	char callednum[256];		/* Called number */
589
	char callednum[256];		/* Called number */
590
	char redirectingnum[256];	/* Redirecting number */
590
	char redirectingnum[256];	/* Redirecting number */
591
	char redirectingname[256];	/* Redirecting name */
591
	char redirectingname[256];	/* Redirecting name */
592
	int redirectingreason;		/* Reason for redirect */
592
	int redirectingreason;		/* Reason for redirect */
593
	int callingplanrdnis;			/* Dialing plan of Redirecting Number */
593
	int callingplanrdnis;			/* Dialing plan of Redirecting Number */
594
	char useruserinfo[260];		/* User->User info */
594
	char useruserinfo[260];		/* User->User info */
595
	int flexible;				/* Are we flexible with our channel selection? */
595
	int flexible;				/* Are we flexible with our channel selection? */
596
	int cref;					/* Call Reference Number */
596
	int cref;					/* Call Reference Number */
597
	int ctype;					/* Call type (see PRI_TRANS_CAP_* */
597
	int ctype;					/* Call type (see PRI_TRANS_CAP_* */
598
	int layer1;					/* User layer 1 */
598
	int layer1;					/* User layer 1 */
599
	int complete;				/* Have we seen "Complete" i.e. no more number? */
599
	int complete;				/* Have we seen "Complete" i.e. no more number? */
600
	q931_call *call;			/* Opaque call pointer */
600
	q931_call *call;			/* Opaque call pointer */
601
	char callingsubaddr[256];	/* Calling parties subaddress, backwards compatibility */
601
	char callingsubaddr[256];	/* Calling parties subaddress, backwards compatibility */
602
	int progress;
602
	int progress;
603
	int progressmask;
603
	int progressmask;
604
	char origcalledname[256];
604
	char origcalledname[256];
605
	char origcallednum[256];
605
	char origcallednum[256];
606
	int callingplanorigcalled;		/* Dialing plan of Originally Called Number */
606
	int callingplanorigcalled;		/* Dialing plan of Originally Called Number */
607
	int origredirectingreason;
607
	int origredirectingreason;
608
	int reversecharge;
608
	int reversecharge;
609
	struct pri_subcommands *subcmds;
609
	struct pri_subcommands *subcmds;
610
	struct pri_party_subaddress calling_subaddress;	/* Calling parties subaddress */
610
	struct pri_party_id calling;			/* Calling Party's info, initially subaddress' */
611
	struct pri_party_subaddress called_subaddress;	/* Called parties subaddress */
611
	struct pri_party_subaddress called_subaddress;	/* Called parties subaddress */
612
} pri_event_ring;
612
} pri_event_ring;
613

    
   
613

   
614
typedef struct pri_event_hangup {
614
typedef struct pri_event_hangup {
615
	int e;
615
	int e;
616
	int channel;				/* Channel requested */
616
	int channel;				/* Channel requested */
617
	int cause;
617
	int cause;
618
	int cref;
618
	int cref;
619
	q931_call *call;			/* Opaque call pointer */
619
	q931_call *call;			/* Opaque call pointer */
620
	long aoc_units;				/* Advise of Charge number of charged units */
620
	long aoc_units;				/* Advise of Charge number of charged units */
621
	char useruserinfo[260];		/* User->User info */
621
	char useruserinfo[260];		/* User->User info */
622
	struct pri_subcommands *subcmds;
622
	struct pri_subcommands *subcmds;
623
} pri_event_hangup;
623
} pri_event_hangup;
624

    
   
624

   
625
typedef struct pri_event_restart_ack {
625
typedef struct pri_event_restart_ack {
626
	int e;
626
	int e;
627
	int channel;
627
	int channel;
628
} pri_event_restart_ack;
628
} pri_event_restart_ack;
629

    
   
629

   
630
#define PRI_PROGRESS_CAUSE
630
#define PRI_PROGRESS_CAUSE
631
typedef struct pri_event_proceeding {
631
typedef struct pri_event_proceeding {
632
	int e;
632
	int e;
633
	int channel;
633
	int channel;
634
	int cref;
634
	int cref;
635
	int progress;
635
	int progress;
636
	int progressmask;
636
	int progressmask;
637
	int cause;
637
	int cause;
638
	q931_call *call;
638
	q931_call *call;
639
	struct pri_subcommands *subcmds;
639
	struct pri_subcommands *subcmds;
640
} pri_event_proceeding;
640
} pri_event_proceeding;
641

    
   
641

   
642
typedef struct pri_event_setup_ack {
642
typedef struct pri_event_setup_ack {
643
	int e;
643
	int e;
644
	int channel;
644
	int channel;
645
	q931_call *call;
645
	q931_call *call;
646
	struct pri_subcommands *subcmds;
646
	struct pri_subcommands *subcmds;
647
} pri_event_setup_ack;
647
} pri_event_setup_ack;
648

    
   
648

   
649
typedef struct pri_event_notify {
649
typedef struct pri_event_notify {
650
	int e;
650
	int e;
651
	int channel;
651
	int channel;
652
	int info;
652
	int info;
653
	struct pri_subcommands *subcmds;
653
	struct pri_subcommands *subcmds;
654
} pri_event_notify;
654
} pri_event_notify;
655

    
   
655

   
656
typedef struct pri_event_keypad_digit {
656
typedef struct pri_event_keypad_digit {
657
	int e;
657
	int e;
658
	int channel;
658
	int channel;
659
	q931_call *call;
659
	q931_call *call;
660
	char digits[64];
660
	char digits[64];
661
	struct pri_subcommands *subcmds;
661
	struct pri_subcommands *subcmds;
662
} pri_event_keypad_digit;
662
} pri_event_keypad_digit;
663

    
   
663

   
664
typedef struct pri_event_service {
664
typedef struct pri_event_service {
665
	int e;
665
	int e;
666
	int channel;
666
	int channel;
667
	int changestatus;
667
	int changestatus;
668
} pri_event_service;
668
} pri_event_service;
669

    
   
669

   
670
typedef struct pri_event_service_ack {
670
typedef struct pri_event_service_ack {
671
	int e;
671
	int e;
672
	int channel;
672
	int channel;
673
	int changestatus;
673
	int changestatus;
674
} pri_event_service_ack;
674
} pri_event_service_ack;
675

    
   
675

   
676
typedef union {
676
typedef union {
677
	int e;
677
	int e;
678
	pri_event_generic gen;		/* Generic view */
678
	pri_event_generic gen;		/* Generic view */
679
	pri_event_restart restart;	/* Restart view */
679
	pri_event_restart restart;	/* Restart view */
680
	pri_event_error	  err;		/* Error view */
680
	pri_event_error	  err;		/* Error view */
681
	pri_event_facname facname;	/* Caller*ID Name on Facility (Deprecated, use pri_event.facility) */
681
	pri_event_facname facname;	/* Caller*ID Name on Facility (Deprecated, use pri_event.facility) */
682
	pri_event_ring	  ring;		/* Ring */
682
	pri_event_ring	  ring;		/* Ring */
683
	pri_event_hangup  hangup;	/* Hang up */
683
	pri_event_hangup  hangup;	/* Hang up */
684
	pri_event_ringing ringing;	/* Ringing */
684
	pri_event_ringing ringing;	/* Ringing */
685
	pri_event_answer  answer;	/* Answer */
685
	pri_event_answer  answer;	/* Answer */
686
	pri_event_restart_ack restartack;	/* Restart Acknowledge */
686
	pri_event_restart_ack restartack;	/* Restart Acknowledge */
687
	pri_event_proceeding  proceeding;	/* Call proceeding & Progress */
687
	pri_event_proceeding  proceeding;	/* Call proceeding & Progress */
688
	pri_event_setup_ack   setup_ack;	/* SETUP_ACKNOWLEDGE structure */
688
	pri_event_setup_ack   setup_ack;	/* SETUP_ACKNOWLEDGE structure */
689
	pri_event_notify notify;		/* Notification */
689
	pri_event_notify notify;		/* Notification */
690
	pri_event_keypad_digit digit;			/* Digits that come during a call */
690
	pri_event_keypad_digit digit;			/* Digits that come during a call */
691
	pri_event_service service;				/* service message */
691
	pri_event_service service;				/* service message */
692
	pri_event_service_ack service_ack;		/* service acknowledgement message */
692
	pri_event_service_ack service_ack;		/* service acknowledgement message */
693
	struct pri_event_facility facility;
693
	struct pri_event_facility facility;
694
} pri_event;
694
} pri_event;
695

    
   
695

   
696
struct pri;
696
struct pri;
697
struct pri_sr;
697
struct pri_sr;
698

    
   
698

   
699
#define PRI_IO_FUNCS
699
#define PRI_IO_FUNCS
700
/* Type declaration for callbacks to read or write a HDLC frame as below */
700
/* Type declaration for callbacks to read or write a HDLC frame as below */
701
typedef int (*pri_io_cb)(struct pri *pri, void *buf, int buflen);
701
typedef int (*pri_io_cb)(struct pri *pri, void *buf, int buflen);
702

    
   
702

   
703
/* Create a D-channel on a given file descriptor.  The file descriptor must be a
703
/* Create a D-channel on a given file descriptor.  The file descriptor must be a
704
   channel operating in HDLC mode with FCS computed by the fd's driver.  Also it
704
   channel operating in HDLC mode with FCS computed by the fd's driver.  Also it
705
   must be NON-BLOCKING! Frames received on the fd should include FCS.  Nodetype
705
   must be NON-BLOCKING! Frames received on the fd should include FCS.  Nodetype
706
   must be one of PRI_NETWORK or PRI_CPE.  switchtype should be PRI_SWITCH_* */
706
   must be one of PRI_NETWORK or PRI_CPE.  switchtype should be PRI_SWITCH_* */
707
struct pri *pri_new(int fd, int nodetype, int switchtype);
707
struct pri *pri_new(int fd, int nodetype, int switchtype);
708
struct pri *pri_new_bri(int fd, int ptpmode, int nodetype, int switchtype);
708
struct pri *pri_new_bri(int fd, int ptpmode, int nodetype, int switchtype);
709

    
   
709

   
710
/* Create D-channel just as above with user defined I/O callbacks and data */
710
/* Create D-channel just as above with user defined I/O callbacks and data */
711
struct pri *pri_new_cb(int fd, int nodetype, int switchtype, pri_io_cb io_read, pri_io_cb io_write, void *userdata);
711
struct pri *pri_new_cb(int fd, int nodetype, int switchtype, pri_io_cb io_read, pri_io_cb io_write, void *userdata);
712

    
   
712

   
713
/* Retrieve the user data associated with the D channel */
713
/* Retrieve the user data associated with the D channel */
714
void *pri_get_userdata(struct pri *pri);
714
void *pri_get_userdata(struct pri *pri);
715

    
   
715

   
716
/* Set the user data associated with the D channel */
716
/* Set the user data associated with the D channel */
717
void pri_set_userdata(struct pri *pri, void *userdata);
717
void pri_set_userdata(struct pri *pri, void *userdata);
718

    
   
718

   
719
/* Set Network Specific Facility for PRI */
719
/* Set Network Specific Facility for PRI */
720
void pri_set_nsf(struct pri *pri, int nsf);
720
void pri_set_nsf(struct pri *pri, int nsf);
721

    
   
721

   
722
/* Set debug parameters on PRI -- see above debug definitions */
722
/* Set debug parameters on PRI -- see above debug definitions */
723
void pri_set_debug(struct pri *pri, int debug);
723
void pri_set_debug(struct pri *pri, int debug);
724

    
   
724

   
725
/* Get debug parameters on PRI -- see above debug definitions */
725
/* Get debug parameters on PRI -- see above debug definitions */
726
int pri_get_debug(struct pri *pri);
726
int pri_get_debug(struct pri *pri);
727

    
   
727

   
728
#define PRI_FACILITY_ENABLE
728
#define PRI_FACILITY_ENABLE
729
/* Enable transmission support of Facility IEs on the pri */
729
/* Enable transmission support of Facility IEs on the pri */
730
void pri_facility_enable(struct pri *pri);
730
void pri_facility_enable(struct pri *pri);
731

    
   
731

   
732
/* Run PRI on the given D-channel, taking care of any events that
732
/* Run PRI on the given D-channel, taking care of any events that
733
   need to be handled.  If block is set, it will block until an event
733
   need to be handled.  If block is set, it will block until an event
734
   occurs which needs to be handled */
734
   occurs which needs to be handled */
735
pri_event *pri_dchannel_run(struct pri *pri, int block);
735
pri_event *pri_dchannel_run(struct pri *pri, int block);
736

    
   
736

   
737
/* Check for an outstanding event on the PRI */
737
/* Check for an outstanding event on the PRI */
738
pri_event *pri_check_event(struct pri *pri);
738
pri_event *pri_check_event(struct pri *pri);
739

    
   
739

   
740
/* Give a name to a given event ID */
740
/* Give a name to a given event ID */
741
char *pri_event2str(int id);
741
char *pri_event2str(int id);
742

    
   
742

   
743
/* Give a name to a node type */
743
/* Give a name to a node type */
744
char *pri_node2str(int id);
744
char *pri_node2str(int id);
745

    
   
745

   
746
/* Give a name to a switch type */
746
/* Give a name to a switch type */
747
char *pri_switch2str(int id);
747
char *pri_switch2str(int id);
748

    
   
748

   
749
/* Print an event */
749
/* Print an event */
750
void pri_dump_event(struct pri *pri, pri_event *e);
750
void pri_dump_event(struct pri *pri, pri_event *e);
751

    
   
751

   
752
/* Turn presentation into a string */
752
/* Turn presentation into a string */
753
char *pri_pres2str(int pres);
753
char *pri_pres2str(int pres);
754

    
   
754

   
755
/* Turn numbering plan into a string */
755
/* Turn numbering plan into a string */
756
char *pri_plan2str(int plan);
756
char *pri_plan2str(int plan);
757

    
   
757

   
758
/* Turn cause into a string */
758
/* Turn cause into a string */
759
char *pri_cause2str(int cause);
759
char *pri_cause2str(int cause);
760

    
   
760

   
761
/* Acknowledge a call and place it on the given channel.  Set info to non-zero if there
761
/* Acknowledge a call and place it on the given channel.  Set info to non-zero if there
762
   is in-band data available on the channel */
762
   is in-band data available on the channel */
763
int pri_acknowledge(struct pri *pri, q931_call *call, int channel, int info);
763
int pri_acknowledge(struct pri *pri, q931_call *call, int channel, int info);
764

    
   
764

   
765
/* Send a digit in overlap mode */
765
/* Send a digit in overlap mode */
766
int pri_information(struct pri *pri, q931_call *call, char digit);
766
int pri_information(struct pri *pri, q931_call *call, char digit);
767

    
   
767

   
768
#define PRI_KEYPAD_FACILITY_TX
768
#define PRI_KEYPAD_FACILITY_TX
769
/* Send a keypad facility string of digits */
769
/* Send a keypad facility string of digits */
770
int pri_keypad_facility(struct pri *pri, q931_call *call, const char *digits);
770
int pri_keypad_facility(struct pri *pri, q931_call *call, const char *digits);
771

    
   
771

   
772
/* Answer the incomplete(call without called number) call on the given channel.
772
/* Answer the incomplete(call without called number) call on the given channel.
773
   Set non-isdn to non-zero if you are not connecting to ISDN equipment */
773
   Set non-isdn to non-zero if you are not connecting to ISDN equipment */
774
int pri_need_more_info(struct pri *pri, q931_call *call, int channel, int nonisdn);
774
int pri_need_more_info(struct pri *pri, q931_call *call, int channel, int nonisdn);
775

    
   
775

   
776
/* Answer the call on the given channel (ignored if you called acknowledge already).
776
/* Answer the call on the given channel (ignored if you called acknowledge already).
777
   Set non-isdn to non-zero if you are not connecting to ISDN equipment */
777
   Set non-isdn to non-zero if you are not connecting to ISDN equipment */
778
int pri_answer(struct pri *pri, q931_call *call, int channel, int nonisdn);
778
int pri_answer(struct pri *pri, q931_call *call, int channel, int nonisdn);
779

    
   
779

   
780
/*!
780
/*!
781
 * \brief Give connected line information to a call
781
 * \brief Give connected line information to a call
782
 * \note Could be used instead of pri_sr_set_caller_party() before calling pri_setup().
782
 * \note Could be used instead of pri_sr_set_caller_party() before calling pri_setup().
783
 */
783
 */
784
int pri_connected_line_update(struct pri *pri, q931_call *call, const struct pri_party_connected_line *connected);
784
int pri_connected_line_update(struct pri *pri, q931_call *call, const struct pri_party_connected_line *connected);
785

    
   
785

   
786
/*!
786
/*!
787
 * \brief Give redirection information to a call
787
 * \brief Give redirection information to a call
788
 * \note Could be used instead of pri_sr_set_redirecting_parties() before calling pri_setup().
788
 * \note Could be used instead of pri_sr_set_redirecting_parties() before calling pri_setup().
789
 */
789
 */
790
int pri_redirecting_update(struct pri *pri, q931_call *call, const struct pri_party_redirecting *redirecting);
790
int pri_redirecting_update(struct pri *pri, q931_call *call, const struct pri_party_redirecting *redirecting);
791

    
   
791

   
792
/* Set CRV reference for GR-303 calls */
792
/* Set CRV reference for GR-303 calls */
793

    
   
793

   
794

    
   
794

   
795
#undef pri_release
795
#undef pri_release
796
#undef pri_disconnect
796
#undef pri_disconnect
797

    
   
797

   
798
/* backwards compatibility for those who don't use asterisk with libpri */
798
/* backwards compatibility for those who don't use asterisk with libpri */
799
#define pri_release(a,b,c) \
799
#define pri_release(a,b,c) \
800
	pri_hangup(a,b,c)
800
	pri_hangup(a,b,c)
801

    
   
801

   
802
#define pri_disconnect(a,b,c) \
802
#define pri_disconnect(a,b,c) \
803
	pri_hangup(a,b,c)
803
	pri_hangup(a,b,c)
804

    
   
804

   
805
/* Hangup a call */
805
/* Hangup a call */
806
#define PRI_HANGUP
806
#define PRI_HANGUP
807
int pri_hangup(struct pri *pri, q931_call *call, int cause);
807
int pri_hangup(struct pri *pri, q931_call *call, int cause);
808

    
   
808

   
809
#define PRI_DESTROYCALL
809
#define PRI_DESTROYCALL
810
void pri_destroycall(struct pri *pri, q931_call *call);
810
void pri_destroycall(struct pri *pri, q931_call *call);
811

    
   
811

   
812
#define PRI_RESTART
812
#define PRI_RESTART
813
int pri_restart(struct pri *pri);
813
int pri_restart(struct pri *pri);
814

    
   
814

   
815
int pri_reset(struct pri *pri, int channel);
815
int pri_reset(struct pri *pri, int channel);
816

    
   
816

   
817
/* handle b-channel maintenance messages */
817
/* handle b-channel maintenance messages */
818
extern int pri_maintenance_service(struct pri *pri, int span, int channel, int changestatus);
818
extern int pri_maintenance_service(struct pri *pri, int span, int channel, int changestatus);
819

    
   
819

   
820
/* Create a new call */
820
/* Create a new call */
821
q931_call *pri_new_call(struct pri *pri);
821
q931_call *pri_new_call(struct pri *pri);
822

    
   
822

   
823
/* Retrieve CRV reference for GR-303 calls.  Returns >0 on success. */
823
/* Retrieve CRV reference for GR-303 calls.  Returns >0 on success. */
824
int pri_get_crv(struct pri *pri, q931_call *call, int *callmode);
824
int pri_get_crv(struct pri *pri, q931_call *call, int *callmode);
825

    
   
825

   
826
/* Retrieve CRV reference for GR-303 calls.  CRV must be >0, call mode should be 0 */
826
/* Retrieve CRV reference for GR-303 calls.  CRV must be >0, call mode should be 0 */
827
int pri_set_crv(struct pri *pri, q931_call *call, int crv, int callmode);
827
int pri_set_crv(struct pri *pri, q931_call *call, int crv, int callmode);
828

    
   
828

   
829
/* How long until you need to poll for a new event */
829
/* How long until you need to poll for a new event */
830
struct timeval *pri_schedule_next(struct pri *pri);
830
struct timeval *pri_schedule_next(struct pri *pri);
831

    
   
831

   
832
/* Run any pending schedule events */
832
/* Run any pending schedule events */
833
extern pri_event *pri_schedule_run(struct pri *pri);
833
extern pri_event *pri_schedule_run(struct pri *pri);
834
extern pri_event *pri_schedule_run_tv(struct pri *pri, const struct timeval *now);
834
extern pri_event *pri_schedule_run_tv(struct pri *pri, const struct timeval *now);
835

    
   
835

   
836
int pri_call(struct pri *pri, q931_call *c, int transmode, int channel,
836
int pri_call(struct pri *pri, q931_call *c, int transmode, int channel,
837
    int exclusive, int nonisdn, char *caller, int callerplan, char *callername, int callerpres,
837
    int exclusive, int nonisdn, char *caller, int callerplan, char *callername, int callerpres,
838
    char *called, int calledplan, int ulayer1);
838
    char *called, int calledplan, int ulayer1);
839

    
   
839

   
840
struct pri_sr *pri_sr_new(void);
840
struct pri_sr *pri_sr_new(void);
841
void pri_sr_free(struct pri_sr *sr);
841
void pri_sr_free(struct pri_sr *sr);
842

    
   
842

   
843
int pri_sr_set_channel(struct pri_sr *sr, int channel, int exclusive, int nonisdn);
843
int pri_sr_set_channel(struct pri_sr *sr, int channel, int exclusive, int nonisdn);
844
int pri_sr_set_bearer(struct pri_sr *sr, int transmode, int userl1);
844
int pri_sr_set_bearer(struct pri_sr *sr, int transmode, int userl1);
845
int pri_sr_set_called(struct pri_sr *sr, char *called, int calledplan, int complete);
845
int pri_sr_set_called(struct pri_sr *sr, char *called, int calledplan, int complete);
846

    
   
846

   
847
/*!
847
/*!
848
 * \brief Set the caller party ID information in the call SETUP record.
848
 * \brief Set the caller party ID information in the call SETUP record.
849
 *
849
 *
850
 * \param sr New call SETUP record.
850
 * \param sr New call SETUP record.
851
 * \param caller Caller party ID information to set.
851
 * \param caller Caller party ID information to set.
852
 *
852
 *
853
 * \return Nothing
853
 * \return Nothing
854
 */
854
 */
855
void pri_sr_set_caller_party(struct pri_sr *sr, const struct pri_party_id *caller);
855
void pri_sr_set_caller_party(struct pri_sr *sr, const struct pri_party_id *caller);
856
/*! \note Use pri_sr_set_caller_party() instead to pass more precise caller information. */
856
/*! \note Use pri_sr_set_caller_party() instead to pass more precise caller information. */
857
int pri_sr_set_caller(struct pri_sr *sr, char *caller, char *callername, int callerplan, int callerpres);
857
int pri_sr_set_caller(struct pri_sr *sr, char *caller, char *callername, int callerplan, int callerpres);
858

    
   
858

   
859
/*!
859
/*!
860
 * \brief Set the calling/called subaddress information in the call SETUP record.
860
 * \brief Set the calling/called subaddress information in the call SETUP record.
861
 *
861
 *
862
 * \param sr New call SETUP record.
862
 * \param sr New call SETUP record.
863
 * \param Subaddress information to set.
863
 * \param Subaddress information to set.
864
 *
864
 *
865
 * \return Nothing
865
 * \return Nothing
866
 */
866
 */

    
   
867

   
867
#define HAVE_PRI_SUBADDR
868
#define HAVE_PRI_SUBADDR
868
void pri_sr_set_calling_subaddress(struct pri_sr *sr, const struct pri_party_subaddress *subaddress);
869
/* XXX TODO XXX remove the above HAVE_PRI_SUBADDR line and put a test for the feature in configure.ac when it is committed

    
   
870
 */

    
   
871
void pri_sr_set_caller_subaddress(struct pri_sr *sr, const struct pri_party_subaddress *subaddress);
869
void pri_sr_set_called_subaddress(struct pri_sr *sr, const struct pri_party_subaddress *subaddress);
872
void pri_sr_set_called_subaddress(struct pri_sr *sr, const struct pri_party_subaddress *subaddress);
870

    
   
873

   
871
/*!
874
/*!
872
 * \brief Set the redirecting information in the call SETUP record.
875
 * \brief Set the redirecting information in the call SETUP record.
873
 *
876
 *
874
 * \param sr New call SETUP record.
877
 * \param sr New call SETUP record.
875
 * \param caller Redirecting information to set.
878
 * \param caller Redirecting information to set.
876
 *
879
 *
877
 * \return Nothing
880
 * \return Nothing
878
 */
881
 */
879
void pri_sr_set_redirecting_parties(struct pri_sr *sr, const struct pri_party_redirecting *redirecting);
882
void pri_sr_set_redirecting_parties(struct pri_sr *sr, const struct pri_party_redirecting *redirecting);
880
/*! \note Use pri_sr_set_redirecting_parties() instead to pass more precise redirecting information. */
883
/*! \note Use pri_sr_set_redirecting_parties() instead to pass more precise redirecting information. */
881
int pri_sr_set_redirecting(struct pri_sr *sr, char *num, int plan, int pres, int reason);
884
int pri_sr_set_redirecting(struct pri_sr *sr, char *num, int plan, int pres, int reason);
882

    
   
885

   
883
#define PRI_USER_USER_TX
886
#define PRI_USER_USER_TX
884
/* Set the user user field.  Warning!  don't send binary data accross this field */
887
/* Set the user user field.  Warning!  don't send binary data accross this field */
885
void pri_sr_set_useruser(struct pri_sr *sr, const char *userchars);
888
void pri_sr_set_useruser(struct pri_sr *sr, const char *userchars);
886
void pri_sr_set_reversecharge(struct pri_sr *sr, int requested);
889
void pri_sr_set_reversecharge(struct pri_sr *sr, int requested);
887

    
   
890

   
888
void pri_call_set_useruser(q931_call *sr, const char *userchars);
891
void pri_call_set_useruser(q931_call *sr, const char *userchars);
889

    
   
892

   
890

    
   

   
891
int pri_setup(struct pri *pri, q931_call *call, struct pri_sr *req);
893
int pri_setup(struct pri *pri, q931_call *call, struct pri_sr *req);
892

    
   
894

   
893
/*!
895
/*!
894
 * \brief Set a call as a call indpendent signalling connection (i.e. no bchan)
896
 * \brief Set a call as a call indpendent signalling connection (i.e. no bchan)
895
 * \note Call will automaticlly disconnect after signalling sent.
897
 * \note Call will automaticlly disconnect after signalling sent.
896
 */
898
 */
897
int pri_sr_set_connection_call_independent(struct pri_sr *req);
899
int pri_sr_set_connection_call_independent(struct pri_sr *req);
898

    
   
900

   
899
/*!
901
/*!
900
 * \brief Set a call as a call indpendent signalling connection (i.e. no bchan)
902
 * \brief Set a call as a call indpendent signalling connection (i.e. no bchan)
901
 * \note Call will stay connected until explicitly disconnected.
903
 * \note Call will stay connected until explicitly disconnected.
902
 */
904
 */
903
int pri_sr_set_no_channel_call(struct pri_sr *req);
905
int pri_sr_set_no_channel_call(struct pri_sr *req);
904

    
   
906

   
905
/* Send an MWI indication to a remote location.  If activate is non zero, activates, if zero, deactivates */
907
/* Send an MWI indication to a remote location.  If activate is non zero, activates, if zero, deactivates */
906
int pri_mwi_activate(struct pri *pri, q931_call *c, char *caller, int callerplan, char *callername, int callerpres, char *called, int calledplan);
908
int pri_mwi_activate(struct pri *pri, q931_call *c, char *caller, int callerplan, char *callername, int callerpres, char *called, int calledplan);
907

    
   
909

   
908
/* Send an MWI deactivate request to a remote location */
910
/* Send an MWI deactivate request to a remote location */
909
int pri_mwi_deactivate(struct pri *pri, q931_call *c, char *caller, int callerplan, char *callername, int callerpres, char *called, int calledplan);
911
int pri_mwi_deactivate(struct pri *pri, q931_call *c, char *caller, int callerplan, char *callername, int callerpres, char *called, int calledplan);
910

    
   
912

   
911
/* Set service message support flag */
913
/* Set service message support flag */
912
int pri_set_service_message_support(struct pri *pri, int supportflag);
914
int pri_set_service_message_support(struct pri *pri, int supportflag);
913

    
   
915

   
914
#define PRI_2BCT
916
#define PRI_2BCT
915
/* Attempt to pass the channels back to the NET side if compatable and
917
/* Attempt to pass the channels back to the NET side if compatable and
916
 * suscribed.  Sometimes called 2 bchannel transfer (2BCT) */
918
 * suscribed.  Sometimes called 2 bchannel transfer (2BCT) */
917
int pri_channel_bridge(q931_call *call1, q931_call *call2);
919
int pri_channel_bridge(q931_call *call1, q931_call *call2);
918

    
   
920

   
919
/* Override message and error stuff */
921
/* Override message and error stuff */
920
#define PRI_NEW_SET_API
922
#define PRI_NEW_SET_API
921
void pri_set_message(void (*__pri_error)(struct pri *pri, char *));
923
void pri_set_message(void (*__pri_error)(struct pri *pri, char *));
922
void pri_set_error(void (*__pri_error)(struct pri *pri, char *));
924
void pri_set_error(void (*__pri_error)(struct pri *pri, char *));
923

    
   
925

   
924
/* Set overlap mode */
926
/* Set overlap mode */
925
#define PRI_SET_OVERLAPDIAL
927
#define PRI_SET_OVERLAPDIAL
926
void pri_set_overlapdial(struct pri *pri,int state);
928
void pri_set_overlapdial(struct pri *pri,int state);
927

    
   
929

   
928
/* QSIG logical channel mapping option, do not skip channel 16 */
930
/* QSIG logical channel mapping option, do not skip channel 16 */
929
#define PRI_SET_CHAN_MAPPING_LOGICAL
931
#define PRI_SET_CHAN_MAPPING_LOGICAL
930
void pri_set_chan_mapping_logical(struct pri *pri, int state);
932
void pri_set_chan_mapping_logical(struct pri *pri, int state);
931

    
   
933

   
932
#define PRI_DUMP_INFO_STR
934
#define PRI_DUMP_INFO_STR
933
char *pri_dump_info_str(struct pri *pri);
935
char *pri_dump_info_str(struct pri *pri);
934

    
   
936

   
935
/* Get file descriptor */
937
/* Get file descriptor */
936
int pri_fd(struct pri *pri);
938
int pri_fd(struct pri *pri);
937

    
   
939

   
938
#define PRI_PROGRESS
940
#define PRI_PROGRESS
939
/* Send progress */
941
/* Send progress */
940
int pri_progress(struct pri *pri, q931_call *c, int channel, int info);
942
int pri_progress(struct pri *pri, q931_call *c, int channel, int info);
941

    
   
943

   
942
/* Send progress with cause IE */
944
/* Send progress with cause IE */
943
int pri_progress_with_cause(struct pri *pri, q931_call *c, int channel, int info, int cause);
945
int pri_progress_with_cause(struct pri *pri, q931_call *c, int channel, int info, int cause);
944

    
   
946

   
945
#define PRI_PROCEEDING_FULL
947
#define PRI_PROCEEDING_FULL
946
/* Send call proceeding */
948
/* Send call proceeding */
947
int pri_proceeding(struct pri *pri, q931_call *c, int channel, int info);
949
int pri_proceeding(struct pri *pri, q931_call *c, int channel, int info);
948

    
   
950

   
949
/* Enable inband progress when a DISCONNECT is received */
951
/* Enable inband progress when a DISCONNECT is received */
950
void pri_set_inbanddisconnect(struct pri *pri, unsigned int enable);
952
void pri_set_inbanddisconnect(struct pri *pri, unsigned int enable);
951

    
   
953

   
952
/* Enslave a PRI to another, so they share the same call list
954
/* Enslave a PRI to another, so they share the same call list
953
   (and maybe some timers) */
955
   (and maybe some timers) */
954
void pri_enslave(struct pri *master, struct pri *slave);
956
void pri_enslave(struct pri *master, struct pri *slave);
955

    
   
957

   
956
#define PRI_GR303_SUPPORT
958
#define PRI_GR303_SUPPORT
957
#define PRI_ENSLAVE_SUPPORT
959
#define PRI_ENSLAVE_SUPPORT
958
#define PRI_SETUP_CALL
960
#define PRI_SETUP_CALL
959
#define PRI_RECEIVE_SUBADDR
961
#define PRI_RECEIVE_SUBADDR
960
#define PRI_REDIRECTING_REASON
962
#define PRI_REDIRECTING_REASON
961
#define PRI_AOC_UNITS
963
#define PRI_AOC_UNITS
962
#define PRI_ANI
964
#define PRI_ANI
963

    
   
965

   
964
/* Send notification */
966
/* Send notification */
965
int pri_notify(struct pri *pri, q931_call *c, int channel, int info);
967
int pri_notify(struct pri *pri, q931_call *c, int channel, int info);
966

    
   
968

   
967
int pri_callrerouting_facility(struct pri *pri, q931_call *call, const char *dest, const char* original, const char* reason);
969
int pri_callrerouting_facility(struct pri *pri, q931_call *call, const char *dest, const char* original, const char* reason);
968

    
   
970

   
969
/* Get/Set PRI Timers  */
971
/* Get/Set PRI Timers  */
970
#define PRI_GETSET_TIMERS
972
#define PRI_GETSET_TIMERS
971
int pri_set_timer(struct pri *pri, int timer, int value);
973
int pri_set_timer(struct pri *pri, int timer, int value);
972
int pri_get_timer(struct pri *pri, int timer);
974
int pri_get_timer(struct pri *pri, int timer);
973
int pri_timer2idx(const char *timer_name);
975
int pri_timer2idx(const char *timer_name);
974

    
   
976

   
975
/*! New configurable timers and counters must be added to the end of the list */
977
/*! New configurable timers and counters must be added to the end of the list */
976
enum PRI_TIMERS_AND_COUNTERS {
978
enum PRI_TIMERS_AND_COUNTERS {
977
	PRI_TIMER_N200,	/*!< Maximum numer of Q.921 retransmissions */
979
	PRI_TIMER_N200,	/*!< Maximum numer of Q.921 retransmissions */
978
	PRI_TIMER_N201,	/*!< Maximum numer of octets in an information field */
980
	PRI_TIMER_N201,	/*!< Maximum numer of octets in an information field */
979
	PRI_TIMER_N202,	/*!< Maximum numer of transmissions of the TEI identity request message */
981
	PRI_TIMER_N202,	/*!< Maximum numer of transmissions of the TEI identity request message */
980
	PRI_TIMER_K,	/*!< Maximum number of outstanding I-frames */
982
	PRI_TIMER_K,	/*!< Maximum number of outstanding I-frames */
981

    
   
983

   
982
	PRI_TIMER_T200,	/*!< Time between SABME's */
984
	PRI_TIMER_T200,	/*!< Time between SABME's */
983
	PRI_TIMER_T201,	/*!< Minimum time between retransmissions of the TEI Identity check messages */
985
	PRI_TIMER_T201,	/*!< Minimum time between retransmissions of the TEI Identity check messages */
984
	PRI_TIMER_T202,	/*!< Minimum time between transmission of TEI Identity request messages */
986
	PRI_TIMER_T202,	/*!< Minimum time between transmission of TEI Identity request messages */
985
	PRI_TIMER_T203,	/*!< Maximum time without exchanging packets */
987
	PRI_TIMER_T203,	/*!< Maximum time without exchanging packets */
986

    
   
988

   
987
	PRI_TIMER_T300,
989
	PRI_TIMER_T300,
988
	PRI_TIMER_T301,	/*!< Maximum time to respond to an ALERT */
990
	PRI_TIMER_T301,	/*!< Maximum time to respond to an ALERT */
989
	PRI_TIMER_T302,
991
	PRI_TIMER_T302,
990
	PRI_TIMER_T303,	/*!< Maximum time to wait after sending a SETUP without a response */
992
	PRI_TIMER_T303,	/*!< Maximum time to wait after sending a SETUP without a response */
991
	PRI_TIMER_T304,
993
	PRI_TIMER_T304,
992
	PRI_TIMER_T305,	/*!< Wait for DISCONNECT acknowledge */
994
	PRI_TIMER_T305,	/*!< Wait for DISCONNECT acknowledge */
993
	PRI_TIMER_T306,
995
	PRI_TIMER_T306,
994
	PRI_TIMER_T307,
996
	PRI_TIMER_T307,
995
	PRI_TIMER_T308,	/*!< Wait for RELEASE acknowledge */
997
	PRI_TIMER_T308,	/*!< Wait for RELEASE acknowledge */
996
	PRI_TIMER_T309,	/*!< Time active calls can tollerate data link layer being down before clearing. */
998
	PRI_TIMER_T309,	/*!< Time active calls can tollerate data link layer being down before clearing. */
997
	PRI_TIMER_T310,	/*!< Maximum time between receiving a CALL_PROCEEDING and receiving a ALERT/CONNECT/DISCONNECT/PROGRESS */
999
	PRI_TIMER_T310,	/*!< Maximum time between receiving a CALL_PROCEEDING and receiving a ALERT/CONNECT/DISCONNECT/PROGRESS */
998
	PRI_TIMER_T313,	/*!< Wait for CONNECT acknowledge, CPE side only */
1000
	PRI_TIMER_T313,	/*!< Wait for CONNECT acknowledge, CPE side only */
999
	PRI_TIMER_T314,
1001
	PRI_TIMER_T314,
1000
	PRI_TIMER_T316,	/*!< Maximum time between transmitting a RESTART and receiving a RESTART ACK */
1002
	PRI_TIMER_T316,	/*!< Maximum time between transmitting a RESTART and receiving a RESTART ACK */
1001
	PRI_TIMER_T317,
1003
	PRI_TIMER_T317,
1002
	PRI_TIMER_T318,
1004
	PRI_TIMER_T318,
1003
	PRI_TIMER_T319,
1005
	PRI_TIMER_T319,
1004
	PRI_TIMER_T320,
1006
	PRI_TIMER_T320,
1005
	PRI_TIMER_T321,
1007
	PRI_TIMER_T321,
1006
	PRI_TIMER_T322,
1008
	PRI_TIMER_T322,
1007

    
   
1009

   
1008
	PRI_TIMER_TM20,	/*!< Maximum time awaiting XID response */
1010
	PRI_TIMER_TM20,	/*!< Maximum time awaiting XID response */
1009
	PRI_TIMER_NM20,	/*!< Number of XID retransmits */
1011
	PRI_TIMER_NM20,	/*!< Number of XID retransmits */
1010

    
   
1012

   
1011
	/* Must be last in the enum list */
1013
	/* Must be last in the enum list */
1012
	_PRI_MAX_TIMERS,
1014
	_PRI_MAX_TIMERS,
1013
	PRI_MAX_TIMERS = (_PRI_MAX_TIMERS < 32) ? 32 : _PRI_MAX_TIMERS
1015
	PRI_MAX_TIMERS = (_PRI_MAX_TIMERS < 32) ? 32 : _PRI_MAX_TIMERS
1014
};
1016
};
1015

    
   
1017

   
1016
/* Get PRI version */
1018
/* Get PRI version */
1017
const char *pri_get_version(void);
1019
const char *pri_get_version(void);
1018

    
   
1020

   
1019
#endif
1021
#endif
/team/rmudgett/subaddr/pri.c
Diff Revision 1 Diff Revision 6
 
/team/rmudgett/subaddr/pri_internal.h
Diff Revision 1 Diff Revision 6
 
/team/rmudgett/subaddr/pri_q931.h
Diff Revision 1 Diff Revision 6
 
/team/rmudgett/subaddr/q931.c
Diff Revision 1 Diff Revision 6
 
  1. /team/rmudgett/subaddr/libpri.h: Loading...
  2. /team/rmudgett/subaddr/pri.c: Loading...
  3. /team/rmudgett/subaddr/pri_internal.h: Loading...
  4. /team/rmudgett/subaddr/pri_q931.h: Loading...
  5. /team/rmudgett/subaddr/q931.c: Loading...

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.