-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dialplan idea #121
base: master
Are you sure you want to change the base?
Dialplan idea #121
Conversation
Some request can come without a `To` headers tag (after a 401 for example). This should probably be done only for specific status code.
I think I like the look at this. Funny enough I was looking at doing the same thing right now. I'll check it out and play with it locally and give you some feedback. On a different note - how comfortable would you be with using python-attrs package? Its not an extra dep for me as I already mix this with aiohttp. |
@@ -7,3 +10,31 @@ class BaseDialplan: | |||
async def resolve(self, method, message, protocol, local_addr, remote_addr): | |||
LOG.debug('Resolving dialplan for %s %s connecting on %s from %s via %s', | |||
method, message, local_addr, remote_addr, protocol) | |||
|
|||
|
|||
class AuthDialplan(BaseDialplan): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay taking this, but I suspect we don't actually need classes in the public API.
An async generator and closure should be sufficient to capture everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like class because they can be easily subclassed. I'll have to try your proposition make my mind
I haven't used |
This is a quick implementation of my idea about dialplan (third commit) by implementing a dialplan that handle authentication.