Problem with ICE in pjanth.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hey all.
I'm using ICE module in pjnath. And now I realy need some suggest from you
since that ICE didn't work well as I expected.

The control flow is about below.

-------------------------------------------------------------------------
    pj_stun_config stun_cfg;
    create_stun_config(pool,&stun_cfg);

    pj_ice_strans *ice_st;
    pj_ice_strans_cfg cfg;
    pj_ice_strans_cfg_default(&cfg);
    cfg.stun_cfg = stun_cfg;

    pj_ice_strans_cb cb;
    /* Init callback */
    pj_bzero(&cb, sizeof(cb));
    cb.on_ice_complete = &ice_complete;
    cb.on_rx_data = &rx_data;

    cfg.stun.server = pj_str("stun.xxx.com");
    cfg.stun.port = 3478;
    cfg.turn.server = pj_str("55.55.55.55");
    cfg.turn.port = 3478;

    cfg.turn.conn_type = PJ_TURN_TP_UDP;
    cfg.turn.auth_cred.type = PJ_STUN_AUTH_CRED_STATIC ;
    cfg.turn.auth_cred.data.static_cred.data_type = PJ_STUN_PASSWD_PLAIN;
    cfg.turn.auth_cred.data.static_cred.username = pj_str("san at xxx.com");
    cfg.turn.auth_cred.data.static_cred.data = pj_str("123456");

    pj_ice_strans_create("ice_strans",&cfg, 3, NULL, &cb,&ice_st);
    pj_ice_strans_init_ice(ice_st, PJ_ICE_SESS_ROLE_UNKNOWN, NULL, NULL);

    //..........................something else.
---------------------------------------------------------------------------------------------------------------

and there is the output:

---------------------------------------------------------------------------------------------------------------
 17:01:07.832 os_core_unix.c  pjlib 1.0.1 for POSIX initialized
 17:01:07.832          pjlib  select() I/O Queue created (0x900a63c)
xxxx1xxx
 17:01:07.833     ice_strans  Creating ICE stream transport with 3
component(s)
 17:01:07.833     ice_strans  Comp 1: srflx candidate starts Binding
discovery
 17:01:07.904 stuntp0x900a05  TX 20 bytes STUN message to 24.24.25.26:3478:
--- begin STUN message ---
STUN Binding request
 Hdr: length=0, magic=2112a442, tsx_id=62c2007c27f808540001231b
 Attributes:
--- end of STUN message ---

 17:01:07.905 stuntsx0x9014d  STUN client transaction created
 17:01:07.905 stuntsx0x9014d  STUN sending message (transmit count=1)
 17:01:07.905     ice_strans  Comp 1: host candidate 192.168.0.123:36479added
 17:01:07.905 udprel0x9014df  TURN client session created
 17:01:07.905 udprel0x9014df  Resolving 58.68.181.17 with DNS A
 17:01:07.905 udprel0x9014df  State changed Null --> Resolving
 17:01:07.905     ice_strans  TURN client state changed Null --> Resolving
 17:01:07.905 udprel0x9014df  State changed Resolving --> Resolved
 17:01:07.905     ice_strans  TURN client state changed Resolving -->
Resolved
 17:01:07.905 udprel0x9014df  Connecting to 55.55.55.55:3478
 17:01:07.905 udprel0x9014df  State changed Resolved --> Allocating
 17:01:07.905     ice_strans  TURN client state changed Resolved -->
Allocating
 17:01:07.905 udprel0x9014df  TX 28 bytes STUN message to 55.55.55.55:3478:
--- begin STUN message ---
STUN Allocate request
 Hdr: length=8, magic=2112a442, tsx_id=00004aab66ef438d1190cde7
 Attributes:
  REQUESTED-TRANSPORT: length=4, value=285212672 (0x11000000)
--- end of STUN message ---

 17:01:07.905 stuntsx0x9018c  STUN client transaction created
 17:01:07.905 stuntsx0x9018c  STUN sending message (transmit count=1)
 17:01:07.905     ice_strans  Comp 1: TURN relay candidate waiting for
allocation
 17:01:07.905     ice_strans  Comp 2: srflx candidate starts Binding
discovery
 17:01:07.936 stuntp0x901913  TX 20 bytes STUN message to 24.24.25.26:3478:
--- begin STUN message ---
STUN Binding request
 Hdr: length=0, magic=2112a442, tsx_id=255a0f767263f92e0001c233
 Attributes:
--- end of STUN message ---

 17:01:07.936 stuntsx0x901b5  STUN client transaction created
 17:01:07.936 stuntsx0x901b5  STUN sending message (transmit count=1)
 17:01:07.937     ice_strans  Comp 2: host candidate 192.168.0.123:55552added
 17:01:07.937 udprel0x901b63  TURN client session created
 17:01:07.937 udprel0x901b63  Resolving 55.55.55.55 with DNS A
 17:01:07.937 udprel0x901b63  State changed Null --> Resolving
 17:01:07.937     ice_strans  TURN client state changed Null --> Resolving
 17:01:07.937 udprel0x901b63  State changed Resolving --> Resolved
 17:01:07.937     ice_strans  TURN client state changed Resolving -->
Resolved
 17:01:07.937 udprel0x901b63  Connecting to 55.55.55.55:3478
 17:01:07.937 udprel0x901b63  State changed Resolved --> Allocating
 17:01:07.937     ice_strans  TURN client state changed Resolved -->
Allocating
 17:01:07.937 udprel0x901b63  TX 28 bytes STUN message to 55.55.55.55:3478:
--- begin STUN message ---
STUN Allocate request
 Hdr: length=8, magic=2112a442, tsx_id=00004aab41a7c4c91190cde8
 Attributes:
  REQUESTED-TRANSPORT: length=4, value=285212672 (0x11000000)
--- end of STUN message ---

 17:01:07.937 stuntsx0x901f4  STUN client transaction created
 17:01:07.937 stuntsx0x901f4  STUN sending message (transmit count=1)
 17:01:07.937     ice_strans  Comp 2: TURN relay candidate waiting for
allocation
 17:01:07.937     ice_strans  Comp 3: srflx candidate starts Binding
discovery
 17:01:07.968 stuntp0x901f98  TX 20 bytes STUN message to 24.24.25.26:3478:
--- begin STUN message ---
STUN Binding request
 Hdr: length=0, magic=2112a442, tsx_id=fb66079a500d5d320001d7b7
 Attributes:
--- end of STUN message ---

 17:01:07.968 stuntsx0x9021d  STUN client transaction created
 17:01:07.968 stuntsx0x9021d  STUN sending message (transmit count=1)
 17:01:07.969     ice_strans  Comp 3: host candidate 192.168.0.123:38218added
 17:01:07.969 udprel0x9021e8  TURN client session created
 17:01:07.969 udprel0x9021e8  Resolving 55.55.55.55 with DNS A
 17:01:07.969 udprel0x9021e8  State changed Null --> Resolving
 17:01:07.969     ice_strans  TURN client state changed Null --> Resolving
 17:01:07.969 udprel0x9021e8  State changed Resolving --> Resolved
 17:01:07.969     ice_strans  TURN client state changed Resolving -->
Resolved
 17:01:07.969 udprel0x9021e8  Connecting to 55.55.55.55:3478
 17:01:07.969 udprel0x9021e8  State changed Resolved --> Allocating
 17:01:07.969     ice_strans  TURN client state changed Resolved -->
Allocating
 17:01:07.969 udprel0x9021e8  TX 28 bytes STUN message to 55.55.55.55:3478:
--- begin STUN message ---
STUN Allocate request
 Hdr: length=8, magic=2112a442, tsx_id=00004aab7c83e4581190cde9
 Attributes:
  REQUESTED-TRANSPORT: length=4, value=285212672 (0x11000000)
--- end of STUN message ---

 17:01:07.969 stuntsx0x9025d  STUN client transaction created
 17:01:07.969 stuntsx0x9025d  STUN sending message (transmit count=1)
 17:01:07.969     ice_strans  Comp 3: TURN relay candidate waiting for
allocation
 17:01:07.969     ice_strans  ICE stream transport created
 17:01:07.969     ice_strans  ICE session created, comp_cnt=3, role is
Unknown agent
 17:01:07.969     ice_strans  Disabling STUN Indication logging for
component 1
 17:01:07.969     ice_strans  Candidate 0 of comp 0 is not added (pending)
 17:01:07.969     ice_strans  Candidate 0 added: comp_id=1, type=host,
foundation=H, addr=192.168.0.123:36479, base=192.168.0.123:36479, prio=0x27
(39)
 17:01:07.969     ice_strans  Candidate 2 of comp 0 is not added (pending)
 17:01:07.969     ice_strans  Disabling STUN Indication logging for
component 2
 17:01:07.969     ice_strans  Candidate 0 of comp 1 is not added (pending)
 17:01:07.969     ice_strans  Candidate 1 added: comp_id=2, type=host,
foundation=H, addr=192.168.0.123:55552, base=192.168.0.123:55552, prio=0x26
(38)
 17:01:07.969     ice_strans  Candidate 2 of comp 1 is not added (pending)
 17:01:07.969     ice_strans  Disabling STUN Indication logging for
component 3
 17:01:07.969     ice_strans  Candidate 0 of comp 2 is not added (pending)
 17:01:07.969     ice_strans  Candidate 2 added: comp_id=3, type=host,
foundation=H, addr=192.168.0.123:38218, base=192.168.0.123:38218, prio=0x25
(37)
 17:01:07.969     ice_strans  Candidate 2 of comp 2 is not added (pending)
-----------------------------------------------------------------------------------------------------------
I have some problem with pj_ice_init_ice();
I captured packets using tcpdump, it shows a success binding response from
stun, and a error 401 with turn response,but ICE didn't continue interactive
with turn server(In my opinion, ice_init() should continue send request  to
turn server with proper attributes such as nonce, realm,e.g.). ICE also
didn't add mapped address from stun's respnose to a component.
I think there must be a mistake i made. but I have no idea how to do.
Can anyone suggest something for me?

Thanks very much && best regards!
---
San
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20090325/08afe184/attachment-0001.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux