I just installed opensips 1.9.0 from scratch and get the following error when testing server:
root@sip:~# sipsak -T -s sip:1001@memorea.com -vv
warning: IP extract from warning activated to be more informational
Max-Forwards set to 0
0: 'no Warning header found' (0.076 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 1
1: 'no Warning header found' (211.197 ms) SIP/2.0 403 Rely forbidden
without Contact header
Debug server says:
Mar 26 19:50:43 DBG:core:udp_rcv_loop: probing packet received len = 4
Mar 26 19:50:43 DBG:core:parse_msg: SIP Request:
Mar 26 19:50:43 DBG:core:parse_msg: method: <OPTIONS>
Mar 26 19:50:43 DBG:core:parse_msg: uri: <sip:1001@memorea.com>
Mar 26 19:50:43 DBG:core:parse_msg: version: <SIP/2.0>
Mar 26 19:50:43 DBG:core:parse_headers: flags=2
Mar 26 19:50:43 DBG:core:parse_via_param: found param type 232, <branch> = <z9hG4bK.5ae68aca>; state=6
Mar 26 19:50:43 DBG:core:parse_via_param: found param type 235, <rport> = <n/a>; state=6
Mar 26 19:50:43 DBG:core:parse_via_param: found param type 237, <alias> = <n/a>; state=16
Mar 26 19:50:43 DBG:core:parse_via: end of header reached, state=5
Mar 26 19:50:43 DBG:core:parse_headers: via found, flags=2
Mar 26 19:50:43 DBG:core:parse_headers: this is the first via
Mar 26 19:50:43 DBG:core:receive_msg: After parse_msg…
Mar 26 19:50:43 DBG:core:receive_msg: preparing to run routing scripts…
Mar 26 19:50:43 DBG:core:parse_headers: flags=100
Mar 26 19:50:43 DBG:core:parse_to: end of header reached, state=9
Mar 26 19:50:43 DBG:core:parse_to: display={}, ruri={sip:1001@memorea.com}
Mar 26 19:50:43 DBG:core:get_hdr_field: <To> ; uri=
Mar 26 19:50:43 DBG:core:get_hdr_field: to body [sip:1001@memorea.com
]
Mar 26 19:50:43 DBG:core:get_hdr_field: cseq <CSeq>: <1> <OPTIONS>
Mar 26 19:50:43 DBG:core:get_hdr_field: content_length=0
Mar 26 19:50:43 DBG:maxfwd:is_maxfwd_present: value = 0
Mar 26 19:50:43 DBG:core:parse_headers: flags=ffffffffffffffff
Mar 26 19:50:43 DBG:core:get_hdr_field: found end of header
Mar 26 19:50:43 DBG:core:destroy_avp_list: destroying list (nil)
Mar 26 19:50:43 DBG:core:receive_msg: cleaning up
Mar 26 19:50:43 DBG:core:parse_msg: SIP Request:
Mar 26 19:50:43 DBG:core:parse_msg: method: <OPTIONS>
Mar 26 19:50:43 DBG:core:parse_msg: uri: <sip:1001@memorea.com>
Mar 26 19:50:43 DBG:core:parse_msg: version: <SIP/2.0>
Mar 26 19:50:43 DBG:core:parse_headers: flags=2
Mar 26 19:50:43 DBG:core:parse_via_param: found param type 232, <branch> = <z9hG4bK.1e4d969f>; state=6
Mar 26 19:50:43 DBG:core:parse_via_param: found param type 235, <rport> = <n/a>; state=6
Mar 26 19:50:43 DBG:core:parse_via_param: found param type 237, <alias> = <n/a>; state=16
Mar 26 19:50:43 DBG:core:parse_via: end of header reached, state=5
Mar 26 19:50:43 DBG:core:parse_headers: via found, flags=2
Mar 26 19:50:43 DBG:core:parse_headers: this is the first via
Mar 26 19:50:43 DBG:core:receive_msg: After parse_msg…
Mar 26 19:50:43 DBG:core:receive_msg: preparing to run routing scripts…
Mar 26 19:50:43 DBG:core:parse_headers: flags=100
Mar 26 19:50:43 DBG:core:parse_to: end of header reached, state=9
Mar 26 19:50:43 DBG:core:parse_to: display={}, ruri={sip:1001@memorea.com}
Mar 26 19:50:43 DBG:core:get_hdr_field: <To> ; uri=
Mar 26 19:50:43 DBG:core:get_hdr_field: to body [sip:1001@memorea.com
]
Mar 26 19:50:43 DBG:core:get_hdr_field: cseq <CSeq>: <2> <OPTIONS>
Mar 26 19:50:43 DBG:core:get_hdr_field: content_length=0
Mar 26 19:50:43 DBG:maxfwd:is_maxfwd_present: value = 1
Mar 26 19:50:43 DBG:uri:has_totag: no totag
Mar 26 19:50:43 DBG:core:parse_headers: flags=78
Mar 26 19:50:43 DBG:tm:t_lookup_request: start searching: hash=60249, isACK=0
Mar 26 19:50:43 DBG:tm:matching_3261: RFC3261 transaction matching failed
Mar 26 19:50:43 DBG:tm:t_lookup_request: no transaction found
Mar 26 19:50:43 DBG:core:parse_to_param: tag=7aa0dc8b
Mar 26 19:50:43 DBG:core:parse_to: end of header reached, state=29
Mar 26 19:50:43 DBG:core:parse_to: display={}, ruri={sip:sipsak@127.0.0.1:38276}
Mar 26 19:50:43 DBG:core:grep_sock_info: checking if host==us: 9==9 && ==
Mar 26 19:50:43 DBG:core:grep_sock_info: checking if port 5060 matches port 38276
Mar 26 19:50:43 DBG:core:check_self: host != me
Mar 26 19:50:43 DBG:core:grep_sock_info: checking if host==us: 11==9 && ==
Mar 26 19:50:43 DBG:core:grep_sock_info: checking if port 5060 matches port 5060
Mar 26 19:50:43 DBG:core:check_self: host != me
Mar 26 19:50:43 DBG:core:parse_headers: flags=ffffffffffffffff
Mar 26 19:50:43 DBG:core:get_hdr_field: found end of header
Mar 26 19:50:43 DBG:core:destroy_avp_list: destroying list (nil)
Mar 26 19:50:43 DBG:core:receive_msg: cleaning up
Mar 26 19:50:53 DBG:core:udp_rcv_loop: probing packet received len = 4
Domain 'memorea.com' is configured in opensis and declared in hosts.conf (127.0.0.1 memorea.com).
What's wrong?
Thanks for help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Most probabaly your opensips is not recognizing the "memorea.com" as a local domain (in order to locally process the traffic) and it is looping the request.
Add "alias=memorea.com" in your cfg as global param and re-test.
Regards,
Bogdan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
root@sip:~# opensipsctl ul show
Domain:: location table=512 records=1
AOR:: 1000
Contact:: sip:1000@sip.memorea.com Q=1
Expires:: permanent
Callid:: dfjrewr12386fd6-343@opensips.mi
Cseq:: 1
User-agent:: OpenSIPS MI Server
State:: CS_SYNC
Flags:: 0
Cflag:: 0
Methods:: 4294967295
but 483 error persists:
root@sip:~# sipsak -T -s sip:1000@sip.memorea.com -vv
warning: IP extract from warning activated to be more informational
Max-Forwards set to 0
0: 'no Warning header found' (0.007 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 1
1: 'no Warning header found' (219.902 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 2
2: 'no Warning header found' (15.166 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 3
3: 'no Warning header found' (49.054 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 4
4: 'no Warning header found' (33.194 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 5
5: 'no Warning header found' (69.334 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 6
6: 'no Warning header found' (79.810 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 7
7: 'no Warning header found' (125.480 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 8
8: 'no Warning header found' (120.172 ms) SIP/2.0 483 Too Many Hops
…
:-(
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
root@sip:~# opensipsctl ul add test sip:1000@sip.memorea.com
root@sip:~# opensipsctl ul show
Domain:: location table=512 records=1
AOR:: test
Contact:: sip:1000@sip.memorea.com Q=1
Expires:: permanent
Callid:: dfjrewr12386fd6-343@opensips.mi
Cseq:: 1
User-agent:: OpenSIPS MI Server
State:: CS_SYNC
Flags:: 0
Cflag:: 0
Methods:: 4294967295
root@sip:~#
root@sip:~#
root@sip:~#
root@sip:~# sipsak -T -s sip:1000@sip.memorea.com -vv
warning: IP extract from warning activated to be more informational
Max-Forwards set to 0
0: 'no Warning header found' (0.042 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 1
1: 'no Warning header found' (0.018 ms) SIP/2.0 404 Not Found
without Contact header
root@sip:~#
Debug server shows a lookup error:
Mar 28 15:22:32 DBG:registrar:lookup: '1000' Not found in usrloc
More information about this:
Mar 28 15:22:32 DBG:core:parse_msg: method: <OPTIONS>
Mar 28 15:22:32 DBG:core:parse_msg: uri: <sip:1000@sip.memorea.com>
Mar 28 15:22:32 DBG:core:parse_msg: version: <SIP/2.0>
Mar 28 15:22:32 DBG:core:parse_headers: flags=2
Mar 28 15:22:32 DBG:core:parse_via_param: found param type 232, <branch> = <z9hG4bK.4ad7035f>; state=6
Mar 28 15:22:32 DBG:core:parse_via_param: found param type 235, <rport> = <n/a>; state=6
Mar 28 15:22:32 DBG:core:parse_via_param: found param type 237, <alias> = <n/a>; state=16
Mar 28 15:22:32 DBG:core:parse_via: end of header reached, state=5
Mar 28 15:22:32 DBG:core:parse_headers: via found, flags=2
Mar 28 15:22:32 DBG:core:parse_headers: this is the first via
Mar 28 15:22:32 DBG:core:receive_msg: After parse_msg…
Mar 28 15:22:32 DBG:core:receive_msg: preparing to run routing scripts…
Mar 28 15:22:32 DBG:core:parse_headers: flags=100
Mar 28 15:22:32 DBG:core:parse_to: end of header reached, state=9
Mar 28 15:22:32 DBG:core:parse_to: display={}, ruri={sip:1000@sip.memorea.com}
Mar 28 15:22:32 DBG:core:get_hdr_field: <To> ; uri=
Mar 28 15:22:32 DBG:core:get_hdr_field: to body [sip:1000@sip.memorea.com
]
Mar 28 15:22:32 DBG:core:get_hdr_field: cseq <CSeq>: <1> <OPTIONS>
Mar 28 15:22:32 DBG:core:get_hdr_field: content_length=0
Mar 28 15:22:32 DBG:maxfwd:is_maxfwd_present: value = 0
Mar 28 15:22:32 DBG:core:parse_headers: flags=ffffffffffffffff
Mar 28 15:22:32 DBG:core:get_hdr_field: found end of header
Mar 28 15:22:32 DBG:core:destroy_avp_list: destroying list (nil)
Mar 28 15:22:32 DBG:core:receive_msg: cleaning up
Mar 28 15:22:32 DBG:core:parse_msg: SIP Request:
Mar 28 15:22:32 DBG:core:parse_msg: method: <OPTIONS>
Mar 28 15:22:32 DBG:core:parse_msg: uri: <sip:1000@sip.memorea.com>
Mar 28 15:22:32 DBG:core:parse_msg: version: <SIP/2.0>
Mar 28 15:22:32 DBG:core:parse_headers: flags=2
Mar 28 15:22:32 DBG:core:parse_via_param: found param type 232, <branch> = <z9hG4bK.33700eac>; state=6
Mar 28 15:22:32 DBG:core:parse_via_param: found param type 235, <rport> = <n/a>; state=6
Mar 28 15:22:32 DBG:core:parse_via_param: found param type 237, <alias> = <n/a>; state=16
Mar 28 15:22:32 DBG:core:parse_via: end of header reached, state=5
Mar 28 15:22:32 DBG:core:parse_headers: via found, flags=2
Mar 28 15:22:32 DBG:core:parse_headers: this is the first via
Mar 28 15:22:32 DBG:core:receive_msg: After parse_msg…
Mar 28 15:22:32 DBG:core:receive_msg: preparing to run routing scripts…
Mar 28 15:22:32 DBG:core:parse_headers: flags=100
Mar 28 15:22:32 DBG:core:parse_to: end of header reached, state=9
Mar 28 15:22:32 DBG:core:parse_to: display={}, ruri={sip:1000@sip.memorea.com}
Mar 28 15:22:32 DBG:core:get_hdr_field: <To> ; uri=
Mar 28 15:22:32 DBG:core:get_hdr_field: to body [sip:1000@sip.memorea.com
]
Mar 28 15:22:32 DBG:core:get_hdr_field: cseq <CSeq>: <2> <OPTIONS>
Mar 28 15:22:32 DBG:core:get_hdr_field: content_length=0
Mar 28 15:22:32 DBG:maxfwd:is_maxfwd_present: value = 1
Mar 28 15:22:32 DBG:uri:has_totag: no totag
Mar 28 15:22:32 DBG:core:parse_headers: flags=78
Mar 28 15:22:32 DBG:tm:t_lookup_request: start searching: hash=17833, isACK=0
Mar 28 15:22:32 DBG:tm:matching_3261: RFC3261 transaction matching failed
Mar 28 15:22:32 DBG:tm:t_lookup_request: no transaction found
Mar 28 15:22:32 DBG:core:parse_to_param: tag=5088ed97
Mar 28 15:22:32 DBG:core:parse_to: end of header reached, state=29
Mar 28 15:22:32 DBG:core:parse_to: display={}, ruri={sip:sipsak@127.0.0.1:34401}
Mar 28 15:22:32 DBG:core:grep_sock_info: checking if host==us: 9==9 && ==
Mar 28 15:22:32 DBG:core:grep_sock_info: checking if port 5060 matches port 34401
Mar 28 15:22:32 DBG:core:check_self: host != me
Mar 28 15:22:32 DBG:core:grep_sock_info: checking if host==us: 15==9 && ==
Mar 28 15:22:32 DBG:core:grep_sock_info: checking if port 5060 matches port 5060
Mar 28 15:22:32 DBG:core:parse_headers: flags=200
Mar 28 15:22:32 DBG:core:get_hdr_field: found end of header
Mar 28 15:22:32 DBG:rr:find_first_route: No Route headers found
Mar 28 15:22:32 DBG:rr:loose_route: There is no Route HF
Mar 28 15:22:32 DBG:core:grep_sock_info: checking if host==us: 15==9 && ==
Mar 28 15:22:32 DBG:core:grep_sock_info: checking if port 5060 matches port 5060
Mar 28 15:22:32 DBG:registrar:lookup: '1000' Not found in usrloc
Mar 28 15:22:32 DBG:tm:t_newtran: transaction on entrance=(nil)
Mar 28 15:22:32 DBG:core:parse_headers: flags=ffffffffffffffff
Mar 28 15:22:32 DBG:core:parse_headers: flags=78
Mar 28 15:22:32 DBG:tm:t_lookup_request: start searching: hash=17833, isACK=0
Mar 28 15:22:32 DBG:tm:matching_3261: RFC3261 transaction matching failed
Mar 28 15:22:32 DBG:tm:t_lookup_request: no transaction found
Mar 28 15:22:32 DBG:tm:run_reqin_callbacks: trans=0x7f96f5a5f5f0, callback type 1, id 1 entered
Mar 28 15:22:32 DBG:tm:run_reqin_callbacks: trans=0x7f96f5a5f5f0, callback type 1, id 0 entered
Mar 28 15:22:32 DBG:core:parse_headers: flags=ffffffffffffffff
Mar 28 15:22:32 DBG:core:_shm_resize: resize(0) called
Mar 28 15:22:32 DBG:tm:cleanup_uac_timers: RETR/FR timers reset
Mar 28 15:22:32 DBG:tm:insert_timer_unsafe: : 0x7f96f5a5f670 (843)
Mar 28 15:22:32 DBG:tm:_reply_light: reply sent out. buf=0x7f96fd0c1900: SIP/2.0 4…, shmem=0x7f96f5a59cb0: SIP/2.0 4
Mar 28 15:22:32 DBG:tm:_reply_light: finished
Mar 28 15:22:32 DBG:tm:t_unref: UNREF_UNSAFE: after is 0
Mar 28 15:22:32 DBG:core:destroy_avp_list: destroying list (nil)
Mar 28 15:22:32 DBG:core:receive_msg: cleaning up
Mar 28 15:22:38 DBG:tm:timer_routine: timer routine:2,tl=0x7f96f5a5f670 next=(nil), timeout=843
Mar 28 15:22:38 DBG:tm:wait_handler: removing 0x7f96f5a5f5f0 from table
Mar 28 15:22:38 DBG:tm:delete_cell: delete transaction 0x7f96f5a5f5f0
Mar 28 15:22:38 DBG:tm:wait_handler: done
And follow the opensips.cfg file:
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=no
/* 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=no
route{
if (!mf_process_maxfwd_header("10")) {
sl_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(ACC_DO); # do accounting …
setflag(ACC_FAILED); # … 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(relay);
} 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;
}
}
sl_send_reply("404","Not here");
}
exit;
}
# CANCEL processing
if (is_method("CANCEL"))
{
if (t_check_trans())
t_relay();
exit;
}
t_check_trans();
if ( !(is_method("REGISTER") ) ) {
if (from_uri==myself)
{
} else {
# if caller is not local, then called number must be local
if (!uri==myself) {
send_reply("403","Rely forbidden");
exit;
}
}
}
# preloaded route checking
if (loose_route()) {
xlog("L_ERR",
"Attempt to route with preloaded Route's ");
if (!is_method("ACK"))
sl_send_reply("403","Preload Route denied");
exit;
}
# record routing
if (!is_method("REGISTER|MESSAGE"))
record_route();
# account only INVITEs
if (is_method("INVITE")) {
setflag(ACC_DO); # do accounting
}
if (!uri==myself) {
append_hf("P-hint: outbound\r\n");
route(relay);
}
# requests for my domain
if (is_method("PUBLISH|SUBSCRIBE"))
{
sl_send_reply("503", "Service Unavailable");
exit;
}
if (is_method("REGISTER"))
{
if ( 0 ) setflag(TCP_PERSISTENT);
if (!save("location"))
sl_reply_error();
exit;
}
if ($rU==NULL) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}
# do lookup with method filtering
if (!lookup("location","m")) {
t_newtran();
t_reply("404", "Not Found");
exit;
}
# when routing via usrloc, log the missed calls also
setflag(ACC_MISSED);
route(relay);
}
route {
# for INVITEs enable some additional helper routes
if (is_method("INVITE")) {
t_on_branch("per_branch_ops");
t_on_reply("handle_nat");
t_on_failure("missed_call");
}
if (!t_relay()) {
send_reply("500","Internal Error");
};
exit;
}
branch_route {
xlog("new branch at $ru\n");
}
onreply_route {
xlog("incoming reply\n");
}
failure_route {
if (t_was_cancelled()) {
exit;
}
# uncomment the following lines if you want to block client
# redirect based on 3xx replies.
##if (t_check_status("3")) {
##t_reply("404","Not found");
## exit;
##}
}
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just installed opensips 1.9.0 from scratch and get the following error when testing server:
root@sip:~# sipsak -T -s sip:1001@memorea.com -vv
warning: IP extract from warning activated to be more informational
Max-Forwards set to 0
0: 'no Warning header found' (0.076 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 1
1: 'no Warning header found' (211.197 ms) SIP/2.0 403 Rely forbidden
without Contact header
Debug server says:
Mar 26 19:50:43 DBG:core:udp_rcv_loop: probing packet received len = 4
Mar 26 19:50:43 DBG:core:parse_msg: SIP Request:
Mar 26 19:50:43 DBG:core:parse_msg: method: <OPTIONS>
Mar 26 19:50:43 DBG:core:parse_msg: uri: <sip:1001@memorea.com>
Mar 26 19:50:43 DBG:core:parse_msg: version: <SIP/2.0>
Mar 26 19:50:43 DBG:core:parse_headers: flags=2
Mar 26 19:50:43 DBG:core:parse_via_param: found param type 232, <branch> = <z9hG4bK.5ae68aca>; state=6
Mar 26 19:50:43 DBG:core:parse_via_param: found param type 235, <rport> = <n/a>; state=6
Mar 26 19:50:43 DBG:core:parse_via_param: found param type 237, <alias> = <n/a>; state=16
Mar 26 19:50:43 DBG:core:parse_via: end of header reached, state=5
Mar 26 19:50:43 DBG:core:parse_headers: via found, flags=2
Mar 26 19:50:43 DBG:core:parse_headers: this is the first via
Mar 26 19:50:43 DBG:core:receive_msg: After parse_msg…
Mar 26 19:50:43 DBG:core:receive_msg: preparing to run routing scripts…
Mar 26 19:50:43 DBG:core:parse_headers: flags=100
Mar 26 19:50:43 DBG:core:parse_to: end of header reached, state=9
Mar 26 19:50:43 DBG:core:parse_to: display={}, ruri={sip:1001@memorea.com}
Mar 26 19:50:43 DBG:core:get_hdr_field: <To> ; uri=
Mar 26 19:50:43 DBG:core:get_hdr_field: to body [sip:1001@memorea.com
]
Mar 26 19:50:43 DBG:core:get_hdr_field: cseq <CSeq>: <1> <OPTIONS>
Mar 26 19:50:43 DBG:core:get_hdr_field: content_length=0
Mar 26 19:50:43 DBG:maxfwd:is_maxfwd_present: value = 0
Mar 26 19:50:43 DBG:core:parse_headers: flags=ffffffffffffffff
Mar 26 19:50:43 DBG:core:get_hdr_field: found end of header
Mar 26 19:50:43 DBG:core:destroy_avp_list: destroying list (nil)
Mar 26 19:50:43 DBG:core:receive_msg: cleaning up
Mar 26 19:50:43 DBG:core:parse_msg: SIP Request:
Mar 26 19:50:43 DBG:core:parse_msg: method: <OPTIONS>
Mar 26 19:50:43 DBG:core:parse_msg: uri: <sip:1001@memorea.com>
Mar 26 19:50:43 DBG:core:parse_msg: version: <SIP/2.0>
Mar 26 19:50:43 DBG:core:parse_headers: flags=2
Mar 26 19:50:43 DBG:core:parse_via_param: found param type 232, <branch> = <z9hG4bK.1e4d969f>; state=6
Mar 26 19:50:43 DBG:core:parse_via_param: found param type 235, <rport> = <n/a>; state=6
Mar 26 19:50:43 DBG:core:parse_via_param: found param type 237, <alias> = <n/a>; state=16
Mar 26 19:50:43 DBG:core:parse_via: end of header reached, state=5
Mar 26 19:50:43 DBG:core:parse_headers: via found, flags=2
Mar 26 19:50:43 DBG:core:parse_headers: this is the first via
Mar 26 19:50:43 DBG:core:receive_msg: After parse_msg…
Mar 26 19:50:43 DBG:core:receive_msg: preparing to run routing scripts…
Mar 26 19:50:43 DBG:core:parse_headers: flags=100
Mar 26 19:50:43 DBG:core:parse_to: end of header reached, state=9
Mar 26 19:50:43 DBG:core:parse_to: display={}, ruri={sip:1001@memorea.com}
Mar 26 19:50:43 DBG:core:get_hdr_field: <To> ; uri=
Mar 26 19:50:43 DBG:core:get_hdr_field: to body [sip:1001@memorea.com
]
Mar 26 19:50:43 DBG:core:get_hdr_field: cseq <CSeq>: <2> <OPTIONS>
Mar 26 19:50:43 DBG:core:get_hdr_field: content_length=0
Mar 26 19:50:43 DBG:maxfwd:is_maxfwd_present: value = 1
Mar 26 19:50:43 DBG:uri:has_totag: no totag
Mar 26 19:50:43 DBG:core:parse_headers: flags=78
Mar 26 19:50:43 DBG:tm:t_lookup_request: start searching: hash=60249, isACK=0
Mar 26 19:50:43 DBG:tm:matching_3261: RFC3261 transaction matching failed
Mar 26 19:50:43 DBG:tm:t_lookup_request: no transaction found
Mar 26 19:50:43 DBG:core:parse_to_param: tag=7aa0dc8b
Mar 26 19:50:43 DBG:core:parse_to: end of header reached, state=29
Mar 26 19:50:43 DBG:core:parse_to: display={}, ruri={sip:sipsak@127.0.0.1:38276}
Mar 26 19:50:43 DBG:core:grep_sock_info: checking if host==us: 9==9 && ==
Mar 26 19:50:43 DBG:core:grep_sock_info: checking if port 5060 matches port 38276
Mar 26 19:50:43 DBG:core:check_self: host != me
Mar 26 19:50:43 DBG:core:grep_sock_info: checking if host==us: 11==9 && ==
Mar 26 19:50:43 DBG:core:grep_sock_info: checking if port 5060 matches port 5060
Mar 26 19:50:43 DBG:core:check_self: host != me
Mar 26 19:50:43 DBG:core:parse_headers: flags=ffffffffffffffff
Mar 26 19:50:43 DBG:core:get_hdr_field: found end of header
Mar 26 19:50:43 DBG:core:destroy_avp_list: destroying list (nil)
Mar 26 19:50:43 DBG:core:receive_msg: cleaning up
Mar 26 19:50:53 DBG:core:udp_rcv_loop: probing packet received len = 4
Domain 'memorea.com' is configured in opensis and declared in hosts.conf (127.0.0.1 memorea.com).
What's wrong?
Thanks for help.
Hi,
Most probabaly your opensips is not recognizing the "memorea.com" as a local domain (in order to locally process the traffic) and it is looping the request.
Add "alias=memorea.com" in your cfg as global param and re-test.
Regards,
Bogdan
Thanks for reply.
I added in cfg:
alias=sip.memorea.com
and reconfigure user:
root@sip:~# opensipsctl ul show
Domain:: location table=512 records=1
AOR:: 1000
Contact:: sip:1000@sip.memorea.com Q=1
Expires:: permanent
Callid:: dfjrewr12386fd6-343@opensips.mi
Cseq:: 1
User-agent:: OpenSIPS MI Server
State:: CS_SYNC
Flags:: 0
Cflag:: 0
Methods:: 4294967295
but 483 error persists:
root@sip:~# sipsak -T -s sip:1000@sip.memorea.com -vv
warning: IP extract from warning activated to be more informational
Max-Forwards set to 0
0: 'no Warning header found' (0.007 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 1
1: 'no Warning header found' (219.902 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 2
2: 'no Warning header found' (15.166 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 3
3: 'no Warning header found' (49.054 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 4
4: 'no Warning header found' (33.194 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 5
5: 'no Warning header found' (69.334 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 6
6: 'no Warning header found' (79.810 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 7
7: 'no Warning header found' (125.480 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 8
8: 'no Warning header found' (120.172 ms) SIP/2.0 483 Too Many Hops
…
:-(
Hi,
Your static registration is causing the loop - AOR 1000 (implicitly 1000@sip.memorea.com) points to contact 1000@sip.memorea.com …
Regards,
Bogdan
Not yet…
I changed but not solve:
root@sip:~# opensipsctl ul add test sip:1000@sip.memorea.com
root@sip:~# opensipsctl ul show
Domain:: location table=512 records=1
AOR:: test
Contact:: sip:1000@sip.memorea.com Q=1
Expires:: permanent
Callid:: dfjrewr12386fd6-343@opensips.mi
Cseq:: 1
User-agent:: OpenSIPS MI Server
State:: CS_SYNC
Flags:: 0
Cflag:: 0
Methods:: 4294967295
root@sip:~#
root@sip:~#
root@sip:~#
root@sip:~# sipsak -T -s sip:1000@sip.memorea.com -vv
warning: IP extract from warning activated to be more informational
Max-Forwards set to 0
0: 'no Warning header found' (0.042 ms) SIP/2.0 483 Too Many Hops
Max-Forwards set to 1
1: 'no Warning header found' (0.018 ms) SIP/2.0 404 Not Found
without Contact header
root@sip:~#
Debug server shows a lookup error:
Mar 28 15:22:32 DBG:registrar:lookup: '1000' Not found in usrloc
More information about this:
Mar 28 15:22:32 DBG:core:parse_msg: method: <OPTIONS>
Mar 28 15:22:32 DBG:core:parse_msg: uri: <sip:1000@sip.memorea.com>
Mar 28 15:22:32 DBG:core:parse_msg: version: <SIP/2.0>
Mar 28 15:22:32 DBG:core:parse_headers: flags=2
Mar 28 15:22:32 DBG:core:parse_via_param: found param type 232, <branch> = <z9hG4bK.4ad7035f>; state=6
Mar 28 15:22:32 DBG:core:parse_via_param: found param type 235, <rport> = <n/a>; state=6
Mar 28 15:22:32 DBG:core:parse_via_param: found param type 237, <alias> = <n/a>; state=16
Mar 28 15:22:32 DBG:core:parse_via: end of header reached, state=5
Mar 28 15:22:32 DBG:core:parse_headers: via found, flags=2
Mar 28 15:22:32 DBG:core:parse_headers: this is the first via
Mar 28 15:22:32 DBG:core:receive_msg: After parse_msg…
Mar 28 15:22:32 DBG:core:receive_msg: preparing to run routing scripts…
Mar 28 15:22:32 DBG:core:parse_headers: flags=100
Mar 28 15:22:32 DBG:core:parse_to: end of header reached, state=9
Mar 28 15:22:32 DBG:core:parse_to: display={}, ruri={sip:1000@sip.memorea.com}
Mar 28 15:22:32 DBG:core:get_hdr_field: <To> ; uri=
Mar 28 15:22:32 DBG:core:get_hdr_field: to body [sip:1000@sip.memorea.com
]
Mar 28 15:22:32 DBG:core:get_hdr_field: cseq <CSeq>: <1> <OPTIONS>
Mar 28 15:22:32 DBG:core:get_hdr_field: content_length=0
Mar 28 15:22:32 DBG:maxfwd:is_maxfwd_present: value = 0
Mar 28 15:22:32 DBG:core:parse_headers: flags=ffffffffffffffff
Mar 28 15:22:32 DBG:core:get_hdr_field: found end of header
Mar 28 15:22:32 DBG:core:destroy_avp_list: destroying list (nil)
Mar 28 15:22:32 DBG:core:receive_msg: cleaning up
Mar 28 15:22:32 DBG:core:parse_msg: SIP Request:
Mar 28 15:22:32 DBG:core:parse_msg: method: <OPTIONS>
Mar 28 15:22:32 DBG:core:parse_msg: uri: <sip:1000@sip.memorea.com>
Mar 28 15:22:32 DBG:core:parse_msg: version: <SIP/2.0>
Mar 28 15:22:32 DBG:core:parse_headers: flags=2
Mar 28 15:22:32 DBG:core:parse_via_param: found param type 232, <branch> = <z9hG4bK.33700eac>; state=6
Mar 28 15:22:32 DBG:core:parse_via_param: found param type 235, <rport> = <n/a>; state=6
Mar 28 15:22:32 DBG:core:parse_via_param: found param type 237, <alias> = <n/a>; state=16
Mar 28 15:22:32 DBG:core:parse_via: end of header reached, state=5
Mar 28 15:22:32 DBG:core:parse_headers: via found, flags=2
Mar 28 15:22:32 DBG:core:parse_headers: this is the first via
Mar 28 15:22:32 DBG:core:receive_msg: After parse_msg…
Mar 28 15:22:32 DBG:core:receive_msg: preparing to run routing scripts…
Mar 28 15:22:32 DBG:core:parse_headers: flags=100
Mar 28 15:22:32 DBG:core:parse_to: end of header reached, state=9
Mar 28 15:22:32 DBG:core:parse_to: display={}, ruri={sip:1000@sip.memorea.com}
Mar 28 15:22:32 DBG:core:get_hdr_field: <To> ; uri=
Mar 28 15:22:32 DBG:core:get_hdr_field: to body [sip:1000@sip.memorea.com
]
Mar 28 15:22:32 DBG:core:get_hdr_field: cseq <CSeq>: <2> <OPTIONS>
Mar 28 15:22:32 DBG:core:get_hdr_field: content_length=0
Mar 28 15:22:32 DBG:maxfwd:is_maxfwd_present: value = 1
Mar 28 15:22:32 DBG:uri:has_totag: no totag
Mar 28 15:22:32 DBG:core:parse_headers: flags=78
Mar 28 15:22:32 DBG:tm:t_lookup_request: start searching: hash=17833, isACK=0
Mar 28 15:22:32 DBG:tm:matching_3261: RFC3261 transaction matching failed
Mar 28 15:22:32 DBG:tm:t_lookup_request: no transaction found
Mar 28 15:22:32 DBG:core:parse_to_param: tag=5088ed97
Mar 28 15:22:32 DBG:core:parse_to: end of header reached, state=29
Mar 28 15:22:32 DBG:core:parse_to: display={}, ruri={sip:sipsak@127.0.0.1:34401}
Mar 28 15:22:32 DBG:core:grep_sock_info: checking if host==us: 9==9 && ==
Mar 28 15:22:32 DBG:core:grep_sock_info: checking if port 5060 matches port 34401
Mar 28 15:22:32 DBG:core:check_self: host != me
Mar 28 15:22:32 DBG:core:grep_sock_info: checking if host==us: 15==9 && ==
Mar 28 15:22:32 DBG:core:grep_sock_info: checking if port 5060 matches port 5060
Mar 28 15:22:32 DBG:core:parse_headers: flags=200
Mar 28 15:22:32 DBG:core:get_hdr_field: found end of header
Mar 28 15:22:32 DBG:rr:find_first_route: No Route headers found
Mar 28 15:22:32 DBG:rr:loose_route: There is no Route HF
Mar 28 15:22:32 DBG:core:grep_sock_info: checking if host==us: 15==9 && ==
Mar 28 15:22:32 DBG:core:grep_sock_info: checking if port 5060 matches port 5060
Mar 28 15:22:32 DBG:registrar:lookup: '1000' Not found in usrloc
Mar 28 15:22:32 DBG:tm:t_newtran: transaction on entrance=(nil)
Mar 28 15:22:32 DBG:core:parse_headers: flags=ffffffffffffffff
Mar 28 15:22:32 DBG:core:parse_headers: flags=78
Mar 28 15:22:32 DBG:tm:t_lookup_request: start searching: hash=17833, isACK=0
Mar 28 15:22:32 DBG:tm:matching_3261: RFC3261 transaction matching failed
Mar 28 15:22:32 DBG:tm:t_lookup_request: no transaction found
Mar 28 15:22:32 DBG:tm:run_reqin_callbacks: trans=0x7f96f5a5f5f0, callback type 1, id 1 entered
Mar 28 15:22:32 DBG:tm:run_reqin_callbacks: trans=0x7f96f5a5f5f0, callback type 1, id 0 entered
Mar 28 15:22:32 DBG:core:parse_headers: flags=ffffffffffffffff
Mar 28 15:22:32 DBG:core:_shm_resize: resize(0) called
Mar 28 15:22:32 DBG:tm:cleanup_uac_timers: RETR/FR timers reset
Mar 28 15:22:32 DBG:tm:insert_timer_unsafe: : 0x7f96f5a5f670 (843)
Mar 28 15:22:32 DBG:tm:_reply_light: reply sent out. buf=0x7f96fd0c1900: SIP/2.0 4…, shmem=0x7f96f5a59cb0: SIP/2.0 4
Mar 28 15:22:32 DBG:tm:_reply_light: finished
Mar 28 15:22:32 DBG:tm:t_unref: UNREF_UNSAFE: after is 0
Mar 28 15:22:32 DBG:core:destroy_avp_list: destroying list (nil)
Mar 28 15:22:32 DBG:core:receive_msg: cleaning up
Mar 28 15:22:38 DBG:tm:timer_routine: timer routine:2,tl=0x7f96f5a5f670 next=(nil), timeout=843
Mar 28 15:22:38 DBG:tm:wait_handler: removing 0x7f96f5a5f5f0 from table
Mar 28 15:22:38 DBG:tm:delete_cell: delete transaction 0x7f96f5a5f5f0
Mar 28 15:22:38 DBG:tm:wait_handler: done
And follow the opensips.cfg file:
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=no
/* 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=no
alias=sip.memorea.com
listen=udp:127.0.0.1:5060 # CUSTOMIZE ME
disable_tcp=yes
disable_tls=yes
####### Modules Section ########
#set module path
mpath="/usr/local/lib64/opensips/modules/"
#### SIGNALING module
loadmodule "signaling.so"
#### StateLess module
loadmodule "sl.so"
#### Transaction Module
loadmodule "tm.so"
modparam("tm", "fr_timer", 5)
modparam("tm", "fr_inv_timer", 30)
modparam("tm", "restart_fr_on_each_reply", 0)
modparam("tm", "onreply_avp_mode", 1)
#### Record Route Module
loadmodule "rr.so"
modparam("rr", "append_fromtag", 0)
#### MAX ForWarD module
loadmodule "maxfwd.so"
#### SIP MSG OPerationS module
loadmodule "sipmsgops.so"
#### FIFO Management Interface
loadmodule "mi_fifo.so"
modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")
modparam("mi_fifo", "fifo_mode", 0666)
#### URI module
loadmodule "uri.so"
modparam("uri", "use_uri_table", 0)
#### Dialog module
loadmodule "dialog.so"
modparam("dialog", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
#modparam("dialog", "db_mode", "2")
#### Domain module
loadmodule "domain.so"
modparam("domain", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam("domain", "db_mode", 2)
#### USeR LOCation module
loadmodule "usrloc.so"
modparam("usrloc", "nat_bflag", "NAT")
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
#### REGISTRAR module
loadmodule "registrar.so"
modparam("registrar", "tcp_persistent_flag", "TCP_PERSISTENT")
/* uncomment the next line not to allow more than 10 contacts per AOR */
#modparam("registrar", "max_contacts", 10)
#### ACCounting module
loadmodule "acc.so"
modparam("acc", "early_media", 0)
modparam("acc", "report_cancels", 0)
modparam("acc", "detect_direction", 0)
modparam("acc", "failed_transaction_flag", "ACC_FAILED")
modparam("acc", "log_flag", "ACC_DO")
modparam("acc", "log_missed_flag", "ACC_MISSED")
loadmodule "alias_db.so"
modparam("alias_db", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
loadmodule "db_mysql.so"
loadmodule "auth.so"
loadmodule "auth_db.so"
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", "")
####### Routing Logic ########
# main request routing logic
route{
if (!mf_process_maxfwd_header("10")) {
sl_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(ACC_DO); # do accounting …
setflag(ACC_FAILED); # … 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(relay);
} 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;
}
}
sl_send_reply("404","Not here");
}
exit;
}
# CANCEL processing
if (is_method("CANCEL"))
{
if (t_check_trans())
t_relay();
exit;
}
t_check_trans();
if ( !(is_method("REGISTER") ) ) {
if (from_uri==myself)
{
} else {
# if caller is not local, then called number must be local
if (!uri==myself) {
send_reply("403","Rely forbidden");
exit;
}
}
}
# preloaded route checking
if (loose_route()) {
xlog("L_ERR",
"Attempt to route with preloaded Route's ");
if (!is_method("ACK"))
sl_send_reply("403","Preload Route denied");
exit;
}
# record routing
if (!is_method("REGISTER|MESSAGE"))
record_route();
# account only INVITEs
if (is_method("INVITE")) {
setflag(ACC_DO); # do accounting
}
if (!uri==myself) {
append_hf("P-hint: outbound\r\n");
route(relay);
}
# requests for my domain
if (is_method("PUBLISH|SUBSCRIBE"))
{
sl_send_reply("503", "Service Unavailable");
exit;
}
if (is_method("REGISTER"))
{
if ( 0 ) setflag(TCP_PERSISTENT);
if (!save("location"))
sl_reply_error();
exit;
}
if ($rU==NULL) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}
# do lookup with method filtering
if (!lookup("location","m")) {
t_newtran();
t_reply("404", "Not Found");
exit;
}
# when routing via usrloc, log the missed calls also
setflag(ACC_MISSED);
route(relay);
}
route {
# for INVITEs enable some additional helper routes
if (is_method("INVITE")) {
t_on_branch("per_branch_ops");
t_on_reply("handle_nat");
t_on_failure("missed_call");
}
if (!t_relay()) {
send_reply("500","Internal Error");
};
exit;
}
branch_route {
xlog("new branch at $ru\n");
}
onreply_route {
xlog("incoming reply\n");
}
failure_route {
if (t_was_cancelled()) {
exit;
}
# uncomment the following lines if you want to block client
# redirect based on 3xx replies.
##if (t_check_status("3")) {
##t_reply("404","Not found");
## exit;
##}
}
Thanks.
What exactly are you trying to achieve here ?
Regards,
Bogdan