[Asterisk-java-users] (no subject)
Brought to you by:
srt
From: Saiful I. <ami...@li...> - 2011-09-18 07:01:32
|
Hello, I am using asterisk-java 1.0.0.M3 with asterisk 1.6. I am setting two channel variables using following code while call origination: private void originateCall() throws TimeoutException, IllegalArgumentException, IllegalStateException, IOException, org.asteriskjava.manager.TimeoutException { OriginateAction originateAction; ManagerResponse originateResponse; originateAction = new OriginateAction(); originateAction.setChannel("Dahdi/" + this.tg + "/" + num); originateAction.setContext(context); originateAction.setExten(this.extension); // set the extension ;1000 for opt-in based; 2000 for rvc originateAction.setCallerId(this.maskName); originateAction.setVariable("Mobile", num); originateAction.setVariable("CMPID", camp_ID); originateAction.setPriority(new Integer(1)); System.out.println("Calling : " + num); originateResponse = managerConnection.sendAction(originateAction, 20000); // System.out.println(originateResponse); // System.out.println("Response: " + originateResponse.getUniqueId()); } >From a separate manager app, I am listening for newChannelEvent, StateChangedEven & HangupEvent. The problem is for first two events, I need to get the custom variables (Mobile, CMPID). I am doing it using following code: managerConnection.login(); GetVarAction getVarAction = new GetVarAction(channel, "CMPID"); //”Mobile” for getting the other variable ManagerResponse response = managerConnection.sendAction(getVarAction); value = response.getAttribute("Value"); managerConnection.logoff(); It seems okay almost every time except heuristically for some 30-40 minutes after 1-3 days, I get “null” for each variable. Though the CMPID variable is got okay in the dialplan, I don’t get it from the manager app using asterisk-java. I need help badly. Please help. Regards, Md. Saiful Islam |