[asterisk-dev] chan_zap questions

Armin Schindler armin at melware.de
Thu Jul 13 06:01:52 MST 2006


On Thu, 13 Jul 2006, Klaus Darilion wrote:
> Armin Schindler wrote:
> > On Wed, 12 Jul 2006, Klaus Darilion wrote:
> > > > Maybe an additional subclass
> > > > AST_CONTROL_AOC
> > > > should be introduced.
> > > Thats what I did and it works fine. But ast_indicate_data requires a
> > > ast_channel as first parameter. If FACILITY is received on leg2, I
> > > have to
> > > find out the ast_channel of leg 1 to indicate on the proper channel.
> > > Fur this
> > > purpose I still use ast_bridged_call. Any other suggestion?
> > 
> > No, don't use ast_indicate*() directly, just use the normal *read
> > function to give this CONTROL frame to asterisk. The asterisk code
> > (bridge or dial-before-bridge) will forward this CONTROL frame to the
> > other leg. 
> 
> Hi Armin!
> 
> How are the frames handled in Asterisk - synchron or asynchron? For example,
> in chap_zap I allocate a buffer, and queue a control frame whose data member
> points to the buffer. Once chan_zap receives the control_frame, it will read
> data from this buffer. Is this safe?

The data of such an control frame is placed like the voice data to
f->data and f->datalen (f->data must point to the buffer).
You should assume asynchron, because on certian parts there are queues and 
pipes used, so it's not synchron.
The f->data pointer must be valid until the other leg has read it.
So maybe an malloc'ed space should be used.

Armin

 
> regards
> klaus
> 
> > 
> > > during processing of case PRI_EVENT_FACNAME:
> > > struct ast_channel *otherchan;
> > > otherchan = ast_bridged_channel(pri->pvts[chanpos]->owner);
> > > if (otherchan && (!strcmp(otherchan->tech->type, "Zap"))) {
> > > /* Only for Zap channels */
> > > ast_indicate_data(otherchan, AST_CONTROL_AOCD, &aocd,
> > > sizeof(struct aocd_data));
> > 
> > Yes, that's the direct way, but you don't need that. See above.
> > 
> > Armin
> > 
> > _______________________________________________
> > --Bandwidth and Colocation provided by Easynews.com --
> > 
> > asterisk-dev mailing list
> > To UNSUBSCRIBE or update options visit:
> > http://lists.digium.com/mailman/listinfo/asterisk-dev
> 
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
> 
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> 
> 



More information about the asterisk-dev mailing list