[asterisk-dev] question about handle_request_subscribe in chan_sip.c V1.6.2

Stefan Schmidt sst at sil.at
Thu Sep 2 03:40:36 CDT 2010


Stefan Schmidt schrieb:
> hello,
>
> i´ve found something i didnt understand in the handle_request_subscribe 
> function.
>
> After some parsing and checks on row 21622 
> (http://www.asterisk.org/doxygen/asterisk1.6.2/chan__sip_8c-source.html#l21622) 
> i would read this row like this:
>
> if its not a MWI subscription and not a renew of an existing subscribe 
> then check if there is allready an old stateid (which means an old 
> callback to notify) then delete this old callback.
> after this a new callback to notify p is set if the exten in context of 
> p does a statechange and the return value is saved in p->stateid.
>
> if i am right so far, then i dont understand why further down on row 
> 21683 the whole ao2 container is looped through to find old dialogs for 
> this peer. if there is no callback for this dialogs, there wouldnt be a 
> notify send to them, so they will just timeout after their expire time?
>
>   
ok i am wrong, even the right callback is reseted or i thought of wrong 
things. if there are several subscribes on a hint even from the same 
peer, each subscribe will get the notify when i dont iterate through all 
dialogs :(

i will try to find a better solution for this cause its just too slow 
under heavy load.
> have i missed something or is this iterating through the dialog 
> container just to remove old subscribe dialogs for this peer and this 
> exten at context which will took more than 10 ms on every subscribe if 
> there are more than 500 open sip dialogs.
>   

best regards

steve
>   



-- 
Für weitere Fragen stehen wir gerne unter voip at sil.at oder
059944 - 2440 zur Verfügung.

Mit freundlichen Grüssen
-- 
Stefan Schmidt
Sysadmin/VOIP // voip at sil.at // Tel 059944-2440//
-------------------------------------------------
SILVER SERVER GmbH // Lorenz-Mandl-Gasse 33/1 //
A-1160 Wien // Fax 059944-9000 // www.sil.at  //
------------------------------------------------- 




More information about the asterisk-dev mailing list