[Serusers] does not work voicemail
Sergio Gerardo Festa
festa at interactuarsh.com.ar
Tue Oct 28 21:33:59 CET 2003
hello
I have problems to make to operate the voicemail.
when it is accomplished the call not lets me to record the message and is
lost the ans_machine.
Español
hola
tengo problemas para hacer funcionar el voicemail.
cuando se realiza la llamada no me deja grabar el mensaje y se pierde el
ans_machine.
estos son mis archivos de configuracion.
Log messages
Oct 28 17:14:09 chitara /usr/sbin/ser[21057]: ACC: call missed:
from=Save1<sip:102 at mydomain.com>;tag=28778-a725, i-uri=sip:100 at mydomain.com,
method=INVITE, o-uri=sip:100 at 262.61.161.129:5060;user=phone, code=488 Not
Acceptable Here
Oct 28 17:14:09 chitara /usr/sbin/ser[21057]: failure_route[1]:jump to
route[4]:vm
Oct 28 17:14:09 chitara /usr/sbin/ser[21057]: submit_query(): You have an
error in your SQL syntax near ''' at line 1
Oct 28 17:14:09 chitara /usr/sbin/ser[21057]: submit_query(): Error while
submitting query
Oct 28 17:14:09 chitara /usr/sbin/ser[21057]: ERROR: vm: db_query() failed.
Oct 28 17:14:09 chitara /usr/sbin/ser[21057]: ERROR: vm: vm_get_user_info
failed
Oct 28 17:14:09 chitara /usr/sbin/ser[21057]: route[3]:vm:voicemail failed
Oct 28 17:14:09 chitara /usr/sbin/ser[21047]: route[]:eof
Oct 28 17:14:10 chitara /usr/sbin/ser[21073]: route[]:eof
----------------------------------------------------------------------------
------------------------------
SER.CFG
#
# $Id: ser.cfg,v 1.20 2003/05/31 21:12:19 jiri Exp $
#
# config script with voicemail, PSTN dial-out functionality
#
# ----------- global configuration parameters ------------------------
debug=1 # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=no # (cmd line: -E)
# Uncomment these lines to enter debugging mode
/*
debug=8
fork=no
log_stderror=yes
*/
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
port=5060
children=4
fifo="/tmp/ser_fifo"
sip_warning=no
listen=262.69.20.92
alias=sip.boxip.com.ar
#
# ------------------ module loading ----------------------------------
#
# Uncomment this if you want to use SQL database
loadmodule "/usr/lib/ser/modules/mysql.so"
#
loadmodule "/usr/lib/ser/modules/sl.so"
loadmodule "/usr/lib/ser/modules/tm.so"
loadmodule "/usr/lib/ser/modules/rr.so"
loadmodule "/usr/lib/ser/modules/maxfwd.so"
loadmodule "/usr/lib/ser/modules/usrloc.so"
loadmodule "/usr/lib/ser/modules/registrar.so"
loadmodule "/usr/lib/ser/modules/vm.so"
loadmodule "/usr/lib/ser/modules/pa.so"
loadmodule "/usr/lib/ser/modules/msilo.so"
loadmodule "/usr/lib/ser/modules/acc.so"
loadmodule "/usr/lib/ser/modules/textops.so"
#
loadmodule "/usr/lib/ser/modules/nathelper.so"
loadmodule "/usr/lib/ser/modules/uri.so"
loadmodule "/usr/lib/ser/modules/group.so"
#
# Uncomment this if you want digest authentication
# mysql.so must be loaded !
loadmodule "/usr/lib/ser/modules/auth.so"
loadmodule "/usr/lib/ser/modules/auth_db.so"
#
# ----------------- setting module-specific parameters ---------------
#
# -- usrloc params --
#
#modparam("usrloc", "db_mode", 0)
#
# Uncomment this if you want to use SQL database
# for persistent storage and comment the previous line
modparam("usrloc", "db_mode", 2)
#
# -- auth params --
# Uncomment if you are using auth module
#
modparam("auth_db", "calculate_ha1", yes)
#
# If you set "calculate_ha1" parameter to yes (which true in this config),
# uncomment also the following parameter)
#
modparam("auth_db", "password_column", "password")
#
#
modparam("tm", "fr_inv_timer", 30) #INVITE timeout
modparam("tm", "fr_timer", 15) #negative INVITE reply or no
#final reply for a request for ACK
#
modparam("voicemail", "db_url", "sql://ser:heslo@localhost/ser")
#
modparam("acc", "db_url", "sql://ser:heslo@localhost/ser")
modparam("acc", "db_flag", 2)
modparam("acc", "db_missed_flag", 3)
#
modparam("acc", "log_level", 1)
modparam("acc", "log_flag", 2)
modparam("acc", "log_missed_flag", 2)
modparam("acc", "log_fmt", "fimos")
#
# ------------------------- request routing logic -------------------
#
# main routing logic
#
alias=262.69.20.92 #sip server IP address
alias=mydomain.com #sip server FQDN
#
route{
# log(1,"entering main route");
setflag(2); #set flag for accounting
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
break;
};
if (len_gt( max_len )) {
sl_send_reply("513", "Message too big");
break;
};
# we record-route all messages -- to make sure that
# subsequent messages will go through our proxy; that's
# particularly good if upstream and downstream entities
# use different transport protocol
record_route();
# loose-route processing
if (loose_route()) {
t_relay();
break;
};
# if the request is for other domain use UsrLoc
# (in case it does not work, use the following command
# with proper names and addresses in it)
if (uri==myself) {
if (method=="REGISTER") {
# digest authentication
# log(1,"request for registration");
# if (!www_authorize("mydomain.com", "subscriber")) {
# www_challenge("mydomain.com", "0");
# break;
# };
save("location");
break;
};
/* ********** Dial out to PSTN logic ************* */
#forward 411[information] and 911[emergency] requests to
gateway
if(uri=~"^sip:(9|2)11@(boxip\.com.ar|200\.69\.20\.92)"){
log(1,"411/911 expression match");
route(2);
break;
};
#forward numerical 7 digit requests to gateway
if(uri=~"^sip:[0-9]{7}@(mydomain\.com|262\.69\.20\.92)"){
log(1,"7 digit expression match");
route(2);
break;
};
# strip 650 and forward to GW if user dials 650 before phone
no.
if(uri=~"^sip:650[0-9]{7}@mydomain\.com|262\.69\.20\.92)"){
strip(3);
log(1,"650 area code dialed, 650 stripped");
route(2);
break;
};
#forward numerical 10 digit requests to gateway, append a 1
first
if(uri=~"^sip:[0-9]{10}@(mydomain\.com|262\.69\.20\.92)"){
prefix("1");
log(1,"10 digit expression match, prefix 1");
route(2);
break;
};
#forward numerical 11 digit requests that start with a 1 to
GW
if(uri=~"^sip:1[0-9]{10}@(mydomain\.com|262\.69\.20\.92)"){
log(1,"10 digit exp match w/leading 1");
route(2);
break;
};
#forward international N digit requests to gateway
if(uri=~"^sip:011[0-9]+@(mydomain\.com|262\.69\.20\.92)"){
log(1,"international expression match");
route(2);
break;
};
/* ********** VOICEMAIL logic ************* */
if (uri=~"^sip:voicemail\+@"){
log(1,"sip:voicemail uri match");
route(3);
break;
};
/* ****** Find Aliases and Locations of users ********* */
#lookup "aliases" before looking up "location"
lookup("aliases");
# native SIP destinations are handled using our USRLOC DB
if (!lookup("location")) {
route(3);
break;
# this section needs help. I need to differentiate between
users that
# exits buy aren't online (send these requests to voicemail)
# requests for users that aren't in my subscriber database
# (send these requests a 404 reply)
sl_send_reply("404", "User Not Found");
break;
};
};
# forward to current uri now; use stateful forwarding; that
# works reliably even if we forward from TCP to UDP
t_on_failure("1");
if (!t_relay()) {
sl_reply_error();
};
log(1,"route[]:eof");
}
route[2]{
log(1,"route[2]:SIP-to-PSTN call routed");
rewritehostport("262.69.20.92:5060");
if(!t_relay()){
sl_reply_error();
};
}
route[3]{
log(1,"route[3]:vm:1");
if (method=="INVITE" || method=="BYE" || method=="REFER"){
log(1,"route[3]:vm:2");
if(t_newtran()){
t_reply("100","Trying -- just a second");
if(method=="INVITE" || method=="REFER"){
log(1,"route[3]:method==INVITE || REFER");
if(uri =~ "conference" ){
if(!vm("/tmp/am_fifo","conference")){
log(1,"route[3]:vm:conference failed");
t_reply("500","could not
contact conference server");
};
}
else if (uri =~"echo"){
if(!vm("/tmp/am_fifo","echo")){
log(1,"route[3]:vm:echo
failed");
t_reply("500","could not
contact echo");
};
}
else{
if(!vm("/tmp/am_fifo","voicemail")){
log(1,"route[3]:vm:voicemail
failed");
t_reply("500", "voicemail
error");
};
};
break;
};
if(method=="BYE"){
log(1,"route[3]:vm:method==BYE");
if(!vm("/tmp/am_fifo","bye")){
log(1,"route[3]:vm:bye failed");
t_reply("500" , "could not contact
the media server");
};
break;
};
}
else{
log(1,"route[3]:vm:new transaction failed");
sl_send_reply("500", "new transaction failed");
break;
};
};
}
route[4]{
# this should be voicemail logic that is specific to a failure_route
# i.e. line busy, or timeout after a certain period with no answer
if(method=="INVITE" || method=="REFER"){
if(!vm("/tmp/am_fifo","voicemail")){
log(1,"route[3]:vm:voicemail failed");
t_reply("500", "voicemail error");
};
}else if(method=="BYE"){
log(1,"route[3]:vm:method==BYE");
if(!vm("/tmp/am_fifo","bye")){
log(1,"route[3]:vm:bye failed");
t_reply("500" , "could not contact the media
server");
};
};
}
failure_route[1]{
log(1,"failure_route[1]:jump to route[4]:vm");
# append_branch("sip:info at mydomain.com");
route(4);
}
----------------------------------------------------------------------------
------------------
SEMS.CFG
# optional parameter: announce_path=<path>
#
# - sets the path where announce files are searched for
announce_path=/usr/lib/sems/audio/
# optional parameter: default_announce=<filename>
#
# - sets the name of the default announce WAV file
default_announce=default_en.wav
# optional parameter: max_record=<seconds>
#
# - maximum record time
max_record=30
# optional parameter: smtp_server=<hostname>
#
# - sets address of smtp server
smtp_server=262.61.161.129
# optional parameter: smtp_port=<port>
#
# - sets port of smtp server
smtp_port=25
##################################
# module specific parameters #
##################################
# add more module configurations here (inline or external):
#
# config.mymodule=<filename>
# or
# config.mymodule=inline
# ...
# config.mymodule=end
----------------------------------------------------------------------------
---------------------------
Thanks
Gracias
Saludos
A su Disposición.
Sergio Gerardo Festa
More information about the sr-users
mailing list