Re: [Asterisk-java-users] OriginateResponse.getAttributes()
Brought to you by:
srt
From: Stefan R. <sr...@re...> - 2006-01-11 23:29:16
|
Hi, > I was wondering if there was a way to return the channel and the data > values from the following OriginateAction actions or even the > callerid: the uniqueId for the call that is originated is contained in the OriginateSuccessEvent generated in response to your OriginateAction. You can use the uniqueId to relate other events for that call to your OriginateAction. Please not that the OriginateSuccessEvent is only generated if you set async to true. Example: OriginateAction originateAction =3D new OriginateAction(); originateAction.setChannel("SIP/1310"); originateAction.setExten("1399"); originateAction.setContext("from-local"); originateAction.setPriority(new Integer(1)); originateAction.setTimeout(new Long(30000)); originateAction.setAsync(Boolean.TRUE); ResponseEvents responseEvents =3D=20 c.sendEventGeneratingAction(originateAction, 30000); =20 for (ManagerEvent event :=20 (Collection<ManagerEvent>) responseEvents.getEvents()) { if (event instanceof OriginateSuccessEvent) { OriginateSuccessEvent success =3D (OriginateSuccessEvent) event; System.out.println("Originate was successful: uniqueId " + success.getUniqueId()); } else if (event instanceof OriginateFailureEvent) { System.out.println("Originate failed"); } } > Also, I have downloaded the asterisk-java-0.2 jar and the > asterisk-java-0.2-src and cannot find the API docs for asterisk-java. > Am I blind or are they not part of the download? You should download asterisk-java-0.2.zip, for example from http://kent.dl.sourceforge.net/sourceforge/asterisk-java/asterisk-java-0.2.= zip this archive contains the api docs in /asterisk-java-0.2/docs/apidocs/ where did you get the jar file from? =3DStefan |