Re: [Asterisk-java-users] Question about commandAction 'iax2 show peer'
Brought to you by:
srt
From: Bruno K. <bru...@un...> - 2007-07-31 18:04:02
|
> > Hi, > > > The response I get is containing response='Follows' but > nothing seems > > to follow. Launching the command through the CLI gives a correct > > result. > > the correct snippet for sending a command action looks like this: > > response = sendAction(new CommandAction(command)); > if (!(response instanceof CommandResponse)) > { > throw some exception here > } > > return ((CommandResponse) response).getResult(); > > is this what you have? No! I had omitted the cast and getResult(). Shame on me! > > > For information, my more general goal is to try to > establish the type > > of channel given an extension. For example, suppose I have an > > extension 804, I would like to try 'sip show peer 804', if it fails > > then 'iax2 show peer 804'. Is is a good method or can I make it > > better? > > If you don't know upfront whether the channel is a SIP or IAX > channel thats probably the only solution. > If you have a corresponding extension in the dialplan though, > you could also use Local/ channels. > > Example > [default] > 804 => Dial(IAX2/804) > > Then just use Local/804@default instead of IAX2/804. Yes, I thought using Local channels but generated events seem to be a bit more complex, so I prefer using the 'show peer' which works perfectly now. Many thanks for your fast reply. Bruno > > Hope that helps, > > Stefan > > -- > reuter network consulting > Neusser Str. 110 > 50760 Koeln > Germany > Telefon: +49 221 1305699-0 > Telefax: +49 221 1305699-90 > E-Mail: ste...@re... > Jabber: ste...@re... > > Steuernummern 215/5140/1791 USt-IdNr. DE220701760 > > |