⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tutorial.txt

📁 开发h323ip电话的朋友
💻 TXT
字号:
A first simple experiment with the gatekeeper=============================================To see that all components are up and running, get2 Linux workstations, both connected to the LAN.Make sure you have at least version 1.1 of OpenH323 and OhPhone installed.On the first machine run the gatekeeper and ohphone (ondifferent consoles):jan@machine1 > gk -tttNow the gatekeeper is running in non-routed mode with a bandwidthlimit of 100MBit. The "-ttt" option tells the gatekeeper to do a lot of debug outputon the console (you can direct that output to a file with "-o logfile").jan@machine1 > ohphone -l -a -u janNow this OhPhone is listening (-l) for calls and will automaticallyaccept them (-a). It has registered as user jan with the gatekeeperthat it will automatically detect. (If the auto detect fails for somereason use "-g 1.2.3.4" to specify the IP number the gatekeeperis running on.)On the second machine run ohphone only:peter@machine2 > ohphone -u peter janThe second instance of OhPhone registers with the auto detectedgatekeeper as user peter and tries to call user jan.The gatekeeper will resolve the username to the IP number fromwhere user jan has registered (machine1 in this case) and OhPhonewill call the other instance of OhPhone on machine one.The first instance of OhPhone will accept that call and Peter and Jan can chat.Using the Status interface to spy on the gatekeeper===================================================Now we try to see which messages are handled by the gatekeeper.On a new console on machine1 we use telnet to connect to the gatekeeper:jan@machine1 > telnet machine1 7000Most probably we'll get an "Access forbidden!" message, becausenot everybody is allowed to spy.Now we create a file called gatekeeper.ini and put it in thedirectory where we start the gatekeeper.gatekeeper.ini only contains 4 lines:[Gatekeeper::Main]Fourtytwo=42[GkStatus::Auth]rule=allow Stop the gatekeeper with Ctrl-C and restart it.When we do the telnet again, we stay connected with the gatekeeper.Now repeat the first experiment where Peter calls Jan and see whichmessages are handled by the gatekeeper in non-routed mode.There is a number of commands that can be issued in this telnet session:Type "help" to see them.To end the telnet session with the gatekeeper type "quit" and hit Enter.Starting the gatekeeper in routed mode======================================Starting the gatekeeper in routed mode means that the gatekeeperuses "gatekeeper routed signaling" for all calls. In thismode the gatekeeper all signaling messages go through the gatekeeperand it has much greater control over the calls.jan@machine1 > gk -rNow the gatekeeper is running in routed mode. Telnet to the status portand make a call to see what messages are now handled by the gatekeeper.Note that all media packets (audio and video) are still sentdirectly between the endpoints (the 2 instances of ohphone).Since gatekeeper routed signaling is much more complicated you aremuch more likely to hit a bug n the gatekeeper in this mode.But if it breaks, you get to keep the pieces. ;-)A virtual PBX: Disconnecting calls via the gatekeeper=====================================================Until now the gatekeeper has only acted as a mechanismto resolve symbolic names to IP addresses. Thats an importantfunction but hardly exciting.Since the gatekeeper has a lot of control over the calls,it can terminate them for example. When we areconnected to the status port, we can list all active callswith "PrintCurrentCalls". To terminate a call, we cansay "Disconnect 1.2.3.4" for one of its endpoints.One could for example write a simple script that connects tothe status port and listens for all ongoing calls and terminatesthem after 5 minutes, so no user can over use system resources.This mechanism could also be used to call transfers between usersor call forwarding. (But thats not yet implemented in the gatekeeper.)Routing calls over a gateway to reach external users=====================================================Without using a gateway you can only call other people with anIP phone over the Internet. To reach people with ordinary telephonesyou must use a gateway._________________          _____________| endpoint "jan"|          |            || 192.168.88.35 |--------->| Gatekeeper ||_______________|          |            |_________________          |            || gateway "gw1" | outgoing |            || 192.168.88.37 |<---------|____________||_______________|The gatekeeper has to know which calls are supposed to be routedover the gateway and what numbers shall be called directly.Use the [RasSvr::GWPrefixes] section of the config file to tellthe gatekeeper the prefix of numbers that shall be routed over thegateway.[RasSvr::GWPrefixes]gw1=0This entry tells the gatekeeper to route all calls to E.164 numbersstarting with 0 to the gateway that has registered with the H.323alias "gw1". If there is no registered gateway with that alias thecall will fail. (Note that you must use the gateway alias - youcan't just tell the gatekeeper the IP number of the gateway.)Rewriting E.164 numbers=======================When using a gateway you often have to use different numbers internallyand rewrite them before sending them over a gateway into the telephonenetwork. You can use the [RasSvr::RewriteE164] section to configurethat.Example:You want to call number 12345 with you IP Phone and would like toreach number 08765 behind a gateway called "gw1".[RasSvr::GWPrefixes]gw1=0[RasSvr::RewriteE164]12345=08765

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -