[pjsip] Problems with payload.

Giuseppina Senzatela giuseppina.senzatela at eunics.it
Tue Feb 5 09:06:25 EST 2008


Hi Benny, you were absolutely right! I was a little bit confused on how to proceed ..
I followed your suggestion and I gave a look to the pjmedia documentation, so the solution you suggested has been very simple for me to achieve.
The media proxy I realized receives packets from UAs, and trasmits them properly (or it seems to be right...).
The problem is that when media proxy transmits the packet, it has the right header but the payload is always a zero sequence... 

This is a tcpdump on the media proxy:

that's the schema of transmission:

UAC0 (62.94.0.199.40862) <----------> (195.62.230.219.60176) | (195.62.230.219.60178)<---------->UAC1 (62.94.0.199.40858) 


 
14:21:14.804865 IP (tos 0x0, ttl  56, id 7802, offset 0, flags [none], proto: UDP (17), length: 280) 62.94.0.199.40862 > 195.62.230.219.60176: UDP, length 252
        0x0000:  4500 0118 1e7a 0000 3811 7a1c 3e5e 00c7  E....z..8.z.>^..
        0x0010:  c33e e6db 9f9e eb10 0104 39e8 8000 01fb  .>........9.....
        0x0020:  00fd c020 726d 3486 7b7a 757e fe78 7dfb  ....rm4.{zu~.x}.
        0x0030:  7c7d fc7a 7a7e 797c 7f7d 7b7d 7e79 7679  |}.zz~y|.}{}~yvy
        0x0040:  7674 7b76 757f 7a79 7a73 7879 7579 7977  vt{vu.zyzsxyuyyw
        0x0050:  7877                                     xw
14:21:14.813985 IP (tos 0x0, ttl 123, id 12412, offset 0, flags [none], proto: UDP (17), length: 200) 62.94.0.199.40858 > 195.62.230.219.60178: UDP, length 172
        0x0000:  4500 00c8 307c 0000 7b11 256a 3e5e 00c7  E...0|..{.%j>^..
        0x0010:  c33e e6db 9f9a eb12 00b4 149f 8000 1282  .>..............
        0x0020:  0004 7f40 8759 9aa9 fefc fcfe fdfd 7c7d  ... at .Y........|}
        0x0030:  fdfb fc7e 7c7b 7d7f fffd fe7c 7b7c 7efb  ...~|{}....|{|~.
        0x0040:  fc7e 7dfe fcfc fe7f fcfa 7e7e fefd 7b75  .~}.......~~..{u
        0x0050:  7bfe                                     {.
14:21:14.820626 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 200) 195.62.230.219.60176 > 62.94.0.199.40862: UDP, length 172
        0x0000:  4500 00c8 0000 4000 4011 50e6 c33e e6db  E..... at .@.P..>..
        0x0010:  3e5e 00c7 eb10 9f9e 00b4 52ba 8000 7a7b  >^........R...z{
        0x0020:  0000 4100 0054 fc0c 0000 0000 0000 0000  ..A..T..........
        0x0030:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0040:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0050:  0000                                     ..
14:21:14.820645 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 200) 195.62.230.219.60178 > 62.94.0.199.40858: UDP, length 172
        0x0000:  4500 00c8 0000 4000 4011 50e6 c33e e6db  E..... at .@.P..>..
        0x0010:  3e5e 00c7 eb12 9f9a 00b4 4284 8000 78c1  >^........B...x.
        0x0020:  0000 4100 23f0 ea62 0000 0000 0000 0000  ..A.#..b........
        0x0030:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0040:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0050:  0000                                     ..
14:21:14.833906 IP (tos 0x0, ttl 123, id 12418, offset 0, flags [none], proto: UDP (17), length: 200) 62.94.0.199.40858 > 195.62.230.219.60178: UDP, length 172
        0x0000:  4500 00c8 3082 0000 7b11 2564 3e5e 00c7  E...0...{.%d>^..
        0x0010:  c33e e6db 9f9a eb12 00b4 270f 8000 1283  .>........'.....
        0x0020:  0004 7fe0 8759 9aa9 fb7e 7c7b 7ffa fbff  .....Y...~|{....
        0x0030:  fdfc 7ffd fb7f 7dfd 7f79 7b7c fdfa 7e7b  ......}..y{|..~{
        0x0040:  7dfe fefe 7e7d 7e7f 7efd fb7f fefe 7a7b  }...~}~.~.....z{
        0x0050:  7f7e                                     .~
14:21:14.835270 IP (tos 0x0, ttl  56, id 7803, offset 0, flags [none], proto: UDP (17), length: 280) 62.94.0.199.40862 > 195.62.230.219.60176: UDP, length 252
        0x0000:  4500 0118 1e7b 0000 3811 7a1b 3e5e 00c7  E....{..8.z.>^..
        0x0010:  c33e e6db 9f9e eb10 0104 cf26 8000 01fc  .>.........&....
        0x0020:  00fd c110 726d 3486 767b 7775 7974 7176  ....rm4.v{wuytqv
        0x0030:  7470 7578 7778 7273 7a72 6f76 7575 7478  tpuxwxrszrovuutx
        0x0040:  7a77 7878 7477 7673 7a7b 7979 7a7b 7b75  zwxxtwvsz{yyz{{u
        0x0050:  7876                                     xv
14:21:14.840625 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 200) 195.62.230.219.60176 > 62.94.0.199.40862: UDP, length 172
        0x0000:  4500 00c8 0000 4000 4011 50e6 c33e e6db  E..... at .@.P..>..
        0x0010:  3e5e 00c7 eb10 9f9e 00b4 5219 8000 7a7c  >^........R...z|
        0x0020:  0000 41a0 0054 fc0c 0000 0000 0000 0000  ..A..T..........
        0x0030:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0040:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0050:  0000                                     ..
14:21:14.840644 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 200) 195.62.230.219.60178 > 62.94.0.199.40858: UDP, length 172
        0x0000:  4500 00c8 0000 4000 4011 50e6 c33e e6db  E..... at .@.P..>..
        0x0010:  3e5e 00c7 eb12 9f9a 00b4 41e3 8000 78c2  >^........A...x.
        0x0020:  0000 41a0 23f0 ea62 0000 0000 0000 0000  ..A.#..b........
        0x0030:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0040:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0050:  0000                                     ..
14:21:14.854187 IP (tos 0x0, ttl 123, id 12426, offset 0, flags [none], proto: UDP (17), length: 200) 62.94.0.199.40858 > 195.62.230.219.60178: UDP, length 172
        0x0000:  4500 00c8 308a 0000 7b11 255c 3e5e 00c7  E...0...{.%\>^..
        0x0010:  c33e e6db 9f9a eb12 00b4 2ed4 8000 1284  .>..............
        0x0020:  0004 8080 8759 9aa9 7a7c f9fa ff7e fefe  .....Y..z|...~..
        0x0030:  fdfa ff7b 7e7c 7c7f 7977 7ffe 7ffc fcfb  ...{~||.yw......
        0x0040:  7f7b 7dfd f6f9 feff fefc fc7e 7ffd feff  .{}........~....
        0x0050:  7f7e                                     .~
14:21:14.860625 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], proto: UDP (17), length: 200) 195.62.230.219.60176 > 62.94.0.199.40862: UDP, length 172
        0x0000:  4500 00c8 0000 4000 4011 50e6 c33e e6db  E..... at .@.P..>..
        0x0010:  3e5e 00c7 eb10 9f9e 00b4 5178 8000 7a7d  >^........Qx..z}
        0x0020:  0000 4240 0054 fc0c 0000 0000 0000 0000  ..B at .T..........
        0x0030:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0040:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0050:  0000                                     ..



Do you see something strange I 'm not able to see, or have any ideas so that the payload is a zero sequence during transmission?
What do you think?

Bye, and.... thanks for your patience! 
Giusy





In that case, I think you probably don't need to use stream at all. Stream
is needed if you need to work with the media at the PCM level, while in this
case, probably what you want is just to forward the RTP packets (without
having to decode/encode etc.).

If this is the case, then the solution couldn't be simpler:
 - create two media transports, one for each UA
 - call pjmedia_transport_attach() to attach your RTP/RTCP RX callbacks.
 - when your RTP/RTCP callback is called by one transport, call
pjmedia_transport_send_rtp/rtcp() to to send the packet with the other
transport.

You will still need  to configure worker threads in pjmedia_endpt to poll
the ioqueue, or otherwise create these threads yourself and make them poll
the ioqueue. See pjmedia_endpt_create() documentation for the details.

What do you think?

cheers,
 -benny





More information about the pjsip mailing list