Re: [Asterisk-java-users] Transfer call to another extension
Brought to you by:
srt
From: Jorge <gus...@gm...> - 2015-01-16 07:35:50
|
Hi, Thank you very much for your answers. *Zoumana* 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 ? The most strange thing is that I don´t see any change in the cli . Here you have the log form log file. [Jan 16 08:23:00] VERBOSE[30650][C-0000002d] pbx.c: -- Executing [1200@ext-queues:2] Answer("DAHDI/i1/myTelephoneNumber-26", "") in new stack [Jan 16 08:23:00] VERBOSE[30650][C-0000002d] pbx.c: -- Executing [1200@ext-queues:3] Set("DAHDI/i1/myTelephoneNumber-26", "__BLKVM_OVERRIDE=BLKVM/1200/DAHDI/i1/myTelephoneNumber-26") in new stack [Jan 16 08:23:00] VERBOSE[30650][C-0000002d] pbx.c: -- Executing [1200@ext-queues:4] Set("DAHDI/i1/myTelephoneNumber-26", "__BLKVM_BASE=1200") in new stack [Jan 16 08:23:00] VERBOSE[30650][C-0000002d] pbx.c: -- Executing [1200@ext-queues:5] Set("DAHDI/i1/myTelephoneNumber-26", "DB(BLKVM/1200/DAHDI/i1/myTelephoneNumber-26)=TRUE") in new stack [Jan 16 08:23:00] VERBOSE[30650][C-0000002d] pbx.c: -- Executing [1200@ext-queues:6] ExecIf("DAHDI/i1/myTelephoneNumber-26", "1?Set(_DIAL_OPTIONS=trM(auto-blkvm))") in new stack [Jan 16 08:23:00] VERBOSE[30650][C-0000002d] pbx.c: -- Executing [1200@ext-queues:7] Set("DAHDI/i1/myTelephoneNumber-26", "__NODEST=1200") in new stack [Jan 16 08:23:00] VERBOSE[30650][C-0000002d] pbx.c: -- Executing [1200@ext-queues:8] Set("DAHDI/i1/myTelephoneNumber-26", "MONITOR_FILENAME=/var/spool/asterisk/monitor/q1200-20150116-082300-myServer-1421396580.53") in new stack [Jan 16 08:23:00] VERBOSE[30650][C-0000002d] pbx.c: -- Executing [1200@ext-queues:9] Set("DAHDI/i1/myTelephoneNumber-26", "__MOHCLASS=none") in new stack [Jan 16 08:23:00] VERBOSE[30650][C-0000002d] pbx.c: -- Executing [1200@ext-queues:10] Set("DAHDI/i1/myTelephoneNumber-26", "__CWIGNORE=TRUE") in new stack [Jan 16 08:23:00] VERBOSE[30650][C-0000002d] pbx.c: -- Executing [1200@ext-queues:11] Queue("DAHDI/i1/myTelephoneNumber-26", "1200,tn,,") in new stack [Jan 16 08:23:00] VERBOSE[30650][C-0000002d] res_musiconhold.c: -- Started music on hold, class 'none', on DAHDI/i1/myTelephoneNumber-26 [Jan 16 08:23:00] VERBOSE[30650][C-0000002d] res_musiconhold.c: -- Stopped music on hold on DAHDI/i1/myTelephoneNumber-26 [Jan 16 08:23:00] VERBOSE[30650][C-0000002d] app_queue.c: -- Hold time for 1200 is 0 minute(s) 0 seconds [Jan 16 08:23:00] VERBOSE[30650][C-0000002d] app_queue.c: -- Told DAHDI/i1/myTelephoneNumber-26 in 1200 their queue position (which was 1) [Jan 16 08:23:00] VERBOSE[30650][C-0000002d] file.c: -- <DAHDI/i1/myTelephoneNumber-26> Playing 'queue-thankyou.gsm' (language 'en') [Jan 16 08:23:01] VERBOSE[30650][C-0000002d] res_musiconhold.c: -- Started music on hold, class 'none', on DAHDI/i1/myTelephoneNumber-26 [Jan 16 08:23:01] WARNING[30650][C-0000002d] format_wav.c: Read failed (type) [Jan 16 08:23:01] WARNING[30650][C-0000002d] file.c: Unable to open format wav [Jan 16 08:23:01] WARNING[30650][C-0000002d] res_musiconhold.c: Unable to open file '/var/lib/asterisk/mohmp3/.nomusic_reserved/silence': No such file or directory [Jan 16 08:23:01] VERBOSE[30650][C-0000002d] res_musiconhold.c: -- Stopped music on hold on DAHDI/i1/myTelephoneNumber-26 *Wayne* Your code gave the clue. It is possible to do on this way: entry.getChannel().redirect("myCall", "s", 1); Kind regards. Jorge ---------------------------------------------------------------------------------------------------------------------------------------------- <https://twitter.com/#%21/correderajorge> <http://www.correderajorge.es/> En función de la *Ley Orgánica 15/1999*, este mensaje de correo electrónico y sus documentos adjuntos están dirigidos *exclusivamente* a los destinatarios especificados y su información es de uso *estrictamente privado* salvo que se especifique lo contrario. La información contenida puede ser *confidencial* y/o estar *legalmente protegida*. Si usted recibe este mensaje por *error*, por favor comuníqueselo inmediatamente al remitente y *elimínelo* ya que carece de autorización de todo tipo. *Se prohíbe expresamente* la revelación, distribución, impresión o copia de toda o alguna parte de la información contenida en este mensaje 2015-01-16 1:00 GMT+01:00 Zoumana TRAORE <zou...@gm...>: > 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 >> >> > > ------------------------------------------------------------------------------ > 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 > > |