apps/app_selective.c
static int say_number_on_list(struct ast_channel *chan, struct ast_str *strbuf, char *buf, struct selective_proc *f)
{
	int res, privates, entries = get_number_entries(chan, strbuf, f, ENTRY_ANY);

	if (!entries) {
		return selective_read(chan, buf, BUFFER_SIZE, MAIN_MENU_TERM, 0, f->prompt_no_entries);
	}

	privates = get_number_entries(chan, strbuf, f, ENTRY_PRIVATE);

	if (entries == 1) {
		return selective_read(chan, buf, BUFFER_SIZE, MAIN_MENU_TERM, 0, f->prompt_there_is,
			privates > 0 ? f->prompt_one_private_entry : f->prompt_one_entry, f->prompt_on_your_list);
	}

	res = selective_read(chan, buf, BUFFER_SIZE, MAIN_MENU_TERM, 0, f->prompt_there_are);
	RETURN_IF_INPUT(buf);
	res = say_number(chan, strbuf, buf, f, entries);
	if (entries == privates) { /* all the entries are private entries */
		return selective_read(chan, buf, BUFFER_SIZE, MAIN_MENU_TERM, 0, f->prompt_private_entries, f->prompt_on_your_list);
	}
	res = selective_read(chan, buf, BUFFER_SIZE, MAIN_MENU_TERM, 0, f->prompt_entries_on_your_list);
	if (privates == 0 || !ast_strlen_zero(buf)) {
		return res;
	}
	res = selective_read(chan, buf, BUFFER_SIZE, MAIN_MENU_TERM, 0, f->prompt_including);
	RETURN_IF_INPUT(buf);
	if (privates == 1) {
		res = selective_read(chan, buf, BUFFER_SIZE, MAIN_MENU_TERM, 0, f->prompt_one_private_entry_down);
	} else { /* more than 1 private entry */
		res = say_number(chan, strbuf, buf, f, privates);
		RETURN_IF_INPUT(buf);
		res = selective_read(chan, buf, BUFFER_SIZE, MAIN_MENU_TERM, 0, f->prompt_private_entries_down);
	}
	return res;
}
/*! \brief Announce how many entries are on a list */
\brief Announce how many entries are on a list
\ brief Announce how many entries are on a list
static int say_number_on_list(struct ast_channel *chan, struct ast_str *strbuf, char *buf, struct selective_proc *f)
{
	int res, privates, entries = get_number_entries(chan, strbuf, f, ENTRY_ANY);
	if (!entries) {
		return selective_read(chan, buf, BUFFER_SIZE, MAIN_MENU_TERM, 0, f->prompt_no_entries);
	}
	privates = get_number_entries(chan, strbuf, f, ENTRY_PRIVATE);
	if (entries == 1) {
		return selective_read(chan, buf, BUFFER_SIZE, MAIN_MENU_TERM, 0, f->prompt_there_is,
			privates > 0 ? f->prompt_one_private_entry : f->prompt_one_entry, f->prompt_on_your_list);
	}
	res = selective_read(chan, buf, BUFFER_SIZE, MAIN_MENU_TERM, 0, f->prompt_there_are);
	RETURN_IF_INPUT(buf);
	res = say_number(chan, strbuf, buf, f, entries);
	if (entries == privates) { 
		return selective_read(chan, buf, BUFFER_SIZE, MAIN_MENU_TERM, 0, f->prompt_private_entries, f->prompt_on_your_list);
	}
	res = selective_read(chan, buf, BUFFER_SIZE, MAIN_MENU_TERM, 0, f->prompt_entries_on_your_list);
	if (privates == 0 || !ast_strlen_zero(buf)) {
		return res;
	}
	res = selective_read(chan, buf, BUFFER_SIZE, MAIN_MENU_TERM, 0, f->prompt_including);
	RETURN_IF_INPUT(buf);
	if (privates == 1) {
		res = selective_read(chan, buf, BUFFER_SIZE, MAIN_MENU_TERM, 0, f->prompt_one_private_entry_down);
	} else { 
		res = say_number(chan, strbuf, buf, f, privates);
		RETURN_IF_INPUT(buf);
		res = selective_read(chan, buf, BUFFER_SIZE, MAIN_MENU_TERM, 0, f->prompt_private_entries_down);
	}
	return res;
}
static int say_number_on_list ( struct ast_channel * chan , struct ast_str * strbuf , char * buf , struct selective_proc * f ) { int res , privates , entries = get_number_entries ( chan , strbuf , f , ENTRY_ANY ) ; if ( ! entries ) { return selective_read ( chan , buf , BUFFER_SIZE , MAIN_MENU_TERM , 0 , f -> prompt_no_entries ) ; } privates = get_number_entries ( chan , strbuf , f , ENTRY_PRIVATE ) ; if ( entries == 1 ) { return selective_read ( chan , buf , BUFFER_SIZE , MAIN_MENU_TERM , 0 , f -> prompt_there_is , privates > 0 ? f -> prompt_one_private_entry : f -> prompt_one_entry , f -> prompt_on_your_list ) ; } res = selective_read ( chan , buf , BUFFER_SIZE , MAIN_MENU_TERM , 0 , f -> prompt_there_are ) ; RETURN_IF_INPUT ( buf ) ; res = say_number ( chan , strbuf , buf , f , entries ) ; if ( entries == privates ) { return selective_read ( chan , buf , BUFFER_SIZE , MAIN_MENU_TERM , 0 , f -> prompt_private_entries , f -> prompt_on_your_list ) ; } res = selective_read ( chan , buf , BUFFER_SIZE , MAIN_MENU_TERM , 0 , f -> prompt_entries_on_your_list ) ; if ( privates == 0 || ! ast_strlen_zero ( buf ) ) { return res ; } res = selective_read ( chan , buf , BUFFER_SIZE , MAIN_MENU_TERM , 0 , f -> prompt_including ) ; RETURN_IF_INPUT ( buf ) ; if ( privates == 1 ) { res = selective_read ( chan , buf , BUFFER_SIZE , MAIN_MENU_TERM , 0 , f -> prompt_one_private_entry_down ) ; } else { res = say_number ( chan , strbuf , buf , f , privates ) ; RETURN_IF_INPUT ( buf ) ; res = selective_read ( chan , buf , BUFFER_SIZE , MAIN_MENU_TERM , 0 , f -> prompt_private_entries_down ) ; } return res ; }
\brief Announce how many entries are on a list
\ brief Announce how many entries are on a list
/* all the entries are private entries */ /* more than 1 private entry */