[Asterisk-Users] Re: Custom handling of SIP 302 redirect?
Olle E. Johansson
oej at edvina.net
Mon Oct 24 07:09:01 MST 2005
Steve Davies wrote:
> On 10/21/05, Steve Davies <davies147 at 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.
>
Just so you don't have to comment on your own comment to your own
mail... :-)
It should go through the dialplan. What we could do is to set a variable
so you could catch it being a call forward in the dial plan so you could
treat it any way you want.
Another question is the context. We have the normal context, the
transfer context, the subscription context - do we need to add another
context or can we reuse one of these for forwards? I would suspect that
using the transfer context with a flag for call forwarding
(CALLFORWARD=yes) would work.
/O
More information about the asterisk-users
mailing list