[asterisk-dev] implementation suggestion

Klaus Darilion klaus.mailinglists at pernau.at
Mon Sep 22 08:59:56 CDT 2008



Kevin P. Fleming schrieb:
> Klaus Darilion wrote:
> 
>> I started thinking about how to implement this feature. What about:
>>
>> 1. Define a channel data store "SIPopts".
>> 2. On incoming SIP calls, the SIPopts channel data store is created, the 
>> member maxfwd is set to the value of the incoming Max-Forwards Header 
>> and the channel data store will be linked to the incoming channel as 
>> "global".
>> 3. Dial() applikation will copy ghe globel data store to all outgoing 
>> channels.
>> 4. If the outgoing channel is a SIP channel, chan_sip will check if the 
>> destination (peer) has set decmaxfwd==true and if yes, it will set 
>> Max-Forwards to the value in the data store minus 1 instead of using 70.
>>
>> What do you think about this?
> 
> Well, I would suggest making the variable and config option names a bit
> more expressive (no need for such short abbreviated names), but other
> than that this is an excellent approach, and exactly why we created
> datastores in the first place.
> 

Is there somewhere a kind of datastore registry? How do I find out if 
there is already a SIP (or ISDN or whatever) datastore? If not IMO we 
should make this (at least a datastores.txt file somewhere in docs)

Should the datastore (struct, free functions ...) be implemented inside 
chan_sip.c or is there another place for all the datastores?

regards
klaus



More information about the asterisk-dev mailing list