drachtio-server icon indicating copy to clipboard operation
drachtio-server copied to clipboard

How to set SIP Timer C?

Open calvet27 opened this issue 5 years ago • 28 comments

Dear Sir,

I checked current timers configuration, But there no timer for SIP Timer C. How could I set this via drachtio,.conf.xml?

Best Regards, Jihyun Yu

calvet27 avatar Aug 07 '20 10:08 calvet27

Good question. I am not sure whether the sofia stack exposes a configuration setting for timer C. I will check.

So you are referring to a scenario where drachtio server is acting as a sip proxy, correct?

davehorton avatar Aug 07 '20 11:08 davehorton

Good question. I am not sure whether the sofia stack exposes a configuration setting for timer C. I will check.

So you are referring to a scenario where drachtio server is acting as a sip proxy, correct?

Yes. I'm using drachtio server as a sip proxy (gateway) for webrtc. Please let me know the results of setting Timer C.

calvet27 avatar Aug 10 '20 02:08 calvet27

Is there any update?

calvet27 avatar Aug 18 '20 04:08 calvet27

Yes, I have looked at the code and recalled that I actually set timer C (good news). It is not currently exposed through a configuration variable, though that could be done.

However, this section of RFC 3261 seems pretty explicit about its duration:

11. Set timer C

         In order to handle the case where an INVITE request never
         generates a final response, the TU uses a timer which is called
         timer C.  Timer C MUST be set for each client transaction when
         an INVITE request is proxied.  The timer MUST be larger than 3
         minutes.

I presume you want to set it shorter than 3 minutes, which would violate the spec. Why do you need a shorter duration - i.e. what is your use case?

davehorton avatar Aug 18 '20 11:08 davehorton

Yes, I have looked at the code and recalled that I actually set timer C (good news). It is not currently exposed through a configuration variable, though that could be done.

However, this section of RFC 3261 seems pretty explicit about its duration:

11. Set timer C

         In order to handle the case where an INVITE request never
         generates a final response, the TU uses a timer which is called
         timer C.  Timer C MUST be set for each client transaction when
         an INVITE request is proxied.  The timer MUST be larger than 3
         minutes.

I presume you want to set it shorter than 3 minutes, which would violate the spec. Why do you need a shorter duration - i.e. what is your use case?

Thanks for updating me. Actually, I have to increase Timer C value up to 1 hour to meet our customer's requirement. The shorter value is not my focus. Please let me know the way to set Timer C value through the configuration.

Many Thanks.

calvet27 avatar Aug 19 '20 02:08 calvet27

I will look into making it configurable

davehorton avatar Aug 20 '20 11:08 davehorton

Ok. Thanks. I will wait for your update.

calvet27 avatar Aug 24 '20 04:08 calvet27

Any update here?

calvet27 avatar Aug 31 '20 11:08 calvet27

I will try to test out this change this week, if possible. I have not prioritized it highly because your use case seems unlikely to be of general interest.

davehorton avatar Aug 31 '20 11:08 davehorton

I have pushed a branch called 'timerc-proxy', can you test this there?

You can set a timer C value in the config, command-line or env vars. This will only apply to proxy processing, not B2BUA. The value is in units of seconds, and MUST be greater than 180.

For instance, to set timer c to 5 minutes:

via config file:

<sip>
   <proxy-timer-c>300</proxy-timer-c>

</sip>

via command line:

drachtio --proxy-timer-c 300

via env:

DRACHTIO_PROXY_TIMER_C=300 drachtio

Could you please test and let me know the results?

davehorton avatar Sep 01 '20 22:09 davehorton

Many thanks for your support. But I use Drachtio sip server within Docker. Please let me know what the image I have to use for test 'timerc-proxy'.

calvet27 avatar Sep 02 '20 05:09 calvet27

docker pull drachtio/drachtio-server:timerc-proxy

davehorton avatar Sep 02 '20 12:09 davehorton

Sorry to late reply. I checked the results of setting timer C as 3600 secs with above docker image, But it does not work. The call is canceled by default value 180 secs. Please double checked it.

image

You can see that above lines show configured value is set into drachtio,

image

But sofia does not get that value and then set it 180 sec as a default.

calvet27 avatar Oct 07 '20 10:10 calvet27

Is there any update?

calvet27 avatar Oct 15 '20 05:10 calvet27

Is there any update yet?

calvet27 avatar Nov 05 '20 04:11 calvet27

sorry, will get a fix out today/tomorrow

davehorton avatar Nov 05 '20 12:11 davehorton

Thanks. When can I get the fixed docker image?

calvet27 avatar Nov 11 '20 02:11 calvet27

When can I get the fixed docker image?

calvet27 avatar Nov 16 '20 01:11 calvet27

I just pushed a commit and docker image is building now. I tested with a timerC value of 300 seconds (5 mins) and it worked for me.

Sorry for the delay on this.

davehorton avatar Nov 21 '20 17:11 davehorton

ok docker image is available, please retest and let me know the results.

davehorton avatar Nov 21 '20 21:11 davehorton

Thx. The tag name of the image is same?

calvet27 avatar Nov 23 '20 05:11 calvet27

I tried to rest with the new image at same tag, timerc-proxy. But it is not worked with the timer C value 3600 seconds.

calvet27 avatar Nov 23 '20 07:11 calvet27

Strange because it worked for me. Can you share a complete drachtio log with loglevel = debug and sofia loglevel 9

davehorton avatar Nov 23 '20 12:11 davehorton

Ok. Please check the attached text file.

drachtio_timerc_proxy_20201124.txt

calvet27 avatar Nov 24 '20 08:11 calvet27

Uh, I don't see any call being proxied in that log. I see an outbound INVITE sent as a UAC, which is different.

timer C only applies to proxies

davehorton avatar Nov 24 '20 12:11 davehorton

Attached log describes that 1 UAC and 1 UAS with different call id respectively at same drachtio server. So is there no way to resolve this in that case?

calvet27 avatar Nov 25 '20 07:11 calvet27

timer C specifically and only applies to proxy transactions:

https://tools.ietf.org/html/rfc3261#page-265

And per your request, that is what I have done. This means that it will be triggered when an app uses srf.proxyRequest

So now you are telling me you are not proxying the request ??

davehorton avatar Nov 25 '20 12:11 davehorton

I do not use srf.proxyRequest. I use both srf.createUAC and srf.createUAS.

So I want to make the inbound call cannot be canceled by Drachtio itself at the short time, 3mins. And I want to set that ringing timer(i.e. no-answer wait timer) via Draachtio's configuration up to 1 hour. Is it possible?

calvet27 avatar Nov 26 '20 07:11 calvet27