(resend) Need some guidance: Weird G711 sample rate crashwith PJSIP

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

 



Rob-

> Hi all, need some guidance on where in PJSUA/SIP/MEDIA to look.
>
> Here is the situation: We have a perfectly (well almost) working client -
> which only supports G711 u law. We often make a call to various PSTN phones
> via different SIP gateways. The call flows of those gateways is almost the
> same - they send 100, then 183, then 200. However, when we test against a
> specific gateway, for some reason, our client crashes.
>
> When we analyzed why, we observed that when PJSIP receives their 183, it
> tries and creates an audio playback stream assuming it will receive packets
> in 100 millisecond intervals and 800 samples per frame (that's what our
> dev_create_stream callback logs  reports).  However, the gateway is actually
> sending packets at 20ms @ 160 samples per second. I validated this by
> analyzing the RTP stream.
>
> This is causing my app to crash (my target platform which is android, only
> works with 20ms @ 160 samples per second). I am trying to figure out
> where/which function within PJSIP is making this decision so I can set logs
> and figure out. Any pointer? I am trying to find the root function that
> starts this chain.

It sounds like the gateway in question and pjsip are not negotiating "packet time"; i.e. interval of voice time
represented by each packet.  Suggest to read about the "ptime" parameter in pjsip...  As a work-around you might be
able to program pjsip to handle it correctly.  The general solution is for both sides to not rely on default values
and negotiate this along with other rtp session parameters.

-Jeff


> The 183 which causes this assumption is: (IP masked)
>
> SIP/2.0 183 Session Progress
> Via: SIP/2.0/UDP xx.xx.xx.xx;branch=0;received=10.1.2.23
> Via: SIP/2.0/UDP
> xx.xx.xx.xx:55014;rport=55014;branch=z9hG4bKPjqpfbDIrPc7bpAeHPUTW61E8cVBU2rSgC
> From: sip:xx@xxxxxxxxxxx;tag=IV75TC5ysisdH.Har8DDcyVz6JdWmoze
> To: sip:yy at yy.yy.yy.yy;tag=as31c43fd9
> Call-ID: rFqYyqnPI0on7JwDORgmLS-jqoMNj9zI
> CSeq: 6045 INVITE
> User-Agent: Asterisk PBX
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
> Supported: replaces
> Contact: <sip:xx at xx.xx.xx.xx>
> Content-Type: application/sdp
> Content-Length: 239
>
> v=0
> o=root 9255 9255 IN IP4 xx.xx.xx.xx
> s=session
> c=IN IP4  xx.xx.xx.xx
> t=0 0
> m=audio 3010 RTP/AVP 0 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=silenceSupp:off - - - -
> a=ptime:20
> a=sendrecv
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>




[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