]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Reject v17 skinny devices in Asterisk10
authorDamien Wedhorn <voip@facts.com.au>
Thu, 6 Oct 2011 23:08:57 +0000 (23:08 +0000)
committerDamien Wedhorn <voip@facts.com.au>
Thu, 6 Oct 2011 23:08:57 +0000 (23:08 +0000)
Small fix for Asterisk10 to reject skinny devices with skinny
firmware version17 and above.

Review: https://reviewboard.asterisk.org/r/1497/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@339722 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_skinny.c

index dbec7e36dad16b3bb7fc42dc27b800309eac3ed1..cc63d6443f702b95ed25c4ea5ff61700cc26f7ca 100644 (file)
@@ -273,6 +273,9 @@ struct register_message {
        uint32_t ip;
        uint32_t type;
        uint32_t maxStreams;
+       uint32_t space;
+       uint8_t protocolVersion;
+       char space2[3] ;
 };
 
 #define IP_PORT_MESSAGE 0x0002
@@ -2049,6 +2052,11 @@ static int skinny_register(struct skinny_req *req, struct skinnysession *s)
        socklen_t slen;
        int instance;
 
+       if (letohl(req->data.reg.protocolVersion) >= 17) {
+               ast_log(LOG_WARNING, "Asterisk10 does not support skinny protocol 17 and above. Rejecting device.\n");
+               return 0;
+       }
+
        AST_LIST_LOCK(&devices);
        AST_LIST_TRAVERSE(&devices, d, list){
                struct ast_sockaddr addr;