I'm new to ser. I'm trying to setup ser to handle registrations, local call's and forward all other call's to PSTN gateway.
I cant get SER to send ACK's recieved from local client to PSTN gate... What am I doing wrong?
Here's my config file:
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/textops.so"
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", 1) modparam("auth_db", "calculate_ha1", yes) modparam("auth_db", "password_column", "password") modparam("rr", "enable_full_lr", 1)
# ------------------------- request routing logic -------------------
# main routing logic
route{ 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 (!method=="REGISTER") record_route();
# subsequent messages withing a dialog should take the # path determined by record-routing if (loose_route()) { # mark routing logic in request append_hf("P-hint: rr-enforced\r\n"); route(1); break; };
if (uri==myself) { if (method=="REGISTER") { if (!www_authorize("quantum.ru", "subscriber")) { www_challenge("quantum.ru", "0"); break; }; save("location"); break; }; if (method=="INVITE") { if(lookup("location")) { append_hf("P-hint: usrloc applied\r\n"); route(1); break; } else { if (uri=~"^sip:10372[0-9][0-9]@.*") { log(1,"**** user not found"); sl_send_reply("404", "Not Found"); break; } else { log (1, "Forwarding to PSTN"); rewritehostport("194.186.xx.xx:5060"); route(1); break; }; }; break; }; }; }
route[1] { # send it out now; use stateful forwarding as it works reliably # even for UDP2TCP if (!t_relay()) { sl_reply_error(); }; }
if (method=="INVITE") {
this is the same mistake I made...
if (method=="INVITE" | method=="ACK")
The ACK is a independant message, so the loose_route doesn't pick it up.
---greg
Igor Diakonov wrote:
I'm new to ser. I'm trying to setup ser to handle registrations, local call's and forward all other call's to PSTN gateway.
I cant get SER to send ACK's recieved from local client to PSTN gate... What am I doing wrong?
Here's my config file:
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/textops.so"
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", 1) modparam("auth_db", "calculate_ha1", yes) modparam("auth_db", "password_column", "password") modparam("rr", "enable_full_lr", 1)
# ------------------------- request routing logic -------------------
# main routing logic
route{ 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 (!method=="REGISTER") record_route();
# subsequent messages withing a dialog should take the # path determined by record-routing if (loose_route()) { # mark routing logic in request append_hf("P-hint: rr-enforced\r\n"); route(1); break; }; if (uri==myself) { if (method=="REGISTER") { if (!www_authorize("quantum.ru", "subscriber")) { www_challenge("quantum.ru", "0"); break; }; save("location"); break; }; if (method=="INVITE") { if(lookup("location")) { append_hf("P-hint: usrloc applied\r\n"); route(1); break; } else { if (uri=~"^sip:10372[0-9][0-9]@.*") { log(1,"**** user not found"); sl_send_reply("404", "Not Found"); break; } else { log (1, "Forwarding to PSTN"); rewritehostport("194.186.xx.xx:5060"); route(1); break; }; }; break; }; };
}
route[1] { # send it out now; use stateful forwarding as it works reliably # even for UDP2TCP if (!t_relay()) { sl_reply_error(); }; }
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
On Thu, 27 Nov 2003 09:19:33 -0600 Greg Fausak lgfausak@august.net wrote:
if (method=="INVITE") {
this is the same mistake I made...
if (method=="INVITE" | method=="ACK")
The ACK is a independant message, so the loose_route doesn't pick it up.
---greg
Thank you. If it's possible - can someone please send me a working example?
While trying to solve this problem i added the following lines to my conf and removed URI==myself check:
if (method=="ASK") { log (1, "************************* ASK received"); break; };
But, I can't see any "************************* ASK received" in, log ;(
0(21153) receive_msg: cleaning up 0(21153) SIP Request: 0(21153) method: <ACK> 0(21153) uri: sip:3264467@194.xx.xx.170:5060 0(21153) version: <SIP/2.0> 0(21153) parse_headers: flags=1 0(21153) Found param type 232, <branch> = <z9hG4bK-5fmxa2a5z7ww>; state=16 0(21153) end of header reached, state=5 0(21153) parse_headers: Via found, flags=1 0(21153) parse_headers: this is the first via 0(21153) After parse_msg... 0(21153) DEBUG : sl_filter_ACK: to late to be a local ACK! 0(21153) preparing to run routing scripts... 0(21153) DEBUG : is_maxfwd_present: searching for max_forwards header 0(21153) parse_headers: flags=128 0(21153) DEBUG: add_param: tag=D4DB9784-2247 0(21153) end of header reached, state=29 0(21153) DEBUG: get_hdr_field: <To> [59]; uri=[sip:3264467@213.xx.xx.171;user=phone] 0(21153) DEBUG: to body [sip:3264467@213.xx.xx.171;user=phone] 0(21153) get_hdr_field: cseq <CSeq>: <1> <ACK> 0(21153) DEBUG: is_maxfwd_present: value = 70 0(21153) DEBUG: add_param: tag=mqgz8tt3vb 0(21153) end of header reached, state=29 0(21153) parse_headers: flags=256 0(21153) check_self - checking if host==us: 15==14 && [194.xx.xx.170] == [213.xx.xx.171] 0(21153) check_self - checking if port 5060 matches port 5060 0(21153) check_self - checking if host==us: 15==14 && [194.xx.xx.170] == [213.xx.xx.171] 0(21153) check_self - checking if port 5060 matches port 5060 0(21153) check_self: host != me 0(21153) check_self - checking if host==us: 14==14 && [213.xx.xx.171] == [213.xx.xx.171] 0(21153) check_self - checking if port 5060 matches port 5060 0(21153) ral(): Topmost route URI: 'sip:3264467@213.xx.xx.171;ftag=mqgz8tt3vb;lr=on' is me 0(21153) parse_headers: flags=256 0(21153) DEBUG: get_hdr_body : content_length=0 0(21153) found end of header 0(21153) fnr(): No next Route HF found 0(21153) ral(): No next URI found 0(21153) receive_msg: cleaning up
Hello, unless it is not a new extension to SIP, ASK should be ACK
... if (method=="ASK") { ...
Daniel
On 11/27/2003 4:56 PM, Igor Diakonov wrote:
On Thu, 27 Nov 2003 09:19:33 -0600 Greg Fausak lgfausak@august.net wrote:
if (method=="INVITE") {
this is the same mistake I made...
if (method=="INVITE" | method=="ACK")
The ACK is a independant message, so the loose_route doesn't pick it up.
---greg
Thank you. If it's possible - can someone please send me a working example?
While trying to solve this problem i added the following lines to my conf and removed URI==myself check:
if (method=="ASK") { log (1, "************************* ASK received"); break; };
But, I can't see any "************************* ASK received" in, log ;(
0(21153) receive_msg: cleaning up 0(21153) SIP Request: 0(21153) method: <ACK> 0(21153) uri: sip:3264467@194.xx.xx.170:5060 0(21153) version: <SIP/2.0> 0(21153) parse_headers: flags=1 0(21153) Found param type 232, <branch> = <z9hG4bK-5fmxa2a5z7ww>; state=16 0(21153) end of header reached, state=5 0(21153) parse_headers: Via found, flags=1 0(21153) parse_headers: this is the first via 0(21153) After parse_msg... 0(21153) DEBUG : sl_filter_ACK: to late to be a local ACK! 0(21153) preparing to run routing scripts... 0(21153) DEBUG : is_maxfwd_present: searching for max_forwards header 0(21153) parse_headers: flags=128 0(21153) DEBUG: add_param: tag=D4DB9784-2247 0(21153) end of header reached, state=29 0(21153) DEBUG: get_hdr_field: <To> [59]; uri=[sip:3264467@213.xx.xx.171;user=phone] 0(21153) DEBUG: to body [sip:3264467@213.xx.xx.171;user=phone] 0(21153) get_hdr_field: cseq <CSeq>: <1> <ACK> 0(21153) DEBUG: is_maxfwd_present: value = 70 0(21153) DEBUG: add_param: tag=mqgz8tt3vb 0(21153) end of header reached, state=29 0(21153) parse_headers: flags=256 0(21153) check_self - checking if host==us: 15==14 && [194.xx.xx.170] == [213.xx.xx.171] 0(21153) check_self - checking if port 5060 matches port 5060 0(21153) check_self - checking if host==us: 15==14 && [194.xx.xx.170] == [213.xx.xx.171] 0(21153) check_self - checking if port 5060 matches port 5060 0(21153) check_self: host != me 0(21153) check_self - checking if host==us: 14==14 && [213.xx.xx.171] == [213.xx.xx.171] 0(21153) check_self - checking if port 5060 matches port 5060 0(21153) ral(): Topmost route URI: 'sip:3264467@213.xx.xx.171;ftag=mqgz8tt3vb;lr=on' is me 0(21153) parse_headers: flags=256 0(21153) DEBUG: get_hdr_body : content_length=0 0(21153) found end of header 0(21153) fnr(): No next Route HF found 0(21153) ral(): No next URI found 0(21153) receive_msg: cleaning up
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Anyway, what is the right way to handle ACK and BYE requests?
As I use rewritehostport("194.xx.xx.170:5060"); before sending request to PSTN - I get ACK whith (!uri==myself) How to handle such ACK's - should I write separate procedure to relay them?
Hello, unless it is not a new extension to SIP, ASK should be ACK
... if (method=="ASK") { ...
Daniel