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

Fix issue #167 #245

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix issue #167 #245

wants to merge 1 commit into from

Conversation

obrain17
Copy link

Fix issue #167 phone.call() function does't work on Fritz!Box.

This PR only contains the 3 lines for the basic fix, so the Fritz!Box will accept the Invite. Other stuff in connection with the Fritz!Box (see zip-file attached to #167) I am considering to suggest with further PRs, following the guideline to do only small fixes per PR.

What is done?

  • Change the branch id after the Unauthorized response. Fritz!Box appearently needs this.
  • I have been using this for some years in my own C++ SIP library.
  • German Softphone for Windows PhonerLite is doing this as well.

Fix issue tayler6000#167 phone.call() function does't work on Fritz!Box
Change branch id for re-authentication. Fritz!Box needs this.
@fussel132
Copy link

I am currently investigating the same issue as I've also encountered it while trying to perform a INVITE request using FritzBox as server. Upon sending the INVITE request I get a 401 as response. From successful attempts with pjsip I know that the first invite usually fails but the next one will include the required auth header(s). This second attempt is missing with pyVoIP and thus the target phone won't ring.

Applying the changes proposed here resolve that issue so long story short: +1 on this one!

@obrain17
Copy link
Author

@fussel132 The "second attempt" as you call it, containing the authentication, has been done at line 1643 also before.
But with the lines added by the PR it uses a new branch id and thus is recognized by the Fritz!Box server as a new invite.

            branch = branch[0:hexindex] + f'{hexdigit:x}' + branch[hexindex+1:]

            invite = self.gen_invite(
                number, str(sess_id), ms, sendtype, branch, call_id
            )

So the issue is resolved and the Fritz!Box makes the phone ring.

@fussel132
Copy link

Uh oh okay my bad. Have not created a WireShark capture with pyVoIP and just assumed it to be the same issue as I had with pjsip before.

Thanks and sorry 🙈

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

Successfully merging this pull request may close these issues.

2 participants