[Asterisk-java-users] Originate and NoSuchChannelException
Brought to you by:
srt
From: Daniele R. <dan...@gm...> - 2014-02-07 15:00:40
|
Hi, I've a very strange behaviour on OriginateAction using the code I'm yet using in another application where works fine. I create a OriginateAction: OriginateAction action = new OriginateAction(); action.setChannel("SIP/provider/39123456"); action.setContext("test"); action.setExten("s"); action.setPriority(1); action.setCallerId(callerId); action.setTimeout(asteriskTimeout); asteriskServer.originateAsync(action, new MyOriginateCallback(call)); When it try to make the call he return always this exception: 07/02/2014 15:51:30 ERROR AsteriskManager:349 - OnFailure(...)' telefonata #1 07/02/2014 15:51:30 ERROR AsteriskManager:350 - org.asteriskjava.live.NoSuchChannelException: Channel 'SIP/provider/39123456' is not available at org.asteriskjava.live.internal.AsteriskServerImpl.handleOriginateEvent(AsteriskServerImpl.java:1116) at org.asteriskjava.live.internal.AsteriskServerImpl.onManagerEvent(AsteriskServerImpl.java:1004) at org.asteriskjava.manager.ManagerEventListenerProxy$1.run(ManagerEventListenerProxy.java:77) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Using Asterisk's cli: channel originate SIP/provider/39123456 extension s@test instead all works fine!! The other class that works is using the same asterisk machine. So I think that is not a problem of Asterisk. The only difference from the two callses if that this new one is managed directly from spring: @Component public class AsteriskManager { @PostConstruct public void start() { log.info("Avvio di AsteriskManager..."); try { ManagerConnectionFactory factory = new ManagerConnectionFactory(host, port, username, password); this.managerConnection = factory.createManagerConnection(); asteriskServer = new DefaultAsteriskServer(managerConnection); asteriskServer.initialize(); log.info("Creata connessione al server Asterisk, stato connessione: " + managerConnection.getState()); } catch (Exception e) { log.error("", e); } } I'm using this in my pom.xml <dependency> <groupId>org.asteriskjava</groupId> <artifactId>asterisk-java</artifactId> <version>1.0.0.M3</version> </dependency> I hope in your suggestion. Thanks -- Daniele Renda |