Hi,
I am trying to forward REGISTER messages as a SIP proxy would do with none (or minimal) message modifications using reSIProcate.
I am looking for the easiest way possible to achieve this.
What I am trying right now - not sure if this is the best - is the following:
1.- Register my DialogUsageManager object for ServerRegistration and ClientRegistration handlers.
2.- Set dummy ClientAuthManager and RegistrationPersistenceManager on same DialogUsageManager object.
3.- When receiving a new REGISTER message on ServerRegistrationHandler::onRefresh(...), call makeRegistration with a new target to create a new REGISTER message, modify the new message created to look like the original message just received and save the associated ServerRegistration on some private data map with callId being the key so we can retrieve it later.
4.- When receiving the response to the REGISTER message sent by us on ClientRegistrationHandler::onSuccess (or onFailure, I guess), retrieve the saved ServerRegistration object on previous step, and call accept/reject with corresponding status code received.
Problem with this approach, is that modifying new message to look like received message on step 3 might become a difficult task, specially if unexpected headers are found on the received message (not sure if this is a real problem), and also, on step 4 if the response has some contacts contained in it (or any extra headers for that matter), I would need to find a way to copy them over to the new response just generated, and since I don't get access to the response message (everything is done internally on ServerRegistration object) I can't modify it myself as I would like.
So, do you have any suggestions on how I could achieve what I want to do the easiest way possible, or if I am on the right track doing what I am doing right now?
Regards,
Jorge Bustamante