[asterisk-dev] Finding the original sip_pvt

Torbjörn Abrahamsson torbjorn.abrahamsson at gmail.com
Mon May 16 07:30:15 CDT 2011


> > Now if I have missed the obvious (and correct) way to do this, please
> enlighten me.. Maybe there is somewhere the new pvt is created, and
> some of its variables gets populated?
> >
> If you look into the fax part of the code, you can see that we peek
> into the bridged channel to the p->owner and check the pvt of that one
> - you need to cross over the bridge (hold on to the rails) and find the
> other channel. Don't assume that you always have one either.
> 
> In other cases, we use channel variables so that the incoming channel
> set a variable that begins with one or two underscores, these will be
> inherited to the new channel.
> 

Tack Olle.

In the case with channel variables, is it actually possible to inherit
variables "backwards"? Ie can I set a new variable with double underscores
in the new channel, and read it in the old? Or maybe set a response variable
in the first channel with double underscores, and then later update this in
the second channel, so that I even later may read the result in the first?

When you talk about the fax code, which part do you mean? In chan_sip or
res_fax(?) or something else? There are a bunch of files regarding fax. And
regarding p->owner, when I did some testing it seemed to me like p and
p->owner->tech_pvt were the same. Have I missed something?

The setup looks like:
SIP1 -> AST -> SIP2

[fromsip1]
exten => _X.,1,NoOp(FROM SIP1)
exten => _X.,n,Dial(SIP/${EXTEN}@sip2)

and the corresponding for fromsip2.

Quite basic. No Local channels and other stuff which complicate things... :)

Thanks!

// T






More information about the asterisk-dev mailing list