Grandstream服务器实时获取电话

时间:2019-12-10 12:12:26

标签: python server real-time

我们已将服务器配置为实时监听呼叫。问题是通话结束后我们会收到响应。我们需要实时接听电话。

#!/bin/python


# To test the cdr realtime sending function
import string
from urllib.request import urlopen
import time
import socket

port = 5855;


def test():
    server = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
    address = ('172.16.1.179', int(port))
    server.bind(address)
    server.listen(10)

    while 1:
        s,addr = server.accept()
        data = s.recv(2048)
        print (data)
        s.close()

test()

0 个答案:

没有答案