<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:courier,monaco,monospace,sans-serif;font-size:12pt">----- Original Message ----<br><div style="font-family: courier,monaco,monospace,sans-serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">From: Mark D. Anderson &lt;mda@discerning.com&gt;<br>To: freeswitch-users@lists.freeswitch.org<br>Sent: Saturday, June 9, 2007 1:18:09 PM<br>Subject: [Freeswitch-users] codec and vad and cng configuration<br><br><div>It seems FS will simply go through the rtpmap offers in an incoming INVITE,<br>in the incoming order, and pick the first one that is in the codec-prefs<br>in my sofia.conf.xml (see end of this message for trace).<br><br>But I was expecting that FS (or sofia underneath) would instead negotiate<br>by checking codecs in my configured list, and pick the first matching one<br>in *my* list, not the first matching one in
 *their* list.<br><br>---------------------------------------------------------------------------------------------------------------<br><span style="font-weight: bold;">That is correct.&nbsp; This was done intentionally.&nbsp; Since you asked *sooo* nicely</span><br style="font-weight: bold;"><span style="font-weight: bold;">
I added a new param to the sofia profile:</span><br style="font-weight: bold;"><br style="font-weight: bold;"><span style="font-weight: bold;">&lt;param name="inbound-codec-negotiation" value="greedy"/&gt;</span><br style="font-weight: bold;"><br style="font-weight: bold;"><span style="font-weight: bold;">This will do what you *expected*, (sorry for not meeting *all* your needs).</span><br style="font-weight: bold;">
---------------------------------------------------------------------------------------------------------------<br><br>I see there is a "inbound-late-negotiation" param, but I don't<br>know how this would be used -- nor do I think i'd want to use<br>it, if the priority can just be taken from my list.<br><br>---------------------------------------------------------------------------------------------------------------<br>
<span style="font-weight: bold;">This option prevents the codec negotiation from happening until the media is required.</span><br style="font-weight: bold;"><span style="font-weight: bold;">You can let calls hit the dialplan and examine the SDP with regular expressions</span><br style="font-weight: bold;"><span style="font-weight: bold;">and set an absolute codec string.&nbsp; The point here is to make it possible to control</span><br style="font-weight: bold;"><span style="font-weight: bold;">the codec behaviour from the code.&nbsp; Using this technique you can now set the </span><br style="font-weight: bold;"><span style="font-weight: bold;">greedy behaviour as a channel variable in the dialplan.</span><br style="font-weight: bold;"><br style="font-weight: bold;"><span style="font-weight: bold;">Since you delayed negotation you had the oppurtunity to set the variable</span><br style="font-weight: bold;"><span style="font-weight: bold;">before the codec negotiation took
 place.</span><br style="font-weight: bold;"><br style="font-weight: bold;"><span style="font-weight: bold;">&lt;action application="set" data="sip_codec_negotiation=greedy"&gt;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&lt;action application="answer"/&gt;</span><br style="font-weight: bold;"><br>---------------------------------------------------------------------------------------------------------------<br>
<br><br><br>Regarding VAD, I'm wondering why there is an "in" or "both" setting --<br>isn't VAD chosen by the sender?<br>Also, it seems kind of limiting to have to enable VAD regardless<br>of who is connecting (what UA) and regardless of what codec is in<br>use. <br>And I see no way to control CNG at all?<br><br>---------------------------------------------------------------------------------------------------------------<br>

<span style="font-weight: bold;">We *always* advertise CNG and we *always* set the CNG mode in&nbsp; the RTP if </span><br style="font-weight: bold;"><span style="font-weight: bold;">someone we talk to supports it.&nbsp; If they don't support it we turn it off.</span><br style="font-weight: bold;"><br style="font-weight: bold;"><span style="font-weight: bold;">When this takes place you will see a message in the DEBUG log about setting </span><br style="font-weight: bold;"><span style="font-weight: bold;">the CNG payload type.&nbsp; This means the RTP stack will send CNG frames whenever</span><br style="font-weight: bold;"><span style="font-weight: bold;">it notices an interval take place where no audio was sent.&nbsp; The VAD param is the </span><br style="font-weight: bold;"><span style="font-weight: bold;">way it is because we have not worked it into the SDP negotiation yet.&nbsp; The in out</span><br style="font-weight: bold;"><span style="font-weight: bold;">or both is
 if you want to use this nonstandard VAD on the inbound media stream, the outbound</span><br style="font-weight: bold;"><span style="font-weight: bold;">streams or both.</span><br style="font-weight: bold;"><br style="font-weight: bold;"><span style="font-weight: bold;">A small TIP.&nbsp;&nbsp; Going forward please take the time to read your email before you send it to</span><br style="font-weight: bold;"><span style="font-weight: bold;">make sure your wording or tone does not HIGHLY OFFEND the developers you are </span><br style="font-weight: bold;"><span style="font-weight: bold;">asking for help.&nbsp; YOU are asking ME to add functionality YOU want to MY software.</span><br style="font-weight: bold;"><br style="font-weight: bold;"><span style="font-weight: bold;">I am perfectly happy without this behaviour and I am adding it for YOU.</span><br style="font-weight: bold;"><span style="font-weight: bold;">I'll give you the benefit of the doubt if you did not realize the
 demanding tone</span><br style="font-weight: bold;"><span style="font-weight: bold;">of your email but please pay more attention to your manners in the future.</span><br style="font-weight: bold;"><br style="font-weight: bold;">---------------------------------------------------------------------------------------------------------------<br>

<br><br><br><br><br>-mda<br><br>example trace, showing how it picks PCMU since it is first in their list,<br>when the first match in my list would have been iLBC<br><br>----<br><br>2007-06-09 13:03:43 [DEBUG] sofia.c:1028 sofia_handle_sip_i_state() Remote SDP:<br>v=0<br>o=root 12720 12720 IN IP4 67.55.159.156<br>s=session<br>c=IN IP4 67.55.159.156<br>t=0 0<br>m=audio 12104 RTP/AVP 0 8 3 111 5 10 7 97 18 101<br>a=rtpmap:0 PCMU/8000<br>a=rtpmap:8 PCMA/8000<br>a=rtpmap:3 GSM/8000<br>a=rtpmap:111 G726-32/8000<br>a=rtpmap:5 DVI4/8000<br>a=rtpmap:10 L16/8000<br>a=rtpmap:7 LPC/8000<br>a=rtpmap:97 iLBC/8000<br>a=rtpmap:18 G729/8000<br>a=fmtp:18 annexb=no<br>a=rtpmap:101 telephone-event/8000<br>a=fmtp:101 0-16<br>a=silenceSupp:off - - - -<br><br>2007-06-09 13:03:43 [DEBUG] sofia_glue.c:1157 sofia_glue_negotiate_sdp() Audio Codec Compare [PCMU:0:8000]/[speex:98:8000]<br>2007-06-09 13:03:43 [DEBUG] sofia_glue.c:1157 sofia_glue_negotiate_sdp() Audio Codec Compare
 [PCMU:0:8000]/[iLBC:97:8000]<br>2007-06-09 13:03:43 [DEBUG] sofia_glue.c:1157 sofia_glue_negotiate_sdp() Audio Codec Compare [PCMU:0:8000]/[GSM:3:8000]<br>2007-06-09 13:03:43 [DEBUG] sofia_glue.c:1157 sofia_glue_negotiate_sdp() Audio Codec Compare [PCMU:0:8000]/[PCMA:8:8000]<br>2007-06-09 13:03:43 [DEBUG] sofia_glue.c:1157 sofia_glue_negotiate_sdp() Audio Codec Compare [PCMU:0:8000]/[PCMU:0:8000]<br>2007-06-09 13:03:43 [DEBUG] sofia_glue.c:817 sofia_glue_tech_set_codec() Set Codec sofia/profile1/8572337508@67.55.159.156:5060 PCMU/8000 20 ms<br><br>_______________________________________________<br>Freeswitch-users mailing list<br>Freeswitch-users@lists.freeswitch.org<br><a target="_blank" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a target="_blank"
 href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a target="_blank" href="http://www.freeswitch.org">http://www.freeswitch.org</a><br></div></div><br></div></div><br>
      <hr size=1>You snooze, you lose. <a href="http://us.rd.yahoo.com/evt=47959/*http://advision.webevents.yahoo.com/mailbeta/newmail_html.html">Get messages ASAP with AutoCheck</a><br> 
in the all-new Yahoo! Mail Beta. </body></html>