pyVoIP icon indicating copy to clipboard operation
pyVoIP copied to clipboard

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

Open abhinandanshrestha opened this issue 1 year ago • 3 comments

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)

abhinandanshrestha avatar Sep 05 '24 06:09 abhinandanshrestha

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?

PranavKathar avatar Oct 21 '24 11:10 PranavKathar

I'm experiencing the same issue with pyVoIP 1.6.8 where calls automatically terminate after exactly 30 seconds. This appears to be related to SIP session timers. @tayler6000 Are there plans to address this in a future release?

Maher-Amara avatar Jul 19 '25 12:07 Maher-Amara

you're likely missing an ack from the other party.

On Sat, Jul 19, 2025 at 5:58 AM Maher Amara @.***> wrote:

Maher-Amara left a comment (tayler6000/pyVoIP#272) https://github.com/tayler6000/pyVoIP/issues/272#issuecomment-3092338327

I'm experiencing the same issue with pyVoIP 1.6.8 where calls automatically terminate after exactly 30 seconds. This appears to be related to SIP session timers. @tayler6000 https://github.com/tayler6000 Are there plans to address this in a future release?

— Reply to this email directly, view it on GitHub https://github.com/tayler6000/pyVoIP/issues/272#issuecomment-3092338327, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFU3N57HVINL2Q4UTWIJUM33JI6GZAVCNFSM6AAAAACB4S7KOOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAOJSGMZTQMZSG4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

tomlynn avatar Jul 20 '25 21:07 tomlynn