From: Simon H. <sh...@us...> - 2005-05-26 02:43:57
|
Update of /cvsroot/openh323/contrib/UPnP/sample In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6983/UPnP/sample Modified Files: H323_uPNP.cpp H323_uPNP.h main.cxx simple.dsp Log Message: More tidy ups (Again) Index: H323_uPNP.h =================================================================== RCS file: /cvsroot/openh323/contrib/UPnP/sample/H323_uPNP.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** H323_uPNP.h 25 May 2005 06:32:06 -0000 1.3 --- H323_uPNP.h 26 May 2005 02:43:49 -0000 1.4 *************** *** 29,32 **** --- 29,35 ---- * * $Log$ + * Revision 1.4 2005/05/26 02:43:49 shorne + * More tidy ups (Again) + * * Revision 1.3 2005/05/25 06:32:06 shorne * More tidy ups *************** *** 72,81 **** */ virtual void OnPortOpen(BOOL isUDP, WORD NatPort) ! { cout << "Port Opened " << NatPort << " UDP " << isUDP << endl;}; /** OnPortClosed Event fires when a IGD NAT port Map is successfully deleted. */ virtual void OnPortClosed(BOOL isUDP, WORD NatPort) ! { cout << "Port Closed " << NatPort << " UDP " << isUDP << endl; }; protected: --- 75,94 ---- */ virtual void OnPortOpen(BOOL isUDP, WORD NatPort) ! { ! if (isUDP) ! cout << "Port Opened " << NatPort << " UDP" << endl; ! else ! cout << "Port Opened " << NatPort << " TCP" << endl; ! }; /** OnPortClosed Event fires when a IGD NAT port Map is successfully deleted. */ virtual void OnPortClosed(BOOL isUDP, WORD NatPort) ! { ! if (isUDP) ! cout << "Port Closed " << NatPort << " UDP" << endl; ! else ! cout << "Port Closed " << NatPort << " TCP" << endl; ! }; protected: Index: main.cxx =================================================================== RCS file: /cvsroot/openh323/contrib/UPnP/sample/main.cxx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.cxx 25 Apr 2005 20:19:18 -0000 1.1 --- main.cxx 26 May 2005 02:43:49 -0000 1.2 *************** *** 23,26 **** --- 23,29 ---- * * $Log$ + * Revision 1.2 2005/05/26 02:43:49 shorne + * More tidy ups (Again) + * * Revision 1.1 2005/04/25 20:19:18 shorne * Initial version *************** *** 153,157 **** } ! PIPSocket::Address iface = args.GetOptionString('i'); H323_uPNP * nth = new H323_uPNP(iface,listenport, endpoint); --- 156,163 ---- } ! PIPSocket::Address iface = PIPSocket::GetGatewayInterfaceAddress(); ! ! if (args.HasOption('i')) ! iface = args.GetOptionString('i'); H323_uPNP * nth = new H323_uPNP(iface,listenport, endpoint); Index: simple.dsp =================================================================== RCS file: /cvsroot/openh323/contrib/UPnP/sample/simple.dsp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** simple.dsp 25 May 2005 06:32:06 -0000 1.2 --- simple.dsp 26 May 2005 02:43:49 -0000 1.3 *************** *** 80,84 **** LINK32=link.exe # ADD BASE LINK32 ptclib.lib ptlib.lib comdlg32.lib winspool.lib wsock32.lib mpr.lib kernel32.lib user32.lib gdi32.lib shell32.lib advapi32.lib /nologo /subsystem:console /machine:I386 ! # ADD LINK32 openh323n.lib ptclib.lib ptlib.lib ../lib/vsUPNPs.lib comdlg32.lib winspool.lib wsock32.lib mpr.lib kernel32.lib user32.lib gdi32.lib shell32.lib advapi32.lib /nologo /subsystem:console /machine:I386 !ENDIF --- 80,84 ---- LINK32=link.exe # ADD BASE LINK32 ptclib.lib ptlib.lib comdlg32.lib winspool.lib wsock32.lib mpr.lib kernel32.lib user32.lib gdi32.lib shell32.lib advapi32.lib /nologo /subsystem:console /machine:I386 ! # ADD LINK32 openh323sn.lib ptclib.lib ptlibs.lib ../lib/vsUPNPs.lib comdlg32.lib winspool.lib wsock32.lib mpr.lib kernel32.lib user32.lib gdi32.lib shell32.lib advapi32.lib /nologo /subsystem:console /machine:I386 !ENDIF Index: H323_uPNP.cpp =================================================================== RCS file: /cvsroot/openh323/contrib/UPnP/sample/H323_uPNP.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** H323_uPNP.cpp 25 Apr 2005 20:19:03 -0000 1.1 --- H323_uPNP.cpp 26 May 2005 02:43:49 -0000 1.2 *************** *** 29,32 **** --- 29,35 ---- * * $Log$ + * Revision 1.2 2005/05/26 02:43:49 shorne + * More tidy ups (Again) + * * Revision 1.1 2005/04/25 20:19:03 shorne * Initial version *************** *** 60,70 **** EP->masqPort = TCPNatPort; H323TransportUDP * rasChannel; PIPSocket::Address interfaceAddress(EP->LocalAddress); rasChannel = new H323TransportUDP(*EP, interfaceAddress); ! // Update the Gatekeeper EP->SetGatekeeper(EP->gkName, rasChannel); ! cout << "UPnP Address: " << ExtIP << " Port:" << TCPNatPort << "\n" << flush; --- 63,75 ---- EP->masqPort = TCPNatPort; + // Reregister with Gatekeeper at new address + if (!EP->gkName) { H323TransportUDP * rasChannel; PIPSocket::Address interfaceAddress(EP->LocalAddress); rasChannel = new H323TransportUDP(*EP, interfaceAddress); ! // Update the Gatekeeper information EP->SetGatekeeper(EP->gkName, rasChannel); ! } cout << "UPnP Address: " << ExtIP << " Port:" << TCPNatPort << "\n" << flush; |