Hi Liviu,
I have tested the patch. Now I see the delay is 2 secs. i.e after 2
secs it sends the HTTP request out.
I suspect this 2000 ms delay is due to the below field:
long connection_timeout = 20;
Can we reduce this field to 5 or 10, so that it waits only half a
second or second to send the request out.
Let me know your thoughts on this.
Am seeing the below message in logs. Is everything working as you
expected?
rest_client:start_async_http_req: libcurl TCP connect: we should wait
up to 1ms (timeout=20000ms)!
Regards,
Agalya
*From:*Liviu Chircu [mailto:[email protected]]
*Sent:* Thursday, September 08, 2016 7:05 AM
*To:* Ramachandran, Agalya (Contractor)
<[email protected]>; Bogdan-Andrei Iancu
<[email protected]>; OpenSIPS users mailling list
<[email protected]>
*Subject:* Re: FW:[OpenSIPS-Users] Asynchronous operation for REST queries
Hi, Agalya!
Regarding the 10s delay problem, a fix was pushed to the development
branch [1]. If you are running on 2.1.4 git branch, could you please
pull the latest changes (git pull --rebase), and test it out? You can
import it with:
git cherry-pick -x 66c337cc
[1]:
https://github.com/OpenSIPS/opensips/commit/66c337cc89a2b5c3e1bbd78c289371efcda21886
Best regards,
Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com
On 07.09.2016 20:14, Ramachandran, Agalya (Contractor) wrote:
Hi team,
Any clue on this below topic would be a great. Am stuck with this
10 sec delay and couldn’t move further.
If I could be able to find the root cause and resolve this , then
only I can implement REST API calls as async.
Because this 10 sec delay is a huge time. Please help me on this.
Regards,
Agalya
*From:*Ramachandran, Agalya (Contractor)
*Sent:* Tuesday, August 30, 2016 10:13 AM
*To:* 'Liviu Chircu' <[email protected] <mailto:[email protected]>>
*Subject:* RE: FW: [OpenSIPS-Users] Asynchronous operation for
REST queries
Hi Liviu,
A clue for this 10 sec delay consumed by opensips before sending
the HTTP request, will be grateful for me. As far as I debugged
this delay is caused by curl library. But wondering what could be
the cause for this constant 10.25 sec delay.?
Please help me out in this.
Regards,
Agalya
*From:*Ramachandran, Agalya (Contractor)
*Sent:* Friday, August 26, 2016 2:29 PM
*To:* 'Liviu Chircu' <[email protected] <mailto:[email protected]>>
*Cc:* OpenSIPS users mailling list <[email protected]
<mailto:[email protected]>>
*Subject:* RE: FW: [OpenSIPS-Users] Asynchronous operation for
REST queries
Hi Liviu,
Here is the dump from the time when the socket is opened and when
the request sent out.
Highlighted in RED color. Any clue for this 10 sec delay?
*17:29:56.430379 IP6 sturn-test.novalocal.44797*>
destination.rtc.sys.comcast.net.webcache: Flags [S], seq
3356294440, win 28800, options [mss 1440,sackOK,TS val 3588300781
ecr 0,nop,wscale 7], length 0
0x0000: 6000 0000 0028 0640 2001 0558 fc0b 0100
`....([email protected] <mailto:[email protected]>....
0x0010: f816 3eff fed5 0bfe 2001 0558 fc11 0000
..>........X....
0x0020: f816 3eff fe11 d5aa aefd 1f90 c80c fd28
..>............(
0x0030: 0000 0000 a002 7080 90bb 0000 0204 05a0
......p.........
0x0040: 0402 080a d5e1 1fed 0000 0000 0103 0307
................
17:29:56.436526 IP6 destination.rtc.sys.comcast.net.webcache >
sturn-test.novalocal.44797: Flags [S.], seq 4065018495, ack
3356294441, win 28560, options [mss 1440,sackOK,TS val 1771678349
ecr 3588300781,nop,wscale 9], length 0
0x0000: 6000 0000 0028 063a 2001 0558 fc11 0000
`....(.:...X....
0x0010: f816 3eff fe11 d5aa 2001 0558 fc0b 0100
..>........X....
0x0020: f816 3eff fed5 0bfe 1f90 aefd f24b 427f
..>..........KB.
0x0030: c80c fd29 a012 6f90 755f 0000 0204 05a0
...)..o.u_......
0x0040: 0402 080a 6999 aa8d d5e1 1fed 0103 0309
....i...........
17:29:56.436575 IP6 sturn-test.novalocal.44797 >
destination.rtc.sys.comcast.net.webcache: Flags [.], ack 1, win
225, options [nop,nop,TS val 3588300787 ecr 1771678349], length 0
0x0000: 6000 0000 0020 0640 2001 0558 fc0b 0100
`[email protected]....
0x0010: f816 3eff fed5 0bfe 2001 0558 fc11 0000
..>........X....
0x0020: f816 3eff fe11 d5aa aefd 1f90 c80c fd29
..>............)
0x0030: f24b 4280 8010 00e1 90b3 0000 0101 080a
.KB.............
0x0040: d5e1 1ff3 6999 aa8d ....i...
*17:30:06.667279 IP6 sturn-test.novalocal.44797*>
destination.rtc.sys.comcast.net.webcache: Flags [P.], seq 1:681,
ack 1, win 225, options [nop,nop,TS val 3588311018 ecr
1771678349], length 680
PUT./RTCGSessionManager/rest/tel/session/createroom?uid=pp&[email protected]/1.1..Host:.tr-sm-as-a-001.rtc.sys.comcast.net:8080..Accept:.*/*..Conten
<mailto:PUT./RTCGSessionManager/rest/tel/session/createroom?uid=pp&[email protected]/1.1..Host:.tr-sm-as-a-001.rtc.sys.comcast.net:8080..Accept:.*/*..Conten>
t-Type:.application/json..Uid:.pp..serviceId:.tel..custguid:[email protected]
<mailto:t-Type:.application/json..Uid:.pp..serviceId:.tel..custguid:[email protected]>.
239...x-tracking-id:.820..X-Trace:[email protected]:.RTCGSM..x-client-name:.IMS
<mailto:239...x-tracking-id:.820..X-Trace:[email protected]:.RTCGSM..x-client-name:.IMS>
x-source-id:.OpenSIP..user-agent:.OpenSIPv1.11.3..device-id:[email protected]
<mailto:x-source-id:.OpenSIP..user-agent:.OpenSIPv1.11.3..device-id:[email protected]>.
239...Content-Length:.211....{"participantsInfo"
:["2155551212"],"callType":"audio","instanceId": "[email protected].
231.239.
<mailto:[email protected].%20231.239.>","fromUID":"pp","fromTN":"pp","isOpenSipRequest":true,"
displayName":"Call.From.IMS","deviceType":"Android/iOS/STB/IMS"}
17:30:06.672819 IP6 destination.rtc.sys.comcast.net.webcache >
sturn-test.novalocal.44797: Flags [.], ack 681, win 59, options
[nop,nop,TS val 1771688585 ecr 3588311018], length 0
0x0000: 6000 0000 0020 063a 2001 0558 fc11 0000
`......:...X....
0x0010: f816 3eff fe11 d5aa 2001 0558 fc0b 0100
..>........X....
0x0020: f816 3eff fed5 0bfe 1f90 aefd f24b 4280
..>..........KB.
0x0030: c80c ffd1 8010 003b c0cd 0000 0101 080a
.......;........
0x0040: 6999 d289 d5e1 47ea i.....G.
17:30:06.778978 IP6 destination.rtc.sys.comcast.net.webcache >
sturn-test.novalocal.44797: Flags [P.], seq 1:358, ack 681, win
59, options [nop,nop,TS val 1771688691 ecr 3588311018], length 357
0x0000: 6000 0000 0185 063a 2001 0558 fc11 0000
`......:...X....
0x0010: f816 3eff fe11 d5aa 2001 0558 fc0b 0100
..>........X....
0x0020: f816 3eff fed5 0bfe 1f90 aefd f24b 4280
..>..........KB.
0x0030: c80c ffd1 8018 003b 8583 0000 0101 080a
.......;........
0x0040: 6999 d2f3 d5e1 47ea 4854 5450 2f31 2e31
i.....G.HTTP/1.1
0x0050: 2032 3030 204f 4b0d 0a53 6572 7665 723a
.200.OK..Server:
…
Regards,
Agalya
*From:*Ramachandran, Agalya (Contractor)
*Sent:* Friday, August 26, 2016 12:01 PM
*To:* 'Liviu Chircu' <[email protected] <mailto:[email protected]>>
*Subject:* RE: FW: [OpenSIPS-Users] Asynchronous operation for
REST queries
Hi Liviu,
As I already emailed you, to contribute the source code there is
some approval process in our organization.
If that goes though I can contribute the REST PUT code.
But I have a question in async operation in opensips.
When a async mode REST API is called either POST/PUT, I see that
opensips waits for 10 sec of time and then only it sends out the
HTTP request out to the network.
Why there is a huge wait time of 10sec?
When I tried to debug, I found it is looping inside the below for
loop for long time in rest_methods.c file, (but all that looping
are taking same seconds, later 10 sec am getting HTTP response)
for (i = 0; i < busy_wait; i += check_time) {…..}
Wondering and interested to know about this delay time.
Please bear some of your timeJ. Thanks in advance.
Regards,
Agalya
*From:*Liviu Chircu [mailto:[email protected]]
*Sent:* Thursday, August 18, 2016 10:14 AM
*To:* Ramachandran, Agalya (Contractor)
<[email protected]
<mailto:[email protected]>>
*Subject:* Re: FW: [OpenSIPS-Users] Asynchronous operation for
REST queries
Hi Agalya,
I am very busy these days and cannot afford to troubleshoot random
problems with libcurl usage. Do you intend to open source the PUT
function by making a Pull Request, after we fix it? If yes, it
will definitely go up in my priority queue.
Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com