[asterisk-commits] may: branch may/ooh323_ipv6 r293799 - in /team/may/ooh323_ipv6/addons: ./ ooh...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Nov 3 11:09:24 CDT 2010


Author: may
Date: Wed Nov  3 11:09:19 2010
New Revision: 293799

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=293799
Log:
bind on ipv6 work

Modified:
    team/may/ooh323_ipv6/addons/chan_ooh323.c
    team/may/ooh323_ipv6/addons/ooh323c/src/ooGkClient.c
    team/may/ooh323_ipv6/addons/ooh323c/src/ooh323ep.c
    team/may/ooh323_ipv6/addons/ooh323c/src/ooh323ep.h

Modified: team/may/ooh323_ipv6/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6/addons/chan_ooh323.c?view=diff&rev=293799&r1=293798&r2=293799
==============================================================================
--- team/may/ooh323_ipv6/addons/chan_ooh323.c (original)
+++ team/may/ooh323_ipv6/addons/chan_ooh323.c Wed Nov  3 11:09:19 2010
@@ -285,6 +285,7 @@
 static int  gPort = 1720;
 static char gIP[2+8*4+7];	/* Max for IPv6 addr */
 struct ast_sockaddr bindaddr;
+int v6mode = 0;
 static char gCallerID[AST_MAX_EXTENSION] = "";
 static struct ooAliases *gAliasList;
 static format_t gCapability = AST_FORMAT_ULAW;
@@ -2534,6 +2535,9 @@
 			if (ast_parse_arg(v->value, PARSE_ADDR, &bindaddr)) {
 				ast_log(LOG_WARNING, "Invalid address: %s\n", v->value);
 				return 1;
+			}
+			if (ast_sockaddr_is_ipv6(&bindaddr)) {
+				v6mode = 1;
 			}
 		} else if (!strcasecmp(v->name, "h225portrange")) {
 			char* endlimit = 0;
@@ -3260,7 +3264,10 @@
 		ooH323EpDisableAutoAnswer();
 		ooH323EpSetH225MsgCallbacks(h225Callbacks);
       		ooH323EpSetTraceLevel(gTRCLVL);
-		ooH323EpSetLocalAddress(gIP, gPort);
+		ooH323EpSetLocalAddress(gIP, gPort, v6mode);
+		if (v6mode) {
+			ast_log(LOG_DEBUG, "OOH323 channel is in IP6 mode\n");
+		}
 		ooH323EpSetCallerID(gCallerID);
  
       if(ooH323EpSetTCPPortRange(ooconfig.mTCPPortStart, 

Modified: team/may/ooh323_ipv6/addons/ooh323c/src/ooGkClient.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6/addons/ooh323c/src/ooGkClient.c?view=diff&rev=293799&r1=293798&r2=293799
==============================================================================
--- team/may/ooh323_ipv6/addons/ooh323c/src/ooGkClient.c (original)
+++ team/may/ooh323_ipv6/addons/ooh323c/src/ooGkClient.c Wed Nov  3 11:09:19 2010
@@ -22,6 +22,7 @@
  */
 #include "asterisk.h"
 #include "asterisk/lock.h"
+#include "asterisk/netsock2.h"
 
 #include "ooGkClient.h"
 #include "ootypes.h"
@@ -269,7 +270,7 @@
    }
    if(pGkClient->localRASPort)
    {
-      ret= ooSocketStrToAddr (pGkClient->localRASIP, &ipaddrs);
+      inet_pton(AF_INET, pGkClient->localRASIP, &ipaddrs);
       if( (ret=ooSocketBind( pGkClient->rasSocket, ipaddrs, 
            pGkClient->localRASPort))!=ASN_OK ) 
       {
@@ -666,7 +667,7 @@
    }
 
  
-   ooSocketConvertIpToNwAddr(pGkClient->localRASIP, pRasAddress->ip.data);
+   inet_pton(AF_INET, pGkClient->localRASIP, pRasAddress->ip.data);
 
    pRasAddress->ip.numocts = 4;
    pRasAddress->port = pGkClient->localRASPort;
@@ -933,7 +934,7 @@
    }
    pTransportAddress->t = T_H225TransportAddress_ipAddress;
    pTransportAddress->u.ipAddress = pIpAddress;
-   ooSocketConvertIpToNwAddr(pGkClient->localRASIP, pIpAddress->ip.data);
+   inet_pton(AF_INET, pGkClient->localRASIP, pIpAddress->ip.data);
    pIpAddress->ip.numocts = 4;
    pIpAddress->port = gH323ep.listenPort;
    
@@ -961,7 +962,7 @@
    pTransportAddress->t = T_H225TransportAddress_ipAddress;
    pTransportAddress->u.ipAddress = pIpAddress;
    
-   ooSocketConvertIpToNwAddr(pGkClient->localRASIP, pIpAddress->ip.data);
+   inet_pton(AF_INET, pGkClient->localRASIP, pIpAddress->ip.data);
 
    pIpAddress->ip.numocts = 4;
    pIpAddress->port = pGkClient->localRASPort;
@@ -1410,7 +1411,7 @@
    }
    pTransportAddress->t = T_H225TransportAddress_ipAddress;
    pTransportAddress->u.ipAddress = pIpAddress;
-   ooSocketConvertIpToNwAddr(pGkClient->localRASIP, pIpAddress->ip.data);
+   inet_pton(AF_INET, pGkClient->localRASIP, pIpAddress->ip.data);
    pIpAddress->ip.numocts = 4;
    pIpAddress->port = gH323ep.listenPort;
    
@@ -1623,14 +1624,14 @@
       ast_mutex_unlock(&pGkClient->Lock);
       return OO_FAILED;
    }
-   ooSocketConvertIpToNwAddr(pGkClient->localRASIP, pIpAddressLocal->ip.data);
+   inet_pton(AF_INET, pGkClient->localRASIP, pIpAddressLocal->ip.data);
 
    pIpAddressLocal->ip.numocts = 4;
    pIpAddressLocal->port = gH323ep.listenPort;
 
    if(!ooUtilsIsStrEmpty(call->remoteIP))
    {
-      ooSocketConvertIpToNwAddr(call->remoteIP, pIpAddressRemote->ip.data);
+      inet_pton(AF_INET, call->remoteIP, pIpAddressRemote->ip.data);
       pIpAddressRemote->ip.numocts = 4;
       pIpAddressRemote->port = call->remotePort;
    }
@@ -2129,7 +2130,7 @@
       ast_mutex_unlock(&pGkClient->Lock);
       return OO_FAILED;
    }
-   ooSocketConvertIpToNwAddr(pGkClient->localRASIP, pIpAddressLocal->ip.data);
+   inet_pton(AF_INET, pGkClient->localRASIP, pIpAddressLocal->ip.data);
 
    pIpAddressLocal->ip.numocts = 4;
    pIpAddressLocal->port = gH323ep.listenPort;
@@ -2160,7 +2161,7 @@
 
    pIpRasAddress->ip.numocts = 4;
    pIpRasAddress->port = pGkClient->localRASPort;
-   ooSocketConvertIpToNwAddr(pGkClient->localRASIP, pIpRasAddress->ip.data);
+   inet_pton(AF_INET, pGkClient->localRASIP, pIpRasAddress->ip.data);
 
    pIRR->rasAddress.u.ipAddress = pIpRasAddress;
    pIRR->rasAddress.t=T_H225TransportAddress_ipAddress; /* IPv4 address */
@@ -2259,11 +2260,11 @@
       return OO_FAILED;
    }
    pLocalAddr->ip.numocts = 4;
-   ooSocketConvertIpToNwAddr(call->localIP, pLocalAddr->ip.data);
+   inet_pton(AF_INET, call->localIP, pLocalAddr->ip.data);
    pLocalAddr->port = (call->pH225Channel->port) ? call->pH225Channel->port : gH323ep.listenPort;
 
    pRemoteAddr->ip.numocts = 4;
-   ooSocketConvertIpToNwAddr(call->remoteIP, pRemoteAddr->ip.data);
+   inet_pton(AF_INET, call->remoteIP, pRemoteAddr->ip.data);
    pRemoteAddr->port = call->remotePort;
 
    perCallInfo->callSignaling.m.sendAddressPresent = TRUE;

Modified: team/may/ooh323_ipv6/addons/ooh323c/src/ooh323ep.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6/addons/ooh323c/src/ooh323ep.c?view=diff&rev=293799&r1=293798&r2=293799
==============================================================================
--- team/may/ooh323_ipv6/addons/ooh323c/src/ooh323ep.c (original)
+++ team/may/ooh323_ipv6/addons/ooh323c/src/ooh323ep.c Wed Nov  3 11:09:19 2010
@@ -171,7 +171,7 @@
       OOTRACEINFO2("Listen port number is set to %d\n", listenport);
    }
    if (mode == 1) {
-	gH323ep.v6Mode = OO_TRUE;
+	gH323ep.v6Mode = TRUE;
    }
    return OO_OK;
 }

Modified: team/may/ooh323_ipv6/addons/ooh323c/src/ooh323ep.h
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6/addons/ooh323c/src/ooh323ep.h?view=diff&rev=293799&r1=293798&r2=293799
==============================================================================
--- team/may/ooh323_ipv6/addons/ooh323c/src/ooh323ep.h (original)
+++ team/may/ooh323_ipv6/addons/ooh323c/src/ooh323ep.h Wed Nov  3 11:09:19 2010
@@ -184,7 +184,7 @@
  *
  * @return               OO_OK, on success. OO_FAILED, on failure.
  */ 
-EXTERN int ooH323EpSetLocalAddress(const char* localip, int listenport);
+EXTERN int ooH323EpSetLocalAddress(const char* localip, int listenport, int mode);
 
 /**
  * This function is used to set the range of tcp ports the application will




More information about the asterisk-commits mailing list