Re: [Asterisk-java-users] Transfer call to another extension
Brought to you by:
srt
From: Zoumana T. <zou...@gm...> - 2015-01-16 00:00:37
|
Hello, For 2) and 3) What is maybe wrong is the fact that you are trying to make an OriginalAction to an invalid channel name according to what is expected to Dial command triggered later. I explain a bit: entry.getChannel().getName() return something like SIP/200-0000001 the last part is generated by Asterisk. What is "Dialable" as channel for OriginateAction is the beginning SIP/200 that explains the message NoSuchChannelException. Also even you split that and set correctly to the action, i suppose that will trigger another line/channel from the same caller not just merge back to the current call. You can try it. Your try 1) seems to be the good way i would have done that. To debug more could you please share the Asterisk CLI logs when you run this ? Regards, Zoumana Le 15 janv. 2015 21:47, "Jorge" <gus...@gm...> a écrit : > Hi, > > I am would like to use Asterisk-Java to transfer a call that is in a > queue. > > The context is the next one. One call go to a queue so I detect the call > with onNewQueueEntry and check if it goes to my queue. If it goes after > doing several things I want to transfers it back to a extension. The main > idea is detecting a call, doing things that can´t be done through the > dialplan and give it back to the dialplan. > > As entry.getChannel has the channel that is in the queue I wanted to use > this channel to transfer to the desired extension. I have done several > attemps but nothing worked. > > public void onNewQueueEntry(final AsteriskQueueEntry entry) { > // Si está en la cola que estamos monitorizando, procesa > if(entry.getQueue().getName().equals(queueName)){ > > Dialplan > > [myCall] > exten => s,1,NoOp(myCall) > exten => s,n,Playback(es/digits/1) > exten => s,n,Return() > > 1) > Java-code > AtxferAction action = new AtxferAction(entry.getChannel().getName(), > "myCall", "s", 1); > ManagerResponse response = > Asterisk.getManagerConnection().sendAction(action); > > > > The answer is ok but nothing happens. > org.asteriskjava.manager.response.ManagerResponse: actionId='null'; > message='Atxfer successfully queued'; response='Success'; uniqueId='null'; > systemHashcode=1928471006 > > > 2) OriginateAction dial = new OriginateAction(); > // // Sets the name of the channel to connect to the > outgoing call. > dial.setChannel(entry.getChannel().getName()); > > // Sets the name of the context of the extension to > connect to. > dial.setContext("myCall"); > // Sets the extension to connect to > dial.setExten("s"); > dial.setPriority(1); > ManagerResponse response = > Asterisk.getManagerConnection().sendAction(dial); > It gives me org.asteriskjava.live.NoSuchChannelException:Channel is not > available > > 3) > Asterisk.getAsteriskServer().originateToApplication(entry.getChannel().getName()", > "myCall", "", 1000); > It gives me org.asteriskjava.live.NoSuchChannelException:Channel is not > available > > Could you let my know what I am doing wrong? > > Kind regards. > > > > ------------------------------------------------------------------------------ > New Year. New Location. New Benefits. New Data Center in Ashburn, VA. > GigeNET is offering a free month of service with a new server in Ashburn. > Choose from 2 high performing configs, both with 100TB of bandwidth. > Higher redundancy.Lower latency.Increased capacity.Completely compliant. > http://p.sf.net/sfu/gigenet > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > |