linphone-developers
[Top][All Lists]
Advanced

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

Re: [Linphone-developers] Are PCMA and PCMU working in android version?


From: Odiemius
Subject: Re: [Linphone-developers] Are PCMA and PCMU working in android version? - yes, they are!
Date: Wed, 17 Jun 2015 03:17:39 +0300

Hi!
 
Looks like I have found a bug somewhere in a code, had no time to dig deeper and trace and fix it, but hacked to ensure it is there somewhere:
 
coreapi/linphonecore.c:
@@ -3190,7 +3190,8 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const
                cp->avpf_enabled = linphone_proxy_config_avpf_enabled(proxy);
                cp->avpf_rr_interval = linphone_proxy_config_get_avpf_rr_interval(proxy) * 1000;
        }else{
-               cp->avpf_enabled=linphone_core_get_avpf_mode(lc)==LinphoneAVPFEnabled;
+               //cp->avpf_enabled=linphone_core_get_avpf_mode(lc)==LinphoneAVPFEnabled;
+               cp->avpf_enabled=LinphoneAVPFDisabled;
                if (cp->avpf_enabled) cp->avpf_rr_interval=linphone_core_get_avpf_rr_interval(lc) * 1000;
        }
This change broke AVP, disabling it explicitly, without possibility to enable via user setup.
Before this change applied, disabling AVP in setup did not affected Linphone's behaviour and Linphone was always sending "shortened" list of codec attributes in INVITE, making call negotiation with asterisk impossible.
With this change applied Linphone DOES send full attributes ALWAYS, making audio calls possible (I tested with PCMA and G72):
 
IP A.B.C.D.iad3 > Q.W.E.R.sip: UDP, length 871
INVITE sip:address@hidden SIP/2.0
Via: SIP/2.0/UDP 192.168.2.2:5060;branch=z9hr4bK.eEOyHPIh3;rport
From: <sip:address@hidden>;tag=NTh-MSGeW
To: sip:address@hidden
CSeq: 20 INVITE
Call-ID: cGT--oFupy
Max-Forwards: 70
Supported: outbound
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
Content-Type: application/sdp
Content-Length: 297
Contact: <sip:address@hidden:1032>;+sip.instance="<urn:uuid:274e7399-da60-4220-84fa-bcfd965ca9dc>"
User-Agent: LinphoneAndroid/2.4.1-3-g77a0dc6 (belle-sip/1.4.1)

v=0
o=20026 2978 983 IN IP4 192.168.2.2
s=Talk
c=IN IP4 192.168.2.2
b=AS:380
t=0 0
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
m=audio 7076 RTP/AVP 9 3 0 101
a=rtpmap:9 G722/8000
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
It looks like something is broken in settings code, returning always LinphoneAVPFEnabled, instead of a state of a setting switch.
this issue must be fixed....it's 03:17 night... i'm gonna sleep...
 
17.06.2015, 02:31, "Odiemius" <address@hidden>:
Hi,
 
I understand your answer, when I compare Linphone with other softphones and "hardware" phones, I must note they are sending static payloads in attributes too.
When asterisk call for other asterisk they are exchanging with a complete list of attributes, including static payloads.
 
Then I have next question:
 
How I can force Linphone to include static payloads into attributes and send complete list info in INVITE, being even excessive?
 
I tried to disable allmost all codecs, just PCMU, PCMA, G722 and GSM were left enabled, and it failed again to make a call to my asterisk with the same error:
 
ASTER*CLI>
  == Using SIP VIDEO CoS mark 4
  == Using SIP RTP CoS mark 6
  == Using UDPTL CoS mark 6
[2015-06-17 02:11:11.255] NOTICE[20959][C-000000da]: chan_sip.c:10542 process_sdp: No compatible codecs, not accepting this offer!
  == Using SIP VIDEO CoS mark 4
  == Using SIP RTP CoS mark 6
  == Using UDPTL CoS mark 6
[2015-06-17 02:11:11.352] NOTICE[20959][C-000000db]: chan_sip.c:10109 process_sdp: Received AVP profile in audio answer but AVPF is enabled, disabling: audio 7076 RTP/AVP 8 9 3 0 101
[2015-06-17 02:11:11.354] NOTICE[20959][C-000000db]: chan_sip.c:10542 process_sdp: No compatible codecs, not accepting this offer!
ASTER*CLI>
From tcpdump this session looks like:
 
IP A.B.C.D.iad3 > Q.W.E.R.sip: UDP, length 834
INVITE sip: INVITE sip:address@hidden SIP/2.0
Via: SIP/2.0/UDP 192.168.2.2:5060;branch=z9hE6bK.JvY1i7rdC;rport
From: <sip:address@hidden>;tag=ir~AGdkap
To: sip:address@hidden
CSeq: 20 INVITE
Call-ID: 70dukWC1PS
Max-Forwards: 70
Supported: outbound
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
Content-Type: application/sdp
Content-Length: 260
Contact: <sip:address@hidden:1032>;+sip.instance="<urn:uuid:0c6153c7-0318-45b0-9e02-0bf7198ba52f>"
User-Agent: LinphoneAndroid/2.4.1-3-g77a0dc6 (belle-sip/1.4.1)

v=0
o=20026 2428 43 IN IP4 192.168.2.2
s=Talk
c=IN IP4 192.168.2.2
b=AS:380
t=0 0
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
m=audio 7076 RTP/AVPF 8 9 3 0 101
a=rtpmap:101 telephone-event/8000
a=rtcp-fb:* trr-int 3000
This one SIP INVITE does fits into one UDP-packet.
 
16.06.2015, 18:39, "Ghislain MARY" <address@hidden>:
Hi,

The payload type numbers for PCMA, PCMU, GSM and G722 are static, respectively (8, 0, 3 and 9). In your example of INVITE they appear correctly in:
m=audio 7078 RTP/AVP 96 97 98 99 
0 8 3 9
 100 102 103 104 105 106 107 101 108 109 110 111 112 113
These codecs are included in Linphone for Android.
However it appears you are using SIP over UDP and have enabled all the codecs. This can not work because the INVITE packet will get truncated, which appears to be the case in your example. To fix this, enable only the codecs you want or even better use TCP or TLS as the SIP transport.

To add more codecs, you will need to write a mediastreamer2 filter either built-in mediastreamer2 or as a mediastreamer2 plugin. Take a look at mediastreamer2 code to see how it is done.

Cheers,
Ghislain

Le 16/06/2015 17:00, Konstantin.O a écrit :
Hi Linphone Developer!

Yesterday I cloned from Git and built latest Linphone for Android, exactly as it is hinted in README.md.
It work fine but codecs only working (adevtised) are OPUS, iLBC, SILK and SPEEX.
I have enabled all codecs in settings, but I never seen PCMA/PCMU, GSM, G726, G722 in list.
There are NO widely used codes like PCMA/PCMU, GSM, G726, G722 in SIP INVITE message.
I used tcpdump to examine SIP dialogs with asterisk, here is example of INVITE from Linphone to asterisk:

     A.B.C.D.60191 > Q.W.E.R.5060: SIP, length: 1472
        INVITE sip:address@hidden SIP/2.0
        Via: SIP/2.0/UDP 192.168.2.2:60191;branch=z9hs4bK.YuOjUMR-c;rport
        From: <sip:address@hidden>;tag=-GsMdk1kU
        To: sip:address@hidden
        CSeq: 21 INVITE
        Call-ID: MFuoHrcVVt
        Max-Forwards: 70
        Supported: outbound
        Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
        Content-Type: application/sdp
        Content-Length: 1692
        Contact: <sip:address@hidden:60191>;+sip.instance="<urn:uuid:2523207c-9b19-3451-8a48-60bf318684eb>"
        User-Agent: LinphoneIphone/X
        Authorization:  Digest realm="ASTASTAST", nonce="aa372dce", algorithm=MD5, username="20029",  uri="sip:address@hidden", response="1eb25ee20e29e7f87be9542eed3d0e18"

        v=0
        o=20029 3033 2572 IN IP4 192.168.2.224
        s=Talk
        c=IN IP4 192.168.2.224
        b=AS:512
        t=0 0
        a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
        m=audio 7078 RTP/AVP 96 97 98 99 0 8 3 9 100 102 103 104 105 106 107 101 108 109 110 111 112 113
        a=rtpmap:96 opus/48000/2
        a=fmtp:96 useinbandfec=1; stereo=0; sprop-stereo=0
        a=rtpmap:97 SILK/16000
        a=rtpmap:98 speex/16000
        a=fmtp:98 vbr=on
        a=rtpmap:99 speex/8000
        a=fmtp:99 vbr=on
        a=rtpmap:100 iLBC/8000
        a=fmtp:100 mode=30
        a=rtpmap:102 mpeg4-generic/16000
        a=fmtp:102 config=F8EE2000; constantDuration=512; indexDeltaLength=3; indexLength=3; mode=AAC-hbr; profile-level-id=76; sizeLength=13; streamType=5
        a=rtpmap:103 mpeg4-generi[|sip]

My questions are:

1. How I can enable building and use of codecs PCMA, PCMU, GSM and G726 in Android version of Linphone?

2. How can I add other codes, say, Codec2?

,

_______________________________________________
Linphone-developers mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/linphone-developers

 
 
--
Я.
 
,

_______________________________________________
Linphone-developers mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/linphone-developers

 
 
--
Я.
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]