Eyepea / aiosip

SIP support for AsyncIO (DEPRECATED)
Apache License 2.0
82 stars 41 forks source link

New middleware #82

Open vodik opened 6 years ago

vodik commented 6 years ago

I want to play around with creating an aiosip_auth package to be able to layer in authentication APIs, but the current middleware APIs aren't sufficient.

I really need to be able to intercept every incoming SIP message, so I think we'll need to change its design so that its done as a chained iterator: the middleware first received the message and then optionally yields it down to the actual handler below.

This would let me, for example, challenge all SUBSCRIPTION or REGISTER messages, regardless of when they show up in the dialog, without having the layer below having to handle being aware of the challenge authentication messages.

ludovic-gasc commented 6 years ago

I'm agree with your suggestion.

Be my guest to architecture the API for that.