Skip to content
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

When i get access to Asterisk server, I got such errors. What is the reason and how to fix it? #251

Open
codemaven0321 opened this issue Mar 9, 2024 · 1 comment

Comments

@codemaven0321
Copy link

codemaven0321 commented Mar 9, 2024

When I want to connect PyVoIP script to Asterisk server, I faced a problem. But with minisip server, it works well.
I got such error with Python script.

Error on header parsing: Unable to decipher SIP request: NOTIFY sip:[email protected]:5060;transport=UDP SIP/2.0Error on header parsing: Unable to decipher SIP request: NOTIFY sip:[email protected]:5060;transport=UDP SIP/2.0Error on header parsing: Unable to decipher SIP request: OPTIONS sip:[email protected]:5060;transport=UDP SIP/2.0Error on header parsing: Unable to decipher SIP request: OPTIONS sip:[email protected]:5060;transport=UDP SIP/2.0Error on header parsing: Unable to decipher SIP request: NOTIFY sip:[email protected]:5060;transport=UDP SIP/2.0Error on header parsing: Unable to decipher SIP request: OPTIONS sip:[email protected]:5060;transport=UDP SIP/2.0Error on header parsing: Unable to decipher SIP request: NOTIFY sip:[email protected]:5060;transport=UDP SIP/2.0Error on header parsing: Unable to decipher SIP request: NOTIFY sip:[email protected]:5060;transport=UDP SIP/2.0REGISTERATION ERROR: Unable to decipher SIP request: OPTIONS sip:[email protected]:5060;transport=UDP SIP

And server log like that
[Mar 11 04:12:56] NOTICE[6188]: chan_sip.c:30637 sip_poke_noanswer: Peer '5711300' is now UNREACHABLE! Last qualify: 0

@obrain17
Copy link

obrain17 commented Mar 13, 2024

PyVoIP can handle the methods:

SIPCompatibleMethods = ["INVITE", "ACK", "BYE", "CANCEL"]

On Registeration pyVoIP tells the server these methods by sending the header:

Allow: INVITE, ACK, BYE, CANCEL

Nevertheless your Asterisk server sends Requests with the type OPTIONS and NOTIFY, but the minisip server does not.
pyVoIP tries to parse all headers of incoming messages, checking both SIPCompatibleVersions (SIP/2.0) and SIPCompatibleMethods.
That is why the error is raised, when receiving non-compatible methods.
To solve this either:

  • Configure Asterisk to not send these requests - or
  • Modify PyVoIP to accept them with an OK-Message, but then do nothing.
    An example how to do this is here: Add OPTIONS and CANCEL methods #177

Edit: See also here: #46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants