Open kousu opened 4 years ago
I don't understand the motivation behind what I got rid of. Hopefully you can take a look and tell me if this will screw something else up. Especially, why would you want to use a different username depending on the case, or why it ignores the one explicitly passed by the user?
Am I misusing aiosip somehow?
If I put my app back closer to how I found the initial example (https://github.com/Eyepea/aiosip/blob/553b7b2b408f1f165a1da68a876f27eaafe3ad1e/examples/back_to_back/client.py#L61-L71)
by re-adding the username@ part:
async def login(peer):
await peer.register(
from_details=aiosip.Contact.from_header('sip:{}@{}'.format(
sip_config['user'], sip_config['srv_host']
)),
- to_details=aiosip.Contact.from_header('sip:{}'.format(
- sip_config['srv_host']
+ to_details=aiosip.Contact.from_header('sip:{}@{}'.format(
+ sip_config['user'], sip_config['srv_host']
)),
then it logs in without complaint. But logging in "to" yourself doesn't make sense to me, and it's not what Linphone does either; so I didn't pass a user part for that field, so to_details
ends up with an empty ['user']
.
Working off
master
here (I installed withgit clone https://github.com/Eyepea/aiosip/; cd aiosip ;pip install -e .
) I can't log in to my SIP server with aiosip, as it stands. Here is my sample program:It dies deep in with a TypeError:
With the patch, I can log in (though I still can't make a call, but that's because the server I tested with only takes calls to itself and rejected me):
I'm trying this on
because that's what Ubuntu has for me, but I suspect this is a general problem (though I haven't tested other distros yet).