32 #define ANALOG_SMDI_MD_WAIT_TIMEOUT 1500
33 #define ANALOG_MAX_CID 300
35 #define RING_PATTERNS 3
38 #define ANALOG_FIRST_DIGIT_TIMEOUT 16000
40 #define ANALOG_INTER_DIGIT_TIMEOUT 8000
42 #define ANALOG_MATCH_DIGIT_TIMEOUT 3000
60 ANALOG_SIG_FGC_CAMAMF,
65 ANALOG_SIG_SF_FEATDMF,
66 ANALOG_SIG_FEATDMF_TA,
71 ANALOG_TONE_RINGTONE = 0,
73 ANALOG_TONE_CONGESTION,
75 ANALOG_TONE_DIALRECALL,
80 ANALOG_EVENT_NONE = 0,
82 ANALOG_EVENT_RINGOFFHOOK,
83 ANALOG_EVENT_WINKFLASH,
86 ANALOG_EVENT_DIALCOMPLETE,
87 ANALOG_EVENT_RINGERON,
88 ANALOG_EVENT_RINGEROFF,
89 ANALOG_EVENT_HOOKCOMPLETE,
90 ANALOG_EVENT_PULSE_START,
91 ANALOG_EVENT_POLARITY,
92 ANALOG_EVENT_RINGBEGIN,
93 ANALOG_EVENT_EC_DISABLED,
95 ANALOG_EVENT_NEONMWI_ACTIVE,
96 ANALOG_EVENT_NEONMWI_INACTIVE,
97 ANALOG_EVENT_TX_CED_DETECTED,
98 ANALOG_EVENT_RX_CED_DETECTED,
99 ANALOG_EVENT_EC_NLP_DISABLED,
100 ANALOG_EVENT_EC_NLP_ENABLED,
102 ANALOG_EVENT_DTMFCID,
103 ANALOG_EVENT_PULSEDIGIT = (1 << 16),
104 ANALOG_EVENT_DTMFDOWN = (1 << 17),
105 ANALOG_EVENT_DTMFUP = (1 << 18),
114 enum analog_dsp_digitmode {
115 ANALOG_DIGITMODE_DTMF = 1,
119 enum analog_dialmode {
120 ANALOG_DIALMODE_BOTH = 0,
121 ANALOG_DIALMODE_PULSE,
122 ANALOG_DIALMODE_DTMF,
123 ANALOG_DIALMODE_NONE,
126 enum analog_cid_start {
127 ANALOG_CID_START_POLARITY = 1,
128 ANALOG_CID_START_POLARITY_IN,
129 ANALOG_CID_START_RING,
130 ANALOG_CID_START_DTMF_NOALERT,
134 ANALOG_DIAL_OP_REPLACE = 2,
145 void (*
const unlock_private)(
void *pvt);
147 void (*
const lock_private)(
void *pvt);
149 void (*
const deadlock_avoidance_private)(
void *pvt);
156 int (*
const get_event)(
void *pvt);
157 int (*
const wait_event)(
void *pvt);
158 int (*
const is_off_hook)(
void *pvt);
159 int (*
const is_dialing)(
void *pvt,
enum analog_sub sub);
161 int (*
const start)(
void *pvt);
162 int (*
const ring)(
void *pvt);
163 int (*
const flash)(
void *pvt);
168 void (*
const set_needringing)(
void *pvt,
int value);
179 int (*
const wink)(
void *pvt,
enum analog_sub sub);
181 int (*
const send_fsk)(
void *pvt,
struct ast_channel *ast,
char *fsk);
182 int (*
const play_tone)(
void *pvt,
enum analog_sub sub,
enum analog_tone tone);
184 int (*
const set_echocanceller)(
void *pvt,
int enable);
185 int (*
const train_echocanceller)(
void *pvt);
186 int (*
const dsp_set_digitmode)(
void *pvt,
enum analog_dsp_digitmode mode);
187 int (*
const dsp_reset_and_flush_digits)(
void *pvt);
188 int (*
const send_callerid)(
void *pvt,
int cwcid,
struct ast_party_caller *caller);
190 int (*
const get_callerid)(
void *pvt,
char *name,
char *num,
enum analog_event *ev,
size_t timeout);
192 int (*
const start_cid_detect)(
void *pvt,
int cid_signalling);
194 int (*
const stop_cid_detect)(
void *pvt);
197 int (*
const callwait)(
void *pvt);
199 int (*
const stop_callwait)(
void *pvt);
202 int (*
const allocate_sub)(
void *pvt,
enum analog_sub sub);
203 int (*
const unallocate_sub)(
void *pvt,
enum analog_sub sub);
210 int (*
const conf_add)(
void *pvt,
enum analog_sub sub);
212 int (*
const conf_del)(
void *pvt,
enum analog_sub sub);
216 int (*
const complete_conference_update)(
void *pvt,
int needconf);
220 void (*
const all_subchannels_hungup)(
void *pvt);
223 int (*
const check_for_conference)(
void *pvt);
224 void (*
const handle_notify_message)(
struct ast_channel *chan,
void *pvt,
int cid_flags,
int neon_mwievent);
227 void (*
const increase_ss_count)(void);
228 void (*
const decrease_ss_count)(void);
230 int (*
const distinctive_ring)(
struct ast_channel *chan,
void *pvt,
int idx,
int *ringdata);
232 int (*
const set_linear_mode)(
void *pvt,
enum analog_sub sub,
int linear_mode);
233 void (*
const set_inthreeway)(
void *pvt,
enum analog_sub sub,
int inthreeway);
234 void (*
const get_and_handle_alarms)(
void *pvt);
235 void * (*
const get_sigpvt_bridged_channel)(
struct ast_channel *chan);
236 int (*
const get_sub_fd)(
void *pvt,
enum analog_sub sub);
238 void (*
const set_alarm)(
void *pvt,
int in_alarm);
239 void (*
const set_dialing)(
void *pvt,
int is_dialing);
240 void (*
const set_outgoing)(
void *pvt,
int is_outgoing);
241 void (*
const set_ringtimeout)(
void *pvt,
int ringt);
242 void (*
const set_waitingfordt)(
void *pvt,
struct ast_channel *ast);
243 int (*
const check_waitingfordt)(
void *pvt);
244 void (*
const set_confirmanswer)(
void *pvt,
int flag);
245 int (*
const check_confirmanswer)(
void *pvt);
246 void (*
const set_callwaiting)(
void *pvt,
int callwaiting_enable);
247 void (*
const cancel_cidspill)(
void *pvt);
248 int (*
const confmute)(
void *pvt,
int mute);
249 void (*
const set_pulsedial)(
void *pvt,
int flag);
250 void (*
const set_new_owner)(
void *pvt,
struct ast_channel *new_owner);
252 const char *(*
const get_orig_dialstring)(
void *pvt);
253 int (*
const have_progressdetect)(
void *pvt);
254 int (*
const get_firstdigit_timeout)(
void *pvt);
255 int (*
const get_interdigit_timeout)(
void *pvt);
256 int (*
const get_matchdigit_timeout)(
void *pvt);
266 unsigned int inthreeway:1;
268 unsigned int allocd:1;
273 enum analog_sigtype sig;
287 unsigned int ani_info_digits:8;
288 unsigned int ani_timeout:16;
289 unsigned int ani_wink_time:16;
291 unsigned int answeronpolarityswitch:1;
293 unsigned int callreturn:1;
294 unsigned int cancallforward:1;
295 unsigned int canpark:1;
297 unsigned int hanguponpolarityswitch:1;
298 unsigned int immediate:1;
302 unsigned int pulse:1;
303 unsigned int threewaycalling:1;
305 unsigned int transfer:1;
308 unsigned int usedistinctiveringdetection:1;
320 enum analog_sigtype outsigmod;
324 int polarityonanswerdelay;
326 enum analog_cid_start cid_start;
335 unsigned int dialednone:1;
338 unsigned int echobreak:1;
339 unsigned int hidecallerid:1;
341 unsigned int inalarm:1;
361 struct timeval polaritydelaytv;
379 struct analog_pvt *analog_new(
enum analog_sigtype signallingtype,
void *private_data);
398 int analog_config_complete(
struct analog_pvt *p);
402 enum analog_cid_start analog_str_to_cidstart(
const char *value);
404 const char *analog_cidstart_to_str(
enum analog_cid_start cid_start);
406 enum analog_sigtype analog_str_to_sigtype(
const char *name);
408 const char *analog_sigtype_to_str(
enum analog_sigtype sigtype);
410 unsigned int analog_str_to_cidtype(
const char *name);
412 const char *analog_cidtype_to_str(
unsigned int cid_type);
418 int analog_dnd(
struct analog_pvt *p,
int flag);
enum analog_dialmode dialmode
int(*const on_hook)(void *pvt)
Set channel on hook.
unsigned int use_callerid
Main Channel structure associated with a channel.
struct ast_smdi_interface * smdi_iface
The SMDI interface to get SMDI messages from.
void(*const answer_polarityswitch)(void *pvt)
Switch FXS line polarity, based on answeronpolarityswitch=yes.
void(*const start_polarityswitch)(void *pvt)
Reset FXS line polarity to IDLE, based on answeronpolarityswitch and hanguponpolarityswitch.
void(*const hangup_polarityswitch)(void *pvt)
Switch FXS line polarity, based on answeronpolarityswitch and hanguponpolarityswitch.
unsigned int transfertobusy
unsigned int use_smdi
TRUE if SMDI (Simplified Message Desk Interface) is enabled.
void(*const set_polarity)(void *pvt, int value)
Set FXS line polarity to 0=IDLE NZ=REVERSED.
struct ast_channel * owner
General Asterisk PBX channel definitions.
#define AST_MAX_EXTENSION
Caller Party information.
Asterisk internal frame definitions.
static int cidrings[NUM_CADENCE_MAX]
cidrings says in which pause to transmit the cid information, where the first pause is 1...
static int ringt_base
Configured ring timeout base.
unsigned int immediatering
void(*const swap_subs)(void *pvt, enum analog_sub a, struct ast_channel *new_a_owner, enum analog_sub b, struct ast_channel *new_b_owner)
int(*const off_hook)(void *pvt)
Set channel off hook.
unsigned int dahditrcallerid
int msgstate
-1 = unknown, 0 = no messages, 1 = new messages available
SMDI support for Asterisk.
unsigned int permhidecallerid
static int has_voicemail(const char *mailbox, const char *folder)
Determines if the given folder has messages.
unsigned int callwaitingcallerid
unsigned int call_qualifier
Data structure associated with a single frame of data.
unsigned int threewaysilenthold
unsigned int callwaitcas
TRUE if Call Waiting (CW) CPE Alert Signal (CAS) is being sent.
struct analog_subchannel subs[3]
unsigned int calledsubscriberheld
unsigned int permcallwaiting
void analog_delete(struct analog_pvt *doomed)
Delete the analog private structure.
struct analog_callback analog_callbacks