Skip to content

Workshop 2.1: SIP transaction time outs

Gittermans edited this page Dec 7, 2013 · 1 revision

In workshop 2 we focussed on SIP transactions. I explained you why, you have to use them, and how that's done in Hallo. In this workshop I'm going to prove you that client transactions actually do retransmit the request, as long as the response is not received. The retransmission of the request by the (client) transaction, is not done endlessly. RFC 3261 dictates, that after, 32*T1, the transaction, will stop retransmitting, and go into Time-out (T1 defaults to 500 ms). How this happens in Hallo, is what i'm going to demonstrate:

Start coding...

This time, in our ISipListener ProcessRequest method, we are not going to send a response back to the client, so as to keep the client retransmitting the request. What we will do, is write out a trace message to the console. The same thing goes for the ProcessTimeOut method. Running the workshop, will prove that requests are indeed retransmitted, and that after 32 seconds, a timeout will happen in the stack, and be deliver up to the level of the ISipListener.

        public void ProcessTimeOut(SipTimeOutEvent timeOutEvent)
        {
            Console.WriteLine("Received timeout for request '{0}' on {1}", timeOutEvent.Request.CSeq.Command, DateTime.Now.ToString("hh:mm:ss"));
        }

        public void ProcessRequest(SipRequestEvent requestEvent)
        {
            Console.WriteLine("Received '{0}' request on {1}", requestEvent.Request.CSeq.Command, DateTime.Now.ToString("hh:mm:ss"));

            requestEvent.IsSent = true;
        }

The output

When the workshop is run, you should see this