[Asterisk-java-devel] timoute on sending actions ...
Brought to you by:
srt
From: Daniel G. <da...@gr...> - 2007-02-15 15:33:42
|
Hi Stefan, do you know why these lines of code throws TimeoutException all the time ? try { ManagerResponse re = serverImpl.getManagerConnection().sendAction(new QueueStatusAction()); }catch (TimeoutException e) { log.warn("timeout on queue status action", e); } catch (IOException e) { log.error("communication problem", e); return; } I laso did try to send the action via sendEventGeneratingAction as it is done in org.asteriskjava.live.internal.QueueManager#initialize but I still receive the timeoute, even if the events are correctly sent by asterisk, so the action has been also received by asterisk. I am using asterisk 1.4. So in this first case it is ok, because i know the bug ... but here ... as you suggested to me in a previous thread I just want to see if i receive the peer context ... i also receive the TimeoutException. Whatever i do, event setting the timeout to 20 seconds ... there is no help. CommandAction act = new CommandAction("sip show peer "+event.getObjectName()); CommandResponse response = (CommandResponse) serverImpl.getManagerConnection().sendAction(act,15000); for (String line : response.getResult()){ System.out.println("RESP : "+line); } Do you know for what reason? Everything else is fine but sending any actions cause a TimeoutException. Another example is this also ... OriginateAction o = new OriginateAction(); o.setContext(context.getOutgoingContext()); o.setCallerId(from); o.setChannel("SIP/"+from); o.setExten(to); o.setPriority(1); //o.setTimeout(new Long(30000)); ManagerResponse resp = null; try { resp = serverImpl.getManagerConnection().sendAction(o); } catch (TimeoutException e) { //FIXME : there is a problem with timeout log.warn("Timeout for call from " + from + " to " + to+". Message : "+e.getMessage()); //return ""; } catch (IOException e) { e.printStackTrace(); log.error("dial error : server communication",e); return "dial error : server communication"; } Regards, Daniel |