Skip to content

Instantly share code, notes, and snippets.

View razvancrainea's full-sized avatar

Răzvan Crainea razvancrainea

  • OpenSIPS
  • Romania
View GitHub Profile
diff --git a/lib/codeclib.c b/lib/codeclib.c
index ed454a79..c0f9fe79 100644
--- a/lib/codeclib.c
+++ b/lib/codeclib.c
@@ -1478,10 +1478,14 @@ static const char *avc_encoder_init(encoder_t *enc, const str *extra_opts) {
enc->u.avc.avcctx->time_base = (AVRational){1,enc->actual_format.clockrate};
enc->u.avc.avcctx->bit_rate = enc->bitrate;
- enc->samples_per_frame = enc->actual_format.clockrate * enc->ptime / 1000;
+ enc->samples_per_packet = enc->actual_format.clockrate * enc->ptime / 1000;
@razvancrainea
razvancrainea / rtpengine-pause-subscription.patch
Created March 3, 2023 14:02
RTPEngine attempt to pause subscription
diff --git a/daemon/call.c b/daemon/call.c
index 2e74b1b9..2a07ab9c 100644
--- a/daemon/call.c
+++ b/daemon/call.c
@@ -3405,7 +3405,7 @@ static int monologue_subscribe_request1(struct call_monologue *src_ml, struct ca
codec_handlers_update(dst_media, src_media, flags, sp);
- if (MEDIA_ISSET(src_media, RECV))
+ if (MEDIA_ISSET(src_media, RECV) && !flags->nosend)
@razvancrainea
razvancrainea / cluecon-tgi2021-dashboard.json
Last active July 18, 2021 07:07
ClueCon TGI2021: Configs for Quality Based Routing statistics
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
commit 89023bb1ff1be17e0a3d316a8f6de1e4e4e20640
Author: Razvan Crainea <razvan@opensips.org>
Date: Wed Oct 9 12:35:33 2019 +0300
properly populate route_type for certain routes
Reported by Ben Newlin in ticket #1846
diff --git a/modules/b2b_entities/dlg.c b/modules/b2b_entities/dlg.c
index 17deae9da..afa2ec9dd 100644
@razvancrainea
razvancrainea / rtpengine-reconnect.patch
Created October 29, 2018 15:42
Patch to reconnect rtpengine node
diff --git a/modules/rtpengine/rtpengine.c b/modules/rtpengine/rtpengine.c
index 456c2c1f2..39639b26e 100644
--- a/modules/rtpengine/rtpengine.c
+++ b/modules/rtpengine/rtpengine.c
@@ -1224,12 +1224,65 @@ static int mi_child_init(void)
return 0;
}
-static int connect_rtpengines(void)
+static inline int rtpengine_connect_node(struct rtpe_node *pnode)
@razvancrainea
razvancrainea / opensipsctl_fifo.py
Created July 25, 2018 21:55
opensipsctl fifo in python
#!/usr/bin/env python
import sys
import os
"""
This module provides the methods to connect to an OpenSIPS instance and run a
command over the mi_fifo module.
Usage example:
@razvancrainea
razvancrainea / debug_timer_warn.patch
Last active March 21, 2017 10:36
debug timer warnings
diff --git a/io_wait_loop.h b/io_wait_loop.h
index c33c591b4..77bc9f39d 100644
--- a/io_wait_loop.h
+++ b/io_wait_loop.h
@@ -156,6 +156,9 @@ inline static int io_wait_loop_epoll(io_wait_h* h, int t, int repeat)
again:
ret=n=epoll_wait(h->epfd, h->ep_array, h->fd_no, t*1000);
+#ifdef HAVE_EPOLL_TIMER_DEBUG
+ gettimeofday(&epoll_exit, NULL);
@razvancrainea
razvancrainea / drouting_gw_whitelist.patch
Created March 10, 2017 09:48
Dynamic routing pkg memory leak when using GW whitelist
diff --git a/modules/drouting/drouting.c b/modules/drouting/drouting.c
index 7b0c3544b..a4e0d1ebe 100644
--- a/modules/drouting/drouting.c
+++ b/modules/drouting/drouting.c
@@ -3095,9 +3095,11 @@ no_gws:
}
}
+ if (wl_list) pkg_free(wl_list);
if (ruri_buf) pkg_free(ruri_buf);
@razvancrainea
razvancrainea / net_con_release.patch
Created January 31, 2017 16:59
TCP conection release
diff --git a/net/net_tcp.c b/net/net_tcp.c
index 1422d5eb8..e4f430bac 100644
--- a/net/net_tcp.c
+++ b/net/net_tcp.c
@@ -1187,6 +1187,15 @@ inline static int handle_tcp_worker(struct tcp_child* tcp_c, int fd_i)
reactor_add_reader( tcpconn->s, F_TCPCONN, RCT_PRIO_NET, tcpconn);
tcpconn->flags&=~F_CONN_REMOVED;
break;
+ case CONN_RELEASE_WRITE:
+ tcp_c->busy--;
@razvancrainea
razvancrainea / tcp_conn_debug.patch
Last active January 20, 2017 08:44
TCP connection debugging
diff --git a/net/net_tcp_proc.c b/net/net_tcp_proc.c
index a9aa86d67..3dc70d95a 100644
--- a/net/net_tcp_proc.c
+++ b/net/net_tcp_proc.c
@@ -166,10 +166,12 @@ again:
* already existing events => might call handle_io and
* handle_io might decide to del. the new connection =>
* must be in the list */
+ tcpconn_check_add(con);
tcpconn_listadd(tcp_conn_lst, con, c_next, c_prev);