官方论坛产品帮助刷图视频问题反馈

suphp error Directory / is not owned by admin

发表于 秦海传媒

问题:今天突然网站报500错误。提示信息为suphp error Directory / is not owned by admin 其中admin是用户名。
解决:ssh登录并运营

chown root:root /

原因:暂时未知,等待查询中。。。

如何在opensips集成asterisk 实现媒体服务

发表于 秦海传媒

本文档按照官方文档的指导进行了重新的配置说明,官方文档的cfg 文件不是完全正确,在启动opensips 时有一些模块名称和参数已经更新,所以如果安装官方的cfg文件,可能导致opensips 启动失败。所以我们不能完全安装官方的例子来测试,需要修改opensips.cfg 文件.

这里,opensips 作为一个注册服务器,asterisk 仅执行媒体功能,例如语音邮箱,播报,或者会议等等。

获得完整配置文档和测试信息,请访问:

http://kamailio.org.cn/doku.php?id=opensips-asterisk

修改后的opensips 配置文件:

opensips.cfg 文件:

$Id: opensips.cfg 8758 2012-02-29 11:59:26Z vladut-paiu $
OpenSIPS residential configuration script
by OpenSIPS Solutions
This script was generated via “make menuconfig”, from
the “Residential” scenario.
You can enable / disable more features / functionalities by
re-generating the scenario with different options.#
Please refer to the Core CookBook at:
http://www.opensips.org/Resources/DocsCookbooks
for a explanation of possible statements, functions and parameters.
Global Parameters #########
debug=5
log_stderror=yes
log_facility=LOG_LOCAL0

fork=yes
children=4

/* uncomment the following lines to enable debugging */

debug=6
fork=no
log_stderror=yes
/* uncomment the next line to enable the auto temporary blacklisting of
not available destinations (default disabled) */
disable_dns_blacklist=yes

/* uncomment the next line to enable IPv6 lookup after IPv4 dns
lookup failures (default disabled) */

dns_try_ipv6=yes
/* comment the next line to enable the auto discovery of local aliases
based on revers DNS on IPs */
/* auto_aliases=yes */
/* alias=test.com */

port = 5060
listen=udp:192.168.1.104:5060 # CUSTOMIZE ME
disable_tcp=yes

disable_tls=yes
Modules Section ########
set module path
mpath=”/usr/local/lib/opensips/modules/”

loadmodule “db_mysql.so”
loadmodule “signaling.so”
loadmodule “sl.so”
loadmodule “tm.so”
loadmodule “rr.so”
loadmodule “maxfwd.so”
loadmodule “usrloc.so”
loadmodule “registrar.so”
loadmodule “textops.so”
loadmodule “mi_fifo.so”

loadmodule “uri_db.so”
loadmodule “uri.so”

loadmodule “xlog.so”
loadmodule “acc.so”
loadmodule “auth.so”
loadmodule “auth_db.so”
loadmodule “sipmsgops.so”
loadmodule “domain.so”

—————– setting module-specific parameters —————
—– mi_fifo params —–
modparam(“mi_fifo”, “fifo_name”, “/tmp/opensips_fifo”)

—– rr params —–
add value to ;lr param to cope with most of the UAs
modparam(“rr”, “enable_double_rr”, 1)

do not append from tag to the RR (no need for this script)
modparam(“rr”, “append_fromtag”, 0)

—– usrloc params —–
modparam(“usrloc”, “db_mode”, 2)
modparam(“usrloc”, “db_url”,
“mysql://opensips:opensipsrw@localhost/opensips”)

—– uri_db params —–
modparam(“uri_db”, “use_uri_table”, 0)
modparam(“uri_db”, “db_url”, “”)
—– acc params —–
/* what sepcial events should be accounted ? */
modparam(“acc”, “early_media”, 1)

modparam(“acc”, “report_ack”, 1)
modparam(“acc”, “report_cancels”, 1)
/* account triggers (flags) */
modparam(“acc”, “failed_transaction_flag”, 3)
modparam(“acc”, “log_flag”, 1)
modparam(“acc”, “log_missed_flag”, 2)
/* uncomment the following lines to enable DB accounting also */
modparam(“acc”, “db_flag”, 1)
modparam(“acc”, “db_missed_flag”, 2)

—– auth_db params —–
modparam(“auth_db”, “calculate_ha1″, yes)
modparam(“auth_db”, “password_column”, “password”)
modparam(“auth_db”, “db_url”,
“mysql://opensips:opensipsrw@localhost/opensips”)
modparam(“auth_db”, “load_credentials”, “”)

—– domain params —–
modparam(“domain”, “db_url”,
“mysql://opensips:opensipsrw@localhost/opensips”)
modparam(“domain”, “db_mode”, 1) # Use caching

—– multi-module params —–
/* uncomment the following line if you want to enable multi-domain support
in the modules (dafault off) */
modparam(“alias_db|auth_db|usrloc|uri_db”, “use_domain”, 1)

Routing Logic ########
main request routing logic
route{

if (!mf_process_maxfwd_header(“10″)) {
send_reply(“483″,”Too Many Hops”);
exit;
}

if (has_totag()) {

sequential request withing a dialog should
take the path determined by record-routing
if (loose_route()) {
if (is_method(“BYE”)) {
setflag(1); # do accounting …
setflag(3); # … even if the transaction fails
} else if (is_method(“INVITE”)) {

even if in most of the cases is useless, do RR for
re-INVITEs alos, as some buggy clients do change route set
during the dialog.
record_route();
}

route it out to whatever destination was set by loose_route()
in $du (destination URI).
route(1);
} else {
if ( is_method(“ACK”) ) {
if ( t_check_trans() ) {

non loose-route, but stateful ACK; must be an ACK after
a 487 or e.g. 404 from upstream server
t_relay();
exit;
} else {

ACK without matching transaction ->
ignore and discard
exit;
}
}
send_reply(“404″,”Not here”);
}
exit;
}

initial requests
CANCEL processing
if (is_method(“CANCEL”)) {
if (t_check_trans())
t_relay();
exit;
}

t_check_trans();

authenticate if from local subscriber
if (!(method==”REGISTER”) && is_from_local()) {
if (!proxy_authorize(“”, “subscriber”)) {
proxy_challenge(“”, “0″);
exit;
}
if (!db_check_from()) {
send_reply(“403″,”Forbidden auth ID”);
exit;
}

consume_credentials();

caller authenticated
}

preloaded route checking
if (loose_route()) {
xlog(“L_ERR”,
“Attempt to route with preloaded Route’s [$fu/$tu/$ru/$ci]“);
if (!is_method(“ACK”))
send_reply(“403″,”Preload Route denied”);
exit;
}

record routing
if (!is_method(“REGISTER|MESSAGE”))
record_route();

account only INVITEs
if (is_method(“INVITE”)) {
setflag(1); # do accounting
}

if not a targetting a local SIP domain, just send it out
based on DNS (calls to foreign SIP domains)
if (!is_uri_host_local()) {
append_hf(“P-hint: outbound\r\n”);
route(1);
}

requests for my domain
if (is_method(“REGISTER”)) {

authenticate the REGISTER requests
if (!www_authorize(“”, “subscriber”)) {
www_challenge(“”, “0″);
exit;
}
if (!db_check_to()) {
send_reply(“403″,”Forbidden auth ID”);
exit;
}

if (!save(“location”))
sl_reply_error();

exit;
}

if ($rU==NULL) {

request with no Username in RURI
send_reply(“484″,”Address Incomplete”);
exit;
}

ASTERISK HOOK – BEGIN
media service number? (digits starting with *)
if ($rU=~”^\*[1-9]+”) {

we do provide access to media services only to our
subscribers, who were previously authenticated
if (!is_from_local()) {
send_reply(“403″,”Forbidden access to media service”);
exit;
}

identify the services and translate to Asterisk extensions
if ($rU==”*1111″) {

access to own voicemail IVR
seturi(“sip:VM_pickup@192.168.1.104:5090″); // 访问asterisk IP 和端口
} else
if ($rU==”*2111″) {

access to the “say time” announcement
seturi(“sip:AN_time@192.168.1.104:5090″);
} else
if ($rU==”*2112″) {

access to the “say date” announcement
seturi(“sip:AN_date@192.168.1.104:5090″);
} else
if ($rU==”*2113″) {

access to the “echo” service
seturi(“sip:AN_echo@192.168.1.104:5090″);
} else
if ($rU=~”\*3[0-9]{3}”) {

access to the conference service
remove the “*3″ prefix and place the “CR_” prefix
strip(2);
prefix(“CR_”);
rewritehostport(“192.168.1.104:5090″);
} else {

unknown service
seturi(“sip:AN_notavailable@192.168.1.104:5090″);
}

after setting the proper RURI (to point to corresponding ASTERISK extension),
simply forward the call
t_relay();
exit;
}

ASTERISK HOOK – END
do lookup
if (!lookup(“location”)) {

ASTERISK HOOK – BEGIN
callee is not registered, so different to Voicemail
First add the VM recording prefix to the RURI
prefix(“VMR_”);

forward to the call to Asterisk (replace below with real IP and port)
rewritehostport(“192.168.1.104:5090″);
route(1);

ASTERISK HOOK – END
exit;
}

when routing via usrloc, log the missed calls also
setflag(2);

arm a failure route in order to catch failed calls
targeting local subscribers; if we fail to deliver
the call to the user, we send the call to voicemail
t_on_failure(“1″);

route(1);
}
route[1] {
if (!t_relay()) {
sl_reply_error();
};
exit;
}
failure_route[1] {
if (t_was_cancelled()) {
exit;
}

if the failure code is “408 – timeout” or “486 – busy”,
forward the calls to voicemail recording
if (t_check_status(“486|408″)) {

ASTERISK HOOK – BEGIN
First revert the RURI to get the original user in RURI
Then add the VM recording prefix to the RURI
revert_uri();
prefix(“VMR_”);

forward to the call to Asterisk (replace below with real IP and port)
rewritehostport(“192.168.1.104:5090″);
t_relay();

ASTERISK HOOK – END
exit;
}
}

opensipsctl ul show 检查命令价格

root@opensips-1:/usr/src# opensipsctl ul show
Domain:: location table=512 records=2
AOR:: 104@192.168.1.104
Contact:: sip:104@192.168.1.103:5060 Q=
Expires:: 121
Callid:: 623004373-5060-1@BJC.BGI.B.BAD
Cseq:: 2106
User-agent:: Grandstream GXP2124 1.0.4.10 // 潮流注册话机
State:: CS_SYNC
Flags:: 0
Cflag:: 0
Socket:: udp:192.168.1.104:5060
Methods:: 6015
AOR:: 103@192.168.1.104
Contact:: sip:103@192.168.1.200:15590;rinstance=148938c9ce8d11b6 Q=
Expires:: 3536
Callid:: OTJlZjBlMmYyMjhjOTE2YmExM2E3ZjdlOGI5ZDYwZGI.
Cseq:: 10
User-agent:: X-Lite release 1011s stamp 41150
State:: CS_SYNC
Flags:: 0
Cflag:: 0
Socket:: udp:192.168.1.104:5060
Methods:: 5951
root@opensips-1:/usr/src#

asterisk测试日期播报,拨打*2112 或者*2111播报日期或者时间

ACL Port Status Realtime 0 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 0 offline] *CLI> == Using SIP RTP CoS mark 5

- Executing [AN_time@default:1] Ringing(“SIP/103-00000004”, ””) in new stack
- Executing [AN_time@default:2] Wait(“SIP/103-00000004”, “1”) in new stack
- Executing [AN_time@default:3] SayUnixTime(“SIP/103-00000004”, ”,Europe/Bucharest,HMp”) in new stack
- Playing ‘digits/oh.gsm’ (language ‘en’)
-
Playing ‘digits/9.gsm’ (language ‘en’)
-
Playing ‘digits/20.gsm’ (language ‘en’)
-
Playing ‘digits/4.gsm’ (language ‘en’)
-
Playing ‘digits/a-m.gsm’ (language ‘en’)
- Executing [AN_time@default:4] Hangup(“SIP/103-00000004”, ””) in new stack

小炖肉

发表于 秦海传媒

材料:
精品五花肉1000克 葱1棵 姜1块 蒜1头

调料:
①调料盒:花椒30粒,大料3个,香叶2片,桂皮2块,干辣椒3个
②料酒3小勺,老抽5小勺,生抽3小勺,白糖2小勺,腐乳汁一小勺
③盐2小勺

制法:
1、将五花肉切成小块,焯水去血水后,用凉水洗净、沥干。
2、葱切3厘米段,姜拍破,蒜去皮备用。
3、将洗净五花肉入高压锅,小火煸干水分,加调料②改中火加热炒匀至肉上色后加入没过肉块的沸水。
4、加入葱、姜、蒜及调料盒①,大火煮沸后加盖上阀用高压锅压制。
5、大火5分钟,改小火炖15分钟后关火。
6、待高压锅自行冷却后(不再加筏),打开,加入盐,并用大火煮沸3分钟后关火即可。
7、装入容器前,取出葱、姜、蒜及调料盒。

唠唠叨叨:
1、五花肉建议切成2厘米的正方块,我有时切成1厘米*2厘米的长方块,也易烹制入味。
2、加开水使得肉质更加松软。
3、盐要最后放,因为盐是加碘的,加的是碘酸钾,碘酸钾受热不稳定,会分解,为了不让碘元素流失。
4、口味微辣,喜辣的可再多放些辣椒。
5、此方还可用于红烧鸡腿、红烧小排,只是炖红肉时老抽的用量要略多,易于上色,吃起来不腻。
6、葱、姜、蒜及调料盒最后一定要取出,不然放置时间长了,调料味道会过重,影响五花肉的香味。

Data URI Scheme介绍

发表于 秦海传媒

生成图片数据
根据上面的格式,我们可以编写一个小程序进行生成,但我们不需要这么麻烦,有很多网站提供这种(免费)服务。下面给出几个:

1.http://dataurl.sveinbjorn.org/dataurlmaker

提供预览,复制方便

/**
 * data:,文本数据
 * data:text/plain,文本数据
 * data:text/html,HTML代码
 * data:text/css;base64,css代码
 * data:text/javascript;base64,javascript代码
 * data:image/x-icon;base64,base64编码的icon图片数据
 * data:image/gif;base64,base64编码的gif图片数据
 * data:image/png;base64,base64编码的png图片数据
 * data:image/jpeg;base64,base64编码的jpeg图片数据,示例:
 */
body { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAIAAAA7ljmRAAAAGElEQVQIW2P4DwcMDAxAfBvMAhEQMYgcACEHG8ELxtbPAAAAAElFTkSuQmCC");}

/**
 * data:text/css,css代码,示例:
 * 注意:下列方式是无法设置background-image:url()样式的
 */

在Windows 7下创建目录的符号链接

发表于 秦海传媒

mklink /j "D:\Program Files\EditPlus\Inis" "D:\s@qinhai.us\Soft\EditPlus\Inis"
mklink /d "D:\Program Files\EditPlus\Inis" "D:\s@qinhai.us\Soft\EditPlus\Inis"

mklink  /h "H:\Program Files\FlashFXP\active_edits.ini" "H:\s@qinhai.us\Soft\FlashFXP\active_edits.ini"
mklink  /h "H:\Program Files\FlashFXP\ca_root.pem" "H:\s@qinhai.us\Soft\FlashFXP\ca_root.pem"
mklink  /h "H:\Program Files\FlashFXP\FlashFXP.ini" "H:\s@qinhai.us\Soft\FlashFXP\FlashFXP.ini"
mklink  /h "H:\Program Files\FlashFXP\flashfxp.key" "H:\s@qinhai.us\Soft\FlashFXP\flashfxp.key"
mklink  /h "H:\Program Files\FlashFXP\quick.dat" "H:\s@qinhai.us\Soft\FlashFXP\quick.dat"
mklink  /h "H:\Program Files\FlashFXP\Sites.dat" "H:\s@qinhai.us\Soft\FlashFXP\Sites.dat"
mklink  /h "H:\Program Files\FlashFXP\Stats.dat" "H:\s@qinhai.us\Soft\FlashFXP\Stats.dat"


mklink  /h "H:\Program Files\WinSCP\WinSCP.ini" "H:\s@qinhai.us\Soft\WinSCP\WinSCP.ini"

mklink  /h "H:\Program Files\myentunnel4\myentunnel.ini" "H:\s@qinhai.us\Soft\myentunnel4\myentunnel.ini"
mklink  /h "H:\Program Files\myentunnel-2\myentunnel.ini" "H:\s@qinhai.us\Soft\myentunnel-2\myentunnel.ini"
mklink  /h "H:\Program Files\myentunnel-3\myentunnel.ini" "H:\s@qinhai.us\Soft\myentunnel-3\myentunnel.ini"
mklink  /h "H:\Program Files\myentunnel-4\myentunnel.ini" "H:\s@qinhai.us\Soft\myentunnel-4\myentunnel.ini"
mklink  /h "H:\Program Files\myentunnel-5\myentunnel.ini" "H:\s@qinhai.us\Soft\myentunnel-5\myentunnel.ini"

mklink是Windows 7下的一个类似于linux下In的命令,其作用是在NTFS文件系统中创建文件或目录的链接(类似于桌面快捷方式)。如果加以利用其发挥的作用是非常的大的,不仅可以帮助我们节省不少时间,而且可以使我们重装系统后不再丢失用户文件。 继续阅读

Google ADs

除非另有声明,本站文章遵循知识共享署名-非商业性使用 2.5 中国大陆许可协议。 Copyright © 2008-2012 99288.NET.CN.