]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Setup IP proto version for call in GK mode
authorAlexandr Anikin <may@telecom-service.ru>
Tue, 9 Aug 2011 16:36:39 +0000 (16:36 +0000)
committerAlexandr Anikin <may@telecom-service.ru>
Tue, 9 Aug 2011 16:36:39 +0000 (16:36 +0000)
Added additional check for IP semantics before parse destination
by ast_parse_args due to it can parse numeric as IP.

 (closes issue ASTERISK-18218)
 Reported by: slesru
 Patch: ASTERISK-18218.patch

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

addons/ooh323c/src/ooGkClient.c
addons/ooh323c/src/ooq931.c

index 7252195b57a0ebaf34fee6cb5f16cb835efaf559..36ef8d0c3bf7d48dddeb585ba6497879a9fa830c 100644 (file)
@@ -1947,8 +1947,11 @@ int ooGkClientHandleAdmissionConfirm
                                     ipAddress->ip.data[1],
                                     ipAddress->ip.data[2],
                                     ipAddress->ip.data[3]);
-         if(strcmp(ip, "0.0.0.0"))
+         if(strcmp(ip, "0.0.0.0")) {
+/* fix this when gk client will adopt to work with IPv6 */
+           pCallAdmInfo->call->versionIP = 4;
             strcpy(pCallAdmInfo->call->remoteIP, ip);
+        }
          pCallAdmInfo->call->remotePort = ipAddress->port;
          /* Update call model */
          if(pAdmissionConfirm->callModel.t == T_H225CallModel_direct)
index 352f85ed2c246be3249e3811a27b316ae57266b0..efef2747c929df510d8f035251045b2f270c25fe 100644 (file)
@@ -3624,7 +3624,8 @@ int ooParseDestination
       return OO_OK;
    }
 
-   if (!ast_parse_arg(dest, PARSE_ADDR, &tmpaddr)) {
+   /* parse direct IP dest */
+   if ((strchr(dest, ':') || strchr(dest,'[') || strchr(dest,'.')) && !ast_parse_arg(dest, PARSE_ADDR, &tmpaddr)) {
       if(strlen(dest)+7>len)
       {
          OOTRACEERR1("Error:Insufficient buffer space for parsed ip - "