usnistgov / jsip

JSIP: Java SIP specification Reference Implementation (moved from java.net)
Other
285 stars 129 forks source link

Need for an ability to know whether a SipMessage is Retransmitted (SipRequest or SipResponse) and log the sip message #79

Open mahilion opened 2 years ago

mahilion commented 2 years ago

Today the JAIN stack does the request retransmissions (incase of SipClientTransactions) and also the response retransmissions (incase of SipServerTransactions).

It would be nice to have whether the request / response is retransmitted in the SipMessage object. and also log the message.

This helps for the application to keep track of retransmissions in log messages.

Thanks Mahesh N

vladimirralev commented 2 years ago

Without retransmissions it probably can't be called a transaction anymore, so it would no longer be a transactional FSM. I think the Valve API can work for you. It skips dialog and transaction statefullness and you are responsible for all state and re-transmissions. Check this example:

https://github.com/usnistgov/jsip/blob/master/src/test/unit/gov/nist/javax/sip/stack/SIPMessageValveTest.java

and this is the example handler:

https://github.com/usnistgov/jsip/blob/master/src/test/unit/gov/nist/javax/sip/stack/SIPMessageValveImpl.java

mahilion commented 2 years ago

I was talking about the outgoing request and responses from JAIN stack. For example: when JAIN creates a clientTransaction to send a request to an UAS (User Agent Server). if the UAS is not responding , the JAIN tries to send a retransmission for few times until a TIMEOUT is reached. So these requests which are sent as part of retransmission timer , can they marked in the ServerLogger ?

Same argument for the responses sent out of JAIN stack when it has created ServerTransaction to an UAC (User Agent Client).