Review Board 1.7.16


Prevent DTMF incorrectly triggering during SAS+CAS (CallWaiting) signalling to an FXS port

Review Request #978 - Created Oct. 19, 2010 and submitted

Alec Davis
trunk
18129
Reviewers
asterisk-dev
Asterisk
The dsp incorrectly detects a DTMF 'D' start event, during the call waiting CAS acknowledgement from a CPE device that supports SAS+CAS connected an FXS port.
The result is the SIP call has continuous DTMF RTP packets sent to it.

This can be corrected by the FXS port pressing any DTMF button.
intial setup SIP -> FXS port (TDM800P)
2nd call from console -> same FXS port as above.

Call waiting beep heard, and audio resumes both directions.

Changes between revision 2 and 3

1 2 3
1 2 3

  1. trunk/channels/chan_dahdi.c: Loading...
trunk/channels/chan_dahdi.c
Diff Revision 2 Diff Revision 3
[20] 1848 lines
[+20] [+] static int my_stop_callwait(void *pvt)
1849

    
   
1849

   
1850
	return 0;
1850
	return 0;
1851
}
1851
}
1852

    
   
1852

   
1853
static int save_conference(struct dahdi_pvt *p);
1853
static int save_conference(struct dahdi_pvt *p);
1854
static void enable_dtmf_detect(struct dahdi_pvt *p);

   
1855
static void disable_dtmf_detect(struct dahdi_pvt *p);

   
1856

    
   
1854

   
1857
static int my_callwait(void *pvt)
1855
static int my_callwait(void *pvt)
1858
{
1856
{
1859
	struct dahdi_pvt *p = pvt;
1857
	struct dahdi_pvt *p = pvt;
1860
	p->callwaitingrepeat = CALLWAITING_REPEAT_SAMPLES;
1858
	p->callwaitingrepeat = CALLWAITING_REPEAT_SAMPLES;
1861
	if (p->cidspill) {
1859
	if (p->cidspill) {
1862
		ast_log(LOG_WARNING, "Spill already exists?!?\n");
1860
		ast_log(LOG_WARNING, "Spill already exists?!?\n");
1863
		ast_free(p->cidspill);
1861
		ast_free(p->cidspill);
1864
	}
1862
	}
1865
	if (!(p->cidspill = ast_malloc(2400 /* SAS */ + 680 /* CAS */ + READ_SIZE * 4)))
1863
	if (!(p->cidspill = ast_malloc(2400 /* SAS */ + 680 /* CAS */ + READ_SIZE * 4)))
1866
		return -1;
1864
		return -1;
1867
	disable_dtmf_detect(p);

   
1868
	save_conference(p);
1865
	save_conference(p);
1869
	/* Silence */
1866
	/* Silence */
1870
	memset(p->cidspill, 0x7f, 2400 + 600 + READ_SIZE * 4);
1867
	memset(p->cidspill, 0x7f, 2400 + 600 + READ_SIZE * 4);
1871
	if (!p->callwaitrings && p->callwaitingcallerid) {
1868
	if (!p->callwaitrings && p->callwaitingcallerid) {
1872
		ast_gen_cas(p->cidspill, 1, 2400 + 680, AST_LAW(p));
1869
		ast_gen_cas(p->cidspill, 1, 2400 + 680, AST_LAW(p));
[+20] [20] 196 lines
[+20] [+] static void my_deadlock_avoidance_private(void *pvt)
2069
}
2066
}
2070

    
   
2067

   
2071
/* linear_mode = 0 - turn linear mode off, >0 - turn linear mode on
2068
/* linear_mode = 0 - turn linear mode off, >0 - turn linear mode on
2072
* 	returns the last value of the linear setting 
2069
* 	returns the last value of the linear setting 
2073
*/ 
2070
*/ 
2074
static int my_set_linear_mode(void *pvt, int idx, int linear_mode)
2071
static int my_set_linear_mode(void *pvt, enum analog_sub sub, int linear_mode)
2075
{
2072
{
2076
	struct dahdi_pvt *p = pvt;
2073
	struct dahdi_pvt *p = pvt;
2077
	int oldval;
2074
	int oldval;

    
   
2075
	int idx = analogsub_to_dahdisub(sub);
2078
	
2076
	
2079
    if (0 > linear_mode || !dahdi_setlinear(p->subs[idx].dfd, linear_mode)) {
2077
	dahdi_setlinear(p->subs[idx].dfd, linear_mode);
2080
        return -1;

   
2081
    }

   
2082
	oldval = p->subs[idx].linear;
2078
	oldval = p->subs[idx].linear;
2083
	p->subs[idx].linear = linear_mode;
2079
	p->subs[idx].linear = linear_mode ? 1 : 0;
2084
	return oldval;
2080
	return oldval;
2085
}
2081
}
2086

    
   
2082

   

    
   
2083
static void my_set_inthreeway(void *pvt, enum analog_sub sub, int inthreeway)

    
   
2084
{

    
   
2085
	struct dahdi_pvt *p = pvt;

    
   
2086
	int idx = analogsub_to_dahdisub(sub);

    
   
2087

   

    
   
2088
	p->subs[idx].inthreeway = inthreeway;

    
   
2089
}

    
   
2090

   
2087
static int get_alarms(struct dahdi_pvt *p);
2091
static int get_alarms(struct dahdi_pvt *p);
2088
static void handle_alarms(struct dahdi_pvt *p, int alms);
2092
static void handle_alarms(struct dahdi_pvt *p, int alms);
2089
static void my_get_and_handle_alarms(void *pvt)
2093
static void my_get_and_handle_alarms(void *pvt)
2090
{
2094
{
2091
	int res;
2095
	int res;
[+20] [20] 291 lines
[+20] [+] static int my_check_for_conference(void *pvt)
2383
static void my_swap_subchannels(void *pvt, enum analog_sub a, struct ast_channel *ast_a,  enum analog_sub b, struct ast_channel *ast_b)
2387
static void my_swap_subchannels(void *pvt, enum analog_sub a, struct ast_channel *ast_a,  enum analog_sub b, struct ast_channel *ast_b)
2384
{
2388
{
2385
	struct dahdi_pvt *p = pvt;
2389
	struct dahdi_pvt *p = pvt;
2386
	int da, db;
2390
	int da, db;
2387
	int tchan;
2391
	int tchan;

    
   
2392
	int tinthreeway;
2388

    
   
2393

   
2389
	da = analogsub_to_dahdisub(a);
2394
	da = analogsub_to_dahdisub(a);
2390
	db = analogsub_to_dahdisub(b);
2395
	db = analogsub_to_dahdisub(b);
2391

    
   
2396

   
2392
	tchan = p->subs[da].chan;
2397
	tchan = p->subs[da].chan;
2393

    
   

   
2394
	p->subs[da].chan = p->subs[db].chan;
2398
	p->subs[da].chan = p->subs[db].chan;
2395

    
   

   
2396
	p->subs[db].chan = tchan;
2399
	p->subs[db].chan = tchan;
2397

    
   
2400

   

    
   
2401
	tinthreeway = p->subs[da].inthreeway;

    
   
2402
	p->subs[da].inthreeway = p->subs[db].inthreeway;

    
   
2403
	p->subs[db].inthreeway = tinthreeway;

    
   
2404

   
Moved from 2403

    
   
2405
	p->subs[da].owner = ast_a;
Moved from 2404

    
   
2406
	p->subs[db].owner = ast_b;

    
   
2407

   
2398
	if (ast_a)
2408
	if (ast_a)
2399
		ast_channel_set_fd(ast_a, 0, p->subs[da].dfd);
2409
		ast_channel_set_fd(ast_a, 0, p->subs[da].dfd);
2400
	if (ast_b)
2410
	if (ast_b)
2401
		ast_channel_set_fd(ast_b, 0, p->subs[db].dfd);
2411
		ast_channel_set_fd(ast_b, 0, p->subs[db].dfd);
2402

    
   
2412

   
2403
	p->subs[da].owner = ast_a;
Moved to 2405

   
2404
	p->subs[db].owner = ast_b;
Moved to 2406

   
2405

    
   

   
2406
	wakeup_sub(p, a);
2413
	wakeup_sub(p, a);
2407
	wakeup_sub(p, b);
2414
	wakeup_sub(p, b);
2408

    
   
2415

   
2409
	return;
2416
	return;
2410
}
2417
}
[+20] [20] 1093 lines
[+20] [+] static struct analog_callback dahdi_analog_callbacks =
3504
	.handle_notify_message = my_handle_notify_message,
3511
	.handle_notify_message = my_handle_notify_message,
3505
	.increase_ss_count = my_increase_ss_count,
3512
	.increase_ss_count = my_increase_ss_count,
3506
	.decrease_ss_count = my_decrease_ss_count,
3513
	.decrease_ss_count = my_decrease_ss_count,
3507
	.distinctive_ring = my_distinctive_ring,
3514
	.distinctive_ring = my_distinctive_ring,
3508
	.set_linear_mode = my_set_linear_mode,
3515
	.set_linear_mode = my_set_linear_mode,

    
   
3516
	.set_inthreeway = my_set_inthreeway,
3509
	.get_and_handle_alarms = my_get_and_handle_alarms,
3517
	.get_and_handle_alarms = my_get_and_handle_alarms,
3510
	.get_sigpvt_bridged_channel = my_get_sigpvt_bridged_channel,
3518
	.get_sigpvt_bridged_channel = my_get_sigpvt_bridged_channel,
3511
	.get_sub_fd = my_get_sub_fd,
3519
	.get_sub_fd = my_get_sub_fd,
3512
	.set_cadence = my_set_cadence,
3520
	.set_cadence = my_set_cadence,
3513
	.set_alarm = my_set_alarm,
3521
	.set_alarm = my_set_alarm,
[+20] [20] 15 lines
[+20] static struct analog_callback dahdi_analog_callbacks =
3529
};
3537
};
3530

    
   
3538

   
3531
/*! Round robin search locations. */
3539
/*! Round robin search locations. */
3532
static struct dahdi_pvt *round_robin[32];
3540
static struct dahdi_pvt *round_robin[32];
3533

    
   
3541

   
3534
static int dahdi_get_index(struct ast_channel *ast, struct dahdi_pvt *p, int nullok)
3542
#define dahdi_get_index(ast, p, nullok)	_dahdi_get_index(ast, p, nullok, __PRETTY_FUNCTION__, __LINE__)

    
   
3543
static int _dahdi_get_index(struct ast_channel *ast, struct dahdi_pvt *p, int nullok, const char *fname, unsigned long line)
3535
{
3544
{
3536
	int res;
3545
	int res;
3537
	if (p->subs[SUB_REAL].owner == ast)
3546
	if (p->subs[SUB_REAL].owner == ast)
3538
		res = 0;
3547
		res = 0;
3539
	else if (p->subs[SUB_CALLWAIT].owner == ast)
3548
	else if (p->subs[SUB_CALLWAIT].owner == ast)
3540
		res = 1;
3549
		res = 1;
3541
	else if (p->subs[SUB_THREEWAY].owner == ast)
3550
	else if (p->subs[SUB_THREEWAY].owner == ast)
3542
		res = 2;
3551
		res = 2;
3543
	else {
3552
	else {
3544
		res = -1;
3553
		res = -1;
3545
		if (!nullok)
3554
		if (!nullok)
3546
			ast_log(LOG_WARNING, "Unable to get index, and nullok is not asserted\n");
3555
			ast_log(LOG_WARNING,

    
   
3556
				"Unable to get index for '%s' on channel %d (%s(), line %lu)\n",

    
   
3557
				ast ? ast->name : "", p->channel, fname, line);
3547
	}
3558
	}
3548
	return res;
3559
	return res;
3549
}
3560
}
3550

    
   
3561

   
3551
/*!
3562
/*!
[+20] [20] 1567 lines
[+20] [+] static int dahdi_callwait(struct ast_channel *ast)
5119
	p->callwaitingrepeat = CALLWAITING_REPEAT_SAMPLES;
5130
	p->callwaitingrepeat = CALLWAITING_REPEAT_SAMPLES;
5120
	if (p->cidspill) {
5131
	if (p->cidspill) {
5121
		ast_log(LOG_WARNING, "Spill already exists?!?\n");
5132
		ast_log(LOG_WARNING, "Spill already exists?!?\n");
5122
		ast_free(p->cidspill);
5133
		ast_free(p->cidspill);
5123
	}
5134
	}

    
   
5135

   

    
   
5136
	/* SAS: Subscriber Alert Signal, 440Hz for 300ms */

    
   
5137
	/* CAS: CPE Alert Signal, 2130Hz * 2750Hz sine waves */

    
   
5138

   
5124
	if (!(p->cidspill = ast_malloc(2400 /* SAS */ + 680 /* CAS */ + READ_SIZE * 4)))
5139
	if (!(p->cidspill = ast_malloc(2400 /* SAS */ + 680 /* CAS */ + READ_SIZE * 4)))
5125
		return -1;
5140
		return -1;
5126
	disable_dtmf_detect(p);

   
5127
	save_conference(p);
5141
	save_conference(p);
5128
	/* Silence */
5142
	/* Silence */
5129
	memset(p->cidspill, 0x7f, 2400 + 600 + READ_SIZE * 4);
5143
	memset(p->cidspill, 0x7f, 2400 + 600 + READ_SIZE * 4);
5130
	if (!p->callwaitrings && p->callwaitingcallerid) {
5144
	if (!p->callwaitrings && p->callwaitingcallerid) {
5131
		ast_gen_cas(p->cidspill, 1, 2400 + 680, AST_LAW(p));
5145
		ast_gen_cas(p->cidspill, 1, 2400 + 680, AST_LAW(p));
[+20] [20] 1963 lines
[+20] [+] static enum ast_bridge_result dahdi_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc, int timeoutms)
7095
		if ((oi1 == SUB_THREEWAY) &&
7109
		if ((oi1 == SUB_THREEWAY) &&
7096
			p1->subs[SUB_THREEWAY].inthreeway &&
7110
			p1->subs[SUB_THREEWAY].inthreeway &&
7097
			p1->subs[SUB_REAL].owner &&
7111
			p1->subs[SUB_REAL].owner &&
7098
			p1->subs[SUB_REAL].inthreeway &&
7112
			p1->subs[SUB_REAL].inthreeway &&
7099
			(p1->subs[SUB_REAL].owner->_state == AST_STATE_RINGING)) {
7113
			(p1->subs[SUB_REAL].owner->_state == AST_STATE_RINGING)) {
7100
			ast_debug(1, "Playing ringback on %s since %s is in a ringing three-way\n", c0->name, c1->name);
7114
			ast_debug(1,

    
   
7115
				"Playing ringback on %d/%d(%s) since %d/%d(%s) is in a ringing three-way\n",

    
   
7116
				p0->channel, oi0, c0->name, p1->channel, oi1, c1->name);
7101
			tone_zone_play_tone(p0->subs[oi0].dfd, DAHDI_TONE_RINGTONE);
7117
			tone_zone_play_tone(p0->subs[oi0].dfd, DAHDI_TONE_RINGTONE);
7102
			os1 = p1->subs[SUB_REAL].owner->_state;
7118
			os1 = p1->subs[SUB_REAL].owner->_state;
7103
		} else {
7119
		} else {
7104
			ast_debug(1, "Stopping tones on %d/%d talking to %d/%d\n", p0->channel, oi0, p1->channel, oi1);
7120
			ast_debug(1, "Stopping tones on %d/%d(%s) talking to %d/%d(%s)\n",

    
   
7121
				p0->channel, oi0, c0->name, p1->channel, oi1, c1->name);
7105
			tone_zone_play_tone(p0->subs[oi0].dfd, -1);
7122
			tone_zone_play_tone(p0->subs[oi0].dfd, -1);
7106
		}
7123
		}
7107
		if ((oi0 == SUB_THREEWAY) &&
7124
		if ((oi0 == SUB_THREEWAY) &&
7108
			p0->subs[SUB_THREEWAY].inthreeway &&
7125
			p0->subs[SUB_THREEWAY].inthreeway &&
7109
			p0->subs[SUB_REAL].owner &&
7126
			p0->subs[SUB_REAL].owner &&
7110
			p0->subs[SUB_REAL].inthreeway &&
7127
			p0->subs[SUB_REAL].inthreeway &&
7111
			(p0->subs[SUB_REAL].owner->_state == AST_STATE_RINGING)) {
7128
			(p0->subs[SUB_REAL].owner->_state == AST_STATE_RINGING)) {
7112
			ast_debug(1, "Playing ringback on %s since %s is in a ringing three-way\n", c1->name, c0->name);
7129
			ast_debug(1,

    
   
7130
				"Playing ringback on %d/%d(%s) since %d/%d(%s) is in a ringing three-way\n",

    
   
7131
				p1->channel, oi1, c1->name, p0->channel, oi0, c0->name);
7113
			tone_zone_play_tone(p1->subs[oi1].dfd, DAHDI_TONE_RINGTONE);
7132
			tone_zone_play_tone(p1->subs[oi1].dfd, DAHDI_TONE_RINGTONE);
7114
			os0 = p0->subs[SUB_REAL].owner->_state;
7133
			os0 = p0->subs[SUB_REAL].owner->_state;
7115
		} else {
7134
		} else {
7116
			ast_debug(1, "Stopping tones on %d/%d talking to %d/%d\n", p1->channel, oi1, p0->channel, oi0);
7135
			ast_debug(1, "Stopping tones on %d/%d(%s) talking to %d/%d(%s)\n",
7117
			tone_zone_play_tone(p1->subs[oi0].dfd, -1);
7136
				p1->channel, oi1, c1->name, p0->channel, oi0, c0->name);

    
   
7137
			tone_zone_play_tone(p1->subs[oi1].dfd, -1);
7118
		}
7138
		}
7119
		if ((oi0 == SUB_REAL) && (oi1 == SUB_REAL)) {
7139
		if ((oi0 == SUB_REAL) && (oi1 == SUB_REAL)) {
7120
			if (!p0->echocanbridged || !p1->echocanbridged) {
7140
			if (!p0->echocanbridged || !p1->echocanbridged) {
7121
				/* Disable echo cancellation if appropriate */
7141
				/* Disable echo cancellation if appropriate */
7122
				dahdi_disable_ec(p0);
7142
				dahdi_disable_ec(p0);
[+20] [20] 1072 lines
[+20] [+] static struct ast_frame *dahdi_handle_event(struct ast_channel *ast)
8195
						ast_log(LOG_WARNING, "Unable to start simple switch on channel %d\n", p->channel);
8215
						ast_log(LOG_WARNING, "Unable to start simple switch on channel %d\n", p->channel);
8196
						res = tone_zone_play_tone(p->subs[SUB_REAL].dfd, DAHDI_TONE_CONGESTION);
8216
						res = tone_zone_play_tone(p->subs[SUB_REAL].dfd, DAHDI_TONE_CONGESTION);
8197
						dahdi_enable_ec(p);
8217
						dahdi_enable_ec(p);
8198
						ast_hangup(chan);
8218
						ast_hangup(chan);
8199
					} else {
8219
					} else {
8200
 						struct ast_channel *other = ast_bridged_channel(p->subs[SUB_THREEWAY].owner);

   
8201
 						int way3bridge = 0, cdr3way = 0;

   
8202

    
   

   
8203
							if (!other) {

   
8204
 							other = ast_bridged_channel(p->subs[SUB_REAL].owner);

   
8205
 						} else

   
8206
 							way3bridge = 1;

   
8207

    
   

   
8208
							if (p->subs[SUB_THREEWAY].owner->cdr)

   
8209
 							cdr3way = 1;

   
8210

    
   

   
8211
						ast_verb(3, "Started three way call on channel %d\n", p->channel);
8220
						ast_verb(3, "Started three way call on channel %d\n", p->channel);
8212

    
   
8221

   
8213
						/* Start music on hold if appropriate */
8222
						/* Start music on hold if appropriate */
8214
						if (ast_bridged_channel(p->subs[SUB_THREEWAY].owner)) {
8223
						if (ast_bridged_channel(p->subs[SUB_THREEWAY].owner)) {
8215
							ast_queue_control_data(p->subs[SUB_THREEWAY].owner, AST_CONTROL_HOLD,
8224
							ast_queue_control_data(p->subs[SUB_THREEWAY].owner, AST_CONTROL_HOLD,
[+20] [20] 22 lines
[+20] static struct ast_frame *dahdi_handle_event(struct ast_channel *ast)
8238
				} else {
8247
				} else {
8239
					/* Lets see what we're up to */
8248
					/* Lets see what we're up to */
8240
					if (((ast->pbx) || (ast->_state == AST_STATE_UP)) &&
8249
					if (((ast->pbx) || (ast->_state == AST_STATE_UP)) &&
8241
						(p->transfertobusy || (ast->_state != AST_STATE_BUSY))) {
8250
						(p->transfertobusy || (ast->_state != AST_STATE_BUSY))) {
8242
						int otherindex = SUB_THREEWAY;
8251
						int otherindex = SUB_THREEWAY;
8243
						struct ast_channel *other = ast_bridged_channel(p->subs[SUB_THREEWAY].owner);

   
8244
						int way3bridge = 0, cdr3way = 0;

   
8245

    
   
8252

   
8246
						if (!other) {
8253
						ast_verb(3, "Building conference call with %s and %s\n",
8247
							other = ast_bridged_channel(p->subs[SUB_REAL].owner);
8254
							p->subs[SUB_THREEWAY].owner->name,
8248
						} else
8255
							p->subs[SUB_REAL].owner->name);
8249
							way3bridge = 1;

   
8250

    
   

   
8251
						if (p->subs[SUB_THREEWAY].owner->cdr)

   
8252
							cdr3way = 1;

   
8253

    
   

   
8254
						ast_verb(3, "Building conference on call on %s and %s\n", p->subs[SUB_THREEWAY].owner->name, p->subs[SUB_REAL].owner->name);

   
8255
						/* Put them in the threeway, and flip */
8256
						/* Put them in the threeway, and flip */
8256
						p->subs[SUB_THREEWAY].inthreeway = 1;
8257
						p->subs[SUB_THREEWAY].inthreeway = 1;
8257
						p->subs[SUB_REAL].inthreeway = 1;
8258
						p->subs[SUB_REAL].inthreeway = 1;
8258
						if (ast->_state == AST_STATE_UP) {
8259
						if (ast->_state == AST_STATE_UP) {
8259
							swap_subs(p, SUB_THREEWAY, SUB_REAL);
8260
							swap_subs(p, SUB_THREEWAY, SUB_REAL);
8260
							otherindex = SUB_REAL;
8261
							otherindex = SUB_REAL;
8261
						}
8262
						}
8262
						if (p->subs[otherindex].owner && ast_bridged_channel(p->subs[otherindex].owner))
8263
						if (p->subs[otherindex].owner && ast_bridged_channel(p->subs[otherindex].owner))
8263
							ast_queue_control(p->subs[otherindex].owner, AST_CONTROL_UNHOLD);
8264
							ast_queue_control(p->subs[otherindex].owner, AST_CONTROL_UNHOLD);
8264
						p->subs[otherindex].needunhold = 1;
8265
						p->subs[otherindex].needunhold = 1;
8265
						p->owner = p->subs[SUB_REAL].owner;
8266
						p->owner = p->subs[SUB_REAL].owner;
8266
						if (ast->_state == AST_STATE_RINGING) {

   
8267
							ast_debug(1, "Enabling ringtone on real and threeway\n");

   
8268
							res = tone_zone_play_tone(p->subs[SUB_REAL].dfd, DAHDI_TONE_RINGTONE);

   
8269
							res = tone_zone_play_tone(p->subs[SUB_THREEWAY].dfd, DAHDI_TONE_RINGTONE);

   
8270
						}

   
8271
					} else {
8267
					} else {
8272
						ast_verb(3, "Dumping incomplete call on on %s\n", p->subs[SUB_THREEWAY].owner->name);
8268
						ast_verb(3, "Dumping incomplete call on on %s\n", p->subs[SUB_THREEWAY].owner->name);
8273
						swap_subs(p, SUB_THREEWAY, SUB_REAL);
8269
						swap_subs(p, SUB_THREEWAY, SUB_REAL);
8274
						p->subs[SUB_THREEWAY].owner->_softhangup |= AST_SOFTHANGUP_DEV;
8270
						p->subs[SUB_THREEWAY].owner->_softhangup |= AST_SOFTHANGUP_DEV;
8275
						p->owner = p->subs[SUB_REAL].owner;
8271
						p->owner = p->subs[SUB_REAL].owner;
[+20] [20] 516 lines
[+20] [+] static struct ast_frame *dahdi_read(struct ast_channel *ast)
8792
		p->callwaitrings++;
8788
		p->callwaitrings++;
8793
		dahdi_callwait(ast);
8789
		dahdi_callwait(ast);
8794
	}
8790
	}
8795
	/* Expire CID/CW */
8791
	/* Expire CID/CW */
8796
	if (p->cidcwexpire == 1) {
8792
	if (p->cidcwexpire == 1) {

    
   
8793
		p->callwaitcas = 0;
8797
		ast_verb(3, "CPE does not support Call Waiting Caller*ID.\n");
8794
		ast_verb(3, "CPE does not support Call Waiting Caller*ID.\n");
8798
		restore_conference(p);
8795
		restore_conference(p);
8799
		enable_dtmf_detect(p);

   
8800
	}
8796
	}
8801
	if (p->subs[idx].linear) {
8797
	if (p->subs[idx].linear) {
8802
		p->subs[idx].f.datalen = READ_SIZE * 2;
8798
		p->subs[idx].f.datalen = READ_SIZE * 2;
8803
	} else
8799
	} else
8804
		p->subs[idx].f.datalen = READ_SIZE;
8800
		p->subs[idx].f.datalen = READ_SIZE;
[+20] [20] 30 lines
[+20] static struct ast_frame *dahdi_read(struct ast_channel *ast)
8835
		/* Perform busy detection etc on the dahdi line */
8831
		/* Perform busy detection etc on the dahdi line */
8836
		int mute;
8832
		int mute;
8837

    
   
8833

   
8838
		f = ast_dsp_process(ast, p->dsp, &p->subs[idx].f);
8834
		f = ast_dsp_process(ast, p->dsp, &p->subs[idx].f);
8839

    
   
8835

   

    
   
8836
		if (p->callwaitcas) {

    
   
8837
			/* If were in the middle of a SAS+CAS signalling Mute the conference */

    
   
8838
			mute = 1;

    
   
8839
		} else {
8840
		/* Check if DSP code thinks we should be muting this frame and mute the conference if so */
8840
			/* Check if DSP code thinks we should be muting this frame and mute the conference if so */
8841
		mute = ast_dsp_was_muted(p->dsp);
8841
			mute = ast_dsp_was_muted(p->dsp);

    
   
8842
		}
8842
		if (p->muting != mute) {
8843
		if (p->muting != mute) {
8843
			p->muting = mute;
8844
			p->muting = mute;
8844
			dahdi_confmute(p, mute);
8845
			dahdi_confmute(p, mute);
8845
		}
8846
		}
8846

    
   
8847

   
[+20] [20] 9159 lines
  1. trunk/channels/chan_dahdi.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.