From 1727213bb8edf1c2a6d6d05f09a9c9d5b555caba Mon Sep 17 00:00:00 2001 From: Simon Wunderlich Date: Fri, 28 Feb 2014 13:59:31 +0100 Subject: [PATCH 1/3] mod_skinny: make 7925g work Cisco 7925G seem to work only with the correct conference_id2 and rtptimeout set, so add protocol 11 definition fields and set conference_id2 correctly. Signed-off-by: Simon Wunderlich Signed-off-by: Nathan Neulinger --- src/mod/endpoints/mod_skinny/skinny_protocol.c | 1 + src/mod/endpoints/mod_skinny/skinny_protocol.h | 4 +++- src/mod/endpoints/mod_skinny/skinny_server.c | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mod/endpoints/mod_skinny/skinny_protocol.c b/src/mod/endpoints/mod_skinny/skinny_protocol.c index 5498e5ebee..ee8c8b73e3 100644 --- a/src/mod/endpoints/mod_skinny/skinny_protocol.c +++ b/src/mod/endpoints/mod_skinny/skinny_protocol.c @@ -911,6 +911,7 @@ switch_status_t perform_send_open_receive_channel(listener_t *listener, message->data.open_receive_channel.echo_cancel_type = echo_cancel_type; message->data.open_receive_channel.g723_bitrate = g723_bitrate; message->data.open_receive_channel.conference_id2 = conference_id2; + message->data.open_receive_channel.rtptimeout = htonl(0x0a); /* message->data.open_receive_channel.reserved[0] = reserved[0]; message->data.open_receive_channel.reserved[1] = reserved[1]; diff --git a/src/mod/endpoints/mod_skinny/skinny_protocol.h b/src/mod/endpoints/mod_skinny/skinny_protocol.h index 870b4c578a..efa4282f27 100644 --- a/src/mod/endpoints/mod_skinny/skinny_protocol.h +++ b/src/mod/endpoints/mod_skinny/skinny_protocol.h @@ -683,7 +683,9 @@ struct PACKED open_receive_channel_message { uint32_t echo_cancel_type; uint32_t g723_bitrate; uint32_t conference_id2; - uint32_t reserved[10]; + uint32_t reserved[14]; + uint32_t rtpdtmfpayload; + uint32_t rtptimeout; }; /* CloseReceiveChannelMessage */ diff --git a/src/mod/endpoints/mod_skinny/skinny_server.c b/src/mod/endpoints/mod_skinny/skinny_server.c index e6efd6a110..8af25fa96a 100644 --- a/src/mod/endpoints/mod_skinny/skinny_server.c +++ b/src/mod/endpoints/mod_skinny/skinny_server.c @@ -802,7 +802,7 @@ switch_status_t skinny_session_start_media(switch_core_session_t *session, liste SKINNY_CODEC_ULAW_64K, /* uint32_t payload_capacity, */ 0, /* uint32_t echo_cancel_type, */ 0, /* uint32_t g723_bitrate, */ - 0, /* uint32_t conference_id2, */ + tech_pvt->call_id, /* uint32_t conference_id2, */ 0 /* uint32_t reserved[10] */ ); } @@ -868,7 +868,7 @@ switch_status_t skinny_session_unhold_line(switch_core_session_t *session, liste SKINNY_CODEC_ULAW_64K, /* uint32_t payload_capacity, */ 0, /* uint32_t echo_cancel_type, */ 0, /* uint32_t g723_bitrate, */ - 0, /* uint32_t conference_id2, */ + tech_pvt->call_id, /* uint32_t conference_id2, */ 0 /* uint32_t reserved[10] */ ); From 305543814da4452338cb3abaee12071685dfb9e2 Mon Sep 17 00:00:00 2001 From: Simon Wunderlich Date: Fri, 28 Feb 2014 14:06:22 +0100 Subject: [PATCH 2/3] mod_skinny: wait up to 5 seconds for OpenRecvChannelAck WiFi phones like the 7925g may take longer than just one second to acknowledge the open receive message. Increase the timeout to 5 seconds. Signed-off-by: Simon Wunderlich Signed-off-by: Nathan Neulinger --- src/mod/endpoints/mod_skinny/mod_skinny.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_skinny/mod_skinny.c b/src/mod/endpoints/mod_skinny/mod_skinny.c index 2d243fdc02..dfda8ad63a 100644 --- a/src/mod/endpoints/mod_skinny/mod_skinny.c +++ b/src/mod/endpoints/mod_skinny/mod_skinny.c @@ -1142,7 +1142,7 @@ switch_status_t channel_answer_channel(switch_core_session_t *session) /* Wait for media */ while(!switch_test_flag(tech_pvt, TFLAG_IO)) { switch_cond_next(); - if (++x > 1000) { + if (++x > 5000) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Wait tooo long to answer %s:%s\n", switch_channel_get_variable(channel, "skinny_device_name"), switch_channel_get_variable(channel, "skinny_device_instance")); return SWITCH_STATUS_FALSE; From 9f804d2d955a5ab7f7191ce6ba81bc08d92c374a Mon Sep 17 00:00:00 2001 From: Simon Wunderlich Date: Fri, 28 Feb 2014 14:21:39 +0100 Subject: [PATCH 3/3] mod_skinny: remove unknown field from access_status Cisco 7925g send access status message with just 8 byte of payload data. Since we don't interpret the unknown 3rd field anyway, remove it. This will prevent the first register to fail. Signed-off-by: Simon Wunderlich Signed-off-by: Nathan Neulinger --- src/mod/endpoints/mod_skinny/skinny_protocol.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_skinny/skinny_protocol.h b/src/mod/endpoints/mod_skinny/skinny_protocol.h index efa4282f27..4ea82ec057 100644 --- a/src/mod/endpoints/mod_skinny/skinny_protocol.h +++ b/src/mod/endpoints/mod_skinny/skinny_protocol.h @@ -458,7 +458,7 @@ struct PACKED dialed_phone_book_message { struct PACKED accessory_status_message { uint32_t accessory_id; uint32_t accessory_status; - uint32_t unknown; + /* uint32_t unknown; */ /* this field is missing in 7925G */ }; /* RegisterAckMessage */