Beispiel #1
0
static switch_status_t skinny_api_set_dnd(switch_stream_handle_t *stream, const char *profile_name, const char* state, const char *device_name)
{
	skinny_profile_t *profile = skinny_find_profile(profile_name);
	listener_t *listener = NULL;
	if(profile)
	{
		skinny_profile_find_listener_by_device_name(profile, device_name, &listener);
		if(listener)
			{
				if(!strcasecmp(state, "ON")) {
					listener->dnd = 1;
					send_display_prompt_status(listener, 0, "DND ON", 0, 0);
				} else if (!strcasecmp(state, "OFF")) {
					listener->dnd = 0;
					send_display_prompt_status(listener, 2, "DND OFF", 0, 0);
				}

			}
	}
	return SWITCH_STATUS_SUCCESS;
}
Beispiel #2
0
static switch_status_t skinny_api_cmd_profile_device_send_display_prompt_status_message(const char *profile_name, const char *device_name, const char *display, switch_stream_handle_t *stream)
{
	skinny_profile_t *profile;

	if ((profile = skinny_find_profile(profile_name))) {
		listener_t *listener = NULL;
		skinny_profile_find_listener_by_device_name(profile, device_name, &listener);
		if(listener) {

			send_display_prompt_status(listener, 0, display, 0, 0); 

			stream->write_function(stream, "+OK\n");
		} else {
			stream->write_function(stream, "Listener not found!\n");
		}
	} else {
		stream->write_function(stream, "Profile not found!\n");
	}

	return SWITCH_STATUS_SUCCESS;
}