asterisk-java-users Mailing List for Asterisk-Java Library (Page 19)
Brought to you by:
srt
You can subscribe to this list here.
2005 |
Jan
|
Feb
(8) |
Mar
(33) |
Apr
(36) |
May
(19) |
Jun
(21) |
Jul
(53) |
Aug
(30) |
Sep
(36) |
Oct
(34) |
Nov
(43) |
Dec
(72) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(123) |
Feb
(75) |
Mar
(86) |
Apr
(46) |
May
(41) |
Jun
(29) |
Jul
(76) |
Aug
(38) |
Sep
(39) |
Oct
(68) |
Nov
(16) |
Dec
(17) |
2007 |
Jan
(34) |
Feb
(18) |
Mar
(39) |
Apr
(30) |
May
(20) |
Jun
(10) |
Jul
(59) |
Aug
(54) |
Sep
(60) |
Oct
(22) |
Nov
(14) |
Dec
(10) |
2008 |
Jan
(34) |
Feb
(67) |
Mar
(65) |
Apr
(67) |
May
(60) |
Jun
(51) |
Jul
(88) |
Aug
(75) |
Sep
(47) |
Oct
(143) |
Nov
(54) |
Dec
(42) |
2009 |
Jan
(46) |
Feb
(80) |
Mar
(162) |
Apr
(159) |
May
(200) |
Jun
(34) |
Jul
(46) |
Aug
(59) |
Sep
(5) |
Oct
(35) |
Nov
(73) |
Dec
(30) |
2010 |
Jan
(23) |
Feb
(50) |
Mar
(8) |
Apr
(24) |
May
(19) |
Jun
(49) |
Jul
(56) |
Aug
(35) |
Sep
(26) |
Oct
(79) |
Nov
(39) |
Dec
(34) |
2011 |
Jan
(27) |
Feb
(22) |
Mar
(28) |
Apr
(12) |
May
(16) |
Jun
(19) |
Jul
(1) |
Aug
(64) |
Sep
(19) |
Oct
(11) |
Nov
(17) |
Dec
(12) |
2012 |
Jan
(6) |
Feb
(8) |
Mar
(15) |
Apr
(43) |
May
(41) |
Jun
(14) |
Jul
(32) |
Aug
(3) |
Sep
(4) |
Oct
(7) |
Nov
(11) |
Dec
(11) |
2013 |
Jan
(35) |
Feb
(11) |
Mar
(23) |
Apr
(25) |
May
(37) |
Jun
(47) |
Jul
(25) |
Aug
(21) |
Sep
|
Oct
(1) |
Nov
(9) |
Dec
|
2014 |
Jan
(26) |
Feb
(2) |
Mar
(18) |
Apr
(41) |
May
(7) |
Jun
(7) |
Jul
(24) |
Aug
(5) |
Sep
(6) |
Oct
(8) |
Nov
(9) |
Dec
(7) |
2015 |
Jan
(7) |
Feb
(15) |
Mar
(8) |
Apr
(12) |
May
(7) |
Jun
|
Jul
|
Aug
(5) |
Sep
(1) |
Oct
(3) |
Nov
(30) |
Dec
(3) |
2016 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
|
May
(9) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
(4) |
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: sekar <che...@re...> - 2013-03-20 06:41:08
|
I have completely read http://www.voip-info.org/wiki/view/Asterisk+DTMF article but couldn't find an example anywhere online regarding capturing DTMF events on asterisk . Having this problem for 2 weeks . It would be very helpful if you reply with an example Cheers |
From: Carlos G M. <tr...@hu...> - 2013-03-12 10:18:39
|
Just to add to what Ives says, this topic was covered a couple of times already, and there are some ideas in the list archives, may be even some code. Handling channel renames is a must, if I remember correctly :) -Carlos Yves A. @ 12/03/2013 05:45 -0300 dixit: > hi, > > sorry for the late reply, mail went into SPAM... > it IS possible, even with multiple calls to the same number, to identify > each event and relate it to the originating call.. > I've written some day ago a class for this purpose... the trick is to > identify the unique channel-ids for each connected leg. > this way I could e.g. log any event and relate to the call... much > better than the verbose cli output where it is difficult to trace > what happens, if you have high traffic... > > basically, this was my approach: > > 1.) catch all events, store them in a hash <String,Vector> where string > is the unique id, if you catch an event, add the event to the vector > that is stored with the unique id as the key in the hash (if id occurs > first time, create the vector first of course) > 2.) originate with callback (not a must) to get the first-leg-unique id > 3.) on a bridge event, catch the bridged channel id and you have your > pair of channels... > 4.) on hangup, get all related events from your hash, order them by time > and you are done. > 5.) do not forget to clear the data from your hash... it might become > full and procude ooM-exceptions, if you do not do so.. > > thats just a short extract... of course there was a little bit more to > think about... my class could also handle channel-rename events, > masquerades and therefore use of multiple (local too) channels, as they > may come up when you dial multiple targets, do forwards and so on. > > regards, > yves > > Am 06.03.2013 16:17, schrieb Mordechay Kaganer: >> B.H. >> >> Yves, thanks for the testing and the logs :-). That's exactly what >> i meant. At least in relation to dialing real PSTN numbers, matching >> the call by the dialed phone number will be a bad idea because it's >> not really unique. Theoretically, it's perfectly OK to dial the same >> number several times in parallel, at least if the destination is some >> kind of office PBX or IVR e t.c. >> >> Maybe, to workaround it will be possible to dial to "local" channel, >> answer() the call and then dial out from the dialplan. Then >> OriginateAction will always succeed almost immediately and then >> application will be able to track the actual dial out process by >> tracking the bridged channel. But IMHO it will require a lot of >> resources and not really practical with significant call volumes. >> >> Thanks for the advice, anyway :-) >> >> >> >> On Wed, Mar 6, 2013 at 4:56 PM, Yves A. <yv...@gm... >> <mailto:yv...@gm...>> wrote: >> >> maybe we talk about different things, but if i run my given code, >> i can see status updates via callbackhandler... >> I agree, that there is obviously no way to _immediately_ get the >> channelID via asynchronous dial, but thats >> no problem, because you can pass your own references to the >> callbackhandler constructor. In my example it >> is a simple string, but you could pass any other object there.. >> if your listening to ami events only, you could match the value of >> the channel (event.getChannel) against the >> "number" you dialed and can track any state of your call this >> way.... (but i admit... there are nuts and bolts... >> redirecting calls, ringgroups, followme, local channels, queues >> and so on can make track a call quite hard...) >> >> the following example uses callbackhandler plus eventlisteners to >> get all information in realtime: >> >> package tests; >> >> >> import org.asteriskjava.live.AsteriskChannel; >> import org.asteriskjava.live.AsteriskQueueEntry; >> import org.asteriskjava.live.AsteriskServerListener; >> import org.asteriskjava.live.DefaultAsteriskServer; >> import org.asteriskjava.live.MeetMeUser; >> import org.asteriskjava.live.internal.AsteriskAgentImpl; >> import org.asteriskjava.manager.ManagerConnection; >> import org.asteriskjava.manager.ManagerEventListener; >> import org.asteriskjava.manager.action.OriginateAction; >> import org.asteriskjava.manager.event.BridgeEvent; >> import org.asteriskjava.manager.event.ChannelUpdateEvent; >> import org.asteriskjava.manager.event.DialEvent; >> import org.asteriskjava.manager.event.HangupEvent; >> import org.asteriskjava.manager.event.LinkEvent; >> import org.asteriskjava.manager.event.ManagerEvent; >> import org.asteriskjava.manager.event.NewAccountCodeEvent; >> import org.asteriskjava.manager.event.NewCallerIdEvent; >> import org.asteriskjava.manager.event.NewChannelEvent; >> import org.asteriskjava.manager.event.NewStateEvent; >> import org.asteriskjava.manager.event.OriginateFailureEvent; >> import org.asteriskjava.manager.event.OriginateResponseEvent; >> import org.asteriskjava.manager.event.OriginateSuccessEvent; >> import org.asteriskjava.manager.event.UnlinkEvent; >> >> >> public class CallTestWithCallbackHandler implements >> AsteriskServerListener, ManagerEventListener{ >> >> private static ManagerConnection managerConnection; >> >> public CallTestWithCallbackHandler() throws Exception{ >> >> DefaultAsteriskServer asteriskServer = new >> DefaultAsteriskServer("SERVER", "USERNAME", "PASSWORD"); >> asteriskServer.getManagerConnection().login(); >> asteriskServer.addAsteriskServerListener(this); >> asteriskServer.getManagerConnection().addEventListener(this); >> >> >> >> try { >> OriginateAction originateAction = new >> OriginateAction(); >> originateAction.setChannel("DAHDI/g0/SOURCENUMBERHERE"); >> originateAction.setContext("from-sip"); >> originateAction.setExten("DESTINATIONNUMBERHERE"); >> originateAction.setPriority(1); >> originateAction.setTimeout(15000l); >> asteriskServer.originateAsync(originateAction, new >> myCallbackHandler("TESTCALL")); >> >> System.out.println("now idling for a minute to get >> a chance to receive events and states..."); >> try { >> Thread.sleep(60000); >> } >> catch (Exception e) { >> System.out.println(e.getMessage()); >> } >> } >> catch (Exception e) { >> System.out.println(e.getMessage()); >> } >> } >> >> public static void main(String[] args) throws Exception{ >> CallTestWithCallbackHandler aCall = new >> CallTestWithCallbackHandler(); >> } >> >> @Override >> public void onNewAsteriskChannel(AsteriskChannel channel) { >> System.out.println("new Channel created... data is: >> "+channel); >> >> } >> >> @Override >> public void onNewMeetMeUser(MeetMeUser user) { >> } >> >> @Override >> public void onNewAgent(AsteriskAgentImpl agent) { >> } >> >> @Override >> public void onNewQueueEntry(AsteriskQueueEntry entry) { >> } >> >> @Override >> public void onManagerEvent(ManagerEvent event) { >> // only print out relevant events here.. >> if (event instanceof NewChannelEvent >> || event instanceof ChannelUpdateEvent >> || event instanceof OriginateResponseEvent >> || event instanceof OriginateFailureEvent >> || event instanceof OriginateSuccessEvent >> || event instanceof NewCallerIdEvent >> || event instanceof NewStateEvent >> || event instanceof LinkEvent >> || event instanceof UnlinkEvent >> || event instanceof BridgeEvent >> || event instanceof DialEvent >> || event instanceof HangupEvent) >> System.out.println("got Event: "+event); >> >> } >> >> } >> >> an execution prints out, what happens in detail during a call >> setup, the call itself and the hangup.. >> output of callbackhandler is blue, managerevents are red, >> serverevents are violet and important details are _*black,bold and >> underlined*_... >> with this trace you can see very well, what happens at which time... >> >> myCallbackHandler for reference TESTCALL just instantiated. >> >> now idling for a minute to get a chance to receive events and >> states... >> got Event: >> org.asteriskjava.manager.event._*NewChannelEvent*_[dateReceived='Wed >> Mar 06 15:30:02 CET >> 2013',privilege='call,all',callerid=null,sequencenumber=null,state='_*Rsrvd*_',channelstate='1',calleridname=null,timestamp=null,uniqueid='_*1362580137.4260*_',context='from-pstn',exten=null,accountcode=null,server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',channelstatedesc='Rsrvd',systemHashcode=1564136253] >> got Event: >> org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed >> Mar 06 15:30:02 CET >> 2013',privilege='call,all',callerid=null,sequencenumber=null,state='Dialing',channelstate='3',calleridname=null,timestamp=null,uniqueid='1362580137.4260',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',channelstatedesc='Dialing',systemHashcode=959993440] >> myCallbackHandler for reference TESTCALL receives state: Dialling, >> channelID is: *_1362580137.4260_*, State is: RSRVD >> new Channel created... data is: >> AsteriskChannel[id='_*1362580137.4260*_',name='DAHDI/i1/SOURCENUMBERHERE-24d',callerId='',state='RSRVD',account='null',dateOfCreation=Wed >> Mar 06 15:30:02 CET >> 2013,dialedChannel=null,dialingChannel=null,linkedChannel=null] >> got Event: >> org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed >> Mar 06 15:30:05 CET >> 2013',privilege='call,all',callerid=null,sequencenumber=null,state='*_Ringing_*',channelstate='5',calleridname=null,timestamp=null,uniqueid='_*1362580137.4260*_',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',channelstatedesc='Ringing',systemHashcode=591210723] >> got Event: >> org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed >> Mar 06 15:30:07 CET >> 2013',privilege='call,all',callerid=null,sequencenumber=null,state='_*Up*_',channelstate='6',calleridname=null,timestamp=null,uniqueid='1362580137.4260',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',channelstatedesc='Up',systemHashcode=1084010740] >> got Event: >> org.asteriskjava.manager.event._*OriginateResponseEvent*_[dateReceived='Wed >> Mar 06 15:30:07 CET >> 2013',privilege='call,all',sequencenumber=null,reason='4',response='_*Success*_',calleridname=null,timestamp=null,uniqueid='_*1362580137.4260*_',actionid='AJ_ORIGINATE_0',internalactionid='569616903_9',context='from-sip',exten='DESTINATIONNUMBERHERE',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',systemHashcode=1864729679] >> myCallbackHandler for reference TESTCALL receives state: Success, >> channelID is: _*1362580137.4260*_, State is: _*UP*_ >> got Event: >> org.asteriskjava.manager.event._*NewChannelEvent*_[dateReceived='Wed >> Mar 06 15:30:07 CET >> 2013',privilege='call,all',callerid=null,sequencenumber=null,state='_*Rsrvd*_',channelstate='1',calleridname=null,timestamp=null,uniqueid='_*1362580141.4261*_',context='from-pstn',exten=null,accountcode=null,server=null,calleridnum=null,channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',channelstatedesc='Rsrvd',systemHashcode=198249052] >> got Event: >> org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed >> Mar 06 15:30:07 CET >> 2013',privilege='call,all',callerid='DESTINATIONNUMBERHERE',sequencenumber=null,state='_*Dialing*_',channelstate='3',calleridname=null,timestamp=null,uniqueid='_*1362580141.4261*_',server=null,calleridnum='DESTINATIONNUMBERHERE',channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',channelstatedesc='Dialing',systemHashcode=1832874625] >> got Event: >> org.asteriskjava.manager.event._*DialEvent*_[dateReceived='Wed Mar >> 06 15:30:07 CET >> 2013',privilege='call,all',subevent='Begin',callerid=null,dialstatus=null,sequencenumber=null,_*destuniqueid='1362580141.4261',srcuniqueid='1362580137.4260'*_,destination='DAHDI/i1/DESTINATIONNUMBERHERE-24e',dialstring='g0/DESTINATIONNUMBERHERE',timestamp=null,calleridname=null,uniqueid='1362580137.4260',server=null,src='DAHDI/i1/SOURCENUMBERHERE-24d',calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',systemHashcode=1000613778] >> new Channel created... data is: >> AsteriskChannel[_*id='1362580141.4261'*_,name='DAHDI/i1/DESTINATIONNUMBERHERE-24e',callerId='',state='_*RSRVD*_',account='null',dateOfCreation=Wed >> Mar 06 15:30:07 CET >> 2013,dialedChannel=null,dialingChannel=null,linkedChannel=null] >> got Event: >> org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed >> Mar 06 15:30:12 CET >> 2013',privilege='call,all',callerid='DESTINATIONNUMBERHERE',sequencenumber=null,state='_*Ringing*_',channelstate='5',calleridname=null,timestamp=null,uniqueid='_*1362580141.4261*_',server=null,calleridnum='DESTINATIONNUMBERHERE',channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',channelstatedesc='Ringing',systemHashcode=158635208] >> got Event: >> org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed >> Mar 06 15:30:14 CET >> 2013',privilege='call,all',callerid=null,sequencenumber=null,state='_*Up*_',channelstate='6',calleridname=null,timestamp=null,uniqueid='*_1362580141.4261_*',server=null,calleridnum=null,channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',channelstatedesc='Up',systemHashcode=1232704349] >> got Event: >> org.asteriskjava.manager.event._*BridgeEvent*_[dateReceived='Wed >> Mar 06 15:30:14 CET >> 2013',privilege='call,all',_*uniqueid1='1362580137.4260',uniqueid2='1362580141.4261'*_,sequencenumber=null,bridgestate='_*Link*_',bridgetype='core',timestamp=null,channel1='DAHDI/i1/SOURCENUMBERHERE-24d',channel2='DAHDI/i1/DESTINATIONNUMBERHERE-24e',callerid1=null,server=null,callerid2=null,systemHashcode=45104096] >> got Event: >> org.asteriskjava.manager.event._*BridgeEvent*_[dateReceived='Wed >> Mar 06 15:30:17 CET >> 2013',privilege='call,all',_*uniqueid1='1362580137.4260',uniqueid2='1362580141.4261'*_,sequencenumber=null,bridgestate='_*Unlink*_',bridgetype='core',timestamp=null,channel1='DAHDI/i1/SOURCENUMBERHERE-24d',channel2='DAHDI/i1/DESTINATIONNUMBERHERE-24e',callerid1=null,server=null,callerid2=null,systemHashcode=277466206] >> got Event: >> org.asteriskjava.manager.event._*HangupEvent*_[dateReceived='Wed >> Mar 06 15:30:17 CET 2013',privilege='call,all',causetxt='Normal >> Clearing',callerid=null,cause='16',sequencenumber=null,calleridname=null,timestamp=null,uniqueid='_*1362580141.4261*_',server=null,calleridnum=null,channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',systemHashcode=2110683211] >> got Event: >> org.asteriskjava.manager.event._*DialEvent*_[dateReceived='Wed Mar >> 06 15:30:17 CET >> 2013',privilege='call,all',subevent='End',callerid=null,dialstatus='*_ANSWER_*',sequencenumber=null,destuniqueid=null,srcuniqueid='*_1362580137.4260_*',destination=null,dialstring=null,timestamp=null,calleridname=null,uniqueid='1362580137.4260',server=null,src='DAHDI/i1/SOURCENUMBERHERE-24d',calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',systemHashcode=1501740254] >> got Event: >> org.asteriskjava.manager.event._*HangupEvent*_[dateReceived='Wed >> Mar 06 15:30:17 CET 2013',privilege='call,all',causetxt='Normal >> Clearing',callerid=null,cause='16',sequencenumber=null,calleridname=null,timestamp=null,uniqueid='_*1362580137.4260*_',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',systemHashcode=373145787] >> >> >> >> regards, >> yves >> >> Am 06.03.2013 13:23, schrieb Mordechay Kaganer: >>> B.H. >>> >>> Hi >>> >>> There is indeed some problem with OriginateAction events - but it >>> seems to be asterisk's problem. When i send OriginateAction (in >>> async mode, but this doesn't really matter AFAIK), asterisk >>> immediately create a channel and starts to ring while it do >>> generate all related AMI events like NewChannelEvent, >>> NewStateEvent on that channel, but until the call is established >>> or failed the AMI listener is unable to link between the >>> OriginateAction and the new channel. Only OriginateResponseEvent >>> will contain both OriginateAction's id and the newly created >>> channel. This means that there's no way to get status updates on >>> ongoing originate action like see if the channel is ringing or >>> dialing or whatever, even that the same app "sees" the new >>> channel and it's status updates. >>> >>> At least, that's what i have learned from my experience. Maybe >>> somebody knows how to workaround this? >>> >>> >>> On Wed, Mar 6, 2013 at 1:38 PM, Yves A. <yv...@gm... >>> <mailto:yv...@gm...>> wrote: >>> >>> hi, >>> >>> pls. see attached source... >>> >>> >>> package tests; >>> >>> >>> import org.asteriskjava.live.AsteriskChannel; >>> import org.asteriskjava.live.DefaultAsteriskServer; >>> import org.asteriskjava.live.LiveException; >>> import org.asteriskjava.live.OriginateCallback; >>> import org.asteriskjava.manager.ManagerConnection; >>> import org.asteriskjava.manager.action.OriginateAction; >>> >>> >>> public class CallTestWithCallbackHandler { >>> >>> private static ManagerConnection managerConnection; >>> >>> public static void main(String[] args) throws Exception{ >>> >>> DefaultAsteriskServer asteriskServer = new >>> DefaultAsteriskServer("SERVER", "USER", "PASSWORD"); >>> asteriskServer.getManagerConnection().login(); >>> >>> >>> try { >>> OriginateAction originateAction = new >>> OriginateAction(); >>> originateAction.setChannel("SIP/177");//first leg >>> originateAction.setContext("from-internal"); >>> originateAction.setExten("08154711"); //second leg >>> originateAction.setPriority(1); >>> originateAction.setTimeout(15000); >>> asteriskServer.originateAsync(originateAction, new >>> myCallbackHandler("177")); >>> System.out.println("now idling for a minute to get a chance >>> to receive events and states..."); >>> try { >>> Thread.sleep(60000); >>> } >>> catch (Exception e) { >>> System.out.println(e.getMessage()); >>> } >>> } >>> catch (Exception e) { >>> System.out.println(e.getMessage()); >>> } >>> } >>> } >>> >>> >>> >>> package tests; >>> >>> import org.asteriskjava.live.AsteriskChannel; >>> import org.asteriskjava.live.LiveException; >>> import org.asteriskjava.live.OriginateCallback; >>> >>> public class myCallbackHandler implements OriginateCallback{ >>> >>> >>> public String reference; >>> >>> public myCallbackHandler(String reference){ >>> System.out.println("myCallbackHandler for reference >>> "+reference+" just instantiated."); >>> this.reference = reference; >>> } >>> >>> public void onDialing(AsteriskChannel ac) >>> { >>> System.out.println("myCallbackHandler for reference >>> "+reference+" receives state: Dialling, channelID is: >>> "+ac.getId()+", State is: "+ac.getState()); >>> >>> String channelID=ac.getId(); >>> } >>> >>> public void onBusy(AsteriskChannel ac) >>> { >>> System.out.println("myCallbackHandler for reference >>> "+reference+" receives state: Busy, channelID is: >>> "+ac.getId()+", State is: "+ac.getState()); >>> } >>> >>> public void onFailure(LiveException le) >>> { >>> System.out.println("myCallbackHandler for reference >>> "+reference+" receives state: Failure "+le.getMessage()); >>> } >>> >>> public void onNoAnswer(AsteriskChannel ac) >>> { >>> System.out.println("myCallbackHandler for reference >>> "+reference+" receives state: No Answer, channelID is: >>> "+ac.getId()+", State is: "+ac.getState()); >>> } >>> >>> public void onSuccess(AsteriskChannel ac) >>> { >>> System.out.println("myCallbackHandler for reference >>> "+reference+" receives state: Success, channelID is: >>> "+ac.getId()+", State is: "+ac.getState()); >>> } >>> >>> } >>> >>> >>> regards, >>> yves >>> >>> >>> Am 06.03.2013 04:57, schrieb roko: >>>> Hi >>>> >>>> I use the SendActionCallback, but I'm getting the same >>>> response that I get from the blocking function... no new >>>> data. So, how can I get the value of the ORIGINATE_STATUS >>>> variable ? >>>> >>>> E. >>>> >>>> ------------------------------------------------------------------------ >>>> *De:* roko <ro...@ya...> <mailto:ro...@ya...> >>>> *Para:* "ast...@li..." >>>> <mailto:ast...@li...> >>>> <ast...@li...> >>>> <mailto:ast...@li...> >>>> *Enviado:* Lunes, 4 de marzo, 2013 10:38 A.M. >>>> *Asunto:* Re: [Asterisk-java-users] How to get >>>> ORIGINATE_STATUS value after OriginateAction >>>> >>>> Hi >>>> >>>> Thx for your answer. Do you mean instead of blocking using: >>>> >>>> ManagerResponse >>>> <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/response/ManagerResponse.html> sendAction(ManagerAction >>>> <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/action/ManagerAction.html> action, >>>> long timeout) >>>> >>>> Should I use this function ?: >>>> >>>> void sendAction(ManagerAction >>>> <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/action/ManagerAction.html> action, >>>> SendActionCallback >>>> <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/SendActionCallback.html> callback) >>>> >>>> I see in the docs that I still get a ManagerResponse >>>> <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/response/ManagerResponse.html>. >>>> Pls forgive me, I'm very new at this. How can I get the >>>> ORIGINATE_STATUS from the ManagerResponse object ? Do you >>>> have an example that I could use ? Thx for your help. >>>> >>>> E. >>>> >>>> ------------------------------------------------------------------------ >>>> *De:* Yves A. <yv...@gm...> <mailto:yv...@gm...> >>>> *Para:* ast...@li... >>>> <mailto:ast...@li...> >>>> *Enviado:* Lunes, 4 de marzo, 2013 2:45 A.M. >>>> *Asunto:* Re: [Asterisk-java-users] How to get >>>> ORIGINATE_STATUS value after OriginateAction >>>> >>>> Hi, >>>> >>>> you could use a callback handler. this way you´ll get >>>> informed about any state change. >>>> >>>> yves >>>> >>>> Am 04.03.2013 04:06, schrieb roko: >>>>> Hi everyone >>>>> >>>>> I'm just starting with asterisk and asterisk-java, so >>>>> please forgive me if this is a silly question. Here >>>>> (http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate) >>>>> <http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate> >>>>> I can see that the originate cmd sets the ORIGINATE_STATUS >>>>> variable before exiting. How can I get this value from >>>>> asterisk-java ? At this point I'm using the code from the >>>>> tutorial, like this: >>>>> OriginateAction originateAction; >>>>> ManagerResponse originateResponse; >>>>> >>>>> originateAction = new OriginateAction(); >>>>> originateAction.setChannel("SIP/John"); >>>>> originateAction.setContext("default"); >>>>> originateAction.setExten("1300"); >>>>> originateAction.setPriority(new Integer(1)); >>>>> originateAction.setTimeout(new Integer(30000)); >>>>> >>>>> managerConnection.login(); >>>>> originateResponse = managerConnection.sendAction(originateAction, 30000); >>>>> Thx for your help. >>>>> >>>>> E. >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Everyone hates slow websites. So do we. >>>>> Make your web apps faster with AppDynamics >>>>> Download AppDynamics Lite for free today: >>>>> http://p.sf.net/sfu/appdyn_d2d_feb >>>>> >>>>> >>>>> _______________________________________________ >>>>> Asterisk-java-users mailing list >>>>> Ast...@li... <mailto:Ast...@li...> >>>>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Everyone hates slow websites. So do we. >>>> Make your web apps faster with AppDynamics >>>> Download AppDynamics Lite for free today: >>>> http://p.sf.net/sfu/appdyn_d2d_feb >>>> _______________________________________________ >>>> Asterisk-java-users mailing list >>>> Ast...@li... >>>> <mailto:Ast...@li...> >>>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Everyone hates slow websites. So do we. >>>> Make your web apps faster with AppDynamics >>>> Download AppDynamics Lite for free today: >>>> http://p.sf.net/sfu/appdyn_d2d_feb >>>> _______________________________________________ >>>> Asterisk-java-users mailing list >>>> Ast...@li... >>>> <mailto:Ast...@li...> >>>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>>> >>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester >>>> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the >>>> endpoint security space. For insight on selecting the right partner to >>>> tackle endpoint security challenges, access the full report. >>>> http://p.sf.net/sfu/symantec-dev2dev >>>> >>>> >>>> _______________________________________________ >>>> Asterisk-java-users mailing list >>>> Ast...@li... <mailto:Ast...@li...> >>>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >>> ------------------------------------------------------------------------------ >>> Symantec Endpoint Protection 12 positioned as A LEADER in The >>> Forrester >>> Wave(TM): Endpoint Security, Q1 2013 and "remains a good >>> choice" in the >>> endpoint security space. For insight on selecting the right >>> partner to >>> tackle endpoint security challenges, access the full report. >>> http://p.sf.net/sfu/symantec-dev2dev >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... >>> <mailto:Ast...@li...> >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >>> >>> >>> -- >>> משיח NOW! >>> Moshiach is coming very soon, prepare yourself! >>> יחי אדוננו מורינו ורבינו מלך המשיח לעולם ועד! >>> >>> >>> ------------------------------------------------------------------------------ >>> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester >>> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the >>> endpoint security space. For insight on selecting the right partner to >>> tackle endpoint security challenges, access the full report. >>> http://p.sf.net/sfu/symantec-dev2dev >>> >>> >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... <mailto:Ast...@li...> >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> ------------------------------------------------------------------------------ >> Symantec Endpoint Protection 12 positioned as A LEADER in The >> Forrester >> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" >> in the >> endpoint security space. For insight on selecting the right partner to >> tackle endpoint security challenges, access the full report. >> http://p.sf.net/sfu/symantec-dev2dev >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> <mailto:Ast...@li...> >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> >> >> -- >> משיח NOW! >> Moshiach is coming very soon, prepare yourself! >> יחי אדוננו מורינו ורבינו מלך המשיח לעולם ועד! >> >> >> ------------------------------------------------------------------------------ >> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester >> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the >> endpoint security space. For insight on selecting the right partner to >> tackle endpoint security challenges, access the full report. >> http://p.sf.net/sfu/symantec-dev2dev >> >> >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > ------------------------------------------------------------------------------ > Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester > Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the > endpoint security space. For insight on selecting the right partner to > tackle endpoint security challenges, access the full report. > http://p.sf.net/sfu/symantec-dev2dev > > > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > -- Carlos G Mendioroz <tr...@hu...> LW7 EQI Argentina |
From: Yves A. <yv...@gm...> - 2013-03-12 08:46:36
|
hi, sorry for the late reply, mail went into SPAM... it IS possible, even with multiple calls to the same number, to identify each event and relate it to the originating call.. I've written some day ago a class for this purpose... the trick is to identify the unique channel-ids for each connected leg. this way I could e.g. log any event and relate to the call... much better than the verbose cli output where it is difficult to trace what happens, if you have high traffic... basically, this was my approach: 1.) catch all events, store them in a hash <String,Vector> where string is the unique id, if you catch an event, add the event to the vector that is stored with the unique id as the key in the hash (if id occurs first time, create the vector first of course) 2.) originate with callback (not a must) to get the first-leg-unique id 3.) on a bridge event, catch the bridged channel id and you have your pair of channels... 4.) on hangup, get all related events from your hash, order them by time and you are done. 5.) do not forget to clear the data from your hash... it might become full and procude ooM-exceptions, if you do not do so.. thats just a short extract... of course there was a little bit more to think about... my class could also handle channel-rename events, masquerades and therefore use of multiple (local too) channels, as they may come up when you dial multiple targets, do forwards and so on. regards, yves Am 06.03.2013 16:17, schrieb Mordechay Kaganer: > B.H. > > Yves, thanks for the testing and the logs :-). That's exactly what > i meant. At least in relation to dialing real PSTN numbers, matching > the call by the dialed phone number will be a bad idea because it's > not really unique. Theoretically, it's perfectly OK to dial the same > number several times in parallel, at least if the destination is some > kind of office PBX or IVR e t.c. > > Maybe, to workaround it will be possible to dial to "local" channel, > answer() the call and then dial out from the dialplan. Then > OriginateAction will always succeed almost immediately and then > application will be able to track the actual dial out process by > tracking the bridged channel. But IMHO it will require a lot of > resources and not really practical with significant call volumes. > > Thanks for the advice, anyway :-) > > > > On Wed, Mar 6, 2013 at 4:56 PM, Yves A. <yv...@gm... > <mailto:yv...@gm...>> wrote: > > maybe we talk about different things, but if i run my given code, > i can see status updates via callbackhandler... > I agree, that there is obviously no way to _immediately_ get the > channelID via asynchronous dial, but thats > no problem, because you can pass your own references to the > callbackhandler constructor. In my example it > is a simple string, but you could pass any other object there.. > if your listening to ami events only, you could match the value of > the channel (event.getChannel) against the > "number" you dialed and can track any state of your call this > way.... (but i admit... there are nuts and bolts... > redirecting calls, ringgroups, followme, local channels, queues > and so on can make track a call quite hard...) > > the following example uses callbackhandler plus eventlisteners to > get all information in realtime: > > package tests; > > > import org.asteriskjava.live.AsteriskChannel; > import org.asteriskjava.live.AsteriskQueueEntry; > import org.asteriskjava.live.AsteriskServerListener; > import org.asteriskjava.live.DefaultAsteriskServer; > import org.asteriskjava.live.MeetMeUser; > import org.asteriskjava.live.internal.AsteriskAgentImpl; > import org.asteriskjava.manager.ManagerConnection; > import org.asteriskjava.manager.ManagerEventListener; > import org.asteriskjava.manager.action.OriginateAction; > import org.asteriskjava.manager.event.BridgeEvent; > import org.asteriskjava.manager.event.ChannelUpdateEvent; > import org.asteriskjava.manager.event.DialEvent; > import org.asteriskjava.manager.event.HangupEvent; > import org.asteriskjava.manager.event.LinkEvent; > import org.asteriskjava.manager.event.ManagerEvent; > import org.asteriskjava.manager.event.NewAccountCodeEvent; > import org.asteriskjava.manager.event.NewCallerIdEvent; > import org.asteriskjava.manager.event.NewChannelEvent; > import org.asteriskjava.manager.event.NewStateEvent; > import org.asteriskjava.manager.event.OriginateFailureEvent; > import org.asteriskjava.manager.event.OriginateResponseEvent; > import org.asteriskjava.manager.event.OriginateSuccessEvent; > import org.asteriskjava.manager.event.UnlinkEvent; > > > public class CallTestWithCallbackHandler implements > AsteriskServerListener, ManagerEventListener{ > > private static ManagerConnection managerConnection; > > public CallTestWithCallbackHandler() throws Exception{ > > DefaultAsteriskServer asteriskServer = new > DefaultAsteriskServer("SERVER", "USERNAME", "PASSWORD"); > asteriskServer.getManagerConnection().login(); > asteriskServer.addAsteriskServerListener(this); > asteriskServer.getManagerConnection().addEventListener(this); > > > > try { > OriginateAction originateAction = new > OriginateAction(); > originateAction.setChannel("DAHDI/g0/SOURCENUMBERHERE"); > originateAction.setContext("from-sip"); > originateAction.setExten("DESTINATIONNUMBERHERE"); > originateAction.setPriority(1); > originateAction.setTimeout(15000l); > asteriskServer.originateAsync(originateAction, new > myCallbackHandler("TESTCALL")); > > System.out.println("now idling for a minute to get > a chance to receive events and states..."); > try { > Thread.sleep(60000); > } > catch (Exception e) { > System.out.println(e.getMessage()); > } > } > catch (Exception e) { > System.out.println(e.getMessage()); > } > } > > public static void main(String[] args) throws Exception{ > CallTestWithCallbackHandler aCall = new > CallTestWithCallbackHandler(); > } > > @Override > public void onNewAsteriskChannel(AsteriskChannel channel) { > System.out.println("new Channel created... data is: > "+channel); > > } > > @Override > public void onNewMeetMeUser(MeetMeUser user) { > } > > @Override > public void onNewAgent(AsteriskAgentImpl agent) { > } > > @Override > public void onNewQueueEntry(AsteriskQueueEntry entry) { > } > > @Override > public void onManagerEvent(ManagerEvent event) { > // only print out relevant events here.. > if (event instanceof NewChannelEvent > || event instanceof ChannelUpdateEvent > || event instanceof OriginateResponseEvent > || event instanceof OriginateFailureEvent > || event instanceof OriginateSuccessEvent > || event instanceof NewCallerIdEvent > || event instanceof NewStateEvent > || event instanceof LinkEvent > || event instanceof UnlinkEvent > || event instanceof BridgeEvent > || event instanceof DialEvent > || event instanceof HangupEvent) > System.out.println("got Event: "+event); > > } > > } > > an execution prints out, what happens in detail during a call > setup, the call itself and the hangup.. > output of callbackhandler is blue, managerevents are red, > serverevents are violet and important details are _*black,bold and > underlined*_... > with this trace you can see very well, what happens at which time... > > myCallbackHandler for reference TESTCALL just instantiated. > > now idling for a minute to get a chance to receive events and > states... > got Event: > org.asteriskjava.manager.event._*NewChannelEvent*_[dateReceived='Wed > Mar 06 15:30:02 CET > 2013',privilege='call,all',callerid=null,sequencenumber=null,state='_*Rsrvd*_',channelstate='1',calleridname=null,timestamp=null,uniqueid='_*1362580137.4260*_',context='from-pstn',exten=null,accountcode=null,server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',channelstatedesc='Rsrvd',systemHashcode=1564136253] > got Event: > org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed > Mar 06 15:30:02 CET > 2013',privilege='call,all',callerid=null,sequencenumber=null,state='Dialing',channelstate='3',calleridname=null,timestamp=null,uniqueid='1362580137.4260',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',channelstatedesc='Dialing',systemHashcode=959993440] > myCallbackHandler for reference TESTCALL receives state: Dialling, > channelID is: *_1362580137.4260_*, State is: RSRVD > new Channel created... data is: > AsteriskChannel[id='_*1362580137.4260*_',name='DAHDI/i1/SOURCENUMBERHERE-24d',callerId='',state='RSRVD',account='null',dateOfCreation=Wed > Mar 06 15:30:02 CET > 2013,dialedChannel=null,dialingChannel=null,linkedChannel=null] > got Event: > org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed > Mar 06 15:30:05 CET > 2013',privilege='call,all',callerid=null,sequencenumber=null,state='*_Ringing_*',channelstate='5',calleridname=null,timestamp=null,uniqueid='_*1362580137.4260*_',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',channelstatedesc='Ringing',systemHashcode=591210723] > got Event: > org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed > Mar 06 15:30:07 CET > 2013',privilege='call,all',callerid=null,sequencenumber=null,state='_*Up*_',channelstate='6',calleridname=null,timestamp=null,uniqueid='1362580137.4260',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',channelstatedesc='Up',systemHashcode=1084010740] > got Event: > org.asteriskjava.manager.event._*OriginateResponseEvent*_[dateReceived='Wed > Mar 06 15:30:07 CET > 2013',privilege='call,all',sequencenumber=null,reason='4',response='_*Success*_',calleridname=null,timestamp=null,uniqueid='_*1362580137.4260*_',actionid='AJ_ORIGINATE_0',internalactionid='569616903_9',context='from-sip',exten='DESTINATIONNUMBERHERE',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',systemHashcode=1864729679] > myCallbackHandler for reference TESTCALL receives state: Success, > channelID is: _*1362580137.4260*_, State is: _*UP*_ > got Event: > org.asteriskjava.manager.event._*NewChannelEvent*_[dateReceived='Wed > Mar 06 15:30:07 CET > 2013',privilege='call,all',callerid=null,sequencenumber=null,state='_*Rsrvd*_',channelstate='1',calleridname=null,timestamp=null,uniqueid='_*1362580141.4261*_',context='from-pstn',exten=null,accountcode=null,server=null,calleridnum=null,channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',channelstatedesc='Rsrvd',systemHashcode=198249052] > got Event: > org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed > Mar 06 15:30:07 CET > 2013',privilege='call,all',callerid='DESTINATIONNUMBERHERE',sequencenumber=null,state='_*Dialing*_',channelstate='3',calleridname=null,timestamp=null,uniqueid='_*1362580141.4261*_',server=null,calleridnum='DESTINATIONNUMBERHERE',channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',channelstatedesc='Dialing',systemHashcode=1832874625] > got Event: > org.asteriskjava.manager.event._*DialEvent*_[dateReceived='Wed Mar > 06 15:30:07 CET > 2013',privilege='call,all',subevent='Begin',callerid=null,dialstatus=null,sequencenumber=null,_*destuniqueid='1362580141.4261',srcuniqueid='1362580137.4260'*_,destination='DAHDI/i1/DESTINATIONNUMBERHERE-24e',dialstring='g0/DESTINATIONNUMBERHERE',timestamp=null,calleridname=null,uniqueid='1362580137.4260',server=null,src='DAHDI/i1/SOURCENUMBERHERE-24d',calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',systemHashcode=1000613778] > new Channel created... data is: > AsteriskChannel[_*id='1362580141.4261'*_,name='DAHDI/i1/DESTINATIONNUMBERHERE-24e',callerId='',state='_*RSRVD*_',account='null',dateOfCreation=Wed > Mar 06 15:30:07 CET > 2013,dialedChannel=null,dialingChannel=null,linkedChannel=null] > got Event: > org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed > Mar 06 15:30:12 CET > 2013',privilege='call,all',callerid='DESTINATIONNUMBERHERE',sequencenumber=null,state='_*Ringing*_',channelstate='5',calleridname=null,timestamp=null,uniqueid='_*1362580141.4261*_',server=null,calleridnum='DESTINATIONNUMBERHERE',channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',channelstatedesc='Ringing',systemHashcode=158635208] > got Event: > org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed > Mar 06 15:30:14 CET > 2013',privilege='call,all',callerid=null,sequencenumber=null,state='_*Up*_',channelstate='6',calleridname=null,timestamp=null,uniqueid='*_1362580141.4261_*',server=null,calleridnum=null,channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',channelstatedesc='Up',systemHashcode=1232704349] > got Event: > org.asteriskjava.manager.event._*BridgeEvent*_[dateReceived='Wed > Mar 06 15:30:14 CET > 2013',privilege='call,all',_*uniqueid1='1362580137.4260',uniqueid2='1362580141.4261'*_,sequencenumber=null,bridgestate='_*Link*_',bridgetype='core',timestamp=null,channel1='DAHDI/i1/SOURCENUMBERHERE-24d',channel2='DAHDI/i1/DESTINATIONNUMBERHERE-24e',callerid1=null,server=null,callerid2=null,systemHashcode=45104096] > got Event: > org.asteriskjava.manager.event._*BridgeEvent*_[dateReceived='Wed > Mar 06 15:30:17 CET > 2013',privilege='call,all',_*uniqueid1='1362580137.4260',uniqueid2='1362580141.4261'*_,sequencenumber=null,bridgestate='_*Unlink*_',bridgetype='core',timestamp=null,channel1='DAHDI/i1/SOURCENUMBERHERE-24d',channel2='DAHDI/i1/DESTINATIONNUMBERHERE-24e',callerid1=null,server=null,callerid2=null,systemHashcode=277466206] > got Event: > org.asteriskjava.manager.event._*HangupEvent*_[dateReceived='Wed > Mar 06 15:30:17 CET 2013',privilege='call,all',causetxt='Normal > Clearing',callerid=null,cause='16',sequencenumber=null,calleridname=null,timestamp=null,uniqueid='_*1362580141.4261*_',server=null,calleridnum=null,channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',systemHashcode=2110683211] > got Event: > org.asteriskjava.manager.event._*DialEvent*_[dateReceived='Wed Mar > 06 15:30:17 CET > 2013',privilege='call,all',subevent='End',callerid=null,dialstatus='*_ANSWER_*',sequencenumber=null,destuniqueid=null,srcuniqueid='*_1362580137.4260_*',destination=null,dialstring=null,timestamp=null,calleridname=null,uniqueid='1362580137.4260',server=null,src='DAHDI/i1/SOURCENUMBERHERE-24d',calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',systemHashcode=1501740254] > got Event: > org.asteriskjava.manager.event._*HangupEvent*_[dateReceived='Wed > Mar 06 15:30:17 CET 2013',privilege='call,all',causetxt='Normal > Clearing',callerid=null,cause='16',sequencenumber=null,calleridname=null,timestamp=null,uniqueid='_*1362580137.4260*_',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',systemHashcode=373145787] > > > > regards, > yves > > Am 06.03.2013 13:23, schrieb Mordechay Kaganer: >> B.H. >> >> Hi >> >> There is indeed some problem with OriginateAction events - but it >> seems to be asterisk's problem. When i send OriginateAction (in >> async mode, but this doesn't really matter AFAIK), asterisk >> immediately create a channel and starts to ring while it do >> generate all related AMI events like NewChannelEvent, >> NewStateEvent on that channel, but until the call is established >> or failed the AMI listener is unable to link between the >> OriginateAction and the new channel. Only OriginateResponseEvent >> will contain both OriginateAction's id and the newly created >> channel. This means that there's no way to get status updates on >> ongoing originate action like see if the channel is ringing or >> dialing or whatever, even that the same app "sees" the new >> channel and it's status updates. >> >> At least, that's what i have learned from my experience. Maybe >> somebody knows how to workaround this? >> >> >> On Wed, Mar 6, 2013 at 1:38 PM, Yves A. <yv...@gm... >> <mailto:yv...@gm...>> wrote: >> >> hi, >> >> pls. see attached source... >> >> >> package tests; >> >> >> import org.asteriskjava.live.AsteriskChannel; >> import org.asteriskjava.live.DefaultAsteriskServer; >> import org.asteriskjava.live.LiveException; >> import org.asteriskjava.live.OriginateCallback; >> import org.asteriskjava.manager.ManagerConnection; >> import org.asteriskjava.manager.action.OriginateAction; >> >> >> public class CallTestWithCallbackHandler { >> >> private static ManagerConnection managerConnection; >> >> public static void main(String[] args) throws Exception{ >> >> DefaultAsteriskServer asteriskServer = new >> DefaultAsteriskServer("SERVER", "USER", "PASSWORD"); >> asteriskServer.getManagerConnection().login(); >> >> >> try { >> OriginateAction originateAction = new >> OriginateAction(); >> originateAction.setChannel("SIP/177");//first leg >> originateAction.setContext("from-internal"); >> originateAction.setExten("08154711"); //second leg >> originateAction.setPriority(1); >> originateAction.setTimeout(15000); >> asteriskServer.originateAsync(originateAction, new >> myCallbackHandler("177")); >> System.out.println("now idling for a minute to get a chance >> to receive events and states..."); >> try { >> Thread.sleep(60000); >> } >> catch (Exception e) { >> System.out.println(e.getMessage()); >> } >> } >> catch (Exception e) { >> System.out.println(e.getMessage()); >> } >> } >> } >> >> >> >> package tests; >> >> import org.asteriskjava.live.AsteriskChannel; >> import org.asteriskjava.live.LiveException; >> import org.asteriskjava.live.OriginateCallback; >> >> public class myCallbackHandler implements OriginateCallback{ >> >> >> public String reference; >> >> public myCallbackHandler(String reference){ >> System.out.println("myCallbackHandler for reference >> "+reference+" just instantiated."); >> this.reference = reference; >> } >> >> public void onDialing(AsteriskChannel ac) >> { >> System.out.println("myCallbackHandler for reference >> "+reference+" receives state: Dialling, channelID is: >> "+ac.getId()+", State is: "+ac.getState()); >> >> String channelID=ac.getId(); >> } >> >> public void onBusy(AsteriskChannel ac) >> { >> System.out.println("myCallbackHandler for reference >> "+reference+" receives state: Busy, channelID is: >> "+ac.getId()+", State is: "+ac.getState()); >> } >> >> public void onFailure(LiveException le) >> { >> System.out.println("myCallbackHandler for reference >> "+reference+" receives state: Failure "+le.getMessage()); >> } >> >> public void onNoAnswer(AsteriskChannel ac) >> { >> System.out.println("myCallbackHandler for reference >> "+reference+" receives state: No Answer, channelID is: >> "+ac.getId()+", State is: "+ac.getState()); >> } >> >> public void onSuccess(AsteriskChannel ac) >> { >> System.out.println("myCallbackHandler for reference >> "+reference+" receives state: Success, channelID is: >> "+ac.getId()+", State is: "+ac.getState()); >> } >> >> } >> >> >> regards, >> yves >> >> >> Am 06.03.2013 04:57, schrieb roko: >>> Hi >>> >>> I use the SendActionCallback, but I'm getting the same >>> response that I get from the blocking function... no new >>> data. So, how can I get the value of the ORIGINATE_STATUS >>> variable ? >>> >>> E. >>> >>> ------------------------------------------------------------------------ >>> *De:* roko <ro...@ya...> <mailto:ro...@ya...> >>> *Para:* "ast...@li..." >>> <mailto:ast...@li...> >>> <ast...@li...> >>> <mailto:ast...@li...> >>> *Enviado:* Lunes, 4 de marzo, 2013 10:38 A.M. >>> *Asunto:* Re: [Asterisk-java-users] How to get >>> ORIGINATE_STATUS value after OriginateAction >>> >>> Hi >>> >>> Thx for your answer. Do you mean instead of blocking using: >>> >>> ManagerResponse >>> <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/response/ManagerResponse.html> sendAction(ManagerAction >>> <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/action/ManagerAction.html> action, >>> long timeout) >>> >>> Should I use this function ?: >>> >>> void sendAction(ManagerAction >>> <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/action/ManagerAction.html> action, >>> SendActionCallback >>> <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/SendActionCallback.html> callback) >>> >>> I see in the docs that I still get a ManagerResponse >>> <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/response/ManagerResponse.html>. >>> Pls forgive me, I'm very new at this. How can I get the >>> ORIGINATE_STATUS from the ManagerResponse object ? Do you >>> have an example that I could use ? Thx for your help. >>> >>> E. >>> >>> ------------------------------------------------------------------------ >>> *De:* Yves A. <yv...@gm...> <mailto:yv...@gm...> >>> *Para:* ast...@li... >>> <mailto:ast...@li...> >>> *Enviado:* Lunes, 4 de marzo, 2013 2:45 A.M. >>> *Asunto:* Re: [Asterisk-java-users] How to get >>> ORIGINATE_STATUS value after OriginateAction >>> >>> Hi, >>> >>> you could use a callback handler. this way you´ll get >>> informed about any state change. >>> >>> yves >>> >>> Am 04.03.2013 04:06, schrieb roko: >>>> Hi everyone >>>> >>>> I'm just starting with asterisk and asterisk-java, so >>>> please forgive me if this is a silly question. Here >>>> (http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate) >>>> <http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate> >>>> I can see that the originate cmd sets the ORIGINATE_STATUS >>>> variable before exiting. How can I get this value from >>>> asterisk-java ? At this point I'm using the code from the >>>> tutorial, like this: >>>> OriginateAction originateAction; >>>> ManagerResponse originateResponse; >>>> >>>> originateAction = new OriginateAction(); >>>> originateAction.setChannel("SIP/John"); >>>> originateAction.setContext("default"); >>>> originateAction.setExten("1300"); >>>> originateAction.setPriority(new Integer(1)); >>>> originateAction.setTimeout(new Integer(30000)); >>>> >>>> managerConnection.login(); >>>> originateResponse = managerConnection.sendAction(originateAction, 30000); >>>> Thx for your help. >>>> >>>> E. >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Everyone hates slow websites. So do we. >>>> Make your web apps faster with AppDynamics >>>> Download AppDynamics Lite for free today: >>>> http://p.sf.net/sfu/appdyn_d2d_feb >>>> >>>> >>>> _______________________________________________ >>>> Asterisk-java-users mailing list >>>> Ast...@li... <mailto:Ast...@li...> >>>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >>> ------------------------------------------------------------------------------ >>> Everyone hates slow websites. So do we. >>> Make your web apps faster with AppDynamics >>> Download AppDynamics Lite for free today: >>> http://p.sf.net/sfu/appdyn_d2d_feb >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... >>> <mailto:Ast...@li...> >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Everyone hates slow websites. So do we. >>> Make your web apps faster with AppDynamics >>> Download AppDynamics Lite for free today: >>> http://p.sf.net/sfu/appdyn_d2d_feb >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... >>> <mailto:Ast...@li...> >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester >>> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the >>> endpoint security space. For insight on selecting the right partner to >>> tackle endpoint security challenges, access the full report. >>> http://p.sf.net/sfu/symantec-dev2dev >>> >>> >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... <mailto:Ast...@li...> >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> ------------------------------------------------------------------------------ >> Symantec Endpoint Protection 12 positioned as A LEADER in The >> Forrester >> Wave(TM): Endpoint Security, Q1 2013 and "remains a good >> choice" in the >> endpoint security space. For insight on selecting the right >> partner to >> tackle endpoint security challenges, access the full report. >> http://p.sf.net/sfu/symantec-dev2dev >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> <mailto:Ast...@li...> >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> >> >> -- >> ???? NOW! >> Moshiach is coming very soon, prepare yourself! >> ??? ?????? ?????? ?????? ??? ????? ????? ???! >> >> >> ------------------------------------------------------------------------------ >> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester >> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the >> endpoint security space. For insight on selecting the right partner to >> tackle endpoint security challenges, access the full report. >> http://p.sf.net/sfu/symantec-dev2dev >> >> >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... <mailto:Ast...@li...> >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > ------------------------------------------------------------------------------ > Symantec Endpoint Protection 12 positioned as A LEADER in The > Forrester > Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" > in the > endpoint security space. For insight on selecting the right partner to > tackle endpoint security challenges, access the full report. > http://p.sf.net/sfu/symantec-dev2dev > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > <mailto:Ast...@li...> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > -- > ???? NOW! > Moshiach is coming very soon, prepare yourself! > ??? ?????? ?????? ?????? ??? ????? ????? ???! > > > ------------------------------------------------------------------------------ > Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester > Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the > endpoint security space. For insight on selecting the right partner to > tackle endpoint security challenges, access the full report. > http://p.sf.net/sfu/symantec-dev2dev > > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Mordechay K. <mka...@gm...> - 2013-03-06 15:18:04
|
B.H. Yves, thanks for the testing and the logs :-). That's exactly what i meant. At least in relation to dialing real PSTN numbers, matching the call by the dialed phone number will be a bad idea because it's not really unique. Theoretically, it's perfectly OK to dial the same number several times in parallel, at least if the destination is some kind of office PBX or IVR e t.c. Maybe, to workaround it will be possible to dial to "local" channel, answer() the call and then dial out from the dialplan. Then OriginateAction will always succeed almost immediately and then application will be able to track the actual dial out process by tracking the bridged channel. But IMHO it will require a lot of resources and not really practical with significant call volumes. Thanks for the advice, anyway :-) On Wed, Mar 6, 2013 at 4:56 PM, Yves A. <yv...@gm...> wrote: > maybe we talk about different things, but if i run my given code, i can > see status updates via callbackhandler... > I agree, that there is obviously no way to _immediately_ get the channelID > via asynchronous dial, but thats > no problem, because you can pass your own references to the > callbackhandler constructor. In my example it > is a simple string, but you could pass any other object there.. > if your listening to ami events only, you could match the value of the > channel (event.getChannel) against the > "number" you dialed and can track any state of your call this way.... (but > i admit... there are nuts and bolts... > redirecting calls, ringgroups, followme, local channels, queues and so on > can make track a call quite hard...) > > the following example uses callbackhandler plus eventlisteners to get all > information in realtime: > > package tests; > > > import org.asteriskjava.live.AsteriskChannel; > import org.asteriskjava.live.AsteriskQueueEntry; > import org.asteriskjava.live.AsteriskServerListener; > import org.asteriskjava.live.DefaultAsteriskServer; > import org.asteriskjava.live.MeetMeUser; > import org.asteriskjava.live.internal.AsteriskAgentImpl; > import org.asteriskjava.manager.ManagerConnection; > import org.asteriskjava.manager.ManagerEventListener; > import org.asteriskjava.manager.action.OriginateAction; > import org.asteriskjava.manager.event.BridgeEvent; > import org.asteriskjava.manager.event.ChannelUpdateEvent; > import org.asteriskjava.manager.event.DialEvent; > import org.asteriskjava.manager.event.HangupEvent; > import org.asteriskjava.manager.event.LinkEvent; > import org.asteriskjava.manager.event.ManagerEvent; > import org.asteriskjava.manager.event.NewAccountCodeEvent; > import org.asteriskjava.manager.event.NewCallerIdEvent; > import org.asteriskjava.manager.event.NewChannelEvent; > import org.asteriskjava.manager.event.NewStateEvent; > import org.asteriskjava.manager.event.OriginateFailureEvent; > import org.asteriskjava.manager.event.OriginateResponseEvent; > import org.asteriskjava.manager.event.OriginateSuccessEvent; > import org.asteriskjava.manager.event.UnlinkEvent; > > > public class CallTestWithCallbackHandler implements > AsteriskServerListener, ManagerEventListener{ > > private static ManagerConnection managerConnection; > > public CallTestWithCallbackHandler() throws Exception{ > > DefaultAsteriskServer asteriskServer = new > DefaultAsteriskServer("SERVER", "USERNAME", "PASSWORD"); > asteriskServer.getManagerConnection().login(); > asteriskServer.addAsteriskServerListener(this); > asteriskServer.getManagerConnection().addEventListener(this); > > > > try { > OriginateAction originateAction = new OriginateAction(); > originateAction.setChannel("DAHDI/g0/SOURCENUMBERHERE"); > originateAction.setContext("from-sip"); > originateAction.setExten("DESTINATIONNUMBERHERE"); > originateAction.setPriority(1); > originateAction.setTimeout(15000l); > asteriskServer.originateAsync(originateAction, new > myCallbackHandler("TESTCALL")); > > System.out.println("now idling for a minute to get a > chance to receive events and states..."); > try { > Thread.sleep(60000); > } > catch (Exception e) { > System.out.println(e.getMessage()); > } > } > catch (Exception e) { > System.out.println(e.getMessage()); > } > } > > public static void main(String[] args) throws Exception{ > CallTestWithCallbackHandler aCall = new > CallTestWithCallbackHandler(); > } > > @Override > public void onNewAsteriskChannel(AsteriskChannel channel) { > System.out.println("new Channel created... data is: "+channel); > > } > > @Override > public void onNewMeetMeUser(MeetMeUser user) { > } > > @Override > public void onNewAgent(AsteriskAgentImpl agent) { > } > > @Override > public void onNewQueueEntry(AsteriskQueueEntry entry) { > } > > @Override > public void onManagerEvent(ManagerEvent event) { > // only print out relevant events here.. > if (event instanceof NewChannelEvent > || event instanceof ChannelUpdateEvent > || event instanceof OriginateResponseEvent > || event instanceof OriginateFailureEvent > || event instanceof OriginateSuccessEvent > || event instanceof NewCallerIdEvent > || event instanceof NewStateEvent > || event instanceof LinkEvent > || event instanceof UnlinkEvent > || event instanceof BridgeEvent > || event instanceof DialEvent > || event instanceof HangupEvent) > System.out.println("got Event: "+event); > > } > > } > > an execution prints out, what happens in detail during a call setup, the > call itself and the hangup.. > output of callbackhandler is blue, managerevents are red, serverevents > are violet and important details are *black,bold and underlined*... > with this trace you can see very well, what happens at which time... > > myCallbackHandler for reference TESTCALL just instantiated. > > now idling for a minute to get a chance to receive events and states... > got Event: org.asteriskjava.manager.event.*NewChannelEvent*[dateReceived='Wed > Mar 06 15:30:02 CET > 2013',privilege='call,all',callerid=null,sequencenumber=null,state='*Rsrvd > *',channelstate='1',calleridname=null,timestamp=null,uniqueid='* > 1362580137.4260* > ',context='from-pstn',exten=null,accountcode=null,server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',channelstatedesc='Rsrvd',systemHashcode=1564136253] > got Event: org.asteriskjava.manager.event.*NewStateEvent*[dateReceived='Wed > Mar 06 15:30:02 CET > 2013',privilege='call,all',callerid=null,sequencenumber=null,state='Dialing',channelstate='3',calleridname=null,timestamp=null,uniqueid='1362580137.4260',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',channelstatedesc='Dialing',systemHashcode=959993440] > myCallbackHandler for reference TESTCALL receives state: Dialling, > channelID is: *1362580137.4260*, State is: RSRVD > new Channel created... data is: AsteriskChannel[id='*1362580137.4260*',name='DAHDI/i1/SOURCENUMBERHERE-24d',callerId='',state='RSRVD',account='null',dateOfCreation=Wed > Mar 06 15:30:02 CET > 2013,dialedChannel=null,dialingChannel=null,linkedChannel=null] > got Event: org.asteriskjava.manager.event.*NewStateEvent*[dateReceived='Wed > Mar 06 15:30:05 CET > 2013',privilege='call,all',callerid=null,sequencenumber=null,state='* > Ringing*',channelstate='5',calleridname=null,timestamp=null,uniqueid='* > 1362580137.4260* > ',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',channelstatedesc='Ringing',systemHashcode=591210723] > got Event: org.asteriskjava.manager.event.*NewStateEvent*[dateReceived='Wed > Mar 06 15:30:07 CET > 2013',privilege='call,all',callerid=null,sequencenumber=null,state='*Up* > ',channelstate='6',calleridname=null,timestamp=null,uniqueid='1362580137.4260',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',channelstatedesc='Up',systemHashcode=1084010740] > got Event: org.asteriskjava.manager.event.*OriginateResponseEvent*[dateReceived='Wed > Mar 06 15:30:07 CET > 2013',privilege='call,all',sequencenumber=null,reason='4',response='* > Success*',calleridname=null,timestamp=null,uniqueid='*1362580137.4260* > ',actionid='AJ_ORIGINATE_0',internalactionid='569616903_9',context='from-sip',exten='DESTINATIONNUMBERHERE',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',systemHashcode=1864729679] > myCallbackHandler for reference TESTCALL receives state: Success, > channelID is: *1362580137.4260*, State is: *UP* > got Event: org.asteriskjava.manager.event.*NewChannelEvent*[dateReceived='Wed > Mar 06 15:30:07 CET > 2013',privilege='call,all',callerid=null,sequencenumber=null,state='*Rsrvd > *',channelstate='1',calleridname=null,timestamp=null,uniqueid='* > 1362580141.4261* > ',context='from-pstn',exten=null,accountcode=null,server=null,calleridnum=null,channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',channelstatedesc='Rsrvd',systemHashcode=198249052] > got Event: org.asteriskjava.manager.event.*NewStateEvent*[dateReceived='Wed > Mar 06 15:30:07 CET > 2013',privilege='call,all',callerid='DESTINATIONNUMBERHERE',sequencenumber=null,state=' > *Dialing*',channelstate='3',calleridname=null,timestamp=null,uniqueid='* > 1362580141.4261* > ',server=null,calleridnum='DESTINATIONNUMBERHERE',channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',channelstatedesc='Dialing',systemHashcode=1832874625] > got Event: org.asteriskjava.manager.event.*DialEvent*[dateReceived='Wed > Mar 06 15:30:07 CET > 2013',privilege='call,all',subevent='Begin',callerid=null,dialstatus=null,sequencenumber=null, > *destuniqueid='1362580141.4261',srcuniqueid='1362580137.4260'* > ,destination='DAHDI/i1/DESTINATIONNUMBERHERE-24e',dialstring='g0/DESTINATIONNUMBERHERE',timestamp=null,calleridname=null,uniqueid='1362580137.4260',server=null,src='DAHDI/i1/SOURCENUMBERHERE-24d',calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',systemHashcode=1000613778] > new Channel created... data is: AsteriskChannel[*id='1362580141.4261'* > ,name='DAHDI/i1/DESTINATIONNUMBERHERE-24e',callerId='',state='*RSRVD*',account='null',dateOfCreation=Wed > Mar 06 15:30:07 CET > 2013,dialedChannel=null,dialingChannel=null,linkedChannel=null] > got Event: org.asteriskjava.manager.event.*NewStateEvent*[dateReceived='Wed > Mar 06 15:30:12 CET > 2013',privilege='call,all',callerid='DESTINATIONNUMBERHERE',sequencenumber=null,state=' > *Ringing*',channelstate='5',calleridname=null,timestamp=null,uniqueid='* > 1362580141.4261* > ',server=null,calleridnum='DESTINATIONNUMBERHERE',channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',channelstatedesc='Ringing',systemHashcode=158635208] > got Event: org.asteriskjava.manager.event.*NewStateEvent*[dateReceived='Wed > Mar 06 15:30:14 CET > 2013',privilege='call,all',callerid=null,sequencenumber=null,state='*Up* > ',channelstate='6',calleridname=null,timestamp=null,uniqueid='* > 1362580141.4261* > ',server=null,calleridnum=null,channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',channelstatedesc='Up',systemHashcode=1232704349] > got Event: org.asteriskjava.manager.event.*BridgeEvent*[dateReceived='Wed > Mar 06 15:30:14 CET 2013',privilege='call,all',* > uniqueid1='1362580137.4260',uniqueid2='1362580141.4261'* > ,sequencenumber=null,bridgestate='*Link* > ',bridgetype='core',timestamp=null,channel1='DAHDI/i1/SOURCENUMBERHERE-24d',channel2='DAHDI/i1/DESTINATIONNUMBERHERE-24e',callerid1=null,server=null,callerid2=null,systemHashcode=45104096] > got Event: org.asteriskjava.manager.event.*BridgeEvent*[dateReceived='Wed > Mar 06 15:30:17 CET 2013',privilege='call,all',* > uniqueid1='1362580137.4260',uniqueid2='1362580141.4261'* > ,sequencenumber=null,bridgestate='*Unlink* > ',bridgetype='core',timestamp=null,channel1='DAHDI/i1/SOURCENUMBERHERE-24d',channel2='DAHDI/i1/DESTINATIONNUMBERHERE-24e',callerid1=null,server=null,callerid2=null,systemHashcode=277466206] > got Event: org.asteriskjava.manager.event.*HangupEvent*[dateReceived='Wed > Mar 06 15:30:17 CET 2013',privilege='call,all',causetxt='Normal > Clearing',callerid=null,cause='16',sequencenumber=null,calleridname=null,timestamp=null,uniqueid=' > *1362580141.4261* > ',server=null,calleridnum=null,channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',systemHashcode=2110683211] > got Event: org.asteriskjava.manager.event.*DialEvent*[dateReceived='Wed > Mar 06 15:30:17 CET > 2013',privilege='call,all',subevent='End',callerid=null,dialstatus='* > ANSWER*',sequencenumber=null,destuniqueid=null,srcuniqueid='* > 1362580137.4260* > ',destination=null,dialstring=null,timestamp=null,calleridname=null,uniqueid='1362580137.4260',server=null,src='DAHDI/i1/SOURCENUMBERHERE-24d',calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',systemHashcode=1501740254] > got Event: org.asteriskjava.manager.event.*HangupEvent*[dateReceived='Wed > Mar 06 15:30:17 CET 2013',privilege='call,all',causetxt='Normal > Clearing',callerid=null,cause='16',sequencenumber=null,calleridname=null,timestamp=null,uniqueid=' > *1362580137.4260* > ',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',systemHashcode=373145787] > > > > regards, > yves > > Am 06.03.2013 13:23, schrieb Mordechay Kaganer: > > B.H. > > Hi > > There is indeed some problem with OriginateAction events - but it seems > to be asterisk's problem. When i send OriginateAction (in async mode, but > this doesn't really matter AFAIK), asterisk immediately create a channel > and starts to ring while it do generate all related AMI events like > NewChannelEvent, NewStateEvent on that channel, but until the call > is established or failed the AMI listener is unable to link between the > OriginateAction and the new channel. Only OriginateResponseEvent will > contain both OriginateAction's id and the newly created channel. This means > that there's no way to get status updates on ongoing originate action like > see if the channel is ringing or dialing or whatever, even that the same > app "sees" the new channel and it's status updates. > > At least, that's what i have learned from my experience. Maybe somebody > knows how to workaround this? > > > On Wed, Mar 6, 2013 at 1:38 PM, Yves A. <yv...@gm...> wrote: > >> hi, >> >> pls. see attached source... >> >> >> package tests; >> >> >> import org.asteriskjava.live.AsteriskChannel; >> import org.asteriskjava.live.DefaultAsteriskServer; >> import org.asteriskjava.live.LiveException; >> import org.asteriskjava.live.OriginateCallback; >> import org.asteriskjava.manager.ManagerConnection; >> import org.asteriskjava.manager.action.OriginateAction; >> >> >> public class CallTestWithCallbackHandler { >> >> private static ManagerConnection managerConnection; >> >> public static void main(String[] args) throws Exception{ >> >> DefaultAsteriskServer asteriskServer = new >> DefaultAsteriskServer("SERVER", "USER", "PASSWORD"); >> asteriskServer.getManagerConnection().login(); >> >> >> try { >> OriginateAction originateAction = new OriginateAction(); >> originateAction.setChannel("SIP/177"); //first leg >> originateAction.setContext("from-internal"); >> originateAction.setExten("08154711"); //second leg >> originateAction.setPriority(1); >> originateAction.setTimeout(15000); >> asteriskServer.originateAsync(originateAction, new >> myCallbackHandler("177")); >> System.out.println("now idling for a minute to get a >> chance to receive events and states..."); >> try { >> Thread.sleep(60000); >> } >> catch (Exception e) { >> System.out.println(e.getMessage()); >> } >> } >> catch (Exception e) { >> System.out.println(e.getMessage()); >> } >> } >> } >> >> >> >> package tests; >> >> import org.asteriskjava.live.AsteriskChannel; >> import org.asteriskjava.live.LiveException; >> import org.asteriskjava.live.OriginateCallback; >> >> public class myCallbackHandler implements OriginateCallback{ >> >> >> public String reference; >> >> public myCallbackHandler(String reference){ >> System.out.println("myCallbackHandler for reference "+reference+" >> just instantiated."); >> this.reference = reference; >> } >> >> public void onDialing(AsteriskChannel ac) >> { >> System.out.println("myCallbackHandler for reference "+reference+" >> receives state: Dialling, channelID is: "+ac.getId()+", State is: >> "+ac.getState()); >> >> String channelID=ac.getId(); >> } >> >> public void onBusy(AsteriskChannel ac) >> { >> System.out.println("myCallbackHandler for reference "+reference+" >> receives state: Busy, channelID is: "+ac.getId()+", State is: >> "+ac.getState()); >> } >> >> public void onFailure(LiveException le) >> { >> System.out.println("myCallbackHandler for reference "+reference+" >> receives state: Failure "+le.getMessage()); >> } >> >> public void onNoAnswer(AsteriskChannel ac) >> { >> System.out.println("myCallbackHandler for reference "+reference+" >> receives state: No Answer, channelID is: "+ac.getId()+", State is: >> "+ac.getState()); >> } >> >> public void onSuccess(AsteriskChannel ac) >> { >> System.out.println("myCallbackHandler for reference "+reference+" >> receives state: Success, channelID is: "+ac.getId()+", State is: >> "+ac.getState()); >> } >> >> } >> >> >> regards, >> yves >> >> >> Am 06.03.2013 04:57, schrieb roko: >> >> Hi >> >> I use the SendActionCallback, but I'm getting the same response that I >> get from the blocking function... no new data. So, how can I get the value >> of the ORIGINATE_STATUS variable ? >> >> E. >> >> ------------------------------ >> *De:* roko <ro...@ya...> <ro...@ya...> >> *Para:* "ast...@li..."<ast...@li...> >> <ast...@li...><ast...@li...> >> *Enviado:* Lunes, 4 de marzo, 2013 10:38 A.M. >> *Asunto:* Re: [Asterisk-java-users] How to get ORIGINATE_STATUS value >> after OriginateAction >> >> Hi >> >> Thx for your answer. Do you mean instead of blocking using: >> >> ManagerResponse<http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/response/ManagerResponse.html> >> sendAction(ManagerAction<http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/action/ManagerAction.html> action, >> long timeout) >> >> Should I use this function ?: >> >> void sendAction(ManagerAction<http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/action/ManagerAction.html> action, >> SendActionCallback<http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/SendActionCallback.html> >> callback) >> >> I see in the docs that I still get a ManagerResponse<http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/response/ManagerResponse.html>. >> Pls forgive me, I'm very new at this. How can I get the ORIGINATE_STATUS >> from the ManagerResponse object ? Do you have an example that I could use >> ? Thx for your help. >> >> E. >> >> ------------------------------ >> *De:* Yves A. <yv...@gm...> <yv...@gm...> >> *Para:* ast...@li... >> *Enviado:* Lunes, 4 de marzo, 2013 2:45 A.M. >> *Asunto:* Re: [Asterisk-java-users] How to get ORIGINATE_STATUS value >> after OriginateAction >> >> Hi, >> >> you could use a callback handler. this way you´ll get informed about any >> state change. >> >> yves >> >> Am 04.03.2013 04:06, schrieb roko: >> >> Hi everyone >> >> I'm just starting with asterisk and asterisk-java, so please forgive me >> if this is a silly question. Here >> (http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate)<http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate>I can see that the originate cmd sets the ORIGINATE_STATUS variable before >> exiting. How can I get this value from asterisk-java ? At this point I'm >> using the code from the tutorial, like this: >> >> OriginateAction originateAction; >> ManagerResponse originateResponse; >> >> originateAction = new OriginateAction(); >> originateAction.setChannel("SIP/John"); >> originateAction.setContext("default"); >> originateAction.setExten("1300"); >> originateAction.setPriority(new Integer(1)); >> originateAction.setTimeout(new Integer(30000)); >> >> managerConnection.login(); >> originateResponse = managerConnection.sendAction(originateAction, 30000); >> >> Thx for your help. >> >> E. >> >> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today:http://p.sf.net/sfu/appdyn_d2d_feb >> >> >> >> _______________________________________________ >> Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> >> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_d2d_feb >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> >> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_d2d_feb >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> >> >> ------------------------------------------------------------------------------ >> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester >> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the >> endpoint security space. For insight on selecting the right partner to >> tackle endpoint security challenges, access the full report. http://p.sf.net/sfu/symantec-dev2dev >> >> >> >> _______________________________________________ >> Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> >> >> ------------------------------------------------------------------------------ >> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester >> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the >> endpoint security space. For insight on selecting the right partner to >> tackle endpoint security challenges, access the full report. >> http://p.sf.net/sfu/symantec-dev2dev >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> > > > -- > משיח NOW! > Moshiach is coming very soon, prepare yourself! > יחי אדוננו מורינו ורבינו מלך המשיח לעולם ועד! > > > ------------------------------------------------------------------------------ > Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester > Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the > endpoint security space. For insight on selecting the right partner to > tackle endpoint security challenges, access the full report. http://p.sf.net/sfu/symantec-dev2dev > > > > _______________________________________________ > Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > ------------------------------------------------------------------------------ > Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester > Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the > endpoint security space. For insight on selecting the right partner to > tackle endpoint security challenges, access the full report. > http://p.sf.net/sfu/symantec-dev2dev > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > -- משיח NOW! Moshiach is coming very soon, prepare yourself! יחי אדוננו מורינו ורבינו מלך המשיח לעולם ועד! |
From: Yves A. <yv...@gm...> - 2013-03-06 14:56:30
|
maybe we talk about different things, but if i run my given code, i can see status updates via callbackhandler... I agree, that there is obviously no way to _immediately_ get the channelID via asynchronous dial, but thats no problem, because you can pass your own references to the callbackhandler constructor. In my example it is a simple string, but you could pass any other object there.. if your listening to ami events only, you could match the value of the channel (event.getChannel) against the "number" you dialed and can track any state of your call this way.... (but i admit... there are nuts and bolts... redirecting calls, ringgroups, followme, local channels, queues and so on can make track a call quite hard...) the following example uses callbackhandler plus eventlisteners to get all information in realtime: package tests; import org.asteriskjava.live.AsteriskChannel; import org.asteriskjava.live.AsteriskQueueEntry; import org.asteriskjava.live.AsteriskServerListener; import org.asteriskjava.live.DefaultAsteriskServer; import org.asteriskjava.live.MeetMeUser; import org.asteriskjava.live.internal.AsteriskAgentImpl; import org.asteriskjava.manager.ManagerConnection; import org.asteriskjava.manager.ManagerEventListener; import org.asteriskjava.manager.action.OriginateAction; import org.asteriskjava.manager.event.BridgeEvent; import org.asteriskjava.manager.event.ChannelUpdateEvent; import org.asteriskjava.manager.event.DialEvent; import org.asteriskjava.manager.event.HangupEvent; import org.asteriskjava.manager.event.LinkEvent; import org.asteriskjava.manager.event.ManagerEvent; import org.asteriskjava.manager.event.NewAccountCodeEvent; import org.asteriskjava.manager.event.NewCallerIdEvent; import org.asteriskjava.manager.event.NewChannelEvent; import org.asteriskjava.manager.event.NewStateEvent; import org.asteriskjava.manager.event.OriginateFailureEvent; import org.asteriskjava.manager.event.OriginateResponseEvent; import org.asteriskjava.manager.event.OriginateSuccessEvent; import org.asteriskjava.manager.event.UnlinkEvent; public class CallTestWithCallbackHandler implements AsteriskServerListener, ManagerEventListener{ private static ManagerConnection managerConnection; public CallTestWithCallbackHandler() throws Exception{ DefaultAsteriskServer asteriskServer = new DefaultAsteriskServer("SERVER", "USERNAME", "PASSWORD"); asteriskServer.getManagerConnection().login(); asteriskServer.addAsteriskServerListener(this); asteriskServer.getManagerConnection().addEventListener(this); try { OriginateAction originateAction = new OriginateAction(); originateAction.setChannel("DAHDI/g0/SOURCENUMBERHERE"); originateAction.setContext("from-sip"); originateAction.setExten("DESTINATIONNUMBERHERE"); originateAction.setPriority(1); originateAction.setTimeout(15000l); asteriskServer.originateAsync(originateAction, new myCallbackHandler("TESTCALL")); System.out.println("now idling for a minute to get a chance to receive events and states..."); try { Thread.sleep(60000); } catch (Exception e) { System.out.println(e.getMessage()); } } catch (Exception e) { System.out.println(e.getMessage()); } } public static void main(String[] args) throws Exception{ CallTestWithCallbackHandler aCall = new CallTestWithCallbackHandler(); } @Override public void onNewAsteriskChannel(AsteriskChannel channel) { System.out.println("new Channel created... data is: "+channel); } @Override public void onNewMeetMeUser(MeetMeUser user) { } @Override public void onNewAgent(AsteriskAgentImpl agent) { } @Override public void onNewQueueEntry(AsteriskQueueEntry entry) { } @Override public void onManagerEvent(ManagerEvent event) { // only print out relevant events here.. if (event instanceof NewChannelEvent || event instanceof ChannelUpdateEvent || event instanceof OriginateResponseEvent || event instanceof OriginateFailureEvent || event instanceof OriginateSuccessEvent || event instanceof NewCallerIdEvent || event instanceof NewStateEvent || event instanceof LinkEvent || event instanceof UnlinkEvent || event instanceof BridgeEvent || event instanceof DialEvent || event instanceof HangupEvent) System.out.println("got Event: "+event); } } an execution prints out, what happens in detail during a call setup, the call itself and the hangup.. output of callbackhandler is blue, managerevents are red, serverevents are violet and important details are _*black,bold and underlined*_... with this trace you can see very well, what happens at which time... myCallbackHandler for reference TESTCALL just instantiated. now idling for a minute to get a chance to receive events and states... got Event: org.asteriskjava.manager.event._*NewChannelEvent*_[dateReceived='Wed Mar 06 15:30:02 CET 2013',privilege='call,all',callerid=null,sequencenumber=null,state='_*Rsrvd*_',channelstate='1',calleridname=null,timestamp=null,uniqueid='_*1362580137.4260*_',context='from-pstn',exten=null,accountcode=null,server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',channelstatedesc='Rsrvd',systemHashcode=1564136253] got Event: org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed Mar 06 15:30:02 CET 2013',privilege='call,all',callerid=null,sequencenumber=null,state='Dialing',channelstate='3',calleridname=null,timestamp=null,uniqueid='1362580137.4260',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',channelstatedesc='Dialing',systemHashcode=959993440] myCallbackHandler for reference TESTCALL receives state: Dialling, channelID is: *_1362580137.4260_*, State is: RSRVD new Channel created... data is: AsteriskChannel[id='_*1362580137.4260*_',name='DAHDI/i1/SOURCENUMBERHERE-24d',callerId='',state='RSRVD',account='null',dateOfCreation=Wed Mar 06 15:30:02 CET 2013,dialedChannel=null,dialingChannel=null,linkedChannel=null] got Event: org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed Mar 06 15:30:05 CET 2013',privilege='call,all',callerid=null,sequencenumber=null,state='*_Ringing_*',channelstate='5',calleridname=null,timestamp=null,uniqueid='_*1362580137.4260*_',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',channelstatedesc='Ringing',systemHashcode=591210723] got Event: org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed Mar 06 15:30:07 CET 2013',privilege='call,all',callerid=null,sequencenumber=null,state='_*Up*_',channelstate='6',calleridname=null,timestamp=null,uniqueid='1362580137.4260',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',channelstatedesc='Up',systemHashcode=1084010740] got Event: org.asteriskjava.manager.event._*OriginateResponseEvent*_[dateReceived='Wed Mar 06 15:30:07 CET 2013',privilege='call,all',sequencenumber=null,reason='4',response='_*Success*_',calleridname=null,timestamp=null,uniqueid='_*1362580137.4260*_',actionid='AJ_ORIGINATE_0',internalactionid='569616903_9',context='from-sip',exten='DESTINATIONNUMBERHERE',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',systemHashcode=1864729679] myCallbackHandler for reference TESTCALL receives state: Success, channelID is: _*1362580137.4260*_, State is: _*UP*_ got Event: org.asteriskjava.manager.event._*NewChannelEvent*_[dateReceived='Wed Mar 06 15:30:07 CET 2013',privilege='call,all',callerid=null,sequencenumber=null,state='_*Rsrvd*_',channelstate='1',calleridname=null,timestamp=null,uniqueid='_*1362580141.4261*_',context='from-pstn',exten=null,accountcode=null,server=null,calleridnum=null,channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',channelstatedesc='Rsrvd',systemHashcode=198249052] got Event: org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed Mar 06 15:30:07 CET 2013',privilege='call,all',callerid='DESTINATIONNUMBERHERE',sequencenumber=null,state='_*Dialing*_',channelstate='3',calleridname=null,timestamp=null,uniqueid='_*1362580141.4261*_',server=null,calleridnum='DESTINATIONNUMBERHERE',channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',channelstatedesc='Dialing',systemHashcode=1832874625] got Event: org.asteriskjava.manager.event._*DialEvent*_[dateReceived='Wed Mar 06 15:30:07 CET 2013',privilege='call,all',subevent='Begin',callerid=null,dialstatus=null,sequencenumber=null,_*destuniqueid='1362580141.4261',srcuniqueid='1362580137.4260'*_,destination='DAHDI/i1/DESTINATIONNUMBERHERE-24e',dialstring='g0/DESTINATIONNUMBERHERE',timestamp=null,calleridname=null,uniqueid='1362580137.4260',server=null,src='DAHDI/i1/SOURCENUMBERHERE-24d',calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',systemHashcode=1000613778] new Channel created... data is: AsteriskChannel[_*id='1362580141.4261'*_,name='DAHDI/i1/DESTINATIONNUMBERHERE-24e',callerId='',state='_*RSRVD*_',account='null',dateOfCreation=Wed Mar 06 15:30:07 CET 2013,dialedChannel=null,dialingChannel=null,linkedChannel=null] got Event: org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed Mar 06 15:30:12 CET 2013',privilege='call,all',callerid='DESTINATIONNUMBERHERE',sequencenumber=null,state='_*Ringing*_',channelstate='5',calleridname=null,timestamp=null,uniqueid='_*1362580141.4261*_',server=null,calleridnum='DESTINATIONNUMBERHERE',channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',channelstatedesc='Ringing',systemHashcode=158635208] got Event: org.asteriskjava.manager.event._*NewStateEvent*_[dateReceived='Wed Mar 06 15:30:14 CET 2013',privilege='call,all',callerid=null,sequencenumber=null,state='_*Up*_',channelstate='6',calleridname=null,timestamp=null,uniqueid='*_1362580141.4261_*',server=null,calleridnum=null,channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',channelstatedesc='Up',systemHashcode=1232704349] got Event: org.asteriskjava.manager.event._*BridgeEvent*_[dateReceived='Wed Mar 06 15:30:14 CET 2013',privilege='call,all',_*uniqueid1='1362580137.4260',uniqueid2='1362580141.4261'*_,sequencenumber=null,bridgestate='_*Link*_',bridgetype='core',timestamp=null,channel1='DAHDI/i1/SOURCENUMBERHERE-24d',channel2='DAHDI/i1/DESTINATIONNUMBERHERE-24e',callerid1=null,server=null,callerid2=null,systemHashcode=45104096] got Event: org.asteriskjava.manager.event._*BridgeEvent*_[dateReceived='Wed Mar 06 15:30:17 CET 2013',privilege='call,all',_*uniqueid1='1362580137.4260',uniqueid2='1362580141.4261'*_,sequencenumber=null,bridgestate='_*Unlink*_',bridgetype='core',timestamp=null,channel1='DAHDI/i1/SOURCENUMBERHERE-24d',channel2='DAHDI/i1/DESTINATIONNUMBERHERE-24e',callerid1=null,server=null,callerid2=null,systemHashcode=277466206] got Event: org.asteriskjava.manager.event._*HangupEvent*_[dateReceived='Wed Mar 06 15:30:17 CET 2013',privilege='call,all',causetxt='Normal Clearing',callerid=null,cause='16',sequencenumber=null,calleridname=null,timestamp=null,uniqueid='_*1362580141.4261*_',server=null,calleridnum=null,channel='DAHDI/i1/DESTINATIONNUMBERHERE-24e',systemHashcode=2110683211] got Event: org.asteriskjava.manager.event._*DialEvent*_[dateReceived='Wed Mar 06 15:30:17 CET 2013',privilege='call,all',subevent='End',callerid=null,dialstatus='*_ANSWER_*',sequencenumber=null,destuniqueid=null,srcuniqueid='*_1362580137.4260_*',destination=null,dialstring=null,timestamp=null,calleridname=null,uniqueid='1362580137.4260',server=null,src='DAHDI/i1/SOURCENUMBERHERE-24d',calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',systemHashcode=1501740254] got Event: org.asteriskjava.manager.event._*HangupEvent*_[dateReceived='Wed Mar 06 15:30:17 CET 2013',privilege='call,all',causetxt='Normal Clearing',callerid=null,cause='16',sequencenumber=null,calleridname=null,timestamp=null,uniqueid='_*1362580137.4260*_',server=null,calleridnum=null,channel='DAHDI/i1/SOURCENUMBERHERE-24d',systemHashcode=373145787] regards, yves Am 06.03.2013 13:23, schrieb Mordechay Kaganer: > B.H. > > Hi > > There is indeed some problem with OriginateAction events - but it > seems to be asterisk's problem. When i send OriginateAction (in async > mode, but this doesn't really matter AFAIK), asterisk immediately > create a channel and starts to ring while it do generate all related > AMI events like NewChannelEvent, NewStateEvent on that channel, but > until the call is established or failed the AMI listener is unable to > link between the OriginateAction and the new channel. > Only OriginateResponseEvent will contain both OriginateAction's id and > the newly created channel. This means that there's no way to get > status updates on ongoing originate action like see if the channel is > ringing or dialing or whatever, even that the same app "sees" the new > channel and it's status updates. > > At least, that's what i have learned from my experience. Maybe > somebody knows how to workaround this? > > > On Wed, Mar 6, 2013 at 1:38 PM, Yves A. <yv...@gm... > <mailto:yv...@gm...>> wrote: > > hi, > > pls. see attached source... > > > package tests; > > > import org.asteriskjava.live.AsteriskChannel; > import org.asteriskjava.live.DefaultAsteriskServer; > import org.asteriskjava.live.LiveException; > import org.asteriskjava.live.OriginateCallback; > import org.asteriskjava.manager.ManagerConnection; > import org.asteriskjava.manager.action.OriginateAction; > > > public class CallTestWithCallbackHandler { > > private static ManagerConnection managerConnection; > > public static void main(String[] args) throws Exception{ > > DefaultAsteriskServer asteriskServer = new > DefaultAsteriskServer("SERVER", "USER", "PASSWORD"); > asteriskServer.getManagerConnection().login(); > > > try { > OriginateAction originateAction = new > OriginateAction(); > originateAction.setChannel("SIP/177");//first leg > originateAction.setContext("from-internal"); > originateAction.setExten("08154711"); //second leg > originateAction.setPriority(1); > originateAction.setTimeout(15000); > asteriskServer.originateAsync(originateAction, new > myCallbackHandler("177")); > System.out.println("now idling for a minute to get > a chance to receive events and states..."); > try { > Thread.sleep(60000); > } > catch (Exception e) { > System.out.println(e.getMessage()); > } > } > catch (Exception e) { > System.out.println(e.getMessage()); > } > } > } > > > > package tests; > > import org.asteriskjava.live.AsteriskChannel; > import org.asteriskjava.live.LiveException; > import org.asteriskjava.live.OriginateCallback; > > public class myCallbackHandler implements OriginateCallback{ > > > public String reference; > > public myCallbackHandler(String reference){ > System.out.println("myCallbackHandler for reference > "+reference+" just instantiated."); > this.reference = reference; > } > > public void onDialing(AsteriskChannel ac) > { > System.out.println("myCallbackHandler for reference > "+reference+" receives state: Dialling, channelID is: > "+ac.getId()+", State is: "+ac.getState()); > > String channelID=ac.getId(); > } > > public void onBusy(AsteriskChannel ac) > { > System.out.println("myCallbackHandler for reference > "+reference+" receives state: Busy, channelID is: "+ac.getId()+", > State is: "+ac.getState()); > } > > public void onFailure(LiveException le) > { > System.out.println("myCallbackHandler for reference > "+reference+" receives state: Failure "+le.getMessage()); > } > > public void onNoAnswer(AsteriskChannel ac) > { > System.out.println("myCallbackHandler for reference > "+reference+" receives state: No Answer, channelID is: > "+ac.getId()+", State is: "+ac.getState()); > } > > public void onSuccess(AsteriskChannel ac) > { > System.out.println("myCallbackHandler for reference > "+reference+" receives state: Success, channelID is: > "+ac.getId()+", State is: "+ac.getState()); > } > > } > > > regards, > yves > > > Am 06.03.2013 04:57, schrieb roko: >> Hi >> >> I use the SendActionCallback, but I'm getting the same response >> that I get from the blocking function... no new data. So, how >> can I get the value of the ORIGINATE_STATUS variable ? >> >> E. >> >> ------------------------------------------------------------------------ >> *De:* roko <ro...@ya...> <mailto:ro...@ya...> >> *Para:* "ast...@li..." >> <mailto:ast...@li...> >> <ast...@li...> >> <mailto:ast...@li...> >> *Enviado:* Lunes, 4 de marzo, 2013 10:38 A.M. >> *Asunto:* Re: [Asterisk-java-users] How to get ORIGINATE_STATUS >> value after OriginateAction >> >> Hi >> >> Thx for your answer. Do you mean instead of blocking using: >> >> ManagerResponse >> <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/response/ManagerResponse.html> sendAction(ManagerAction >> <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/action/ManagerAction.html> action, >> long timeout) >> >> Should I use this function ?: >> >> void sendAction(ManagerAction >> <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/action/ManagerAction.html> action, >> SendActionCallback >> <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/SendActionCallback.html> callback) >> >> I see in the docs that I still get a ManagerResponse >> <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/response/ManagerResponse.html>. >> Pls forgive me, I'm very new at this. How can I get the >> ORIGINATE_STATUS from the ManagerResponse object ? Do you have an >> example that I could use ? Thx for your help. >> >> E. >> >> ------------------------------------------------------------------------ >> *De:* Yves A. <yv...@gm...> <mailto:yv...@gm...> >> *Para:* ast...@li... >> <mailto:ast...@li...> >> *Enviado:* Lunes, 4 de marzo, 2013 2:45 A.M. >> *Asunto:* Re: [Asterisk-java-users] How to get ORIGINATE_STATUS >> value after OriginateAction >> >> Hi, >> >> you could use a callback handler. this way you´ll get informed >> about any state change. >> >> yves >> >> Am 04.03.2013 04:06, schrieb roko: >>> Hi everyone >>> >>> I'm just starting with asterisk and asterisk-java, so please >>> forgive me if this is a silly question. Here >>> (http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate) >>> <http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate> I >>> can see that the originate cmd sets the ORIGINATE_STATUS >>> variable before exiting. How can I get this value from >>> asterisk-java ? At this point I'm using the code from the >>> tutorial, like this: >>> OriginateAction originateAction; >>> ManagerResponse originateResponse; >>> >>> originateAction = new OriginateAction(); >>> originateAction.setChannel("SIP/John"); >>> originateAction.setContext("default"); >>> originateAction.setExten("1300"); >>> originateAction.setPriority(new Integer(1)); >>> originateAction.setTimeout(new Integer(30000)); >>> >>> managerConnection.login(); >>> originateResponse = managerConnection.sendAction(originateAction, 30000); >>> Thx for your help. >>> >>> E. >>> >>> >>> ------------------------------------------------------------------------------ >>> Everyone hates slow websites. So do we. >>> Make your web apps faster with AppDynamics >>> Download AppDynamics Lite for free today: >>> http://p.sf.net/sfu/appdyn_d2d_feb >>> >>> >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... <mailto:Ast...@li...> >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_d2d_feb >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> <mailto:Ast...@li...> >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_d2d_feb >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> <mailto:Ast...@li...> >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> >> >> >> ------------------------------------------------------------------------------ >> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester >> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the >> endpoint security space. For insight on selecting the right partner to >> tackle endpoint security challenges, access the full report. >> http://p.sf.net/sfu/symantec-dev2dev >> >> >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... <mailto:Ast...@li...> >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > ------------------------------------------------------------------------------ > Symantec Endpoint Protection 12 positioned as A LEADER in The > Forrester > Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" > in the > endpoint security space. For insight on selecting the right partner to > tackle endpoint security challenges, access the full report. > http://p.sf.net/sfu/symantec-dev2dev > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > <mailto:Ast...@li...> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > -- > ???? NOW! > Moshiach is coming very soon, prepare yourself! > ??? ?????? ?????? ?????? ??? ????? ????? ???! > > > ------------------------------------------------------------------------------ > Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester > Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the > endpoint security space. For insight on selecting the right partner to > tackle endpoint security challenges, access the full report. > http://p.sf.net/sfu/symantec-dev2dev > > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Mordechay K. <mka...@gm...> - 2013-03-06 12:23:19
|
B.H. Hi There is indeed some problem with OriginateAction events - but it seems to be asterisk's problem. When i send OriginateAction (in async mode, but this doesn't really matter AFAIK), asterisk immediately create a channel and starts to ring while it do generate all related AMI events like NewChannelEvent, NewStateEvent on that channel, but until the call is established or failed the AMI listener is unable to link between the OriginateAction and the new channel. Only OriginateResponseEvent will contain both OriginateAction's id and the newly created channel. This means that there's no way to get status updates on ongoing originate action like see if the channel is ringing or dialing or whatever, even that the same app "sees" the new channel and it's status updates. At least, that's what i have learned from my experience. Maybe somebody knows how to workaround this? On Wed, Mar 6, 2013 at 1:38 PM, Yves A. <yv...@gm...> wrote: > hi, > > pls. see attached source... > > > package tests; > > > import org.asteriskjava.live.AsteriskChannel; > import org.asteriskjava.live.DefaultAsteriskServer; > import org.asteriskjava.live.LiveException; > import org.asteriskjava.live.OriginateCallback; > import org.asteriskjava.manager.ManagerConnection; > import org.asteriskjava.manager.action.OriginateAction; > > > public class CallTestWithCallbackHandler { > > private static ManagerConnection managerConnection; > > public static void main(String[] args) throws Exception{ > > DefaultAsteriskServer asteriskServer = new > DefaultAsteriskServer("SERVER", "USER", "PASSWORD"); > asteriskServer.getManagerConnection().login(); > > > try { > OriginateAction originateAction = new OriginateAction(); > originateAction.setChannel("SIP/177"); //first leg > originateAction.setContext("from-internal"); > originateAction.setExten("08154711"); //second leg > originateAction.setPriority(1); > originateAction.setTimeout(15000); > asteriskServer.originateAsync(originateAction, new > myCallbackHandler("177")); > System.out.println("now idling for a minute to get a > chance to receive events and states..."); > try { > Thread.sleep(60000); > } > catch (Exception e) { > System.out.println(e.getMessage()); > } > } > catch (Exception e) { > System.out.println(e.getMessage()); > } > } > } > > > > package tests; > > import org.asteriskjava.live.AsteriskChannel; > import org.asteriskjava.live.LiveException; > import org.asteriskjava.live.OriginateCallback; > > public class myCallbackHandler implements OriginateCallback{ > > > public String reference; > > public myCallbackHandler(String reference){ > System.out.println("myCallbackHandler for reference "+reference+" > just instantiated."); > this.reference = reference; > } > > public void onDialing(AsteriskChannel ac) > { > System.out.println("myCallbackHandler for reference "+reference+" > receives state: Dialling, channelID is: "+ac.getId()+", State is: > "+ac.getState()); > > String channelID=ac.getId(); > } > > public void onBusy(AsteriskChannel ac) > { > System.out.println("myCallbackHandler for reference "+reference+" > receives state: Busy, channelID is: "+ac.getId()+", State is: > "+ac.getState()); > } > > public void onFailure(LiveException le) > { > System.out.println("myCallbackHandler for reference "+reference+" > receives state: Failure "+le.getMessage()); > } > > public void onNoAnswer(AsteriskChannel ac) > { > System.out.println("myCallbackHandler for reference "+reference+" > receives state: No Answer, channelID is: "+ac.getId()+", State is: > "+ac.getState()); > } > > public void onSuccess(AsteriskChannel ac) > { > System.out.println("myCallbackHandler for reference "+reference+" > receives state: Success, channelID is: "+ac.getId()+", State is: > "+ac.getState()); > } > > } > > > regards, > yves > > > Am 06.03.2013 04:57, schrieb roko: > > Hi > > I use the SendActionCallback, but I'm getting the same response that I get > from the blocking function... no new data. So, how can I get the value of > the ORIGINATE_STATUS variable ? > > E. > > ------------------------------ > *De:* roko <ro...@ya...> <ro...@ya...> > *Para:* "ast...@li..."<ast...@li...> > <ast...@li...><ast...@li...> > *Enviado:* Lunes, 4 de marzo, 2013 10:38 A.M. > *Asunto:* Re: [Asterisk-java-users] How to get ORIGINATE_STATUS value > after OriginateAction > > Hi > > Thx for your answer. Do you mean instead of blocking using: > > ManagerResponse<http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/response/ManagerResponse.html> > sendAction(ManagerAction<http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/action/ManagerAction.html> action, > long timeout) > > Should I use this function ?: > > void sendAction(ManagerAction<http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/action/ManagerAction.html> action, > SendActionCallback<http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/SendActionCallback.html> > callback) > > I see in the docs that I still get a ManagerResponse<http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/response/ManagerResponse.html>. > Pls forgive me, I'm very new at this. How can I get the ORIGINATE_STATUS > from the ManagerResponse object ? Do you have an example that I could use > ? Thx for your help. > > E. > > ------------------------------ > *De:* Yves A. <yv...@gm...> <yv...@gm...> > *Para:* ast...@li... > *Enviado:* Lunes, 4 de marzo, 2013 2:45 A.M. > *Asunto:* Re: [Asterisk-java-users] How to get ORIGINATE_STATUS value > after OriginateAction > > Hi, > > you could use a callback handler. this way you´ll get informed about any > state change. > > yves > > Am 04.03.2013 04:06, schrieb roko: > > Hi everyone > > I'm just starting with asterisk and asterisk-java, so please forgive me > if this is a silly question. Here > (http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate)<http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate>I can see that the originate cmd sets the ORIGINATE_STATUS variable before > exiting. How can I get this value from asterisk-java ? At this point I'm > using the code from the tutorial, like this: > > OriginateAction originateAction; > ManagerResponse originateResponse; > > originateAction = new OriginateAction(); > originateAction.setChannel("SIP/John"); > originateAction.setContext("default"); > originateAction.setExten("1300"); > originateAction.setPriority(new Integer(1)); > originateAction.setTimeout(new Integer(30000)); > > managerConnection.login(); > originateResponse = managerConnection.sendAction(originateAction, 30000); > > Thx for your help. > > E. > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today:http://p.sf.net/sfu/appdyn_d2d_feb > > > > _______________________________________________ > Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > ------------------------------------------------------------------------------ > Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester > Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the > endpoint security space. For insight on selecting the right partner to > tackle endpoint security challenges, access the full report. http://p.sf.net/sfu/symantec-dev2dev > > > > _______________________________________________ > Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > ------------------------------------------------------------------------------ > Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester > Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the > endpoint security space. For insight on selecting the right partner to > tackle endpoint security challenges, access the full report. > http://p.sf.net/sfu/symantec-dev2dev > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > -- משיח NOW! Moshiach is coming very soon, prepare yourself! יחי אדוננו מורינו ורבינו מלך המשיח לעולם ועד! |
From: Yves A. <yv...@gm...> - 2013-03-06 11:38:25
|
hi, pls. see attached source... package tests; import org.asteriskjava.live.AsteriskChannel; import org.asteriskjava.live.DefaultAsteriskServer; import org.asteriskjava.live.LiveException; import org.asteriskjava.live.OriginateCallback; import org.asteriskjava.manager.ManagerConnection; import org.asteriskjava.manager.action.OriginateAction; public class CallTestWithCallbackHandler { private static ManagerConnection managerConnection; public static void main(String[] args) throws Exception{ DefaultAsteriskServer asteriskServer = new DefaultAsteriskServer("SERVER", "USER", "PASSWORD"); asteriskServer.getManagerConnection().login(); try { OriginateAction originateAction = new OriginateAction(); originateAction.setChannel("SIP/177");//first leg originateAction.setContext("from-internal"); originateAction.setExten("08154711"); //second leg originateAction.setPriority(1); originateAction.setTimeout(15000); asteriskServer.originateAsync(originateAction, new myCallbackHandler("177")); System.out.println("now idling for a minute to get a chance to receive events and states..."); try { Thread.sleep(60000); } catch (Exception e) { System.out.println(e.getMessage()); } } catch (Exception e) { System.out.println(e.getMessage()); } } } package tests; import org.asteriskjava.live.AsteriskChannel; import org.asteriskjava.live.LiveException; import org.asteriskjava.live.OriginateCallback; public class myCallbackHandler implements OriginateCallback{ public String reference; public myCallbackHandler(String reference){ System.out.println("myCallbackHandler for reference "+reference+" just instantiated."); this.reference = reference; } public void onDialing(AsteriskChannel ac) { System.out.println("myCallbackHandler for reference "+reference+" receives state: Dialling, channelID is: "+ac.getId()+", State is: "+ac.getState()); String channelID=ac.getId(); } public void onBusy(AsteriskChannel ac) { System.out.println("myCallbackHandler for reference "+reference+" receives state: Busy, channelID is: "+ac.getId()+", State is: "+ac.getState()); } public void onFailure(LiveException le) { System.out.println("myCallbackHandler for reference "+reference+" receives state: Failure "+le.getMessage()); } public void onNoAnswer(AsteriskChannel ac) { System.out.println("myCallbackHandler for reference "+reference+" receives state: No Answer, channelID is: "+ac.getId()+", State is: "+ac.getState()); } public void onSuccess(AsteriskChannel ac) { System.out.println("myCallbackHandler for reference "+reference+" receives state: Success, channelID is: "+ac.getId()+", State is: "+ac.getState()); } } regards, yves Am 06.03.2013 04:57, schrieb roko: > Hi > > I use the SendActionCallback, but I'm getting the same response that I > get from the blocking function... no new data. So, how can I get the > value of the ORIGINATE_STATUS variable ? > > E. > > ------------------------------------------------------------------------ > *De:* roko <ro...@ya...> > *Para:* "ast...@li..." > <ast...@li...> > *Enviado:* Lunes, 4 de marzo, 2013 10:38 A.M. > *Asunto:* Re: [Asterisk-java-users] How to get ORIGINATE_STATUS value > after OriginateAction > > Hi > > Thx for your answer. Do you mean instead of blocking using: > > ManagerResponse > <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/response/ManagerResponse.html> sendAction(ManagerAction > <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/action/ManagerAction.html> action, > long timeout) > > Should I use this function ?: > > void sendAction(ManagerAction > <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/action/ManagerAction.html> action, > SendActionCallback > <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/SendActionCallback.html> callback) > > I see in the docs that I still get a ManagerResponse > <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/response/ManagerResponse.html>. > Pls forgive me, I'm very new at this. How can I get the > ORIGINATE_STATUS from the ManagerResponse object ? Do you have an > example that I could use ? Thx for your help. > > E. > > ------------------------------------------------------------------------ > *De:* Yves A. <yv...@gm...> > *Para:* ast...@li... > *Enviado:* Lunes, 4 de marzo, 2013 2:45 A.M. > *Asunto:* Re: [Asterisk-java-users] How to get ORIGINATE_STATUS value > after OriginateAction > > Hi, > > you could use a callback handler. this way you´ll get informed about > any state change. > > yves > > Am 04.03.2013 04:06, schrieb roko: >> Hi everyone >> >> I'm just starting with asterisk and asterisk-java, so please forgive >> me if this is a silly question. Here >> (http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate) >> <http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate> I can see >> that the originate cmd sets the ORIGINATE_STATUS variable before >> exiting. How can I get this value from asterisk-java ? At this point >> I'm using the code from the tutorial, like this: >> OriginateAction originateAction; >> ManagerResponse originateResponse; >> >> originateAction = new OriginateAction(); >> originateAction.setChannel("SIP/John"); >> originateAction.setContext("default"); >> originateAction.setExten("1300"); >> originateAction.setPriority(new Integer(1)); >> originateAction.setTimeout(new Integer(30000)); >> >> managerConnection.login(); >> originateResponse = managerConnection.sendAction(originateAction, 30000); >> Thx for your help. >> >> E. >> >> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_d2d_feb >> >> >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... <mailto:Ast...@li...> >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > <mailto:Ast...@li...> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > <mailto:Ast...@li...> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > ------------------------------------------------------------------------------ > Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester > Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the > endpoint security space. For insight on selecting the right partner to > tackle endpoint security challenges, access the full report. > http://p.sf.net/sfu/symantec-dev2dev > > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: roko <ro...@ya...> - 2013-03-06 03:57:20
|
Hi I use the SendActionCallback, but I'm getting the same response that I get from the blocking function... no new data. So, how can I get the value of the ORIGINATE_STATUS variable ? E. ________________________________ De: roko <ro...@ya...> Para: "ast...@li..." <ast...@li...> Enviado: Lunes, 4 de marzo, 2013 10:38 A.M. Asunto: Re: [Asterisk-java-users] How to get ORIGINATE_STATUS value after OriginateAction Hi Thx for your answer. Do you mean instead of blocking using: ManagerResponse sendAction(ManagerAction action, long timeout) Should I use this function ?: void sendAction(ManagerAction action, SendActionCallback callback) I see in the docs that I still get a ManagerResponse. Pls forgive me, I'm very new at this. How can I get the ORIGINATE_STATUS from the ManagerResponse object ? Do you have an example that I could use ? Thx for your help. E. ________________________________ De: Yves A. <yv...@gm...> Para: ast...@li... Enviado: Lunes, 4 de marzo, 2013 2:45 A.M. Asunto: Re: [Asterisk-java-users] How to get ORIGINATE_STATUS value after OriginateAction Hi, you could use a callback handler. this way you´ll get informed about any state change. yves Am 04.03.2013 04:06, schrieb roko: Hi everyone > > >I'm just starting with asterisk and asterisk-java, so please forgive me if this is a silly question. Here (http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate) I can see that the originate cmd sets the ORIGINATE_STATUS variable before exiting. How can I get this value from asterisk-java ? At this point I'm using the code from the tutorial, like this: >OriginateAction originateAction; ManagerResponse originateResponse; originateAction = new OriginateAction(); originateAction.setChannel("SIP/John"); originateAction.setContext("default"); originateAction.setExten("1300"); originateAction.setPriority(new Integer(1)); originateAction.setTimeout(new Integer(30000)); managerConnection.login(); originateResponse = managerConnection.sendAction(originateAction, 30000); >Thx for your help. > > > E. > > > >------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb > > >_______________________________________________ Asterisk-java-users mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-users ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb _______________________________________________ Asterisk-java-users mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-users ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb _______________________________________________ Asterisk-java-users mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Shitian L. <lon...@gm...> - 2013-03-05 09:44:39
|
And I think in this case, probably you want use asterisk "queue" concept. for example: probable you are going to have "support queue", "sales queue" when your support agent want to take call, your agent will join a support queue more reference: http://www.voip-info.org/wiki/view/Asterisk+call+queues here is the java asterisk queue class reference http://www.asterisk-java.org/development/apidocs/org/asteriskjava/live/AsteriskQueue.html On Mar 5, 2013, at 4:55 AM, Jimmy Chang(Gmail) <cha...@gm...> wrote: > Hi Yves, > > These are great hints. > Thanks a lot. > > Jimmy > > 於 2013/3/4 下午 06:21, Yves A. 提到: >> Hi, >> ok, I see. This sounds like a callcenter requirement for me and normally >> any callcenter pbx software >> can handle such agent states... of course using two independent services >> would endup in a never ending >> buttonclick party setting the pause/unpause/wrapup state in one campaign >> and vice versa all the time... >> >> If you cant use software like vicidial or one of the other hundreds >> available, you could really go many many >> ways. depending on your skill, they are quite easy to implement... but >> as i dont know your setup etc. my >> proposals are only hints.. >> you could e.g.: >> a) use queues and dynamically logon or logoff agents >> b) adopt your dialplan and check the availability of the agents on the >> other service, before ringing >> them... if they are busy, route the call to another agent or whatsoever >> c) use realtime sip peers >> [and many more]... >> >> regards, >> yves >> >> >> Am 04.03.2013 09:41, schrieb Jimmy Chang(Gmail): >>> Thanks Yves, >>> >>> consider of the following situation: >>> Agents serv two hotline services(2 phones on desk), one is tradition cti >>> named "A service" the other is asterisk named "B service". >>> When a agent serv at the A service, we don't want he or she to serv "B >>> service" and vice versa. >>> >>> That's why we want to deloy a java applicaiton between these two services. >>> >>> Jimmy >>> >>> >>> 2013/3/4 PM 04:22, Yves A. : >>>> Hi, >>>> >>>> what is your objective? If you want to unregister any SIP client, it >>>> would normally automatically register >>>> after registration expiry... same applies for changing states I think.. >>>> If you want to dynamically allow / disallow certain SIP client to >>>> register / place calls or whatever, I think >>>> a good approach would be to use realtime sip peers or a realtime >>>> extension or a specialised dialplan, >>>> where you check some variables that you can dynamically assign... >>>> >>>> yves >>>> >>>> Am 04.03.2013 09:07, schrieb Jimmy Chang(Gmail): >>>>> Can I unregister a sip client from java API? >>>>> Or can I just set the state of a sip client to DnD? >>>>> >>>>> Thanks. >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Everyone hates slow websites. So do we. >>>>> Make your web apps faster with AppDynamics >>>>> Download AppDynamics Lite for free today: >>>>> http://p.sf.net/sfu/appdyn_d2d_feb >>>>> _______________________________________________ >>>>> Asterisk-java-users mailing list >>>>> Ast...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>>>> >>>> ------------------------------------------------------------------------------ >>>> Everyone hates slow websites. So do we. >>>> Make your web apps faster with AppDynamics >>>> Download AppDynamics Lite for free today: >>>> http://p.sf.net/sfu/appdyn_d2d_feb >>>> _______________________________________________ >>>> Asterisk-java-users mailing list >>>> Ast...@li... >>>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>>> >>>> >>> ------------------------------------------------------------------------------ >>> Everyone hates slow websites. So do we. >>> Make your web apps faster with AppDynamics >>> Download AppDynamics Lite for free today: >>> http://p.sf.net/sfu/appdyn_d2d_feb >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_d2d_feb >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Jimmy Chang(Gmail) <cha...@gm...> - 2013-03-05 03:56:01
|
Hi Yves, These are great hints. Thanks a lot. Jimmy 於 2013/3/4 下午 06:21, Yves A. 提到: > Hi, > ok, I see. This sounds like a callcenter requirement for me and normally > any callcenter pbx software > can handle such agent states... of course using two independent services > would endup in a never ending > buttonclick party setting the pause/unpause/wrapup state in one campaign > and vice versa all the time... > > If you cant use software like vicidial or one of the other hundreds > available, you could really go many many > ways. depending on your skill, they are quite easy to implement... but > as i dont know your setup etc. my > proposals are only hints.. > you could e.g.: > a) use queues and dynamically logon or logoff agents > b) adopt your dialplan and check the availability of the agents on the > other service, before ringing > them... if they are busy, route the call to another agent or whatsoever > c) use realtime sip peers > [and many more]... > > regards, > yves > > > Am 04.03.2013 09:41, schrieb Jimmy Chang(Gmail): >> Thanks Yves, >> >> consider of the following situation: >> Agents serv two hotline services(2 phones on desk), one is tradition cti >> named "A service" the other is asterisk named "B service". >> When a agent serv at the A service, we don't want he or she to serv "B >> service" and vice versa. >> >> That's why we want to deloy a java applicaiton between these two services. >> >> Jimmy >> >> >> 2013/3/4 PM 04:22, Yves A. : >>> Hi, >>> >>> what is your objective? If you want to unregister any SIP client, it >>> would normally automatically register >>> after registration expiry... same applies for changing states I think.. >>> If you want to dynamically allow / disallow certain SIP client to >>> register / place calls or whatever, I think >>> a good approach would be to use realtime sip peers or a realtime >>> extension or a specialised dialplan, >>> where you check some variables that you can dynamically assign... >>> >>> yves >>> >>> Am 04.03.2013 09:07, schrieb Jimmy Chang(Gmail): >>>> Can I unregister a sip client from java API? >>>> Or can I just set the state of a sip client to DnD? >>>> >>>> Thanks. >>>> >>>> ------------------------------------------------------------------------------ >>>> Everyone hates slow websites. So do we. >>>> Make your web apps faster with AppDynamics >>>> Download AppDynamics Lite for free today: >>>> http://p.sf.net/sfu/appdyn_d2d_feb >>>> _______________________________________________ >>>> Asterisk-java-users mailing list >>>> Ast...@li... >>>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>>> >>> ------------------------------------------------------------------------------ >>> Everyone hates slow websites. So do we. >>> Make your web apps faster with AppDynamics >>> Download AppDynamics Lite for free today: >>> http://p.sf.net/sfu/appdyn_d2d_feb >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_d2d_feb >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > |
From: roko <ro...@ya...> - 2013-03-04 15:38:08
|
Hi Thx for your answer. Do you mean instead of blocking using: ManagerResponse sendAction(ManagerAction action, long timeout) Should I use this function ?: void sendAction(ManagerAction action, SendActionCallback callback) I see in the docs that I still get a ManagerResponse. Pls forgive me, I'm very new at this. How can I get the ORIGINATE_STATUS from the ManagerResponse object ? Do you have an example that I could use ? Thx for your help. E. ________________________________ De: Yves A. <yv...@gm...> Para: ast...@li... Enviado: Lunes, 4 de marzo, 2013 2:45 A.M. Asunto: Re: [Asterisk-java-users] How to get ORIGINATE_STATUS value after OriginateAction Hi, you could use a callback handler. this way you´ll get informed about any state change. yves Am 04.03.2013 04:06, schrieb roko: Hi everyone > > >I'm just starting with asterisk and asterisk-java, so please forgive me if this is a silly question. Here (http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate) I can see that the originate cmd sets the ORIGINATE_STATUS variable before exiting. How can I get this value from asterisk-java ? At this point I'm using the code from the tutorial, like this: >OriginateAction originateAction; ManagerResponse originateResponse; originateAction = new OriginateAction(); originateAction.setChannel("SIP/John"); originateAction.setContext("default"); originateAction.setExten("1300"); originateAction.setPriority(new Integer(1)); originateAction.setTimeout(new Integer(30000)); managerConnection.login(); originateResponse = managerConnection.sendAction(originateAction, 30000); >Thx for your help. > > > E. > > > >------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb > > >_______________________________________________ Asterisk-java-users mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-users ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb _______________________________________________ Asterisk-java-users mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Yves A. <yv...@gm...> - 2013-03-04 10:22:21
|
Hi, ok, I see. This sounds like a callcenter requirement for me and normally any callcenter pbx software can handle such agent states... of course using two independent services would endup in a never ending buttonclick party setting the pause/unpause/wrapup state in one campaign and vice versa all the time... If you cant use software like vicidial or one of the other hundreds available, you could really go many many ways. depending on your skill, they are quite easy to implement... but as i dont know your setup etc. my proposals are only hints.. you could e.g.: a) use queues and dynamically logon or logoff agents b) adopt your dialplan and check the availability of the agents on the other service, before ringing them... if they are busy, route the call to another agent or whatsoever c) use realtime sip peers [and many more]... regards, yves Am 04.03.2013 09:41, schrieb Jimmy Chang(Gmail): > Thanks Yves, > > consider of the following situation: > Agents serv two hotline services(2 phones on desk), one is tradition cti > named "A service" the other is asterisk named "B service". > When a agent serv at the A service, we don't want he or she to serv "B > service" and vice versa. > > That's why we want to deloy a java applicaiton between these two services. > > Jimmy > > > 2013/3/4 PM 04:22, Yves A. : >> Hi, >> >> what is your objective? If you want to unregister any SIP client, it >> would normally automatically register >> after registration expiry... same applies for changing states I think.. >> If you want to dynamically allow / disallow certain SIP client to >> register / place calls or whatever, I think >> a good approach would be to use realtime sip peers or a realtime >> extension or a specialised dialplan, >> where you check some variables that you can dynamically assign... >> >> yves >> >> Am 04.03.2013 09:07, schrieb Jimmy Chang(Gmail): >>> Can I unregister a sip client from java API? >>> Or can I just set the state of a sip client to DnD? >>> >>> Thanks. >>> >>> ------------------------------------------------------------------------------ >>> Everyone hates slow websites. So do we. >>> Make your web apps faster with AppDynamics >>> Download AppDynamics Lite for free today: >>> http://p.sf.net/sfu/appdyn_d2d_feb >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_d2d_feb >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |
From: Jimmy Chang(Gmail) <cha...@gm...> - 2013-03-04 08:41:21
|
Thanks Yves, consider of the following situation: Agents serv two hotline services(2 phones on desk), one is tradition cti named "A service" the other is asterisk named "B service". When a agent serv at the A service, we don't want he or she to serv "B service" and vice versa. That's why we want to deloy a java applicaiton between these two services. Jimmy 2013/3/4 PM 04:22, Yves A. : > Hi, > > what is your objective? If you want to unregister any SIP client, it > would normally automatically register > after registration expiry... same applies for changing states I think.. > If you want to dynamically allow / disallow certain SIP client to > register / place calls or whatever, I think > a good approach would be to use realtime sip peers or a realtime > extension or a specialised dialplan, > where you check some variables that you can dynamically assign... > > yves > > Am 04.03.2013 09:07, schrieb Jimmy Chang(Gmail): >> Can I unregister a sip client from java API? >> Or can I just set the state of a sip client to DnD? >> >> Thanks. >> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_d2d_feb >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > |
From: Yves A. <yv...@gm...> - 2013-03-04 08:23:14
|
Hi, what is your objective? If you want to unregister any SIP client, it would normally automatically register after registration expiry... same applies for changing states I think.. If you want to dynamically allow / disallow certain SIP client to register / place calls or whatever, I think a good approach would be to use realtime sip peers or a realtime extension or a specialised dialplan, where you check some variables that you can dynamically assign... yves Am 04.03.2013 09:07, schrieb Jimmy Chang(Gmail): > Can I unregister a sip client from java API? > Or can I just set the state of a sip client to DnD? > > Thanks. > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |
From: Jimmy Chang(Gmail) <cha...@gm...> - 2013-03-04 08:07:23
|
Can I unregister a sip client from java API? Or can I just set the state of a sip client to DnD? Thanks. |
From: Yves A. <yv...@gm...> - 2013-03-04 07:46:00
|
Hi, you could use a callback handler. this way you´ll get informed about any state change. yves Am 04.03.2013 04:06, schrieb roko: > Hi everyone > > I'm just starting with asterisk and asterisk-java, so please forgive > me if this is a silly question. Here > (http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate) > <http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate> I can see > that the originate cmd sets the ORIGINATE_STATUS variable before > exiting. How can I get this value from asterisk-java ? At this point > I'm using the code from the tutorial, like this: > OriginateAction originateAction; > ManagerResponse originateResponse; > > originateAction = new OriginateAction(); > originateAction.setChannel("SIP/John"); > originateAction.setContext("default"); > originateAction.setExten("1300"); > originateAction.setPriority(new Integer(1)); > originateAction.setTimeout(new Integer(30000)); > > managerConnection.login(); > originateResponse = managerConnection.sendAction(originateAction, 30000); > Thx for your help. > > E. > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: roko <ro...@ya...> - 2013-03-04 03:06:55
|
Hi everyone I'm just starting with asterisk and asterisk-java, so please forgive me if this is a silly question. Here (http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate) I can see that the originate cmd sets the ORIGINATE_STATUS variable before exiting. How can I get this value from asterisk-java ? At this point I'm using the code from the tutorial, like this: OriginateAction originateAction; ManagerResponse originateResponse; originateAction = new OriginateAction(); originateAction.setChannel("SIP/John"); originateAction.setContext("default"); originateAction.setExten("1300"); originateAction.setPriority(new Integer(1)); originateAction.setTimeout(new Integer(30000)); managerConnection.login(); originateResponse = managerConnection.sendAction(originateAction, 30000); Thx for your help. E. |
From: Miguel S. <m.s...@gm...> - 2013-02-26 08:27:33
|
1 : Perhaps there is a way to set verbose level. I'm not sure about it, but you can try to look up the Api. 2 : Try logging to manager filtering the events. Example : login ("call",...) instead of login(). I think login() without parameters is the same as login ("all") and allow your listener receive all the events Hope it helps. El 25/02/2013 13:02, "Jeremy Schaeffer" <je...@ph...> escribió: > I keep getting these errors all the time and things seem to work, but it > is hard to follow my logging because every action that is done throws them > - > > Feb 24, 2013 10:30:32 AM > org.asteriskjava.manager.internal.EventBuilderImpl buildEvent > INFO: No event class registered for event type 'varset', attributes: > {uniqueid=1361723424.44734, event=VarSet, privilege=dialplan,all, > value=group, variable=~ODBCFIELDS~, channel=SIP/Toshiba-00007af3} > Feb 24, 2013 10:30:32 AM > org.asteriskjava.manager.internal.EventBuilderImpl buildEvent > INFO: No event class registered for event type 'varset', attributes: > {uniqueid=1361723424.44734, event=VarSet, privilege=dialplan,all, > value=1, variable=ODBCROWS, channel=SIP/Toshiba-00007af3} > Feb 24, 2013 10:30:32 AM > org.asteriskjava.manager.internal.EventBuilderImpl buildEvent > INFO: No event class registered for event type 'varset', attributes: > {uniqueid=1361723424.44734, event=VarSet, privilege=dialplan,all, > value=SUCCESS, variable=ODBCSTATUS, channel=SIP/Toshiba-00007af3} > Feb 24, 2013 10:30:32 AM > org.asteriskjava.manager.internal.EventBuilderImpl buildEvent > INFO: No event class registered for event type 'varset', attributes: > {uniqueid=1361723424.44734, event=VarSet, privilege=dialplan,all, > value=COMPLETE, variable=STATUS, channel=SIP/Toshiba-00007af3} > Feb 24, 2013 10:30:32 AM > org.asteriskjava.manager.internal.EventBuilderImpl setAttributes > SEVERE: Unable to set property 'connectedlinename' to '<unknown>' on > org.asteriskjava.manager.event.HangupEvent: no setter > Feb 24, 2013 10:30:32 AM > org.asteriskjava.manager.internal.EventBuilderImpl setAttributes > > It is always complaining about not having a setter or there is no class > registered for a event. Is there a way to either fix the issue or turn > off the logging. Its hard to troubleshoot my own code when I have lines > and lines of this for every event that happens. I can provide more if it > helps. Thanks! - Jeremy > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |
From: Jeremy S. <je...@ph...> - 2013-02-26 02:19:05
|
I was using 1.0.0.CI, it gave even more errors and I was having issues with it disconnecting and reconnecting constantly (and missing information while it was doing so) so I downgraded to 0.3.1, site said it was the latest stable version. I am using Asterisk 10. This looks to be something about using ODBC, and I am using ODBC to look up and insert information into a mysql database in the extensions.conf file. Thanks for the reply!- Jeremy On 2/25/2013 06:06, Yves A. wrote: > maybe you´re using an outdated version of asterisk-java? > y. > > Am 25.02.2013 13:01, schrieb Jeremy Schaeffer: >> I keep getting these errors all the time and things seem to work, but it >> is hard to follow my logging because every action that is done throws them - >> >> Feb 24, 2013 10:30:32 AM >> org.asteriskjava.manager.internal.EventBuilderImpl buildEvent >> INFO: No event class registered for event type 'varset', attributes: >> {uniqueid=1361723424.44734, event=VarSet, privilege=dialplan,all, >> value=group, variable=~ODBCFIELDS~, channel=SIP/Toshiba-00007af3} >> Feb 24, 2013 10:30:32 AM >> org.asteriskjava.manager.internal.EventBuilderImpl buildEvent >> INFO: No event class registered for event type 'varset', attributes: >> {uniqueid=1361723424.44734, event=VarSet, privilege=dialplan,all, >> value=1, variable=ODBCROWS, channel=SIP/Toshiba-00007af3} >> Feb 24, 2013 10:30:32 AM >> org.asteriskjava.manager.internal.EventBuilderImpl buildEvent >> INFO: No event class registered for event type 'varset', attributes: >> {uniqueid=1361723424.44734, event=VarSet, privilege=dialplan,all, >> value=SUCCESS, variable=ODBCSTATUS, channel=SIP/Toshiba-00007af3} >> Feb 24, 2013 10:30:32 AM >> org.asteriskjava.manager.internal.EventBuilderImpl buildEvent >> INFO: No event class registered for event type 'varset', attributes: >> {uniqueid=1361723424.44734, event=VarSet, privilege=dialplan,all, >> value=COMPLETE, variable=STATUS, channel=SIP/Toshiba-00007af3} >> Feb 24, 2013 10:30:32 AM >> org.asteriskjava.manager.internal.EventBuilderImpl setAttributes >> SEVERE: Unable to set property 'connectedlinename' to '<unknown>' on >> org.asteriskjava.manager.event.HangupEvent: no setter >> Feb 24, 2013 10:30:32 AM >> org.asteriskjava.manager.internal.EventBuilderImpl setAttributes >> >> It is always complaining about not having a setter or there is no class >> registered for a event. Is there a way to either fix the issue or turn >> off the logging. Its hard to troubleshoot my own code when I have lines >> and lines of this for every event that happens. I can provide more if it >> helps. Thanks! - Jeremy >> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_d2d_feb >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |
From: Yves A. <yv...@gm...> - 2013-02-25 12:06:34
|
maybe you´re using an outdated version of asterisk-java? y. Am 25.02.2013 13:01, schrieb Jeremy Schaeffer: > I keep getting these errors all the time and things seem to work, but it > is hard to follow my logging because every action that is done throws them - > > Feb 24, 2013 10:30:32 AM > org.asteriskjava.manager.internal.EventBuilderImpl buildEvent > INFO: No event class registered for event type 'varset', attributes: > {uniqueid=1361723424.44734, event=VarSet, privilege=dialplan,all, > value=group, variable=~ODBCFIELDS~, channel=SIP/Toshiba-00007af3} > Feb 24, 2013 10:30:32 AM > org.asteriskjava.manager.internal.EventBuilderImpl buildEvent > INFO: No event class registered for event type 'varset', attributes: > {uniqueid=1361723424.44734, event=VarSet, privilege=dialplan,all, > value=1, variable=ODBCROWS, channel=SIP/Toshiba-00007af3} > Feb 24, 2013 10:30:32 AM > org.asteriskjava.manager.internal.EventBuilderImpl buildEvent > INFO: No event class registered for event type 'varset', attributes: > {uniqueid=1361723424.44734, event=VarSet, privilege=dialplan,all, > value=SUCCESS, variable=ODBCSTATUS, channel=SIP/Toshiba-00007af3} > Feb 24, 2013 10:30:32 AM > org.asteriskjava.manager.internal.EventBuilderImpl buildEvent > INFO: No event class registered for event type 'varset', attributes: > {uniqueid=1361723424.44734, event=VarSet, privilege=dialplan,all, > value=COMPLETE, variable=STATUS, channel=SIP/Toshiba-00007af3} > Feb 24, 2013 10:30:32 AM > org.asteriskjava.manager.internal.EventBuilderImpl setAttributes > SEVERE: Unable to set property 'connectedlinename' to '<unknown>' on > org.asteriskjava.manager.event.HangupEvent: no setter > Feb 24, 2013 10:30:32 AM > org.asteriskjava.manager.internal.EventBuilderImpl setAttributes > > It is always complaining about not having a setter or there is no class > registered for a event. Is there a way to either fix the issue or turn > off the logging. Its hard to troubleshoot my own code when I have lines > and lines of this for every event that happens. I can provide more if it > helps. Thanks! - Jeremy > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |
From: Jeremy S. <je...@ph...> - 2013-02-25 12:01:07
|
I keep getting these errors all the time and things seem to work, but it is hard to follow my logging because every action that is done throws them - Feb 24, 2013 10:30:32 AM org.asteriskjava.manager.internal.EventBuilderImpl buildEvent INFO: No event class registered for event type 'varset', attributes: {uniqueid=1361723424.44734, event=VarSet, privilege=dialplan,all, value=group, variable=~ODBCFIELDS~, channel=SIP/Toshiba-00007af3} Feb 24, 2013 10:30:32 AM org.asteriskjava.manager.internal.EventBuilderImpl buildEvent INFO: No event class registered for event type 'varset', attributes: {uniqueid=1361723424.44734, event=VarSet, privilege=dialplan,all, value=1, variable=ODBCROWS, channel=SIP/Toshiba-00007af3} Feb 24, 2013 10:30:32 AM org.asteriskjava.manager.internal.EventBuilderImpl buildEvent INFO: No event class registered for event type 'varset', attributes: {uniqueid=1361723424.44734, event=VarSet, privilege=dialplan,all, value=SUCCESS, variable=ODBCSTATUS, channel=SIP/Toshiba-00007af3} Feb 24, 2013 10:30:32 AM org.asteriskjava.manager.internal.EventBuilderImpl buildEvent INFO: No event class registered for event type 'varset', attributes: {uniqueid=1361723424.44734, event=VarSet, privilege=dialplan,all, value=COMPLETE, variable=STATUS, channel=SIP/Toshiba-00007af3} Feb 24, 2013 10:30:32 AM org.asteriskjava.manager.internal.EventBuilderImpl setAttributes SEVERE: Unable to set property 'connectedlinename' to '<unknown>' on org.asteriskjava.manager.event.HangupEvent: no setter Feb 24, 2013 10:30:32 AM org.asteriskjava.manager.internal.EventBuilderImpl setAttributes It is always complaining about not having a setter or there is no class registered for a event. Is there a way to either fix the issue or turn off the logging. Its hard to troubleshoot my own code when I have lines and lines of this for every event that happens. I can provide more if it helps. Thanks! - Jeremy |
From: MT <moh...@gm...> - 2013-02-19 19:17:28
|
use CHANNEL(language) variable instead. channel.setVariable(“CHANNEL(language)”,”es”) On Tue, Feb 19, 2013 at 10:11 PM, Ken Sherman <ken...@1c...>wrote: > We are currently running Asterisk 1.4. I have an English/Spanish > application. When in Spanish mode, how can I change the default language > to Spanish so that channel.sayNumber(amount) will say correctly in Spanish? > **** > > ** ** > > I would have thought that**** > > ** ** > > channel.setVariable(“language”,”es”) would have worked, but it does not.** > ** > > ** ** > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > |
From: Ken S. <ken...@1c...> - 2013-02-19 18:42:02
|
We are currently running Asterisk 1.4. I have an English/Spanish application. When in Spanish mode, how can I change the default language to Spanish so that channel.sayNumber(amount) will say correctly in Spanish? I would have thought that channel.setVariable("language","es") would have worked, but it does not. |
From: Aaron E. <aar...@gm...> - 2013-02-09 22:22:45
|
On Feb 5, 2013 8:31 AM, "MT" <moh...@gm...> wrote: > Hi everyone, > > I can't get MusicOnHoldEvent in handleEvent method but I can see org.asteriskjava.manager.event.MusicOnHoldEvent > when I use onManagerEvent method. > I can get another events > like: HangupEvent,NewStateEvent,PeerStatusEvent,QueueMemberPausedEvent,... > but can't get MusicOnHoldEvent,HoldedCallEvent,HoldEvent > > this is my code: > > public class Monitor extends AbstractManagerEventListener { > > private ManagerConnection managerConnection; > > public Monitor() throws IOException { > > ManagerConnectionFactory factory = new > ManagerConnectionFactory('manager_host', 'manager_user', 'manager_pass'); > > this.managerConnection = factory.createManagerConnection(); > } > > public void run() throws IOException, AuthenticationFailedException, > TimeoutException, InterruptedException { > managerConnection.addEventListener(this); > > managerConnection.login(); > > Thread.sleep(new Long(1000000000)); > } > > public static void main(String[] args) throws Exception { > Monitor helloEvents; > > helloEvents = new Monitor(); > helloEvents.run(); > } > > // when I uncomment following method I can see > org.asteriskjava.manager.event.MusicOnHoldEvent > // public void onManagerEvent(ManagerEvent event) { > // System.out.println("new Manager Event: "+event); > // } > > protected void handleEvent(HangupEvent event) { > System.out.println("Hangup Event"); > } > > protected void handleEvent(NewStateEvent event) { > System.out.println("New State Event"); > } > > // ... also another events works fine like I said above but music on hold > event does not work > > protected void handleEvent(MusicOnHoldEvent event) { > System.out.println("Music On Hold Event"); > } > } > > > I don't know what to do, please help me :( > > mohsen > > > > > ------------------------------------------------------------------------------ > Free Next-Gen Firewall Hardware Offer > Buy your Sophos next-gen firewall before the end March 2013 > and get the hardware for free! Learn more. > http://p.sf.net/sfu/sophos-d2d-feb > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > |
From: MT <moh...@gm...> - 2013-02-07 14:06:07
|
thanks yves for reply, but as I said the org.asteriskjava.manager.event.MusicOnHoldEvent is read by onManagerEvent and I can see MusicOnHoldEvent when I telnet to 5038. I think the problem is this method : handleEvent(MusicOnHoldEvent event) is not exist in AbstractManagerEventListener. I found this solution: public void onManagerEvent(ManagerEvent event) { if (event instanceof MusicOnHoldEvent) { handleEvent((MusicOnHoldEvent) event); } else { super.onManagerEvent(event); } } thank you yves On Wed, Feb 6, 2013 at 1:48 AM, Yves A. <yv...@gm...> wrote: > Hello mohsen, > > for some events to occur, you have to configure asterisk to fire them... > take a look in your manager.conf and sip.conf for appropriate settings. > e.g. if sip.conf contains the line > > callevents=yes > > regards, > yves > > Am 05.02.2013 14:30, schrieb MT: > > Hi everyone, > > I can't get MusicOnHoldEvent in handleEvent method but I can see org.asteriskjava.manager.event.MusicOnHoldEvent > when I use onManagerEvent method. > I can get another events > like: HangupEvent,NewStateEvent,PeerStatusEvent,QueueMemberPausedEvent,... > but can't get MusicOnHoldEvent,HoldedCallEvent,HoldEvent > > this is my code: > > public class Monitor extends AbstractManagerEventListener { > > private ManagerConnection managerConnection; > > public Monitor() throws IOException { > > ManagerConnectionFactory factory = new > ManagerConnectionFactory('manager_host', 'manager_user', 'manager_pass'); > > this.managerConnection = factory.createManagerConnection(); > } > > public void run() throws IOException, AuthenticationFailedException, > TimeoutException, InterruptedException { > managerConnection.addEventListener(this); > > managerConnection.login(); > > Thread.sleep(new Long(1000000000)); > } > > public static void main(String[] args) throws Exception { > Monitor helloEvents; > > helloEvents = new Monitor(); > helloEvents.run(); > } > > // when I uncomment following method I can see > org.asteriskjava.manager.event.MusicOnHoldEvent > // public void onManagerEvent(ManagerEvent event) { > // System.out.println("new Manager Event: "+event); > // } > > protected void handleEvent(HangupEvent event) { > System.out.println("Hangup Event"); > } > > protected void handleEvent(NewStateEvent event) { > System.out.println("New State Event"); > } > > // ... also another events works fine like I said above but music on > hold event does not work > > protected void handleEvent(MusicOnHoldEvent event) { > System.out.println("Music On Hold Event"); > } > } > > > I don't know what to do, please help me :( > > mohsen > > > > > ------------------------------------------------------------------------------ > Free Next-Gen Firewall Hardware Offer > Buy your Sophos next-gen firewall before the end March 2013 > and get the hardware for free! Learn more.http://p.sf.net/sfu/sophos-d2d-feb > > > > _______________________________________________ > Asterisk-java-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > ------------------------------------------------------------------------------ > Free Next-Gen Firewall Hardware Offer > Buy your Sophos next-gen firewall before the end March 2013 > and get the hardware for free! Learn more. > http://p.sf.net/sfu/sophos-d2d-feb > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > |