Hi, I have noticed that when a SIP redirect is sent back to Asterisk by a SIP peer, that Asterisk will (quite appropriately) do a Dial(LOCAL/redirect-number) in the context of the original callee. It also forks the CDR, which is excellent. Sadly, under these circumstances, I need to alter the caller-ID to be a valid value, set the 'src' to be the correct extension no., and set the accountcode to something recognisable as an outbound call by that user. Is there a way of determining in the dialplan that a call is a redirect, and what the original call destination was? Perhaps it is possible to override the context used to make a redirect call??? Thanks for any assistance. Regards, Steve Davies
Steve Davies
2005-Oct-24 07:02 UTC
[Asterisk-Users] Re: Custom handling of SIP 302 redirect?
On 10/21/05, Steve Davies <davies147@gmail.com> wrote:> > I have noticed that when a SIP redirect is sent back to Asterisk by a > SIP peer, that Asterisk will (quite appropriately) do a > Dial(LOCAL/redirect-number) in the context of the original callee. > > It also forks the CDR, which is excellent. Sadly, under these > circumstances, I need to alter the caller-ID to be a valid value, set > the 'src' to be the correct extension no., and set the accountcode to > something recognisable as an outbound call by that user. >I have managed to get part-way through this problem... It seems that ACCOUNTCODE persists across the dial, so I can set that to a meaningful value most of the time, and use the data later for billing, sadly this is only a small (20 character) field, so I can only transfer a limited amount of data. Other fields such as userdata do not persist, and variables that are set in the dialplan do not stay in-scope either. Can anyone suggest another mechanism for passing data across? Perhaps this should be raised as a feature-request such that the caller-ID field is populated from the SIP client that sends the redirect? Looking at the source I expected this to happen already, but it is a fairly complex interaction. Kind regards, Steve