Thread: [Asterisk-java-users] Call redirection
Brought to you by:
srt
From: Jan E. <jan...@pl...> - 2005-09-23 11:37:08
|
Hi, I've had some problems getting a call to be programmatically redirected from one extension to another. I currently can have calls redirected from queues to an operator or some third party. This works fine, the call is redirected without any problems. However, when I want to let the operator redirect an call that has been answered I run into problems. The call is immediately hung up by Asterisk, and I don't know wether I use RedirectAction wrong or just don't understand something. I use code similar to this (version 0.2-rc1): RedirectAction redirect = new RedirectAction (); redirect.setChannel ( channel.getName() ); redirect.setExten ( "1001" ); redirect.setContext ("default"); redirect.setPriority (new Integer(1)); The "channel" is a Channel object. Similar code works fine for my direct redirect without answering in between. Redirection works fine when I do it using the hardware phones (Zyxel and Hitachi stuff), so there doesn't seem to be anything wrong on the Asterisk side either. The SIP accounts are configured to allow call redirections. Anyone stumbled onto this problem? Regards, Jan -- Jan Ekholm jan...@pl... |
From: Jan E. <jan...@pl...> - 2005-09-26 08:27:07
|
On Friday 23 September 2005 14:37, Jan Ekholm wrote: > Hi, > I use code similar to this (version 0.2-rc1): > > RedirectAction redirect = new RedirectAction (); > redirect.setChannel ( channel.getName() ); > redirect.setExten ( "1001" ); > redirect.setContext ("default"); > redirect.setPriority (new Integer(1)); Weird is that I can do this and it works fine: redirect.setChannel ( channel.getLinkedChannel().getName() ); This does what it is supposed to do, ie redirect the channel to the new "1001" extension. Of course, here I redirect the wrong channel (I redirect the one that answered the original call, not the one that did the original call), but why that one works and the real one doesn't is beyond me. However, I think this is one of those PEBKAC problems, as it seems to me that Asterisk-Java sends the correct action to Asterisk and generally does seem to do the right thing. Maybe a channel that has been already redirected once (to the answering operator) can't be redirected, but that doesn't add up as I can do the redirect on the actual hardware phone (dial "#" and "1001") and that works fine. So it's something I probably don't grok about extensions and/or contexts. Personally I wonder why the VoIP/PBX world has got to be so complex... :) -- Jan Ekholm jan...@pl... |
From: Jan E. <jan...@pl...> - 2005-09-30 05:57:09
|
After one of our guys that at least pretend to know Asterisk did some restructuring of the dialplans (for other reasons) it all started to work. Redirection now works as it should. Don't ask me what was wrong, I have no idea and neither did the guy. Oh well, I'm happy it works. :) On Monday 26 September 2005 11:27, Jan Ekholm wrote: > On Friday 23 September 2005 14:37, Jan Ekholm wrote: > > Hi, > > > > I use code similar to this (version 0.2-rc1): > > > > RedirectAction redirect = new RedirectAction (); > > redirect.setChannel ( channel.getName() ); > > redirect.setExten ( "1001" ); > > redirect.setContext ("default"); > > redirect.setPriority (new Integer(1)); > > Weird is that I can do this and it works fine: > > redirect.setChannel ( channel.getLinkedChannel().getName() ); > > This does what it is supposed to do, ie redirect the channel to the new > "1001" extension. Of course, here I redirect the wrong channel (I redirect > the one that answered the original call, not the one that did the original > call), but why that one works and the real one doesn't is beyond me. > > However, I think this is one of those PEBKAC problems, as it seems to me > that Asterisk-Java sends the correct action to Asterisk and generally does > seem to do the right thing. Maybe a channel that has been already > redirected once (to the answering operator) can't be redirected, but that > doesn't add up as I can do the redirect on the actual hardware phone (dial > "#" and "1001") and that works fine. So it's something I probably don't > grok about extensions and/or contexts. > > Personally I wonder why the VoIP/PBX world has got to be so complex... :) -- Jan Ekholm jan...@pl... |
From: Stefan R. <sr...@re...> - 2005-10-03 12:29:35
|
On Fri, 2005-09-30 at 08:57 +0300, Jan Ekholm wrote: > After one of our guys that at least pretend to know Asterisk did some=20 > restructuring of the dialplans (for other reasons) it all started to work= .=20 > Redirection now works as it should. Don't ask me what was wrong, I have n= o=20 > idea and neither did the guy. that really sound weird... maybe it gives some hint about where to start searching if someone encounters a similar problem :) =3DStefan |
From: Jan E. <jan...@pl...> - 2005-10-03 12:41:48
|
On Monday 03 October 2005 15:18, Stefan Reuter wrote: > On Fri, 2005-09-30 at 08:57 +0300, Jan Ekholm wrote: > > After one of our guys that at least pretend to know Asterisk did some > > restructuring of the dialplans (for other reasons) it all started to > > work. Redirection now works as it should. Don't ask me what was wrong, I > > have no idea and neither did the guy. > > that really sound weird... maybe it gives some hint about where to start > searching if someone encounters a similar problem :) Yeah, it wasn't fun to suddenly see code start working with no changes to the actual code. The dialplan must've been subtly broken in some place that only mattered to software clients. When I got that working call parking was an easy thing to do, although it's slightly inconvenient to use in practise. -- Jan Ekholm jan...@pl... |