Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
ff08ea68
提交
ff08ea68
authored
5月 12, 2011
作者:
Mathieu Parent
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Skinny: reindent using vim's =G
上级
5f6c469e
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
1866 行增加
和
1877 行删除
+1866
-1877
mod_skinny.c
src/mod/endpoints/mod_skinny/mod_skinny.c
+263
-263
mod_skinny.h
src/mod/endpoints/mod_skinny/mod_skinny.h
+60
-60
skinny_api.c
src/mod/endpoints/mod_skinny/skinny_api.c
+382
-382
skinny_protocol.c
src/mod/endpoints/mod_skinny/skinny_protocol.c
+199
-199
skinny_protocol.h
src/mod/endpoints/mod_skinny/skinny_protocol.h
+350
-350
skinny_server.c
src/mod/endpoints/mod_skinny/skinny_server.c
+343
-354
skinny_tables.c
src/mod/endpoints/mod_skinny/skinny_tables.c
+151
-151
skinny_tables.h
src/mod/endpoints/mod_skinny/skinny_tables.h
+118
-118
没有找到文件。
src/mod/endpoints/mod_skinny/mod_skinny.c
浏览文件 @
ff08ea68
...
...
@@ -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
);
...
...
@@ -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
;
}
...
...
src/mod/endpoints/mod_skinny/mod_skinny.h
浏览文件 @
ff08ea68
src/mod/endpoints/mod_skinny/skinny_api.c
浏览文件 @
ff08ea68
src/mod/endpoints/mod_skinny/skinny_protocol.c
浏览文件 @
ff08ea68
src/mod/endpoints/mod_skinny/skinny_protocol.h
浏览文件 @
ff08ea68
src/mod/endpoints/mod_skinny/skinny_server.c
浏览文件 @
ff08ea68
...
...
@@ -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
);
}
...
...
src/mod/endpoints/mod_skinny/skinny_tables.c
浏览文件 @
ff08ea68
...
...
@@ -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
...
...
src/mod/endpoints/mod_skinny/skinny_tables.h
浏览文件 @
ff08ea68
...
...
@@ -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
];
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论