Hi , I am trying to add Voicemail services... the problem is that when the call is missed (busy, not answered or not connected) I can see some debug in ser´s second instance for users in "voicemail group" but the call is closed and a busy tone return to the caller... bellow you can see my 3 config files and details from both ser debugs, please someone send me some advice. thank you Rafael
- ser.cfg for Main SER running on 5060 - voicemail.cfg for second instance on port 5090 - sems.conf for Media Server (sems)
SEMS.CFG -------> ----------- global configuration parameters ------------------------ #debug=3 # debug level (cmd line: -dddddddddd) #fork=yes #log_stderror=no # (cmd line: -E) #/* Uncomment these lines to enter debugging mode debug=9 fork=yes log_stderror=yes #*/ listen=200.110.2.131 listen=127.0.0.1 port=5060 # hostname matching an alias will satisfy the condition uri==myself". alias=call.millicom.com.pe alias=200.110.2.131 check_via=no # (cmd. line: -v) dns=no # (cmd. line: -r) rev_dns=no # (cmd. line: -R) children=4 fifo="/tmp/ser_fifo" # ------------------ module loading ---------------------------------- loadmodule "/usr/local/lib/ser/modules/mysql.so" loadmodule "/usr/local/lib/ser/modules/sl.so" loadmodule "/usr/local/lib/ser/modules/tm.so" loadmodule "/usr/local/lib/ser/modules/rr.so" loadmodule "/usr/local/lib/ser/modules/maxfwd.so" loadmodule "/usr/local/lib/ser/modules/usrloc.so" loadmodule "/usr/local/lib/ser/modules/registrar.so" loadmodule "/usr/local/lib/ser/modules/group.so" loadmodule "/usr/local/lib/ser/modules/uri.so" loadmodule "/usr/local/lib/ser/modules/acc.so" loadmodule "/usr/local/lib/ser/modules/textops.so" # digest authentication loadmodule "/usr/local/lib/ser/modules/auth.so" loadmodule "/usr/local/lib/ser/modules/auth_db.so" # ----------------- setting module-specific parameters --------------- modparam("usrloc", "db_mode", 2) # storing passwords in our database in plain text: # modparam("auth_db", "calculate_ha1", yes) # modparam("auth_db", "password_column", "password") # For Rad Accounting modparam("acc","radius_config","/usr/local/etc/radiusclient/radiusclient.conf") modparam("acc", "service_type", 15) modparam("acc", "radius_flag", 1) modparam("acc", "radius_missed_flag", 3) modparam("acc", "report_ack", 0) modparam("tm", "fr_timer", 20 ) modparam("tm", "fr_inv_timer", 30 ) modparam("tm", "wt_timer", 20 ) modparam("tm", "uac_from", "sip:avisos@millicom.net.pe" ) modparam("rr", "enable_full_lr", 1) modparam("group", "db_url", "sql://ser:heslo@localhost/ser") modparam("uri", "db_url", "sql://ser:heslo@localhost/ser")
# --------------------- request routing logic ------------------- route {
# 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 ( msg:len > 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; }; # set for accounting:
if (method=="INVITE") { log(1, "INVITE\n"); setflag(1); /* set for accounting (the same value as in log_flag!) */ }; if (method=="BYE" || method=="CANCEL") { log (1, "BYE or CANCEL\n"); setflag(1); };
if (!uri==myself) { t_relay(); break; }; if (method == "REGISTER") { # to use digest authentication if (!www_authorize("call.millicom.com.pe", "subscriber")) { www_challenge("call.millicom.com.pe", "0"); break; }; if (!save("location")) { sl_reply_error(); }; break; }; # does the user wish redirection on no availability? (i.e., is he # in the voicemail group?) -- determine it now and store it in # flag 4, before we rewrite the flag using UsrLoc if (is_user_in("Request-URI", "voicemail")) { setflag(4); }; setflag(3); # native SIP destinations are handled using our USRLOC DB if (!lookup("location")) { # handle user which was not found route(4); break; }; # if user is on-line and is in voicemail group, enable redirection if (method == "INVITE" && isflagset(4)) { t_on_failure("1"); }; t_relay(); } # ------------- handling of unavailable user ------------------ route[4] { # non-Voip -- just send "off-line" if (!(method=="INVITE" || method=="ACK" || method=="CANCEL")) { sl_send_reply("404", "Not Found"); acc_rad_request("404 Not Found"); break; }; # not voicemail subscriber if (!isflagset(4)) { sl_send_reply("404", "Not Found and no voicemail turned on"); acc_rad_request("404 Not Found"); break; }; # forward to voicemail now rewritehostport("call.millicom.com.pe:5090"); t_relay_to_udp("call.millicom.com.pe", "5090"); }
# if forwarding downstream did not succeed, try voicemail running # at bat.iptel.org:5090 failure_route[1] { revert_uri(); rewritehostport("call.millicom.com.pe:5090"); append_branch(); t_relay_to_udp("call.millicom.com.pe", "5090"); }
################ VOICEMAIL.CFG --------> # ----------- global configuration parameters ------------------------ #debug= # debug level (cmd line: -dddddddddd) #fork=no #log_stderror=yes # (cmd line: -E) #/* Uncomment these lines to enter debugging mode debug=20 fork=yes log_stderror=yes #*/
check_via=no # (cmd. line: -v) dns=no # (cmd. line: -r) rev_dns=no # (cmd. line: -R) port=5090 children=4 fifo="/tmp/vm_ser_fifo" # ------------------ module loading ---------------------------------- loadmodule "/usr/local/lib/ser/modules/sl.so" loadmodule "/usr/local/lib/ser/modules/tm.so" loadmodule "/usr/local/lib/ser/modules/maxfwd.so" loadmodule "/usr/local/lib/ser/modules/mysql.so" loadmodule "/usr/local/lib/ser/modules/vm.so"
# ----------------- setting module-specific parameters --------------- modparam("voicemail", "db_url","sql://ser:heslo@localhost/ser") modparam("voicemail", "subscriber_table", "subscriber") modparam("voicemail", "email_column", "email_address") # ------------------------- request routing logic ------------------- # main routing logic route{
# initial sanity checks -- messages with # max_forwars==0, or excessively long requests if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); break; }; if ( msg:len > max_len ) { sl_send_reply("513", "Message too big"); break; }; if (!uri==myself) { sl_send_reply("404", "not reponsible for host in r-uri"); break; };
# Voicemail specific configuration - begin if(method=="ACK" || method=="INVITE" || method=="BYE"){ if (!t_newtran()) { log("could not create new transaction\n"); sl_send_reply("500","could not create new transaction"); break; }; t_reply("100","Trying -- just wait a minute !"); if(method=="INVITE"){ log("**************** vm start - begin ******************\n"); if (uri=~"sip:as_welcome@.*" || uri=~"sip:as_nomoney@.*") { if (!vm("/tmp/am_fifo", "announcement")) { log("couldn't contact announcement server\n"); t_reply("500", "couldn not contact announcement server"); }; } else { if(!vm("/tmp/am_fifo","voicemail")){ log("could not contact the answer machine\n"); t_reply("500","could not contact the answer machine"); }; }; log("**************** vm start - end ******************\n"); } else if(method=="BYE"){ log("**************** vm end - begin ******************\n"); if(!vm("/tmp/am_fifo","bye")){ log("could not contact the answer machine\n"); t_reply("500","could not contact the answer machine"); }; log("**************** vm end - end ******************\n"); }; break; }; if (method=="CANCEL") { sl_send_reply("200", "cancels are junked here"); break; }; sl_send_reply("501", "method not understood here"); }
###################
SEMS.CFG ----------> [root@gkproxy01 answer_machine]# more /usr/local/etc/sems/sems.conf # $Id: sems.conf.sample,v 1.11.2.5 2004/05/24 14:33:07 rco Exp $ # # sems.conf.sample # # Sip Express Media Server (sems) # # sample configuration file # # # whitespaces (spaces and tabs) are ignored # comments start with a "#" and may be used inline # # example: option=value1, value2 # i like this option # ################################## # global parameters # ################################## # optional parameter: fork={yes|no} # # - specifies if sems should run in daemon mode (background) # (fork=no is the same as -E) fork=yes # optional parameter: stderr={yes|no} # # - debug mode: do not fork and log to stderr # (stderr=yes is the same as -E) stderr=no # optional parameter: loglevel={0|1|2|3} # # - sets log level (error=0, warning=1, info=2, debug=3) # (same as -D) loglevel=1 # optional parameter: fifo_name=<filename> # # - path and file name of our fifo file (same as -i) fifo_name=/tmp/am_fifo # optional parameter: ser_fifo_name=<filename> # # - path and file name of Ser's fifo file (same as -o) ser_fifo_name=/tmp/ser_fifo # optional parameter: plugin_path=<path> # # - sets the path to the plug-ins # - may be absolute or relative to CWD plugin_path=/usr/local/lib/sems/plug-in/ # optional parameter: smtp_server=<hostname> # # - sets address of smtp server smtp_server=200.110.2.44 # optional parameter: smtp_port=<port> # # - sets port of smtp server smtp_port=25 # optional parameter: rtp_low_port=<port> # # - sets port of rtp lowest server #rtp_low_port=1024 # optional parameter: rtp_high_port=<port> # # - sets port of rtp highest server #rtp_high_port=65535 ################################## # module specific parameters # ################################## # sample voicemail configuration (inline) config.voicemail=inline # optional parameter: announce_path=<path> # # - sets the path where announce files are searched for # - the file to be played is determined the following way: # <announce_path>/<domainname>/<username>.wav # if this file is not available <announce_path>/<default_anounce> is used announce_path=/usr/local/lib/sems/audio/ # parameter: default_announce=<filename> # # - sets the name of the default announce WAV file default_announce=default_en.wav # parameter: max_record_time=<seconds> # # - maximum record time max_record_time=30 # parameter: email_template=<filename> # # - email template file # # See the README file in <sems-src>/plug-in/voicemail # for more information on the syntax used. # email_template=/usr/local/lib/sems/plug-in/mail.template # end of configuration section for voicemail module config.voicemail=end
# sample announcement configuration (inline) config.announcement=inline # optional parameter: announce_path=<path> # # - sets the path where announce files are searched for announce_path=/usr/local/lib/sems/audio/ # parameter: default_announce=<filename> # # - sets the name of the default announce WAV file default_announce=default_en.wav # end of configuration section for announcement module config.announcement=end
# sample isdngw module configuration (external file) # config.isdngw=/etc/isdngw.conf # sample ivr module configuration (inline) config.ivr=inline #parameter: python_script_path=<full path> python_script_path=/etc/ivr #parameter: python_script_file=<filename> python_script_file=example.py # end of configuration section for ivr module config.ivr=end
# sample conference configuration (inline) config.conference=inline # parameter: default_announce=<filename> # # - sets the full pathed name of the default announce WAV file. # Will be played to lonely users. default_announce=/usr/local/lib/sems/audio/first_participant.wav # parameter: join_sound=<filename> # # - sets the full pathed name of a WAV file # which will be played to conference users # when a new user joins the conference. join_sound=/usr/local/lib/sems/audio/beep.wav # parameter: drop_sound=<filename> # # - sets the full pathed name of a WAV file # which will be played to conference users # when a user drops the conference. drop_sound=/usr/local/lib/sems/audio/beep.wav # end of configuration section for conference module config.conference=end # example configuration for number reader config.number_reader=inline number_path=/usr/local/lib/sems/audio/ prolog_file=welcome_to_number_reader.wav epilog_file=thanks_calling_number_reader.wav # end of number_reader configuration config.number_reader=end # add more module configurations here (inline or external): # # config.mymodule=<filename> # or # config.mymodule=inline # ... # config.mymodule=end [root@gkproxy01 answer_machine]#
DEBUG from 1st instamce (port 5060) --------------------------------------- 4(31737) DEBUG: relay_reply: branch=1, save=0, relay=1 4(31737) old size: 669, new size: 607 4(31737) build_res_from_sip_res: copied size: orig:108, new: 46, rest: 561 msg= SIP/2.0 404 not reponsible for host in r-uri Via: SIP/2.0/UDP 10.0.0.236:5060;branch=z9hG4bKa200bcf5a4114 From: sip:6603000@call.millicom.com.pe;tag=a200bcf5a4 To: sip:6604000@call.millicom.com.pe;tag=3749ec7003921b5c92fe06c5dc660395.5093 Call-ID: a2609600-48ac-bcf1-81f5-0002a40055b2@10.0.0.236 CSeq: 114 INVITE Server: Sip EXpress router (0.8.14 (i386/linux)) Content-Length: 0 Warning: 392 200.110.2.131:5090 "Noisy feedback tells: pid=31707 req_src_ip=200.110.2.131 req_src_port=5060 in_uri=sip:6604000@call.millicom.com.pe:5090 out_uri=sip:6604000@call.millicom.com.pe:5090 via_cnt==2"
4(31737) DEBUG: reply relayed. buf=0x80dec48: SIP/2.0 4..., shmem=0x422be8a8: SIP/2.0 4 4(31737) DBG: callback type 7, id 1 entered 4(31737) DEBUG: cleanup_uacs: RETR/FR timers reset 4(31737) DEBUG: add_to_tail_of_timer[4]: 0x422c287c 4(31737) DEBUG: add_to_tail_of_timer[0]: 0x422c2890 4(31737) DEBUG:destroy_avp_list: destroing list (nil) 4(31737) receive_msg: cleaning up [root@gkproxy01 admin]# [root@gkproxy01 admin]# 2(31735) SIP Request: 2(31735) method: <ACK> 2(31735) uri: sip:6604000@call.millicom.com.pe 2(31735) version: <SIP/2.0> 2(31735) parse_headers: flags=1 2(31735) Found param type 232, <branch> = <z9hG4bKa200bcf5a4114>; state=16 2(31735) end of header reached, state=5 2(31735) parse_headers: Via found, flags=1 2(31735) parse_headers: this is the first via 2(31735) After parse_msg... 2(31735) preparing to run routing scripts... 2(31735) DEBUG : sl_filter_ACK: to late to be a local ACK! 2(31735) DEBUG : is_maxfwd_present: searching for max_forwards header 2(31735) parse_headers: flags=128 2(31735) DEBUG: add_param: tag=3749ec7003921b5c92fe06c5dc660395.5093 2(31735) end of header reached, state=29 2(31735) DEBUG: get_hdr_field: <To> [78]; uri=[sip:6604000@call.millicom.com.pe] 2(31735) DEBUG: to body [sip:6604000@call.millicom.com.pe] 2(31735) get_hdr_field: cseq <CSeq>: <114> <ACK> 2(31735) DEBUG: get_hdr_body : content_length=0 2(31735) DEBUG: is_maxfwd_present: value = 70 2(31735) DEBUG: add_param: tag=a200bcf5a4 2(31735) end of header reached, state=29 2(31735) parse_headers: flags=256 2(31735) found end of header 2(31735) find_first_route(): No Route headers found 2(31735) loose_route(): There is no Route HF 2(31735) check_self - checking if host==us: 20==13 && [call.millicom.com.pe] == [200.110.2.131] 2(31735) check_self - checking if port 5060 matches port 5060 2(31735) check_self - checking if host==us: 20==9 && [call.millicom.com.pe] == [127.0.0.1] 2(31735) check_self - checking if port 5060 matches port 5060 2(31735) query="select grp from grp where username='6604000' AND grp='voicemail'" 2(31735) is_user_in(): User is in group 'voicemail' 2(31735) rwrite(): Rewriting Request-URI with 'sip:6604000@200.110.6.58' 2(31735) DEBUG: t_addifnew: msg id=11467 , global msg id=11434 , T on entrance=0xffffffff 2(31735) parse_headers: flags=-1 2(31735) parse_headers: flags=60 2(31735) t_lookup_request: start searching: hash=31284, isACK=1 2(31735) DEBUG: RFC3261 transaction matched, tid=a200bcf5a4114 2(31735) DEBUG: t_lookup_request: transaction found (T=0x422c27c8) 2(31735) DEBUG: cleanup_uacs: RETR/FR timers reset 2(31735) DEBUG: add_to_tail_of_timer[2]: 0x422c2810 2(31735) DEBUG:destroy_avp_list: destroing list (nil) 2(31735) receive_msg: cleaning up
DEBUG FROM 2nd INSTANCE (PORT 5090) -------------------------------------------------- ] 7(31709) get_hdr_field: cseq <CSeq>: <113> <INVITE> 7(31709) DEBUG: get_hdr_body : content_length=180 7(31709) DEBUG: is_maxfwd_present: value = 69 7(31709) check_self - checking if host==us: 20==9 && [call.millicom.com.pe] == [127.0.0.1] 7(31709) check_self - checking if port 5090 matches port 5090 7(31709) check_self - checking if host==us: 20==13 && [call.millicom.com.pe] == [200.110.2.131] 7(31709) check_self - checking if port 5090 matches port 5090 7(31709) check_self: host != me 7(31709) parse_headers: flags=-1 7(31709) found end of header 7(31709) check_via_address(200.110.2.131, 200.110.2.131, 0) 7(31709) DEBUG:destroy_avp_list: destroing list (nil) 7(31709) receive_msg: cleaning up 5(31705) SIP Request: 5(31705) method: <ACK> 5(31705) uri: sip:6605454@call.millicom.com.pe:5090 5(31705) version: <SIP/2.0> 5(31705) parse_headers: flags=1 5(31705) Found param type 232, <branch> = <z9hG4bKd517.2ea1e793.0>; state=16 5(31705) end of header reached, state=5 5(31705) parse_headers: Via found, flags=1 5(31705) parse_headers: this is the first via 5(31705) After parse_msg... 5(31705) preparing to run routing scripts... 5(31705) parse_headers: flags=4 5(31705) DEBUG: add_param: tag=3749ec7003921b5c92fe06c5dc660395.01b8 5(31705) end of header reached, state=29 5(31705) DEBUG: get_hdr_field: <To> [78]; uri=[sip:6605454@call.millicom.com.pe] 5(31705) DEBUG: to body [sip:6605454@call.millicom.com.pe] 5(31705) DEBUG: sl_filter_ACK : local ACK found -> dropping it! 5(31705) DEBUG:destroy_avp_list: destroing list (nil) 5(31705) receive_msg: cleaning up 6(31707) SIP Request: 6(31707) method: <INVITE> 6(31707) uri: sip:6604000@call.millicom.com.pe:5090 6(31707) version: <SIP/2.0> 6(31707) parse_headers: flags=1 6(31707) Found param type 232, <branch> = <z9hG4bK43a7.d99b0dc7.1>; state=16 6(31707) end of header reached, state=5 6(31707) parse_headers: Via found, flags=1 6(31707) parse_headers: this is the first via 6(31707) After parse_msg... 6(31707) preparing to run routing scripts... 6(31707) DEBUG : is_maxfwd_present: searching for max_forwards header 6(31707) parse_headers: flags=128 6(31707) Found param type 232, <branch> = <z9hG4bKa200bcf5a4114>; state=16 6(31707) end of header reached, state=5 6(31707) parse_headers: Via found, flags=128 6(31707) parse_headers: this is the second via 6(31707) end of header reached, state=9 6(31707) DEBUG: get_hdr_field: <To> [36]; uri=[sip:6604000@call.millicom.com.pe] 6(31707) DEBUG: to body [sip:6604000@call.millicom.com.pe ] 6(31707) get_hdr_field: cseq <CSeq>: <114> <INVITE> 6(31707) DEBUG: get_hdr_body : content_length=180 6(31707) DEBUG: is_maxfwd_present: value = 69 6(31707) check_self - checking if host==us: 20==9 && [call.millicom.com.pe] == [127.0.0.1] 6(31707) check_self - checking if port 5090 matches port 5090 6(31707) check_self - checking if host==us: 20==13 && [call.millicom.com.pe] == [200.110.2.131] 6(31707) check_self - checking if port 5090 matches port 5090 6(31707) check_self: host != me 6(31707) parse_headers: flags=-1 6(31707) found end of header 6(31707) check_via_address(200.110.2.131, 200.110.2.131, 0) 6(31707) DEBUG:destroy_avp_list: destroing list (nil) 6(31707) receive_msg: cleaning up 8(31711) SIP Request: 8(31711) method: <ACK> 8(31711) uri: sip:6604000@call.millicom.com.pe:5090 8(31711) version: <SIP/2.0> 8(31711) parse_headers: flags=1 8(31711) Found param type 232, <branch> = <z9hG4bK43a7.d99b0dc7.1>; state=16 8(31711) end of header reached, state=5 8(31711) parse_headers: Via found, flags=1 8(31711) parse_headers: this is the first via 8(31711) After parse_msg... 8(31711) preparing to run routing scripts... 8(31711) parse_headers: flags=4 8(31711) DEBUG: add_param: tag=3749ec7003921b5c92fe06c5dc660395.5093 8(31711) end of header reached, state=29 8(31711) DEBUG: get_hdr_field: <To> [78]; uri=[sip:6604000@call.millicom.com.pe] 8(31711) DEBUG: to body [sip:6604000@call.millicom.com.pe] 8(31711) DEBUG: sl_filter_ACK : local ACK found -> dropping it! 8(31711) DEBUG:destroy_avp_list: destroing list (nil) 8(31711) receive_msg: cleaning up
--------------------------------- Do You Yahoo!? Todo lo que quieres saber de Estados Unidos, América Latina y el resto del Mundo. Visíta Yahoo! Noticias.