Re: [Asterisk-java-users] Originating calls
Brought to you by:
srt
From: Laurent S. <lau...@pr...> - 2005-10-07 09:20:37
|
Hello Stefan, First thank you for your quick answer. I had already done that: Call call = astManager.originateCall( origCall ); Channel ch = call.getChannel(); But the problem is that once the call has been established the the result return by the 'call.getChannel();' sentence is null. Using the debuger I saw that most of the fields of the 'Call ' objects are null. None of them allows me to make an association between the originateCall and the resultant call. Furthermore I tried to use the following method: public void displayChannels( AsteriskManager astManager ) { Map map = astManager.getChannels(); if( map.isEmpty() == true ) System.out.println( "The MAP is empty." ); System.out.println("Map content: " + map ); } ... but in my big surprise despite the fact that a call was established no calls were available in the list. Do you have any suggestions? Please find hereafter my configuration: - asterisk v1.0.9 - Asterisk-Java 0.2-rc1 For your question: Indeed I know that I could hangup the application inside the diaplan. But I want to keep the control logic at manager level in order to be able to add other commands as transfers, queueing ... Thanking you in advance, Laurent ----- Original Message ----- From: "Stefan Reuter" <sr...@re...> To: <ast...@li...> Sent: Thursday, October 06, 2005 9:42 PM Subject: Re: [Asterisk-java-users] Originating calls On Thu, 2005-10-06 at 17:37 +0200, Laurent Salagaras wrote: > Currently I am encoutering the following problem. I succeed > to login to Asterisk and initiate a call (both with the > OriginateAction > and with the originateCall method of AsteriskManager). > [...] > However in both methods I do not have as return value the identifier > of the call (or channel). > (e.g.: SIP/laurent-b7485# ) originateCall() in AsteriskManager returns a Call object. call.getChannel().getName() will return what you are looking for. But another question: Do you really need to hangup the call via the Manager API or wouldn't it be easier to just hang up after playing the sound file (via dialplan or AGI or whatever you use) =Stefan |