[asterisk-dev] Finding the original sip_pvt
Olle E. Johansson
oej at edvina.net
Mon May 16 07:34:30 CDT 2011
16 maj 2011 kl. 14.30 skrev Torbjörn Abrahamsson:
>>> 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?
No. You can however code AST_CONTROL frames with payloads and transmit over the bridge.
>
> 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?
In chan_sip.
>
> The setup looks like:
> SIP1 -> AST -> SIP2
SIP1 -> AST <bridge> AST2 -> SIP2
Each pvt has an ast_channel. The bridge joins them. There are functions to find the bridged channel if you check the API.
>
> [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
>
>
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-dev
---
* Olle E Johansson - oej at edvina.net
* Cell phone +46 70 593 68 51, Office +46 8 96 40 20, Sweden
More information about the asterisk-dev
mailing list