提交 59e19758 authored 作者: Mathieu Parent's avatar Mathieu Parent

Skinny: more on device types

- print device type name when doing skinny status profile internal device ...
- add 7962 and 7965
- use base10 number
上级 b062eef1
...@@ -1291,7 +1291,8 @@ static int dump_device_callback(void *pArg, int argc, char **argv, char **column ...@@ -1291,7 +1291,8 @@ static int dump_device_callback(void *pArg, int argc, char **argv, char **column
stream->write_function(stream, "UserId \t%s\n", user_id); stream->write_function(stream, "UserId \t%s\n", user_id);
stream->write_function(stream, "Instance \t%s\n", instance); stream->write_function(stream, "Instance \t%s\n", instance);
stream->write_function(stream, "IP \t%s\n", ip); stream->write_function(stream, "IP \t%s\n", ip);
stream->write_function(stream, "DeviceType \t%s\n", type); stream->write_function(stream, "DeviceTypeId \t%s\n", type);
stream->write_function(stream, "DeviceType \t%s\n", skinny_device_type2str(atoi(type)));
stream->write_function(stream, "MaxStreams \t%s\n", max_streams); stream->write_function(stream, "MaxStreams \t%s\n", max_streams);
stream->write_function(stream, "Port \t%s\n", port); stream->write_function(stream, "Port \t%s\n", port);
stream->write_function(stream, "Codecs \t%s\n", codec_string); stream->write_function(stream, "Codecs \t%s\n", codec_string);
......
...@@ -99,18 +99,20 @@ SKINNY_DECLARE_ID2STR(skinny_message_type2str, SKINNY_MESSAGE_TYPES, "UnknownMes ...@@ -99,18 +99,20 @@ SKINNY_DECLARE_ID2STR(skinny_message_type2str, SKINNY_MESSAGE_TYPES, "UnknownMes
SKINNY_DECLARE_STR2ID(skinny_str2message_type, SKINNY_MESSAGE_TYPES, -1) SKINNY_DECLARE_STR2ID(skinny_str2message_type, SKINNY_MESSAGE_TYPES, -1)
struct skinny_table SKINNY_DEVICE_TYPES[] = { struct skinny_table SKINNY_DEVICE_TYPES[] = {
{"Cisco 30 SP+", 0x0001}, {"Cisco 30 SP+", 1},
{"Cisco 12 SP+", 0x0002}, {"Cisco 12 SP+", 2},
{"Cisco 12 SP", 0x0003}, {"Cisco 12 SP", 3},
{"Cisco 12", 0x0004}, {"Cisco 12", 4},
{"Cisco 30 VIP", 0x0005}, {"Cisco 30 VIP", 5},
{"Cisco IP Phone 7910", 0x0006}, {"Cisco IP Phone 7910", 6},
{"Cisco IP Phone 7960", 0x0007}, {"Cisco IP Phone 7960", 7},
{"Cisco IP Phone 7940", 0x0008}, {"Cisco IP Phone 7940", 8},
{"Cisco IP Phone 7935", 0x0009}, {"Cisco IP Phone 7935", 9},
{"Cisco ATA 186", 0x000c}, {"Cisco ATA 186", 12},
{"Cisco IP Phone 7961", 0x4275}, {"Cisco IP Phone CP-7962G", 404},
{"Cisco IP Phone 7936", 0x4276}, {"Cisco IP Phone CP-7965G", 436},
{"Cisco IP Phone CP-7961G", 30018},
{"Cisco IP Phone 7936", 30019},
{NULL, 0} {NULL, 0}
}; };
SKINNY_DECLARE_ID2STR(skinny_device_type2str, SKINNY_DEVICE_TYPES, "UnknownDeviceType") SKINNY_DECLARE_ID2STR(skinny_device_type2str, SKINNY_DEVICE_TYPES, "UnknownDeviceType")
......
...@@ -92,7 +92,7 @@ const char *skinny_message_type2str(uint32_t id); ...@@ -92,7 +92,7 @@ const char *skinny_message_type2str(uint32_t id);
uint32_t skinny_str2message_type(const char *str); uint32_t skinny_str2message_type(const char *str);
#define SKINNY_PUSH_MESSAGE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_MESSAGE_TYPES) #define SKINNY_PUSH_MESSAGE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_MESSAGE_TYPES)
extern struct skinny_table SKINNY_DEVICE_TYPES[13]; extern struct skinny_table SKINNY_DEVICE_TYPES[15];
const char *skinny_device_type2str(uint32_t id); const char *skinny_device_type2str(uint32_t id);
uint32_t skinny_str2device_type(const char *str); uint32_t skinny_str2device_type(const char *str);
#define SKINNY_PUSH_DEVICE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_DEVICE_TYPES) #define SKINNY_PUSH_DEVICE_TYPES SKINNY_DECLARE_PUSH_MATCH(SKINNY_DEVICE_TYPES)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论