Re: [Asterisk-java-users] Channel extraction.
Brought to you by:
srt
From: Jan du T. <jan...@de...> - 2005-12-12 13:29:01
|
To reproduce the problem, here is the relevant code snippet: Originate org; Call call; //login... managerConnection.login(); org = new Originate(); org.setCallerId("JanDT"); org.setChannel("SIP/Jan"); org.setContext("sgs"); org.setExten(getExtensionNumber()); //this is just the number which we want to dial. org.setPriority(new Integer(1)); org.setTimeout(new Long(30000)); call = this.asteriskManager.originateCall(org); str += "CALL:"+call.getChannel()+"\n"; //this returns null str += "ID:"+call.getUniqueId()+"\n"; //this seems to return the ID correctly. Channel ch = (this.asteriskManager).getChannelById(call.getUniqueId()); if(ch != null) str += ch.toString(); else str += "Channel is NULL"; //it is null //try to see all the active channels... str += "Channels mappings\n"; Map c = this.asteriskManager.getChannels(); Collection channels = c.values(); str += "# of active channels:"+channels.size()+"\n"; //this is always 0, showing it is empty. for(Object cc : channels) { str += "channel:"+cc.toString()+"\n"; } //logoff managerConnection.logoff(); ... It is a 1.2 version. I have now quick way to check if this problem occurs on 1.0x vesrions either than by installing one:( Too give you some good news if you inject the HangupAction with a correct channel id (eg SIP\Jan-random#), which I got from the asterisk show channels command, it works correctly. Stefan Reuter wrote: >Jan du Toit schrieb: > > >>The asteriskManager.getChannels(), is it suppose to show all the active >>channels on the asterisk server or just those that we originated using >>Asterisk-Java? >> >> > >it is supposed to return all active calls regardless who created them. >i must try to reproduce this problem... does it happen with other >versions of asterisk, too? (i.e. 1.0.x or 1.2.0) > > > >>asteriskManager.getChannels() is empty even if their is active channels >>open on the relevant asterisk server at the time of qeuring. >> >> > >this is certainly not correct. > > -- ============================ Jan Gerryt du Toit Software Developer DecisionWorx Cell : +27721769536 ============================ |