El día 11 de marzo de 2009 4:13, Iñaki Baz Castillo <ibc(a)aliax.net> escribió:
Según las trazas SIP que mostrabas antes, tu opensips está rutando los
INVITE directamente a Asterisk. No has mostrado tu código dónde haces
el lookup, pero algo está fallando allí.
te lo envio iñaki y gracias por tu help ...
route[2] {
#
# -- Register request handler --
#
if (is_uri_host_local()) {
if (!www_authorize("", "subscriber")) {
www_challenge("", "0");
exit;
};
if (!check_to()) {
sl_send_reply("403", "prohibido");
exit;
};
save("location");
exit;
} else if {
sl_send_reply("401", "Desautorizado");
};
}
route[3] {
#
# -- INVITE request handler --
#
if (is_from_local()){
# From an internal domain -> check the credentials and the FROM
if(!allow_trusted()){
if (!proxy_authorize("","subscriber")) {
proxy_challenge("","0");
exit;
} else if (!check_from()) {
sl_send_reply("403", "Prohibido, use From=ID");
exit;
};
} else {
log("Request bypassed the auth.using allow_trusted");
};
if(avp_db_load("$ru/username","$avp(s:callfwd)")) {
avp_pushto("$ru", "$avp(s:callfwd)");
route(1);
exit;
}
if (uri=~"^/*") {
route(4);
}
consume_credentials();
# Verify aliases
lookup("aliases");
if (is_uri_host_local()) {
# -- Inbound to Inbound
route(10);
} else {
# -- Inbound to outbound
route(11);
};
} else {
# From an external domain -> do not check credentials
#Verify aliases, if found replace R-URI.
lookup("aliases");
if (is_uri_host_local()) {
#-- Outbound to inbound
route(12);
} else {
# -- Outbound to outbound
route(13);
};
};
}
route[10] {
#from an internal domain -> inbound
#Native SIP destinations are handled using the location table
append_hf("P-hint: inbound->inbound \r\n");
if (uri=~"^sip:[2346597][0-9]{6}@.*") {
# if (is_user_in("From", "local")){
if (is_user_in("credentials", "local")){
route(4);
exit;
} else {
sl_send_reply("403", "No tienes permiso para llamadas locales");
exit;
};
};
if (!lookup("location")) {
xlog("L_INFO","$Crx404 User Not Found$Cxx\n");
if (does_uri_exist()) {
revert_uri();
prefix("u");
rewritehostport("192.168.10.3:5070");
route(1);
} else {
sl_send_reply("404", "Not Found");
exit;
};
sl_send_reply("404", "Not Found");
exit;
};
route(1);
}
route[11] {
# from an internal domain -> outbound
# Simply route the call outbound using DNS search
append_hf("P-hint: inbound->outbound \r\n");
route(1);
}
route[12] {
# From an external domain -> inbound
# Verify aliases, if found replace R-URI.
lookup("aliases");
if (!lookup("location")) {
xlog("L_INFO","$Crx404 User Not Found$Cxx\n");
sl_send_reply("404", "Not Found");
exit;
};
route(1);
}
route[13] {
#From an external domain outbound
#we are not accepting these calls
append_hf("P-hint: outbound->inbound \r\n");
sl_send_reply("403", "Forbidden");
exit;
}
route[4] {
rewritehostport("192.168.10.3:5070");
route(1);
}
Dará algún mensaje de error.
xlog("L_INFO","$Crx404 User Not
Found$Cxx\n");
si te los anexo , es como que no reconoce los caracteres Crx404 ...
sbin/opensips[9705]: ERROR:core:pv_parse_spec: error searching pvar "Crx404"
Mar 11 09:00:10 twoxserver /sbin/opensips[9705]:
ERROR:core:pv_parse_spec: wrong char [4/52] in [$Crx404 User Not
Found$Cxx ] at [6 (0)]
Mar 11 09:00:10 twoxserver /sbin/opensips[9705]:
ERROR:xlog:xdbg_fixup: ERROR: wrong format[$Crx404 User Not Found$Cxx
]!
Mar 11 09:00:10 twoxserver /sbin/opensips[9705]:
ERROR:core:fix_actions: fixing failed (code=-1) at cfg line 247
Mar 11 09:00:10 twoxserver /sbin/opensips[9705]: ERROR:core:main:
failed to fix configuration with err code -1
Mar 11 09:00:10 twoxserver /sbin/opensips[9705]:
NOTICE:presence:destroy: destroy module
saludoss
--
rickygm
http://gnuforever.homelinux.com