[Asterisk-java-users] Call transfer
Brought to you by:
srt
From: Daniele R. <dan...@gm...> - 2013-06-18 13:46:48
|
Hi, I'm doing a particular thing with Asterisk-Java. I'm do an automatic call as this: if (asteriskServer.getManagerConnection().getState() == ManagerConnectionState.CONNECTED) { OriginateAction action = createAction(telefonata); action.setActionId("" + telefonata.getId()); try { telefonata.onCreate(); asteriskServer.originateAsync(action, new MyOriginateCallback(telefonata)); } catch (ManagerCommunicationException e) { log.error(telefonata.getId() + " ha generato un errore", e); telefonata.onFailure(); } } I've a my originatecallback that update the status of the call: channel.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getSource() instanceof AsteriskChannel) { if (channel.getState() == ChannelState.HUNGUP) { .. .. when the calls is originated it go to this dialplan: [test] exten => s,1,Set(dir=test) exten => s,n,Answer() exten => s,n(inizio),Background(custom/${dir}/intro) exten => s,n,WaitExten(10) exten => 3,1,Playback(custom//trasferimento) exten => 3,n,Goto(3902123456,1) exten => 3,n,Hangup() exten =>_X.,1,Dial(SIP/provider/3902123456) exten =>_X.,n(hangup),Hangup() So the call go to the user, the user respond and then when he press the key 3 the call should be transfer. All works fine but unfortunally the original call don't receive the HANGUP event. So in my app the call remains in the DIALING state. Instead if the user don't press the key the HANGUP event arrives correctly. I'm doing something wrong? Thanks -- Daniele Renda |