文章分类 » 未分类

Asterisk PJSIP configuration example

pjsip.conf

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
allow_reload=yes
external_media_address=172.217.25.78 // server ip address
external_signaling_address=172.217.25.78 // server ip address

pjsip_wizard.conf

[user_defaults](!)
type = wizard
endpoint/transport=transport-udp
endpoint/context=from-internal
endpoint/rtp_symmetric=yes
endpoint/rewrite_contact=yes
endpoint/force_rport=yes
endpoint/disallow=all
endpoint/allow=ulaw,gsm
aor/max_contacts=2
aor/qualify_frequency=30

[user1](user_defaults)
inbound_auth/username = 101
inbound_auth/password = password101

[user2](user_defaults)
inbound_auth/username = 102
inbound_auth/password = password102

postfix出错一则

能收到邮件但是发不出去

错误日志如下

Nov  4 20:32:21 localhost postfix/cleanup[4853]: warning: 51CCA2E129: virtual_alias_maps map lookup probl         em for xxxx@gmail.com
Nov  4 20:33:21 localhost postfix/pickup[4851]: 587A12F5F5: uid=0 from=
Nov  4 20:33:21 localhost postfix/cleanup[4853]: warning: connect to mysql server localhost: Can't connec         t to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

原因是之前配置了基于mysql的地址映射

virtual_alias_maps = mysql:/etc/postfix/mysql-alias.cf 

当一些在chroot环境中运行的postfix组建试图通过/var/run/mysqld/mysqld.sock连接数据库时就报错了,在master.cf里禁用smtp,rewrite,cleanup的chroot即可

smtp      inet  n       -       n       -       -       smtpd
rewrite   unix  -       -       n       -       -       trivial-rewrite
cleanup   unix  n       -       n       -       0       cleanup

#这是一种不安全的fix方法,另一种解决方法是修改my.conf同过3306端口访问mysql,也可以解决问题。

PPJ回忆录

个人以为:学一门脚本很容易,但是学几门就是一个痛苦的事,因为我经常把他们搞混。。

于是我下决心写一个能够帮我理清楚的文档,我命之为《PPJ回忆录》,从周5写到今天,精疲力尽,剩下OO和正则部分没写,我决定先歇会~

毫不客气的说,对于同时学里面任意两门语言的同学,这个文档都会对你有帮助。

———–
post by gmail~

c arguments declare old style

看代码的时候看到这种类型声明

static void
add_shopt_to_alist (opt, on_or_off)
     char *opt;
     int on_or_off;
{
    // ...
}

立刻被震住了,smth上发贴弱问了一下,两分钟内便有两个回复,说这是一种老式的语法,也不好厚脸皮追问,顿时想出一串关键瓷:

c arguments declare old style

———–
post by gmail~

highlight plugin test