Hi,
On Thu, 25 May 2006, Legostayev Denis wrote:
1) I have study ssc_sip.c in sofsip_cli, but still have some questions
regarding common codec selection:
[...]
In that example we don't have one single finall point at which we have
common negotiated codecs, especially if offer contain more than one codec.
yes, that's true. Sofsip-cli code is simplified as the client only
supports one codec. So if the remote side accepts the call, we always know
we have a common codec.
But, but, basicly whenever 'r_sdp' is available, at least one round of
offer-answers has been completed.
How should it look if we have only one codec per call, that should be
started in one of mode (PCMU, PCMA, G.723, etc...) only after we have got a
finally negotiated SDP?
Now the code doesn't necessarily look much different, as it's perfecly
normal for SIP calls to have multiple codecs, and also, to have different
sets of codecs in different directions. See for example the SDP O/A
examples document:
- http://www.faqs.org/rfcs/rfc4317.html
If you require negotiation down to a single codec (both sides use the same
codec for sending), then you basicly need multiple rounds of offers (which
is also supported by sofia-sip). See the docs at:
- http://sofia-sip.sourceforge.net/refdocs/nua/pages.html
- http://sofia-sip.sourceforge.net/refdocs/soa/soa_sdp_oa_use_cases.html
- http://sofia-sip.sourceforge.net/refdocs/soa/
So the cases #4-6 in SOA use-cases.
You can use the SOATAG_RTP_SELECT() tag to define how the stack reacts to
incoming offers (we can then answer that we only support one codec,
forcing the other side to select only one as well), and when sending an
updated offer. But of course, this doesn't quite work if we are the one
sending the initial offer, as we cannot beforehand know which of the
codecs we support, to put in our offer (... unless we support only one
like sofsip-cli).
if ( answer_sent ) /* we should use result in l_sdp */;
if ( answer_recv ) /*we should use result in r_sdp */;
As the send and receive codecs might be different (although as per
RFC3264, there has to be at least one common codec, but participants can
include additional codecs in their offer/answers), you should always use
r_sdp to select which codec to use for sending (and where to send the RTP
packets), and l_sdp to configure your stack for receiving RTP.
2) Some another question. Is SOATAG_RTP_SELECT(x) functional in current
Sofia-SIP version? In my application i am trying to use
SOATAG_USER_SDP_STR("v=0\nm=audio 5004 RTP/AVP 8 0\na=rtpmap:8
PCMA/8000\na=rtpmap:0 PCMU/8000") with nua_create and SOATAG_RTP_SELECT(1)
with nua_set_params. But when answer is sent to another endpoint (which have
offered both PCMA and PCMU in INVITE), it contain only one common codec
(PCMA). (Same results with SOATAG_RTP_SELECT(2)).
Hmm, that sounds like a bug. Just to be sure, try passing the
SOATAG_USER_SDP_STR() directly to nua_respond(). If it doesn't work, could
you provide a log taken with "TPORT_LOG=1 ./yourapp"...?
3) What purpose of SOATAG_CAPS_SDP? How it relate with SOATAG_USER_SDP,
SOATAG_REMOTE_SDP and SOATAG_LOCAL_SDP?
That defines the static capabilities reported by the user-agent (which
media types and codecs). For example, if someone sends you an OPTIONS
request, the SDP set by SOATAG_CAPS_SDP is sent in the reply to OPTIONS.
AFAIK, very few clients use this functionality, but in theory you could
query the remote caps using OPTIONS before sending an INVITE.
--
under work: Sofia-SIP at http://sofia-sip.sf.net
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Sofia-sip-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel