Java agi api call delay

I was asked to develope a application that could originate a call by asterisk.
After searching, I found asterisk-java(https://github.com/asterisk-java/asterisk-java) ,then I finished and tested the application. It’s ok.
But now, originating by the application, there’s a delay problem, after 10 or 15 seconds, extension just started ringing.
I used org.asteriskjava.manager.action.OriginateAction api.
Please give any suggestion, thanks in advanced.

Would starting an Asterisk console with:

sudo asterisk -T -d -d -d -d -d -d -r -v -v -v -v -v -v

yield any clues as to where the delay is?

thanks, I’ll try it.

I monitor the asterisk logs by asterisk -T -d -d -d -d -d -d -r -v -v -v -v -v -v.
When a delay occurs,the console loops to print information below until extension gets through.
Could you help me? thanks.

[2018-10-20 09:48:03] DEBUG[10535][C-00000354]: audiohook.c:328 audiohook_read_frame_both: Failed to get 160 samples from write factory 0x7ff308014c58
[2018-10-20 09:48:03] DEBUG[10535][C-00000354]: audiohook.c:275 audiohook_read_frame_both: Read factory 0x7ff308014018 and write factory 0x7ff308014c58 both fail to provide 160 samples