RE: [reSIProcate] SDP Contents not getting created.....
- From: "Leon Thrane" <leon@xxxxxxxxxx>
- Date: Sat, 10 Dec 2005 09:35:35 -0500
Instead of creating your SDP contents through ASCII manipulation use the
classes and methods defined in SdpContents.hxx.
For example to prepare a minimal SDP offer:
UInt64 sessionId = time (0); // note that this really should be an NTP time
value
SdpContents::Session::Origin sdpOrigin ("-", sessionId, sessionId,
SdpContents::IP4, <ip-address>);
SdpContents::Session sdpSession(0, sdpOrigin , "-");
sdpSession.connection () = SdpContents::Session::Connection
(SdpContents::IP4, <ip-address>);
sdpSession.addTime (SdpContents::Session::Time (0, 0));
SdpContents::Session::Medium sdpMedium ("audio", 10000, 0, "RTP/AVP");
sdpMedium.addCodec (SdpContents::Session::Codec::ULaw_8000);
sdpSession.addMedium (sdpMedium);
SdpContents sdpOffer;
sdpOffer.session () = sdpSession;
DISCLAIMER: Note that this is written "freehand" and may/may not compile (or
even do the right thing) and really is to serve as an example of
manipulating SDP using the classes/methods defined in SdpContents.hxx rather
than working code. If you don't understand the parameters that go into the
various functions and constructors above you _have_ to read RFC2327 - I can
not act as a tutor for SDP in general. In other words, I have no inclination
to "support" the above.
-----Original Message-----
From: resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx
[mailto:resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of John
Draper
Sent: Saturday, December 10, 2005 5:58 AM
To: Alan Hawrylyshen; resiprocate-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [reSIProcate] SDP Contents not getting created.....
Alan Hawrylyshen wrote:
> On 12/9/05 3:56 PM, "John Draper" <jdcrunchman@xxxxxxxxxxxxxxxx> wrote:
>
> Alan Hawrylyshen wrote:
> [snip]
>
> John;
> I've asked you to use the list and refrain from personal e-mail unless
> to topic is personal.
The topic was personal. I may have replied to it improperly, sorry.
Sometimes, when
I "reply all" it only sends to the original sender. It happens every once
in a while.
This one is going out to the list as you requested because it relates to my
"SIP"
problem.
>
> - Don't build SDP as ASCII, use the API in the SdpContents class.
I would if I knew how, or could find some example code that does this.
I did find
the BasicCall.cxx code, but I couldn't figure out how to use %s string
substitution,
and had asked list people this very question, but got no volunteers to
tell me how,
so I'm stumbling along trying things until I get it right.
> - Just because a test driver messes around with ASCII to SdpContents
> conversion doesn't mean it's a good idea.
I'm sure it isn't, I just don't know better because I haven't found out
how to do things, so I'm having
to do a lot of experimenting, and am now (FINALLY) able to break the
program at key places with the source level
debugger and examine data. I just recently got to this level of
progress, and it's now made it a lot easier for me to analyse whats
going on.
For instance, in my application, my recipient has a SIP address
pointing to a domain that is NOT
the SIP server. They (my company) are not using DNS SRV, but I figured
out that I can
do this.... to.param(p_maddr) = "213.167.79.25"; to force it to use
this IP as the SIP
server I want. I don't know if this is the "proper" way to do this,
but it does work,
and I'm sending out the proper INVITE message and it goes to the right
server, but when
I ommitted this statement, it went to our web site, because the code tried
to resolve the "domain.com" domain name, which pointed to their web
server, which
obviously not where I want to sent the INVITE request.
If you've read my earlier postings, you'll see my asking for the proper
way to do this.
> - Read the Data class definition, it covers Data manipulation (which
> you almost never need) adequately.
I have.... over and over. But I couldn't figure out how to specify
string substitution
by inserting an IP address into a %s format using the construct in the
BasicCall.cxx.
Care to tell me how? I would like to code this properly of course...
I only did it that
way because I couldn't think of any other way to do it. The test code
does not need
to do string substitution like I do.
For some reason Thunderbird says this message has strange characters and
won't let
me send this... I edited out the chinese character in my subject line,
and trying to send
this again.
John
_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxxxxxx
https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel