Re: [Asterisk-java-users] setVarAction Issue
Brought to you by:
srt
From: Yves A. <yv...@gm...> - 2013-06-13 07:01:03
|
Hi, it seems, you are at the very beginning of your AJ-experiments have some misunderstandings concerning asterisk and asterisk-java. Jumping in in the dialplan just cannot be done this way... instantiating a SetVarAction Object only does not help at all... the action has to be "fired" anyhow... but even if you would have done, it would not have the desired result. - If you want your call to move from ext. 300 to ext. 301 you have to make a transfer. - The "Channel" asterisk uses during a call is not equal to the name of the registered SIP device... if may be a part of it though... so addressing the channel "1000abc" makes no sense, because this channel will never exist... - instead using "Long.valueOf(30000)" you can optimize your code and just write "30000l" (a small letter L after the numbers) - for these kind of experiments I´d recommend using an AGI... yves Am 13.06.2013 08:30, schrieb Rounak Saha: > Hi, > I am using setVarAction command in my Hello manager(given in tutorial) > class to set variable in a context(incoming-call) > variable="context,extension,priority" > i.e number="incoming-call,301,1" > * > * > *Extensions.conf* > [incoming-call] > exten=>300,1,Answer() > same=>n,Goto(${number}) > > exten=>301,1,Playback(/home/atul/Desktop/b) > same=>n,Hangup() > > *Sip.conf* > [1000abc] > type=peer > nat=yes > qualify=no > allow=all > udpbindaddr=0.0.0.0 > bindaddr=0.0.0.0 > secret=mysecret > host=dynamic > context=incoming-call > > *Java Program* > { > OriginateAction originateAction; > SetVarAction setVarAction=new SetVarAction(); > ManagerResponse originateResponse; > managerConnection.login(); > String sip="SIP/1000abc";String context="incoming-call"; > s*etVarAction.setChannel("SIP/1000abc");* > * setVarAction.setVariable("number");* > *setVarAction.setValue("incoming-call,301,1");* > ** > originateAction = new OriginateAction(); > originateAction.setChannel(sip); > originateAction.setContext(context); > originateAction.setExten("300"); > originateAction.setPriority(new Integer(1)); > originateAction.setTimeout(Long.valueOf(30000)); > originateAction.setAsync(true); > originateResponse = > managerConnection.sendAction(originateAction,10000); > managerConnection.logoff(); > } > Error:WARNING[5345]: pbx.c:10560 pbx_parseable_goto: Goto requires an > argument ([[context,]extension,]priority) > == Spawn extension (incoming-call, 300, 2) exited non-zero on > 'SIP/1000abc-00000000' > > > > > ------------------------------------------------------------------------------ > 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 |