java - Android: Send .wav to SIP-Phone via RTP (G.711 PCMU) very noisy, crackling sound based on SipDroid/MjSIP -
i want transmit(send-only) .wav file android softphone (x-lite) called person on x-lite can hear sound of .wav file.
the scenario follows: android , x-lite both in same wlan , both connected freeswitch. can call x-lite android phone. if call accepted on x-lite android sends .wav file , can see in wireshark rtp pakets (g.711 pcmu) send phone x-lite. can hear sound not 1 expect. instead crackling, noisy , beeps.
so there problem in sdp send x-lite?
v=0 o=sip:1002@192.168.2.110 0 0 in ip4 192.168.2.100 s=mysession c=in ip4 192.168.2.110 t=0 0 m=audio 8000 rtp/avp 0 8 101 a=rtpmap:101 telephone-event/8000
or problem way send .wav?
datagramsocket socket = null; rtpstreamsender sender = null; int port =8000; int payload_type = 0; int framesize = 64; int framerate =32; socket = new datagramsocket(port); fileinputstream audioinput = new fileinputstream(f); //f .wav sender = new rtpstreamsender(audioinput, true, payload_type, framerate, framesize, remoteaddress, remoteport); sender.setsyncadj(2); sender.start();
if follow udp stream in wireshark beginning looks this:
........m...riff....wavefmt ........d...........data0...............................m..........................................................................>m..........................................................................]m..........................................................................|m..................... ....................... ..... .......................m........... ......................... .....................................m........................................................... ...............m............................................... .......+...5...8...........m...6...+.'...-...(.....#...-...+... ........................... ...........m...................................................................... ...6m......... ... ............................................................um...........-...1...0...,...)...'...0...?...=.#.'.$. .!....................tm.............................$....................... .....&.......... ....m........................... ...................................,...........m...=...i...w...j.../.....................#...<...t...z...b.................m.....#...5...5......................"... ..... .......5.w.l...n...........m...c...8.m.'.r...>...o...p...~...e...i...3................................m................................................... .......................m... ...5...r...l...3.../...b...z...b...
...x...b...!.........{............mm.........$...2...(........................................................lm...............................-.!.r.j.].s.z.t.u.c.b.
.q.v.....y...........m...h...v...y...c...l.f.e.*.............................(...e...x...........m...j...5.h.7.5.^...~...j.................(.=.h.........f.....q...(.........m.....e.x...{...l.2...............:.......q.......v........... .............m.................0...s...k...7.+.b.....................&...o...]...........m...r.b.......w...8.q...?...a...>...................).../.
so guess not empty. after beginning of signal, signal send x-lite android , again pakets android x-lite... , on
can give me hint why can't hear sound?
(other solutions welcome) edit:
this implementation of rtpstramsender mjsip: http://pastebin.com/xu4edeex
edit 2: changed sdp in rfc to:
m=audio 54874 rtp/avp 96 97 0 8 a=rtpmap:96 pcmu-wb/16000 a=rtpmap:97 pcma-wb/16000 a=rtpmap:0 pcmu/8000 a=rtpmap:8 pcma/8000
but nothing hapened. changed framesize , framerate crackling gets faster or slower
edit 3: implementation of rtppacket: http://pastebin.com/tdlr5cyf
my suspicion packetizing.
this rfc tells how suppoed done: rfc 5391
turned out helped little bit, not way. if can , works, please accept answer rather mine.
Comments
Post a Comment