[reSIProcate] SDP Contents not getting created.....
John Draper
lists at webcrunchers.com
Sat Dec 10 14:00:25 CST 2005
Alan Hawrylyshen wrote:
>
> On 2005.12.10, at 02:57 , John Draper wrote:
>
>>
>>
>>>
>>> - 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.
>>
>
>
> testSdp.cxx --
> sdp.session().connection().getAddress() = Data("10.1.1.1");
> etc.
>
>>> - 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.
>>
>
> Because %foo is a C-ism and this stack is C++. Learn how to use
> std::string, resip::Data is quite similar in many ways.
>
>> 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.
>>
>
> You don't either -- see testSdp.cxx or SdpContents for the methods /
> etc.
It took me a long time to find this, thanx for the tip. Did I reply
the correct way
this time? Sometimes my "reply all" doesn't work on certain messages.
John
John
More information about the resiprocate-devel
mailing list