【问题标题】:How to set up stunserver and turnserver in icedemo?如何在 icedemo 中设置 stun server 和 turn server?
【发布时间】:2014-10-10 09:14:45
【问题描述】:

我正在使用 pjsip 项目 2.3。我想使用 ice 来实现我的 p2p。

所以我编译了icedemo.c,命令行是“-s stunserver.org”。

但是当我运行演示时,我发现它不能正常工作。 像这样的转储信息:

11:46:45.343 os_core_win32.  pjlib 1.4 for win32 initialized
 11:46:45.359          pjlib  select() I/O Queue created (00A338E4)
 +----------------------------------------------------------------------+
|                    M E N U                                           |
+---+------------------------------------------------------------------+
| c | create           Create the instance                             |
| d | destroy          Destroy the instance                            |
| i | init o|a         Initialize ICE session as offerer or answerer   |
| e | stop             End/stop ICE session                            |
| s | show             Display local ICE info                          |
| r | remote           Input remote ICE info                           |
| b | start            Begin ICE negotiation                           |
| x | send <compid> .. Send data to remote                             |
+---+------------------------------------------------------------------+
| h |  help            * Help! *                                       |
| q |  quit            Quit                                            |
+----------------------------------------------------------------------+
Input: c
 11:46:49.703        icedemo  Creating ICE stream transport with 1 component(s)
 11:46:49.734        icedemo  Comp 1: srflx candidate starts Binding discovery
 11:46:50.000 stuntp00A34390  TX 36 bytes STUN message to 132.177.123.13:3478:
--- begin STUN message ---
STUN Binding request
 Hdr: length=16, magic=2112a442, tsx_id=6784482372ae3d6c00015f90
 Attributes:
  SOFTWARE: length=10, value="pjnath-1.4"
--- end of STUN message ---
  11:46:50.000 stuntsx00A3BCF  STUN client transaction created
 11:46:50.000 stuntsx00A3BCF  STUN sending message (transmit count=1)
 11:46:50.015        icedemo  Comp 1: host candidate 192.168.2.146:7033 added
 11:46:50.015        icedemo  ICE stream transport created
 11:46:50.015      icedemo.c  ICE instance successfully created
 +----------------------------------------------------------------------+
|                    M E N U                                           |
+---+------------------------------------------------------------------+
| c | create           Create the instance                             |
| d | destroy          Destroy the instance                            |
| i | init o|a         Initialize ICE session as offerer or answerer   |
| e | stop             End/stop ICE session                            |
| s | show             Display local ICE info                          |
| r | remote           Input remote ICE info                           |
| b | start            Begin ICE negotiation                           |
| x | send <compid> .. Send data to remote                             |
+---+------------------------------------------------------------------+
| h |  help            * Help! *                                       |
| q |  quit            Quit                                            |
+----------------------------------------------------------------------+
Input:  11:46:50.359 stuntsx00A3BCF  STUN sending message (transmit count=2)
 11:46:50.562 stuntsx00A3BCF  STUN sending message (transmit count=3)
 11:46:50.968 stuntsx00A3BCF  STUN sending message (transmit count=4)
 11:46:51.781 stuntsx00A3BCF  STUN sending message (transmit count=5)
 11:46:53.390 stuntsx00A3BCF  STUN sending message (transmit count=6)
 11:46:56.593 stuntsx00A3BCF  STUN sending message (transmit count=7)
 11:46:58.203 stuntsx00A3BCF  STUN timeout waiting for response
 11:46:58.203 stuntp00A34390  Session failed because STUN Binding request failed
: STUN transaction has timed out (PJNATH_ESTUNTIMEDOUT)
  11:46:58.203        icedemo  STUN binding request failed: STUN transaction has
timed out (PJNATH_ESTUNTIMEDOUT)
 11:46:58.203      icedemo.c  ICE initialization failed: STUN transaction has ti
med out (PJNATH_ESTUNTIMEDOUT)
 11:47:00.203 stuntsx00A3BCF  STUN client transaction destroyed

【问题讨论】:

  • 嗨,欢迎来到 StackOverflow。我认为这个问题可能需要做一些工作,您需要在问题中添加little more information 并提供一个示例,说明您已经尝试修复它所做的工作,以及发生错误的代码。

标签: c pjsip stun turn


【解决方案1】:

我的基于 PjSIP 的应用程序也遇到了类似的问题。 stunserver.org 的 STUN 服务器似乎有问题。它会不时下降。

尝试使用 google 提供的 STUN 服务器之一。我发现它们非常可靠。

stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-10-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-30
    • 1970-01-01
    相关资源
    最近更新 更多