Skip to content

Commit 46e1d0f

Browse files
committed
Changed default values for socket
1 parent c334ed6 commit 46e1d0f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

docs/event.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ This package can be used to subscribe to OpenSIPS events.
55
## Supported backend protocols
66

77
The following event transport protocols are supported:
8-
* `datagram` (Default) - uses either UDP or UNIX datagram to receive notifications for subscribed events. By default, the UDP protocol is used with the `ip` and `port` parameters set to `127.0.0.1` and `50060` respectively, but you can tune them to your needs.
8+
* `datagram` (Default) - uses either UDP or UNIX datagram to receive notifications for subscribed events. By default, the UDP protocol is used with the `ip` and `port` parameters set to `0.0.0.0` and `0` (any available port) respectively, but you can tune them to your needs.
99
To use the UNIX datagram, set the `socket_path` parameter.
10-
* `stream` - uses TCP to communicate with the Event Interface. Default values for `ip` and `port` are `127.0.0.1` and `50060` respectively, but you can change them as needed.
10+
* `stream` - uses TCP to communicate with the Event Interface. Default values for `ip` and `port` are `0.0.0.0` and `0` (any available port) respectively, but you can change them as needed.
1111

1212
## How to use
1313

opensips/event/datagram.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ def __init__(self, **kwargs):
3434
if "unix_path" in kwargs:
3535
self.sock_name = kwargs["unix_path"]
3636
else:
37-
self.ip = kwargs.get("ip", "127.0.0.1")
38-
self.port = int(kwargs.get("port", 50060))
37+
self.ip = kwargs.get("ip", "0.0.0.0")
38+
self.port = int(kwargs.get("port", 0))
3939

4040
def create(self):
4141
if self.ip is not None:

opensips/event/stream.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class Stream(GenericSocket):
2727
""" TCP/Stream implementation of a socket """
2828

2929
def __init__(self, **kwargs):
30-
self.ip = kwargs.get("ip", "127.0.0.1")
31-
self.port = int(kwargs.get("port", 50060))
30+
self.ip = kwargs.get("ip", "0.0.0.0")
31+
self.port = int(kwargs.get("port", 0))
3232
self.sock = None
3333
self.sock_name = None
3434

0 commit comments

Comments
 (0)