Ejemplo n.º 1
0
int adsi_channel_restore(struct ast_channel *chan)
{
	char dsp[256];
	int bytes;
	int x;
	unsigned char keyd[6];

	memset(dsp, 0, sizeof(dsp));

	/* Start with initial display setup */
	bytes = 0;
	bytes += adsi_set_line(dsp + bytes, ADSI_INFO_PAGE, 1);

	/* Prepare key setup messages */

	if (speeds) {
		memset(keyd, 0, sizeof(keyd));
		for (x=0;x<speeds;x++) {
			keyd[x] = ADSI_SPEED_DIAL + x;
		}
		bytes += adsi_set_keys(dsp + bytes, keyd);
	}
	adsi_transmit_message(chan, dsp, bytes, ADSI_MSG_DISPLAY);
	return 0;

}
Ejemplo n.º 2
0
int adsi_print(struct ast_channel *chan, char **lines, int *aligns, int voice)
{
	char buf[4096];
	int bytes=0;
	int res;
	int x;
	for(x=0;lines[x];x++) 
		bytes += adsi_display(buf + bytes, ADSI_INFO_PAGE, x+1, aligns[x],0, lines[x], "");
	bytes += adsi_set_line(buf + bytes, ADSI_INFO_PAGE, 1);
	if (voice) {
		bytes += adsi_voice_mode(buf + bytes, 0);
	}
	res = adsi_transmit_message(chan, buf, bytes, ADSI_MSG_DISPLAY);
	if (voice) {
		/* Ignore the resulting DTMF B announcing it's in voice mode */
		ast_waitfordigit(chan, 1000);
	}
	return res;
}
Ejemplo n.º 3
0
static int adsi_channel_restore(struct ast_channel *chan)
{
	unsigned char dsp[256] = "", keyd[6] = "";
	int bytes, x;

	/* Start with initial display setup */
	bytes = 0;
	bytes += adsi_set_line(dsp + bytes, ADSI_INFO_PAGE, 1);

	/* Prepare key setup messages */

	if (speeds) {
		for (x = 0; x < speeds; x++) {
			keyd[x] = ADSI_SPEED_DIAL + x;
		}
		bytes += adsi_set_keys(dsp + bytes, keyd);
	}
	adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0);
	return 0;

}