[reSIProcate] other unknown header field
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@xxxxxxxxxxxxFrom:
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.hxxresip/stack/Headers.cxxresip/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::TransTypein 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