Re: [Asterisk-java-users] Channel extraction.
Brought to you by:
srt
From: Stefan R. <sr...@re...> - 2005-12-12 22:30:26
|
hmm here this stuff works. did you call initialize() in AsteriskManager? what i do is sth like: managerConnection =3D new DefaultManagerConnection(); managerConnection.setHostname("10.13.0.55"); managerConnection.setUsername("manager"); managerConnection.setPassword("pa55w0rd"); manager =3D new DefaultAsteriskManager(); manager.setManagerConnection(managerConnection); manager.initialize(); ... =3DStefan On Mon, 2005-12-12 at 15:27 +0200, Jan du Toit wrote: > To reproduce the problem, here is the relevant code snippet: > Originate org; > Call call; > //login... > managerConnection.login(); >=20 > org =3D 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)); =20 > =20 > call =3D this.asteriskManager.originateCall(org); > str +=3D "CALL:"+call.getChannel()+"\n"; //this returns null > str +=3D "ID:"+call.getUniqueId()+"\n"; //this seems to return > the ID correctly. > =20 > Channel ch =3D > (this.asteriskManager).getChannelById(call.getUniqueId()); > if(ch !=3D null) > str +=3D ch.toString(); > else > str +=3D "Channel is NULL"; //it is null > =20 > //try to see all the active channels... > str +=3D "Channels mappings\n"; > Map c =3D this.asteriskManager.getChannels(); > Collection channels =3D c.values(); > str +=3D "# of active channels:"+channels.size()+"\n"; > //this is always 0, showing it is empty. > for(Object cc : channels) { > str +=3D "channel:"+cc.toString()+"\n"; > } =20 >=20 > //logoff =20 > managerConnection.logoff(); > ... >=20 > 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:( >=20 > 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. >=20 >=20 > Stefan Reuter wrote:=20 > > Jan du Toit schrieb: > > =20 > > > The asteriskManager.getChannels(), is it suppose to show all the acti= ve > > > channels on the asterisk server or just those that we originated usin= g > > > Asterisk-Java? > > > =20 > >=20 > > 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) > >=20 > > =20 > > > asteriskManager.getChannels() is empty even if their is active channe= ls > > > open on the relevant asterisk server at the time of qeuring. > > > =20 > >=20 > > this is certainly not correct. > > =20 >=20 >=20 > --=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > Jan Gerryt du Toit > Software Developer > DecisionWorx > Cell : +27721769536 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D |