< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [reSIProcate] other unknown header field


Actually, I just noticed that you manually editted the HeaderHash.cxx
file - that is correct.  This file is generated automatically from the
.gperf file.  I highly recommend you just use ExtentionHeaders for
your purpose.

https://www.resiprocate.org/Use_Overview#Extension_Header

Scott

On Tue, Nov 24, 2009 at 1:13 PM, Scott Godin <sgodin@xxxxxxxxxxxxxxx> wrote:
> For #1 - You should probably just configure the PJSIP client the use
> STUN, then it will send it's public IP in the contact header, when it
> registers.
>
> For #2 - It would be easier for you to just use ExtentionHeaders, then
> no changes to resip are required at all.  BTW:  I don't see anything
> obvious missing from your steps below (if you are building on Windows
> then the gperf steps are manual).
> http://www.resiprocate.org/Adding_a_new_header
> https://www.resiprocate.org/Use_Overview#Extension_Header
>
> Scott
>
> On Mon, Nov 16, 2009 at 3:53 AM, xutm <xutom2006@xxxxxxxxx> wrote:
>> Hi all,
>>     I am using repro in resiprocate-1.4.1 as a SIP proxy server, and PJSIP
>> as a SIP Client. Now I have two problems:
>>
>> 1. Repro should run with a public IP address and PJSIP Client with a private
>> IP address after NATs. I found when accepting registration from PJSIP Client
>> , repro just save the Contact header field in the REGISTER packet into
>> InMemoryRegistrationDatabase, but the ip address in Contact Header field is
>> private IP address. So when repro receive an INVITE, it locate the callee in
>> LocationServer monkey and found the private IP address of the callee, then
>> it proxy the INVITE to the callee with its private IP address, but the
>> forseeable result is : the INVITE packet cannot reach to the callee. Now i
>> change the record in InMemoryRegistrationDatabase: call method
>> sip->getSource() and sip->getSource().getPort() to get the public IP and
>> port and save them into InMemoryRegistrationDatabase. So repro can
>> successfully proxy the INVITE to callee. Until now , after some test there
>> is no problem. But i am so sure. Can somebody show me the possible errors?
>> Think you!
>>
>> 2. support self-defined header:
>>
>> the SIP INVITE packet from PJSIP contains a self-defined header: TransType,
>> the sample SIP packet is following:
>>
>> INVITE sip:059188244006@xxxxxxxxxxxx:6060 SIP/2.0
>> Via: SIP/2.0/UDP
>> 191.168.17.32:5080;rport=1050;branch=z9hG4bKPje9971ef76dbb473ab43b9a5bc4676b5e;received=218.5.1.50
>> Max-Forwards: 70
>> Contact: <sip:059188244005@xxxxxxxxxxxxx:5080>
>> To: sip:059188244006@xxxxxxxxxxxx
>> From: sip:059188244005@xxxxxxxxxxxx;tag=bf1ceb05c3d94c9488ce712b11e86316
>> Call-ID: 6149f97f89614c9aa66ca5352570f740
>> CSeq: 1 INVITE
>> Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER,
>> MESSAGE, OPTIONS
>> Content-Type: application/sdp
>> Supported: eventlist
>> TransType: MSRPRelay
>> Content-Length: 184
>> ...
>>
>> and i modify the resip source code to support the h_TransType header field,
>> but unfortunately i fail. The following is my modification with the source
>> code:
>>
>> In the following files:
>> resip/stack/SipMessage.hxx :
>> resip/stack/SipMessage.cxx
>> resip/stack/Headers.hxx
>> resip/stack/Headers.cxx
>> resip/stack/HeaderTypes.hxx
>>
>> i add :
>>
>> defineHeader(TransType, "TransType", StringCategory, "RFC 3261");
>>
>> to define the Header TransType.
>>
>> in file:
>> resip/stack/HeaderHash.gperf
>>
>> i add:
>> transtype, Headers::TransType
>>
>> in file:
>> resip/stack/HeaderHash.cxx
>>
>> i add:
>> #line 115 "HeaderHash.gperf"
>>       {"transtype", Headers::TransType},
>>
>> I think i have done all the things. >From the log of repro, i can see the
>> SIP INVITE packet do contain the TransType header field, But when i call
>>
>>                 if (sip->exists(h_TransType)) {
>>                     DebugLog( << "the transtype is exist");
>>                 } else {
>>                     DebugLog( << "the transtype does not exist ...");
>>                 }
>>
>> in method TransactionState::processClientInvite , the log shows "the
>> transtype does not exist ...".
>>
>> Is there anything wrong?  Can somebody help me to solve it? Thinks in
>> advance!
>>
>> Best Regards,
>> xutm
>>
>>
>>
>> _______________________________________________
>> resiprocate-devel mailing list
>> resiprocate-devel@xxxxxxxxxxxxxxx
>> https://list.resiprocate.org/mailman/listinfo/resiprocate-devel
>>
>