Skip to content

Commit

Permalink
deploy: 0c7ac3f
Browse files Browse the repository at this point in the history
  • Loading branch information
wangduanduan committed Dec 28, 2024
1 parent fb589ed commit 3b02ace
Show file tree
Hide file tree
Showing 65 changed files with 618 additions and 418 deletions.
2 changes: 1 addition & 1 deletion archives/index.html

Large diffs are not rendered by default.

17 changes: 7 additions & 10 deletions categories/all/index.html

Large diffs are not rendered by default.

16 changes: 15 additions & 1 deletion categories/all/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,21 @@
</image>
<generator>Hugo -- gohugo.io</generator>
<language>en</language>
<lastBuildDate>Fri, 27 Dec 2024 20:45:03 +0800</lastBuildDate><atom:link href="https://wdd.js.org/categories/all/index.xml" rel="self" type="application/rss+xml" />
<lastBuildDate>Sat, 28 Dec 2024 09:43:00 +0800</lastBuildDate><atom:link href="https://wdd.js.org/categories/all/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>源码笔记 - 自定义事件路由(中)</title>
<link>https://wdd.js.org/kamailio/route-list-action/</link>
<pubDate>Sat, 28 Dec 2024 09:43:00 +0800</pubDate>

<guid>https://wdd.js.org/kamailio/route-list-action/</guid>
<description>[[TOC]]
route_list route.h定义了几个函数分别用来获取、查找、新增route
// src/core/route.h int route_get(struct route_list *rt, char *name); int route_lookup(struct route_list *rt, char *name); void push(struct action *a, struct action **head); struct route_list { struct action **rlist; int idx; /* first empty entry */ int entries; /* total number of entries */ struct str_hash_table names; /* name to route index mappings */ }; rlist 我们对route_list数据模型进行简化:
rlist是一个固定长度的一维数组,通过索引来访问对应的值。如果数组的空间不足,那么就创建一个两倍大的空数据,然后先把原始数据复制过去。这种复制方式保持的原始数据的索引位置。有点像golang的切片扩容机制。
这里最为重要的就是保持数组元素的索引位置在扩容后不变。
static inline int route_new_list(struct route_list *rt) { int ret; struct action **tmp; ret = -1; if(rt-&amp;gt;idx &amp;gt;= rt-&amp;gt;entries) { // 两倍扩容 tmp = pkg_realloc(rt-&amp;gt;rlist, 2 * rt-&amp;gt;entries * sizeof(struct action *)); if(tmp == 0) { LM_CRIT(&amp;#34;out of memory\n&amp;#34;); goto end; } /* init the newly allocated memory chunk */ memset(&amp;amp;tmp[rt-&amp;gt;entries], 0, rt-&amp;gt;entries * sizeof(struct action *)); rt-&amp;gt;rlist = tmp; rt-&amp;gt;entries *= 2; } if(rt-&amp;gt;idx &amp;lt; rt-&amp;gt;entries) { ret = rt-&amp;gt;idx; rt-&amp;gt;idx++; } end: return ret; } str_hash_table 我们对hash_table的数据模型进行简化,它其实就是一hash表,key是路由的名,值是一个正数,正数代表了路由执行单元的索引位置。</description>
</item>

<item>
<title>源码笔记 - 自定义事件路由(上)</title>
<link>https://wdd.js.org/kamailio/customer-event-route/</link>
Expand Down
29 changes: 10 additions & 19 deletions categories/all/page/2/index.html

Large diffs are not rendered by default.

28 changes: 19 additions & 9 deletions categories/all/page/3/index.html

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion categories/all/page/4/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<!doctype html><html lang=en dir=auto><head><meta charset=utf-8><meta http-equiv=x-ua-compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=robots content="index, follow"><title>all | 洞香春</title><meta name=keywords content><meta name=description content="Eddie Wang的个人博客"><meta name=author content="Eddie Wang"><link rel=canonical href=https://wdd.js.org/categories/all/><link crossorigin=anonymous href=/assets/css/stylesheet.6d3944e058d85363bbe8a792a9b5f40002bca80be859dc19c466dd8de223973e.css integrity="sha256-bTlE4FjYU2O76KeSqbX0AAK8qAvoWdwZxGbdjeIjlz4=" rel="preload stylesheet" as=style><link rel=icon href=https://wdd.js.org/cowboy.ico><link rel=icon type=image/png sizes=16x16 href=https://wdd.js.org/cowboy.ico><link rel=icon type=image/png sizes=32x32 href=https://wdd.js.org/cowboy.ico><link rel=apple-touch-icon href=https://wdd.js.org/cowboy.ico><link rel=mask-icon href=https://wdd.js.org/cowboy.ico><meta name=theme-color content="#2e2e33"><meta name=msapplication-TileColor content="#2e2e33"><link rel=alternate type=application/rss+xml href=https://wdd.js.org/categories/all/index.xml><noscript><style>#theme-toggle,.top-link{display:none}</style></noscript><meta property="og:title" content="all"><meta property="og:description" content="Eddie Wang的个人博客"><meta property="og:type" content="website"><meta property="og:url" content="https://wdd.js.org/categories/all/"><meta property="og:image" content="https://wdd.js.org/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta property="og:site_name" content="洞香春"><meta name=twitter:card content="summary_large_image"><meta name=twitter:image content="https://wdd.js.org/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta name=twitter:title content="all"><meta name=twitter:description content="Eddie Wang的个人博客"></head><body class=list id=top><script>localStorage.getItem("pref-theme")==="dark"&&document.body.classList.add("dark")</script><header class=header><nav class=nav><div class=logo><a href=https://wdd.js.org accesskey=h title="洞香春 (Alt + H)"><img src=https://wdd.js.org/cowboy.ico alt aria-label=logo height=35>洞香春</a><div class=logo-switches><button id=theme-toggle accesskey=t title="(Alt + T)"><svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg><svg id="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg></button></div></div><ul id=menu><li><a href=https://wdd.js.org/books/ title=百分之一阅读法><span>百分之一阅读法</span></a></li><li><a href=https://wdd.js.org/freeswitch/ title=FreeSWITCH><span>FreeSWITCH</span></a></li><li><a href=https://wdd.js.org/golang/ title=Golang><span>Golang</span></a></li><li><a href=https://wdd.js.org/kamailio/ title=Kamailio><span>Kamailio</span></a></li><li><a href=https://wdd.js.org/network/ title=Network><span>Network</span></a></li><li><a href=https://wdd.js.org/opensips/ title=OpenSIPS><span>OpenSIPS</span></a></li><li><a href=https://wdd.js.org/vim/ title=VIM><span>VIM</span></a></li><li><a href=https://wdd.js.org/categories/ title=分类><span>分类</span></a></li><li><a href=https://wdd.js.org/fe/ title=前端><span>前端</span></a></li><li><a href=https://wdd.js.org/search/ title=搜索><span>搜索</span></a></li><li><a href=https://wdd.js.org/tags/ title=标签><span>标签</span></a></li><li><a href=https://wdd.js.org/archives/ title=归档><span>归档</span></a></li><li><a href=https://wdd.js.org/about/ title=><span></span></a></li></ul></nav></header><main class=main><header class=page-header><div class=breadcrumbs><a href=https://wdd.js.org>Home</a>&nbsp;»&nbsp;<a href=https://wdd.js.org/categories/>Categories</a></div><h1>all</h1></header><article class="post-entry tag-entry"><header class=entry-header><h2>模块传参的重构</h2></header><div class=entry-content><p>写过opensips脚本的同学,往往对函数的传参感到困惑。
<!doctype html><html lang=en dir=auto><head><meta charset=utf-8><meta http-equiv=x-ua-compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=robots content="index, follow"><title>all | 洞香春</title><meta name=keywords content><meta name=description content="Eddie Wang的个人博客"><meta name=author content="Eddie Wang"><link rel=canonical href=https://wdd.js.org/categories/all/><link crossorigin=anonymous href=/assets/css/stylesheet.6d3944e058d85363bbe8a792a9b5f40002bca80be859dc19c466dd8de223973e.css integrity="sha256-bTlE4FjYU2O76KeSqbX0AAK8qAvoWdwZxGbdjeIjlz4=" rel="preload stylesheet" as=style><link rel=icon href=https://wdd.js.org/cowboy.ico><link rel=icon type=image/png sizes=16x16 href=https://wdd.js.org/cowboy.ico><link rel=icon type=image/png sizes=32x32 href=https://wdd.js.org/cowboy.ico><link rel=apple-touch-icon href=https://wdd.js.org/cowboy.ico><link rel=mask-icon href=https://wdd.js.org/cowboy.ico><meta name=theme-color content="#2e2e33"><meta name=msapplication-TileColor content="#2e2e33"><link rel=alternate type=application/rss+xml href=https://wdd.js.org/categories/all/index.xml><noscript><style>#theme-toggle,.top-link{display:none}</style></noscript><meta property="og:title" content="all"><meta property="og:description" content="Eddie Wang的个人博客"><meta property="og:type" content="website"><meta property="og:url" content="https://wdd.js.org/categories/all/"><meta property="og:image" content="https://wdd.js.org/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta property="og:site_name" content="洞香春"><meta name=twitter:card content="summary_large_image"><meta name=twitter:image content="https://wdd.js.org/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta name=twitter:title content="all"><meta name=twitter:description content="Eddie Wang的个人博客"></head><body class=list id=top><script>localStorage.getItem("pref-theme")==="dark"&&document.body.classList.add("dark")</script><header class=header><nav class=nav><div class=logo><a href=https://wdd.js.org accesskey=h title="洞香春 (Alt + H)"><img src=https://wdd.js.org/cowboy.ico alt aria-label=logo height=35>洞香春</a><div class=logo-switches><button id=theme-toggle accesskey=t title="(Alt + T)"><svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg><svg id="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg></button></div></div><ul id=menu><li><a href=https://wdd.js.org/books/ title=百分之一阅读法><span>百分之一阅读法</span></a></li><li><a href=https://wdd.js.org/freeswitch/ title=FreeSWITCH><span>FreeSWITCH</span></a></li><li><a href=https://wdd.js.org/golang/ title=Golang><span>Golang</span></a></li><li><a href=https://wdd.js.org/kamailio/ title=Kamailio><span>Kamailio</span></a></li><li><a href=https://wdd.js.org/network/ title=Network><span>Network</span></a></li><li><a href=https://wdd.js.org/opensips/ title=OpenSIPS><span>OpenSIPS</span></a></li><li><a href=https://wdd.js.org/vim/ title=VIM><span>VIM</span></a></li><li><a href=https://wdd.js.org/categories/ title=分类><span>分类</span></a></li><li><a href=https://wdd.js.org/fe/ title=前端><span>前端</span></a></li><li><a href=https://wdd.js.org/search/ title=搜索><span>搜索</span></a></li><li><a href=https://wdd.js.org/tags/ title=标签><span>标签</span></a></li><li><a href=https://wdd.js.org/archives/ title=归档><span>归档</span></a></li><li><a href=https://wdd.js.org/about/ title=><span></span></a></li></ul></nav></header><main class=main><header class=page-header><div class=breadcrumbs><a href=https://wdd.js.org>Home</a>&nbsp;»&nbsp;<a href=https://wdd.js.org/categories/>Categories</a></div><h1>all</h1></header><article class="post-entry tag-entry"><header class=entry-header><h2>为什么我不再使用语雀</h2></header><div class=entry-content><p>我在2019年的六月份时候,开始使用语雀。
一路走来,我见证了语雀的功能越来越多,但是于此同时,我也越来越讨厌语雀。
2022年12月初,我基本上把语雀上的所有内容都迁移到我的hugo博客上。
我的博客很乱,也很多。我写了一个脚本,一个一个知识库的搬迁,总体速度还算快,唯一不便的就是图片需要一个一个复制粘贴。
有些图片是用语雀的绘图语言例如plantuml编写的,就只能截图保存了。
总之,我也是蛮累的。
简单列一下我不喜欢语雀的几个原因:
性能差,首页渲染慢,常常要等很久,首页才能打开 产品定位混乱,随意更改用户数据 我记得有时候我把知识库升级成了空间,过了一段时间,不知道为什么空间由变成了知识库。 数字花园这个概念真的很烂。我好好的个人主页,某一天打开,大变样,换了个名字,叫做数字花园。甚至没有给用户一个选择保留老版本的个人主页的权利。太不尊重用户了!! 就好像你下班回家,看见房门被人撬开,你打开房门,看见有人在你的客厅种满大蒜,然后还兴高采烈的告诉你,看,这是您的数字菜园!多好,以后不用买蒜了。 会员的流量计费规则, 或许现在的计费规则已经变了,我也没有再充会员,但是再以前。即使是会员,也是按流量计费的。什么叫按流量计费,假如你的一篇博客里上传了一张1mb的图片,即使你后来把这个图片删了,这1mb的流量还是会存在。而且流量是一直往上涨的,还不像运营商,每月一号给你清零一次的机会。</p></div><footer class=entry-footer><span title='2022-12-06 21:10:38 +0800 CST'>2022-12-06 21:10:38</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;Eddie Wang</footer><a class=entry-link aria-label="post link to 为什么我不再使用语雀" href=https://wdd.js.org/posts/2022/12/why-i-dont-not-use-yuque-any-more/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2>模块传参的重构</h2></header><div class=entry-content><p>写过opensips脚本的同学,往往对函数的传参感到困惑。
例如:
ds_select_dst()可以接受整数或者值为正数的变量作为第一个参数,但是nat_uac_test()的第一个参数就只能是整数,而不能是变量 为什么rl_check()可以接受格式化的字符串,而save()只能接受字符串。 为什么ds_select_dst("1", "4") 作为整数也要加上双引号? 为什么变量要加上双引号? ds_select_dst("$var(aa)", "4") 为什么t_on_branch("1")路由的钩子要加上双引号? 为什么route(go_to_something);这里又不需要加上引号? ds_select_dst("1", "0"); $var(aa)=1; ds_select_dst("$var(aa)", "0"); rl_check("gw_$ru", "$var(limit)"); #格式化的gw_$ru save("location"); #单纯的字符串作为参数 从3.0开始,传参可以更加自然。
整数可以直接传参,不用加双引号 do_something(1, 1); 输入或者输出的$var(), 不用加双引号,加了反而会报错 do_something($var(a), $var(b)); 格式化字符串,需要加双引号 do_something(1, "$var(bb)_$var(b)"); 参考 https://blog.opensips.org/2019/11/05/the-module-function-interface-rework-in-opensips-3-0/ https://www.opensips.org/Documentation/Script-Syntax-3-0#</p></div><footer class=entry-footer><span title='2022-12-03 21:01:02 +0800 CST'>2022-12-03 21:01:02</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;Eddie Wang</footer><a class=entry-link aria-label="post link to 模块传参的重构" href=https://wdd.js.org/opensips/3x/module-args/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2>Pdf学习资料</h2></header><div class=entry-content><p>TelNYX.pdf OpenSIPS 2.3 mediasoup Cutting Edge WebRTC Video COnferencing FreeSWITCH-driven routing in OpenSIPS Voicenter: Contact center on Steroids Vlad_Paiu-Distributed_OpenSIPS_Systems_Cluecon14.pdf Vlad_Paiu-OpenSIPS_Summit_Austin_2015-Async.pdf Ionut_Ionita-OpenSIPS_Summit2017-Capturing_beyond_SIP FLAVIO_GONCALVES-Fraud_in_VoIP_Today.pdf Alexandr_Dubovikov-OpenSIPS_Summit2017-RTC_Threat_Intelligence_Exchange.pdf OpenSIPS_LoadBalancing.pdf Vlad_Paiu-OpenSIPS_Summit_2104-OpenSIPS_End_User_Services.pdf Razvan_Crainea-OpenSIPS_Summit2017-From_SIPI_Trunks_to_End_Users.pdf Razvan_Crainea-OpenSIPS_Summit-Scaling_Asterisk.pdf Vlad_Paiu-OpenSIPS_Summit-Service_Enabling_for_Asterisk.pdf Jonas_Borjesson-OpenSIPS_Summit_Austin_2015.pdf Michele_Pinasi-OpenSIPS_Summit2017-How_we_did_VoIP.pdf Bogdan_Iancu-OpenSIPS_Summit_Keynotes.pdf Giovanni_Maruzselli-OpenSIPS_Summit2017-Scaling_FreeSWITCHes.pdf Maksym_Sobolyev-OpenSIPS_Summit2017-Sippy_Labs_update.pdf docker-cluster.pdf voip malware attack tool .pdf Bogdan_Iancu-OpenSIPS_Summit-OpenSIPS_2_1.pdf Pete_Kelly-OpenSIPS_Workshop_Chicago_2015-Calling_Cards_B2BUA.pdf Bogdan_Iancu-OpenSIPS_Summit-keynotes.pdf Alex_Goulis-Opensips_CNAME.pdf OpenSIPS_2.0_Framework.pdf Norman_Brandinger-OpenSIPS_Summit_2014-Advanced_SIP_Routing_with_OpenSIPS_modules.pdf</p></div><footer class=entry-footer><span title='2022-12-03 16:02:18 +0800 CST'>2022-12-03 16:02:18</span>&nbsp;·&nbsp;1 min&nbsp;·&nbsp;Eddie Wang</footer><a class=entry-link aria-label="post link to Pdf学习资料" href=https://wdd.js.org/opensips/pdf/></a></article><article class="post-entry tag-entry"><header class=entry-header><h2>西安之旅 不仅有羊肉泡馍 也有长恨歌</h2></header><div class=entry-content><p>一年过半以后,偶然打开微信公众号,看到草稿箱里的篇文章。我才回想起去年带女友去西安的那个遥远的夏天。
Expand Down
Loading

0 comments on commit 3b02ace

Please sign in to comment.