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

Call End automatically after 30 sec in pyVoIP 1.6.8; for same code it doesn't end in 1.5.6 #272

Open
abhinandanshrestha opened this issue Sep 5, 2024 · 1 comment

Comments

@abhinandanshrestha
Copy link

abhinandanshrestha commented Sep 5, 2024

`import time
from pyVoIP.VoIP import VoIPPhone, CallState
import threading

phone = VoIPPhone(
server="192.168.88.5",
port=5060,
username="5001",
password="hello123817239",
myIP="192.168.88.10",
sipPort=53563
)

phone.start()
start_thread=False

try:
call = phone.call('5000')
print("Call initiated. Send mode:", call)
# while True:
# print(call.state)

# Wait for the call to be answered
while call.state != CallState.ANSWERED:
    print("Current call state:", call.state)

# Process audio once the call is answered
while call.state == CallState.ANSWERED:
    # print("Current call state:", call.state)
    audio_bytes = call.readAudio()
    if audio_bytes:
        call.writeAudio(audio_bytes)

    else:
        print("No audio data received.")
    
# Handle call end
if call.state == CallState.ENDED:
    print("Call ended.")

except Exception as e:
print("An error occurred:", e)`

@PranavKathar
Copy link

Hi , Did you get any fix for this issue, i am using asterisk as sip server and i am facing the same call drop issue after 30 secs.
If would be great help if someone can reply to this issue @authors?

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