mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-06-07 21:44:51 +00:00
Merge branch 'master' of ssh://git.freeswitch.org:222/freeswitch
This commit is contained in:
commit
e7da47445a
@ -274,7 +274,15 @@
|
||||
|
||||
<extension name="Local_Extension_Skinny">
|
||||
<condition field="destination_number" expression="^(11[01][0-9])$">
|
||||
<action application="set" data="dialed_extension=$1"/>
|
||||
<action application="export" data="dialed_extension=$1"/>
|
||||
<action application="set" data="call_timeout=30"/>
|
||||
<action application="set" data="hangup_after_bridge=true"/>
|
||||
<action application="set" data="continue_on_fail=true"/>
|
||||
<action application="bridge" data="skinny/internal/${destination_number}"/>
|
||||
<action application="answer"/>
|
||||
<action application="sleep" data="1000"/>
|
||||
<action application="bridge" data="loopback/app=voicemail:default ${domain_name} ${dialed_extension}"/>
|
||||
</condition>
|
||||
</extension>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
This context is used for skinny to match dialed number
|
||||
|
||||
The special applications:
|
||||
- skinny-route tells skinny to route the call
|
||||
- skinny-process tells skinny to process the call (route, set call forwarding, ...)
|
||||
- skinny-drop tells skinny to drop the call
|
||||
- skinny-wait tells skinny to wait 'data' seconds for more numbers before drop
|
||||
-->
|
||||
|
@ -1,7 +1,7 @@
|
||||
<include>
|
||||
<extension name="Demo">
|
||||
<condition field="destination_number" expression="^(9[0-9]{3})$">
|
||||
<action application="skinny-route"/>
|
||||
<action application="skinny-process"/>
|
||||
</condition>
|
||||
</extension>
|
||||
</include>
|
||||
|
@ -1,12 +1,12 @@
|
||||
<include>
|
||||
<extension name="Local_Extension">
|
||||
<condition field="destination_number" expression="^(10[01][0-9])$">
|
||||
<action application="skinny-route"/>
|
||||
<action application="skinny-process"/>
|
||||
</condition>
|
||||
</extension>
|
||||
<extension name="Local_Extension_Skinny">
|
||||
<condition field="destination_number" expression="^(11[01][0-9])$">
|
||||
<action application="skinny-route"/>
|
||||
<action application="skinny-process"/>
|
||||
</condition>
|
||||
</extension>
|
||||
</include>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<include>
|
||||
<extension name="External">
|
||||
<condition field="destination_number" expression="^(0[0-9]{10,})$">
|
||||
<action application="skinny-route"/>
|
||||
<action application="skinny-process"/>
|
||||
</condition>
|
||||
</extension>
|
||||
</include>
|
||||
|
@ -272,6 +272,7 @@ static int sangoma_create_rtp(void *usr_priv, sngtc_codec_request_leg_t *codec_r
|
||||
}
|
||||
|
||||
rtp_port = (switch_port_t)(long)*rtp_fd;
|
||||
*rtp_fd = NULL;
|
||||
|
||||
codec_req_leg->host_udp_port = rtp_port;
|
||||
|
||||
@ -307,6 +308,9 @@ static int sangoma_destroy_rtp(void *usr_priv, void *fd)
|
||||
{
|
||||
switch_memory_pool_t *sesspool;
|
||||
switch_rtp_t *rtp = fd;
|
||||
if (!rtp) {
|
||||
return 0;
|
||||
}
|
||||
sesspool = switch_rtp_get_private(rtp);
|
||||
switch_rtp_destroy(&rtp);
|
||||
switch_core_destroy_memory_pool(&sesspool);
|
||||
|
@ -50,58 +50,58 @@ skinny_globals_t globals;
|
||||
/* SQL TABLES */
|
||||
/*****************************************************************************/
|
||||
static char devices_sql[] =
|
||||
"CREATE TABLE skinny_devices (\n"
|
||||
" name VARCHAR(16),\n"
|
||||
" user_id INTEGER,\n"
|
||||
" instance INTEGER,\n"
|
||||
" ip VARCHAR(15),\n"
|
||||
" type INTEGER,\n"
|
||||
" max_streams INTEGER,\n"
|
||||
" port INTEGER,\n"
|
||||
" codec_string VARCHAR(255),\n"
|
||||
" headset INTEGER,\n"
|
||||
" handset INTEGER,\n"
|
||||
" speaker INTEGER\n"
|
||||
");\n";
|
||||
"CREATE TABLE skinny_devices (\n"
|
||||
" name VARCHAR(16),\n"
|
||||
" user_id INTEGER,\n"
|
||||
" instance INTEGER,\n"
|
||||
" ip VARCHAR(15),\n"
|
||||
" type INTEGER,\n"
|
||||
" max_streams INTEGER,\n"
|
||||
" port INTEGER,\n"
|
||||
" codec_string VARCHAR(255),\n"
|
||||
" headset INTEGER,\n"
|
||||
" handset INTEGER,\n"
|
||||
" speaker INTEGER\n"
|
||||
");\n";
|
||||
|
||||
static char lines_sql[] =
|
||||
"CREATE TABLE skinny_lines (\n"
|
||||
" device_name VARCHAR(16),\n"
|
||||
" device_instance INTEGER,\n"
|
||||
" position INTEGER,\n"
|
||||
" line_instance INTEGER,\n"
|
||||
" label VARCHAR(40),\n"
|
||||
" value VARCHAR(24),\n"
|
||||
" caller_name VARCHAR(44),\n"
|
||||
" ring_on_idle INTEGER,\n"
|
||||
" ring_on_active INTEGER,\n"
|
||||
" busy_trigger INTEGER,\n"
|
||||
" forward_all VARCHAR(255),\n"
|
||||
" forward_busy VARCHAR(255),\n"
|
||||
" forward_noanswer VARCHAR(255),\n"
|
||||
" noanswer_duration INTEGER\n"
|
||||
");\n";
|
||||
"CREATE TABLE skinny_lines (\n"
|
||||
" device_name VARCHAR(16),\n"
|
||||
" device_instance INTEGER,\n"
|
||||
" position INTEGER,\n"
|
||||
" line_instance INTEGER,\n"
|
||||
" label VARCHAR(40),\n"
|
||||
" value VARCHAR(24),\n"
|
||||
" caller_name VARCHAR(44),\n"
|
||||
" ring_on_idle INTEGER,\n"
|
||||
" ring_on_active INTEGER,\n"
|
||||
" busy_trigger INTEGER,\n"
|
||||
" forward_all VARCHAR(255),\n"
|
||||
" forward_busy VARCHAR(255),\n"
|
||||
" forward_noanswer VARCHAR(255),\n"
|
||||
" noanswer_duration INTEGER\n"
|
||||
");\n";
|
||||
|
||||
static char buttons_sql[] =
|
||||
"CREATE TABLE skinny_buttons (\n"
|
||||
" device_name VARCHAR(16),\n"
|
||||
" device_instance INTEGER,\n"
|
||||
" position INTEGER,\n"
|
||||
" type INTEGER,\n"
|
||||
" label VARCHAR(40),\n"
|
||||
" value VARCHAR(255),\n"
|
||||
" settings VARCHAR(44)\n"
|
||||
");\n";
|
||||
"CREATE TABLE skinny_buttons (\n"
|
||||
" device_name VARCHAR(16),\n"
|
||||
" device_instance INTEGER,\n"
|
||||
" position INTEGER,\n"
|
||||
" type INTEGER,\n"
|
||||
" label VARCHAR(40),\n"
|
||||
" value VARCHAR(255),\n"
|
||||
" settings VARCHAR(44)\n"
|
||||
");\n";
|
||||
|
||||
static char active_lines_sql[] =
|
||||
"CREATE TABLE skinny_active_lines (\n"
|
||||
" device_name VARCHAR(16),\n"
|
||||
" device_instance INTEGER,\n"
|
||||
" line_instance INTEGER,\n"
|
||||
" channel_uuid VARCHAR(256),\n"
|
||||
" call_id INTEGER,\n"
|
||||
" call_state INTEGER\n"
|
||||
");\n";
|
||||
"CREATE TABLE skinny_active_lines (\n"
|
||||
" device_name VARCHAR(16),\n"
|
||||
" device_instance INTEGER,\n"
|
||||
" line_instance INTEGER,\n"
|
||||
" channel_uuid VARCHAR(256),\n"
|
||||
" call_id INTEGER,\n"
|
||||
" call_state INTEGER\n"
|
||||
");\n";
|
||||
|
||||
/*****************************************************************************/
|
||||
/* PROFILES FUNCTIONS */
|
||||
@ -340,7 +340,7 @@ switch_status_t skinny_execute_sql(skinny_profile_t *profile, char *sql, switch_
|
||||
|
||||
status = switch_cache_db_execute_sql(dbh, sql, NULL);
|
||||
|
||||
end:
|
||||
end:
|
||||
|
||||
switch_cache_db_release_db_handle(&dbh);
|
||||
|
||||
@ -374,7 +374,7 @@ switch_bool_t skinny_execute_sql_callback(skinny_profile_t *profile, switch_mute
|
||||
free(errmsg);
|
||||
}
|
||||
|
||||
end:
|
||||
end:
|
||||
|
||||
switch_cache_db_release_db_handle(&dbh);
|
||||
|
||||
@ -571,7 +571,7 @@ switch_status_t skinny_tech_set_codec(private_t *tech_pvt, int force)
|
||||
}
|
||||
*/
|
||||
|
||||
end:
|
||||
end:
|
||||
if (resetting) {
|
||||
switch_core_session_unlock_codec_write(tech_pvt->session);
|
||||
switch_core_session_unlock_codec_read(tech_pvt->session);
|
||||
@ -600,7 +600,7 @@ void tech_init(private_t *tech_pvt, skinny_profile_t *profile, switch_core_sessi
|
||||
State methods they get called when the state changes to the specific state
|
||||
returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next
|
||||
so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it.
|
||||
*/
|
||||
*/
|
||||
switch_status_t channel_on_init(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
@ -673,12 +673,12 @@ switch_status_t channel_on_routing(switch_core_session_t *session)
|
||||
struct channel_on_routing_helper helper = {0};
|
||||
|
||||
if(switch_test_flag(tech_pvt, TFLAG_FORCE_ROUTE)) {
|
||||
action = SKINNY_ACTION_ROUTE;
|
||||
action = SKINNY_ACTION_PROCESS;
|
||||
} else {
|
||||
action = skinny_session_dest_match_pattern(session, &data);
|
||||
}
|
||||
switch(action) {
|
||||
case SKINNY_ACTION_ROUTE:
|
||||
case SKINNY_ACTION_PROCESS:
|
||||
skinny_profile_find_listener_by_device_name_and_instance(tech_pvt->profile,
|
||||
switch_channel_get_variable(channel, "skinny_device_name"),
|
||||
atoi(switch_channel_get_variable(channel, "skinny_device_instance")), &listener);
|
||||
@ -1020,7 +1020,7 @@ switch_status_t channel_receive_message(switch_core_session_t *session, switch_c
|
||||
|
||||
/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
|
||||
that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
|
||||
*/
|
||||
*/
|
||||
switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, switch_event_t *var_event,
|
||||
switch_caller_profile_t *outbound_profile,
|
||||
switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause)
|
||||
@ -1116,7 +1116,7 @@ switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, swi
|
||||
cause = SWITCH_CAUSE_SUCCESS;
|
||||
goto done;
|
||||
|
||||
error:
|
||||
error:
|
||||
if (nsession) {
|
||||
switch_core_session_destroy(&nsession);
|
||||
}
|
||||
@ -1126,7 +1126,7 @@ switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session, swi
|
||||
}
|
||||
|
||||
|
||||
done:
|
||||
done:
|
||||
|
||||
if (profile) {
|
||||
if (cause == SWITCH_CAUSE_SUCCESS) {
|
||||
@ -1559,7 +1559,7 @@ new_socket:
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Socket up listening on %s:%u\n", profile->ip, profile->port);
|
||||
|
||||
break;
|
||||
sock_fail:
|
||||
sock_fail:
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Socket Error! Could not listen on %s:%u\n", profile->ip, profile->port);
|
||||
switch_yield(100000);
|
||||
}
|
||||
@ -1622,7 +1622,7 @@ new_socket:
|
||||
|
||||
}
|
||||
|
||||
end:
|
||||
end:
|
||||
|
||||
close_socket(&profile->sock, profile);
|
||||
|
||||
@ -1635,7 +1635,7 @@ new_socket:
|
||||
}
|
||||
|
||||
|
||||
fail:
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,7 @@ struct skinny_device_type_params {
|
||||
typedef struct skinny_device_type_params skinny_device_type_params_t;
|
||||
|
||||
typedef enum {
|
||||
SKINNY_ACTION_ROUTE,
|
||||
SKINNY_ACTION_PROCESS,
|
||||
SKINNY_ACTION_DROP,
|
||||
SKINNY_ACTION_WAIT
|
||||
} skinny_action_t;
|
||||
@ -174,12 +174,12 @@ typedef enum {
|
||||
|
||||
struct private_object {
|
||||
unsigned int flags;
|
||||
switch_mutex_t *flag_mutex;
|
||||
switch_frame_t read_frame;
|
||||
unsigned char databuf[SWITCH_RECOMMENDED_BUFFER_SIZE];
|
||||
switch_core_session_t *session;
|
||||
switch_caller_profile_t *caller_profile;
|
||||
switch_mutex_t *mutex;
|
||||
switch_mutex_t *flag_mutex;
|
||||
|
||||
/* identification */
|
||||
skinny_profile_t *profile;
|
||||
|
@ -238,8 +238,8 @@ found:
|
||||
|
||||
extension->current_application = extension->current_application->next;
|
||||
|
||||
if (!strcmp(current_application->application_name, "skinny-route")) {
|
||||
action = SKINNY_ACTION_ROUTE;
|
||||
if (!strcmp(current_application->application_name, "skinny-route") || !strcmp(current_application->application_name, "skinny-process")) {
|
||||
action = SKINNY_ACTION_PROCESS;
|
||||
} else if (!strcmp(current_application->application_name, "skinny-drop")) {
|
||||
action = SKINNY_ACTION_DROP;
|
||||
} else if (!strcmp(current_application->application_name, "skinny-wait")) {
|
||||
@ -290,8 +290,7 @@ switch_status_t skinny_session_process_dest(switch_core_session_t *session, list
|
||||
SKINNY_KEY_SET_DIGITS_AFTER_DIALING_FIRST_DIGIT, 0xffff);
|
||||
}
|
||||
} else {
|
||||
tech_pvt->caller_profile->destination_number = switch_core_strdup(tech_pvt->caller_profile->pool,
|
||||
dest);
|
||||
tech_pvt->caller_profile->destination_number = switch_core_strdup(tech_pvt->caller_profile->pool, dest);
|
||||
switch_set_flag_locked(tech_pvt, TFLAG_FORCE_ROUTE);
|
||||
}
|
||||
|
||||
@ -598,10 +597,8 @@ switch_status_t skinny_session_ring_out(switch_core_session_t *session, listener
|
||||
|
||||
send_start_tone(listener, SKINNY_TONE_ALERT, 0, line_instance, tech_pvt->call_id);
|
||||
skinny_line_set_state(listener, line_instance, tech_pvt->call_id, SKINNY_RING_OUT);
|
||||
send_select_soft_keys(listener, line_instance, tech_pvt->call_id,
|
||||
SKINNY_KEY_SET_RING_OUT, 0xffff);
|
||||
send_display_prompt_status(listener, 0, SKINNY_DISP_RING_OUT,
|
||||
line_instance, tech_pvt->call_id);
|
||||
send_select_soft_keys(listener, line_instance, tech_pvt->call_id, SKINNY_KEY_SET_RING_OUT, 0xffff);
|
||||
send_display_prompt_status(listener, 0, SKINNY_DISP_RING_OUT, line_instance, tech_pvt->call_id);
|
||||
skinny_session_send_call_info(session, listener, line_instance);
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
@ -1776,17 +1773,14 @@ switch_status_t skinny_handle_soft_key_event_message(listener_t *listener, skinn
|
||||
switch(request->data.soft_key_event.event) {
|
||||
case SOFTKEY_REDIAL:
|
||||
status = skinny_create_incoming_session(listener, &line_instance, &session);
|
||||
|
||||
skinny_session_process_dest(session, listener, line_instance, "redial", '\0', 0);
|
||||
break;
|
||||
case SOFTKEY_NEWCALL:
|
||||
status = skinny_create_incoming_session(listener, &line_instance, &session);
|
||||
|
||||
skinny_session_process_dest(session, listener, line_instance, NULL, '\0', 0);
|
||||
break;
|
||||
case SOFTKEY_HOLD:
|
||||
session = skinny_profile_find_session(listener->profile, listener, &line_instance, call_id);
|
||||
|
||||
if(session) {
|
||||
status = skinny_session_hold_line(session, listener, line_instance);
|
||||
}
|
||||
@ -1800,30 +1794,25 @@ switch_status_t skinny_handle_soft_key_event_message(listener_t *listener, skinn
|
||||
break;
|
||||
case SOFTKEY_BACKSPACE:
|
||||
session = skinny_profile_find_session(listener->profile, listener, &line_instance, call_id);
|
||||
|
||||
if(session) {
|
||||
skinny_session_process_dest(session, listener, line_instance, NULL, '\0', 1);
|
||||
}
|
||||
break;
|
||||
case SOFTKEY_ENDCALL:
|
||||
session = skinny_profile_find_session(listener->profile, listener, &line_instance, call_id);
|
||||
|
||||
if(session) {
|
||||
channel = switch_core_session_get_channel(session);
|
||||
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
|
||||
}
|
||||
break;
|
||||
case SOFTKEY_RESUME:
|
||||
session = skinny_profile_find_session(listener->profile, listener, &line_instance, call_id);
|
||||
|
||||
if(session) {
|
||||
status = skinny_session_unhold_line(session, listener, line_instance);
|
||||
}
|
||||
break;
|
||||
case SOFTKEY_ANSWER:
|
||||
session = skinny_profile_find_session(listener->profile, listener, &line_instance, call_id);
|
||||
|
||||
if(session) {
|
||||
status = skinny_session_answer(session, listener, line_instance);
|
||||
}
|
||||
|
@ -108,10 +108,10 @@ struct skinny_table SKINNY_MESSAGE_TYPES[] = {
|
||||
{XML_ALARM_MESSAGE, "XMLAlarmMessage"},
|
||||
{0, NULL}
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_message_type2str, SKINNY_MESSAGE_TYPES, "UnknownMessage")
|
||||
SKINNY_DECLARE_ID2STR(skinny_message_type2str, SKINNY_MESSAGE_TYPES, "UnknownMessage")
|
||||
SKINNY_DECLARE_STR2ID(skinny_str2message_type, SKINNY_MESSAGE_TYPES, -1)
|
||||
|
||||
struct skinny_table SKINNY_DEVICE_TYPES[] = {
|
||||
struct skinny_table SKINNY_DEVICE_TYPES[] = {
|
||||
{1, "Cisco 30 SP+"},
|
||||
{2, "Cisco 12 SP+"},
|
||||
{3, "Cisco 12 SP"},
|
||||
@ -128,29 +128,29 @@ struct skinny_table SKINNY_DEVICE_TYPES[] = {
|
||||
{30018, "Cisco IP Phone CP-7961G"},
|
||||
{30019, "Cisco IP Phone 7936"},
|
||||
{0, NULL}
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_device_type2str, SKINNY_DEVICE_TYPES, "UnknownDeviceType")
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_device_type2str, SKINNY_DEVICE_TYPES, "UnknownDeviceType")
|
||||
SKINNY_DECLARE_STR2ID(skinny_str2device_type, SKINNY_DEVICE_TYPES, -1)
|
||||
|
||||
struct skinny_table SKINNY_RING_TYPES[] = {
|
||||
struct skinny_table SKINNY_RING_TYPES[] = {
|
||||
{SKINNY_RING_OFF, "RingOff"},
|
||||
{SKINNY_RING_INSIDE, "RingInside"},
|
||||
{SKINNY_RING_OUTSIDE, "RingOutside"},
|
||||
{SKINNY_RING_FEATURE, "RingFeature"},
|
||||
{0, NULL}
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_ring_type2str, SKINNY_RING_TYPES, "RingTypeUnknown")
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_ring_type2str, SKINNY_RING_TYPES, "RingTypeUnknown")
|
||||
SKINNY_DECLARE_STR2ID(skinny_str2ring_type, SKINNY_RING_TYPES, -1)
|
||||
|
||||
struct skinny_table SKINNY_RING_MODES[] = {
|
||||
struct skinny_table SKINNY_RING_MODES[] = {
|
||||
{SKINNY_RING_FOREVER, "RingForever"},
|
||||
{SKINNY_RING_ONCE, "RingOnce"},
|
||||
{0, NULL}
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_ring_mode2str, SKINNY_RING_MODES, "RingModeUnknown")
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_ring_mode2str, SKINNY_RING_MODES, "RingModeUnknown")
|
||||
SKINNY_DECLARE_STR2ID(skinny_str2ring_mode, SKINNY_RING_MODES, -1)
|
||||
|
||||
struct skinny_table SKINNY_BUTTONS[] = {
|
||||
struct skinny_table SKINNY_BUTTONS[] = {
|
||||
{SKINNY_BUTTON_UNKNOWN, "Unknown"},
|
||||
{SKINNY_BUTTON_LAST_NUMBER_REDIAL, "LastNumberRedial"},
|
||||
{SKINNY_BUTTON_SPEED_DIAL, "SpeedDial"},
|
||||
@ -162,11 +162,11 @@ struct skinny_table SKINNY_BUTTONS[] = {
|
||||
{SKINNY_BUTTON_SERVICE_URL, "ServiceUrl"},
|
||||
{SKINNY_BUTTON_UNDEFINED, "Undefined"},
|
||||
{0, NULL}
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_button2str, SKINNY_BUTTONS, "Unknown")
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_button2str, SKINNY_BUTTONS, "Unknown")
|
||||
SKINNY_DECLARE_STR2ID(skinny_str2button, SKINNY_BUTTONS, -1)
|
||||
|
||||
struct skinny_table SKINNY_SOFT_KEY_EVENTS[] = {
|
||||
struct skinny_table SKINNY_SOFT_KEY_EVENTS[] = {
|
||||
{SOFTKEY_REDIAL, "SoftkeyRedial"},
|
||||
{SOFTKEY_NEWCALL, "SoftkeyNewcall"},
|
||||
{SOFTKEY_HOLD, "SoftkeyHold"},
|
||||
@ -188,30 +188,30 @@ struct skinny_table SKINNY_SOFT_KEY_EVENTS[] = {
|
||||
{SOFTKEY_DND, "SoftkeyDnd"},
|
||||
{SOFTKEY_IDIVERT, "SoftkeyIdivert"},
|
||||
{0, NULL}
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_soft_key_event2str, SKINNY_SOFT_KEY_EVENTS, "SoftkeyUnknown")
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_soft_key_event2str, SKINNY_SOFT_KEY_EVENTS, "SoftkeyUnknown")
|
||||
SKINNY_DECLARE_STR2ID(skinny_str2soft_key_event, SKINNY_SOFT_KEY_EVENTS, 0)
|
||||
|
||||
struct skinny_table SKINNY_LAMP_MODES[] = {
|
||||
struct skinny_table SKINNY_LAMP_MODES[] = {
|
||||
{SKINNY_LAMP_OFF, "Off"},
|
||||
{SKINNY_LAMP_ON, "On"},
|
||||
{SKINNY_LAMP_WINK, "Wink"},
|
||||
{SKINNY_LAMP_FLASH, "Flash"},
|
||||
{SKINNY_LAMP_BLINK, "Blink"},
|
||||
{0, NULL}
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_lamp_mode2str, SKINNY_LAMP_MODES, "Unknown")
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_lamp_mode2str, SKINNY_LAMP_MODES, "Unknown")
|
||||
SKINNY_DECLARE_STR2ID(skinny_str2lamp_mode, SKINNY_LAMP_MODES, -1)
|
||||
|
||||
struct skinny_table SKINNY_SPEAKER_MODES[] = {
|
||||
struct skinny_table SKINNY_SPEAKER_MODES[] = {
|
||||
{SKINNY_SPEAKER_ON, "SpeakerOn"},
|
||||
{SKINNY_SPEAKER_OFF, "SpeakerOff"},
|
||||
{0, NULL}
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_speaker_mode2str, SKINNY_SPEAKER_MODES, "Unknown")
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_speaker_mode2str, SKINNY_SPEAKER_MODES, "Unknown")
|
||||
SKINNY_DECLARE_STR2ID(skinny_str2speaker_mode, SKINNY_SPEAKER_MODES, -1)
|
||||
|
||||
struct skinny_table SKINNY_KEY_SETS[] = {
|
||||
struct skinny_table SKINNY_KEY_SETS[] = {
|
||||
{SKINNY_KEY_SET_ON_HOOK, "KeySetOnHook"},
|
||||
{SKINNY_KEY_SET_CONNECTED, "KeySetConnected"},
|
||||
{SKINNY_KEY_SET_ON_HOLD, "KeySetOnHold"},
|
||||
@ -224,11 +224,11 @@ struct skinny_table SKINNY_KEY_SETS[] = {
|
||||
{SKINNY_KEY_SET_OFF_HOOK_WITH_FEATURES, "KeySetOffHookWithFeatures"},
|
||||
{SKINNY_KEY_SET_IN_USE_HINT, "KeySetInUseHint"},
|
||||
{0, NULL}
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_soft_key_set2str, SKINNY_KEY_SETS, "UNKNOWN_SOFT_KEY_SET")
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_soft_key_set2str, SKINNY_KEY_SETS, "UNKNOWN_SOFT_KEY_SET")
|
||||
SKINNY_DECLARE_STR2ID(skinny_str2soft_key_set, SKINNY_KEY_SETS, -1)
|
||||
|
||||
struct skinny_table SKINNY_CALL_STATES[] = {
|
||||
struct skinny_table SKINNY_CALL_STATES[] = {
|
||||
{SKINNY_OFF_HOOK, "OffHook"},
|
||||
{SKINNY_ON_HOOK, "OnHook"},
|
||||
{SKINNY_RING_OUT, "RingOut"},
|
||||
@ -244,38 +244,38 @@ struct skinny_table SKINNY_CALL_STATES[] = {
|
||||
{SKINNY_IN_USE_REMOTELY, "InUseRemotely"},
|
||||
{SKINNY_INVALID_NUMBER, "InvalidNumber"},
|
||||
{0, NULL}
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_call_state2str, SKINNY_CALL_STATES, "CallStateUnknown")
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_call_state2str, SKINNY_CALL_STATES, "CallStateUnknown")
|
||||
SKINNY_DECLARE_STR2ID(skinny_str2call_state, SKINNY_CALL_STATES, -1)
|
||||
|
||||
struct skinny_table SKINNY_DEVICE_RESET_TYPES[] = {
|
||||
struct skinny_table SKINNY_DEVICE_RESET_TYPES[] = {
|
||||
{SKINNY_DEVICE_RESET, "DeviceReset"},
|
||||
{SKINNY_DEVICE_RESTART, "DeviceRestart"},
|
||||
{0, NULL}
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_device_reset_type2str, SKINNY_DEVICE_RESET_TYPES, "DeviceResetTypeUnknown")
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_device_reset_type2str, SKINNY_DEVICE_RESET_TYPES, "DeviceResetTypeUnknown")
|
||||
SKINNY_DECLARE_STR2ID(skinny_str2device_reset_type, SKINNY_DEVICE_RESET_TYPES, -1)
|
||||
|
||||
struct skinny_table SKINNY_ACCESSORY_TYPES[] = {
|
||||
struct skinny_table SKINNY_ACCESSORY_TYPES[] = {
|
||||
{SKINNY_ACCESSORY_NONE, "AccessoryNone"},
|
||||
{SKINNY_ACCESSORY_HEADSET, "Headset"},
|
||||
{SKINNY_ACCESSORY_HANDSET, "Handset"},
|
||||
{SKINNY_ACCESSORY_SPEAKER, "Speaker"},
|
||||
{0, NULL}
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_accessory_type2str, SKINNY_ACCESSORY_TYPES, "AccessoryUnknown")
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_accessory_type2str, SKINNY_ACCESSORY_TYPES, "AccessoryUnknown")
|
||||
SKINNY_DECLARE_STR2ID(skinny_str2accessory_type, SKINNY_ACCESSORY_TYPES, -1)
|
||||
|
||||
struct skinny_table SKINNY_ACCESSORY_STATES[] = {
|
||||
struct skinny_table SKINNY_ACCESSORY_STATES[] = {
|
||||
{SKINNY_ACCESSORY_STATE_NONE, "AccessoryNoState"},
|
||||
{SKINNY_ACCESSORY_STATE_OFFHOOK, "OffHook"},
|
||||
{SKINNY_ACCESSORY_STATE_ONHOOK, "OnHook"},
|
||||
{0, NULL}
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_accessory_state2str, SKINNY_ACCESSORY_STATES, "AccessoryStateUnknown")
|
||||
};
|
||||
SKINNY_DECLARE_ID2STR(skinny_accessory_state2str, SKINNY_ACCESSORY_STATES, "AccessoryStateUnknown")
|
||||
SKINNY_DECLARE_STR2ID(skinny_str2accessory_state, SKINNY_ACCESSORY_STATES, -1)
|
||||
|
||||
/* For Emacs:
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
* indent-tabs-mode:t
|
||||
|
@ -41,7 +41,7 @@ struct skinny_table {
|
||||
};
|
||||
|
||||
#define SKINNY_DECLARE_ID2STR(func, TABLE, DEFAULT_STR) \
|
||||
const char *func(uint32_t id) \
|
||||
const char *func(uint32_t id) \
|
||||
{ \
|
||||
const char *str = DEFAULT_STR; \
|
||||
uint8_t x; \
|
||||
@ -57,7 +57,7 @@ const char *func(uint32_t id) \
|
||||
}
|
||||
|
||||
#define SKINNY_DECLARE_STR2ID(func, TABLE, DEFAULT_ID) \
|
||||
uint32_t func(const char *str)\
|
||||
uint32_t func(const char *str)\
|
||||
{\
|
||||
uint32_t id = (uint32_t) DEFAULT_ID;\
|
||||
\
|
||||
@ -77,14 +77,14 @@ uint32_t func(const char *str)\
|
||||
|
||||
#define SKINNY_DECLARE_PUSH_MATCH(TABLE) \
|
||||
switch_console_callback_match_t *my_matches = NULL;\
|
||||
uint8_t x;\
|
||||
for (x = 0; x < (sizeof(TABLE) / sizeof(struct skinny_table)) - 1; x++) {\
|
||||
uint8_t x;\
|
||||
for (x = 0; x < (sizeof(TABLE) / sizeof(struct skinny_table)) - 1; x++) {\
|
||||
switch_console_push_match(&my_matches, TABLE[x].name);\
|
||||
}\
|
||||
if (my_matches) {\
|
||||
}\
|
||||
if (my_matches) {\
|
||||
*matches = my_matches;\
|
||||
status = SWITCH_STATUS_SUCCESS;\
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern struct skinny_table SKINNY_MESSAGE_TYPES[72];
|
||||
|
Loading…
x
Reference in New Issue
Block a user