[asterisk-dev] Finding the original sip_pvt

Torbjörn Abrahamsson torbjorn.abrahamsson at gmail.com
Tue May 17 04:18:17 CDT 2011


> > 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.
> >
> 
> OK, thanks. I will try to find the relevant parts. Just to be sure,
> when you
> speak of a bridged channel above, you do not mean what happens when to
> legs
> of a call are connected, ie a bridged call? Because as this is before
> the
> 200 OK is sent the call is not bridged.. Just making sure I don't go
> looking
> for the wrong things... :)

OK, I solved my problem, maybe not in the "correct" way... But it works...

In handle_request_invite I set a channel variable (with double underscores)
containing the original channel name, and then in transmit_invite I get this
variable, and then use ast_channel_get_by_name to get the original channel,
read the wanted pvt-field, add the header if needed, and then do an
ast_channel_unref. And then I do the same when the response arrives, get the
channel, set the pvt-field, unref the channel, and then read the pvt field
and adding the header if needed, before sending the 200 ok on the original
channel.

Any problems with this approach?

Thanks for your help, Olle.

// T





More information about the asterisk-dev mailing list