Re: [Asterisk-java-users] setVarAction Issue
Brought to you by:
srt
From: Yves A. <yv...@gm...> - 2013-06-13 09:14:32
|
pls. see inline. regards, yves Am 13.06.2013 10:44, schrieb Rounak Saha: > Hii yves, > Sorry am new to Asterisk and Asterisk-java. dont worry, we all have been beginners someday.. > > just after posting I realised that I havenot set the channel correct > and have not send it through manager connection. > I guessed it should be setChannel("incoming-call").But now it seems > its incorrect. unfortunately not... "incoming-call" is one of your contexts. > > Actually I am working under a software for Hospital where I have to > call patients(as max as possible at a time) and remind them to take > medicine.Numbers and medicine to take will be extracted from hospital > Database > If you can suggest a good way to do it,then it will be great this is too little info to make a qualified suggestion... If you want to make all fully automagic system... you have to create some kind of dialer, use TTS and some other enhanced techniques. Not to hard to do, but maybe to difficult for a novice... > > What I though of doing was: > > [incoming-call] > exten,300,1,Answer() > same=>n,Dial(DAHDI/GO/${number}) where number will be set using AMI > under a for loop,each time changing the number value. > > Now I am just testing the various commands in Asterisk-Java. > > This works fine in asterisk though. > > *[incoming-call]* > exten=>300,1,Answer() > same=>n,Set(number="incoming-call,301,1") > same=>n,Goto(${number}) > exten=>301,1,Playback(b) > > So is there not a way to set variable in context? > I tried originateAction.setvariable("number",""value") but it didnot > work also.Whats the use of originateAction.setVariable command then? A call usually has two channels involved... with setVariable you set the variable on the first (initiating) channel. If you need to access these variables on the second channel, you must go another way. But again... you´re trying the wrong approach. This way you would connect the extension 300 with the dialled party, but as far as I understood, you want to call the party and play a soundfile...? Lets say you want to call 01-234567 and play the voicefile after pickup... try this: originateAction = new OriginateAction(); originateAction.setChannel("dahdi/g0/01234567"); originateAction.setContext("medicine"); originateAction.setExten("s"); originateAction.setPriority(1); originateAction.setTimeout(30000l); originateAction.setAsync(true); and have the following context in your asterisk: [medicine] exten => s,1,Answer() exten => s,n,Playback(your voicefile goes here) exten => s,n,Hangup() > > - for these kind of experiments I´d recommend using an AGI... > As directed from my mentor(am doing GSOC > http://www.google-melange.com/) I can use AMI only. > > Please help. > > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |