I have Ser and asterisk on the same machine. When i try to call with a SIP phone registred on asterisk another sip phone also registred on asterisk through SER I receve this error message: Too many hops I not understand the reason. Someone have an idea? Thank's
This is my ser.cfg # # $Id: ser.cfg,v 1.21.4.1 2003/11/10 15:35:15 andrei Exp $ # # simple quick-start config script #
# ----------- global configuration parameters ------------------------
debug=3 # debug level (cmd line: -dddddddddd) fork=yes log_stderror=no # (cmd line: -E)
listen=192.168.9.97
#alias=192.168.9.97 #alias=panoramix.create-net.it #listen=127.0.0.1 #port=5060
check_via=no dns=no # (cmd. line: -r) rev_dns=no # (cmd. line: -R) #port=5060 #children=4 fifo="/tmp/ser_fifo" #fifo_db_url="mysql://ser:heslo@localhost/ser"
# ------------------ module loading ----------------------------------
# Uncomment this if you want to use SQL database loadmodule "/usr/src/ser-0.9.4/modules/mysql/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/registrar.so" #loadmodule "/usr/local/lib/ser/modules/textops.so" #loadmodule "/usr/local/lib/ser/modules/nathelper.so" # added #loadmodule "/usr/local/lib/ser/modules/domain.so" # Uncomment this if you want digest authentication # mysql.so must be loaded ! #loadmodule "/usr/local/lib/ser/modules/auth.so" #loadmodule "/usr/local/lib/ser/modules/auth_db.so" #loadmodule "/usr/local/lib/ser/modules/uri_db.so"
# ----------------- setting module-specific parameters ---------------
# -- usrloc params --
#modparam("auth_db|uri_db|usrloc","db_url","mysql://ser:heslo@localhost/ser") #modparam("auth_db","user_column","username")
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) #modparam("usrloc","time_interval",60)
# -- auth params -- # Uncomment if you are using auth module # #modparam("auth_db", "calculate_ha1", 1) # # If you set "calculate_ha1" parameter to yes (which true in this config), # uncomment also the following parameter) # #modparam("auth_db", "password_column", "password")
# -- rr params -- # add value to ;lr param to make some broken UAs happy modparam("rr", "enable_full_lr", 1)
# ------------------------- request routing logic -------------------
# main routing logic
route{
# lookup("aliases"); # initial sanity checks -- messages with # max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
log("LOG: Too many hops\n"); 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; };
if (method == "INVITE") { if (uri =~"^sip:0[0-9]*@*"){ log(1, "Check 1 succed Forwarding to Asterisk\n"); rewritehostport("192.168.9.97:5061"); t_relay(); break; }; };
# allow NOTIFY messages only from the Asterisk server # if (method=="NOTIFY" & src_ip==192.168.9.97) { # if (!t_relay()) { # sl_reply_error(); # 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=~"create-net.it") {
if (method=="REGISTER") { log(1,"registrazione da utente\n"); # Uncomment this if you want to use digest authentication # if (!www_authorize("create-net.it", "subscriber")) { # www_challenge("create-net.it", "0"); # break; # };
save("location"); break; };
# native SIP destinations are handled using our USRLOC DB if (!lookup("location")) { sl_send_reply("404", "Not Found"); break; }; }; # forward to current uri now; use stateful forwarding; that # works reliably even if we forward from TCP to UDP if (!t_relay()) { sl_reply_error(); };
}
Alle 09:47, mercoledì 02 novembre 2005, Matteo Piazza ha scritto:
I have Ser and asterisk on the same machine. When i try to call with a SIP phone registred on asterisk another sip phone also registred on asterisk through SER I receve this error message: Too many hops
Too many hops is usually reached when there is no rule (or no way) to deliver sip message, adding some log(), or better xlog(), to your routing script could help you (and us) debugging and understanding what's wrong, and which method(s) fail.
if (method == "INVITE") { if (uri =~"^sip:0[0-9]*@*"){ log(1, "Check 1 succed Forwarding to Asterisk\n"); rewritehostport("192.168.9.97:5061"); t_relay(); break; }; };
I don't think this will solve your problem but in my experience I had better result with t_relay_to_udp("192.168.9.97","5061") than rewritehostport("192.168.9.97:5061").
sounds to me like you have a looping problem in your script. I had something similar when using the example from OnSIP.org. The loose_route bit needed to be inside a condition: if (uri!=myself){ if (loose_route()) { route(1); }; }; xlog/ngrep is your friend here as you will be able to see which message is being sent between the two servers.
Noel
Giovanni Balasso wrote:
Alle 09:47, mercoledì 02 novembre 2005, Matteo Piazza ha scritto:
I have Ser and asterisk on the same machine. When i try to call with a SIP phone registred on asterisk another sip phone also registred on asterisk through SER I receve this error message: Too many hops
Too many hops is usually reached when there is no rule (or no way) to deliver sip message, adding some log(), or better xlog(), to your routing script could help you (and us) debugging and understanding what's wrong, and which method(s) fail.
if (method == "INVITE") { if (uri =~"^sip:0[0-9]*@*"){ log(1, "Check 1 succed Forwarding to Asterisk\n"); rewritehostport("192.168.9.97:5061"); t_relay(); break; }; };
I don't think this will solve your problem but in my experience I had better result with t_relay_to_udp("192.168.9.97","5061") than rewritehostport("192.168.9.97:5061").
Noel, It would be interesting to get a description of the setup that caused this problem. Was that Asterisk as well? Same setup as Giovanni? Dependent on auth/non-auth and how Asterisk has been set up with SER, we have seen different problems with signalling and proxying of RTP. I know there was an lr vs. lr=on issue a while back, but somewhere we don't have RFC compliant behavior (all messages with routes should be loose routed). g-)
----- Original Message ----- From: "Noel Sharpe" noels@radnetwork.co.uk To: "Giovanni Balasso" giaso@yahoo.it Cc: serusers@lists.iptel.org Sent: Tuesday, November 15, 2005 10:14 AM Subject: Re: [Serusers] Too Many Hops
sounds to me like you have a looping problem in your script. I had something similar when using the example from OnSIP.org. The loose_route bit needed to be inside a condition: if (uri!=myself){ if (loose_route()) { route(1); }; }; xlog/ngrep is your friend here as you will be able to see which message is being sent between the two servers.
Noel
Giovanni Balasso wrote:
Alle 09:47, mercoledì 02 novembre 2005, Matteo Piazza ha scritto:
I have Ser and asterisk on the same machine. When i try to call with a SIP phone registred on asterisk another sip phone also registred on asterisk through SER I receve this error message: Too many hops
Too many hops is usually reached when there is no rule (or no way) to deliver sip message, adding some log(), or better xlog(), to your routing script could help you (and us) debugging and understanding what's wrong, and which method(s) fail.
if (method == "INVITE") { if (uri =~"^sip:0[0-9]*@*"){ log(1, "Check 1 succed Forwarding to Asterisk\n"); rewritehostport("192.168.9.97:5061"); t_relay(); break; }; };
I don't think this will solve your problem but in my experience I had better result with t_relay_to_udp("192.168.9.97","5061") than rewritehostport("192.168.9.97:5061").
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Greger I am trying to get a cascading hierarchy of geographically separated SIP servers. The reason for this is that I am providing services to a wireless community that connect to the internet via many different gateways to the internet. Most of the users are behind a nat device, and connect to a SER proxy on the wireless net work on the 10.0.0.0/8 network. Each SER server keeps a local location database, but forwards any requests that it cannot complete to a sip proxy on the internet (to which each SER proxy replicates all REGISTER's). It looks a bit like this:
UAC(192.168.0.123)--->WIFI_AP(10.1.2.3)---->WIFI_GATEWAY_1--->INTERNET for browsing / email / ftp etc | | v SER_SERVER on WiFi network (10.0.0.123) also has (public IP Address)--->INTERNET GATEWAY for VOIP 1--->SER_SERVER on internet
^
| UAC(192.168.0.234)--->WIFI_AP(10.3.4.5)---->WIFI_GATEWAY_2--->INTERNET for browsing / email / ftp etc | | | | | v | SER_SERVER on WiFi network (10.3.4.123) | also has (public IP Address)--->INTERNET GATEWAY for VOIP 2-----
Each SER server implements it's own far end nat traversal based on nathelper/rtpproxy, which means that expensive internet links are not used to terminate calls between subscribers on the same wifi network.
The issue I was having with loose routing appeared to be because the SER_SERVER on the WiFi network was multihomed. When a reply cam back from the ser server on the internet (I think it was only ACK's causing the problem), SER tried to loose_route the reply and the next hop was infact the servers own internal ip address.
After loosing much hair, I worked out that if I included the condition I could get the packet to route through to the correct final destination. I am not sure if it's because there is a REAL issue with loose_route not working with mhomed properly, or if it's a peculiarity of my setup.
Noel
Greger V. Teigre wrote:
Noel, It would be interesting to get a description of the setup that caused this problem. Was that Asterisk as well? Same setup as Giovanni? Dependent on auth/non-auth and how Asterisk has been set up with SER, we have seen different problems with signalling and proxying of RTP. I know there was an lr vs. lr=on issue a while back, but somewhere we don't have RFC compliant behavior (all messages with routes should be loose routed). g-)
----- Original Message ----- From: "Noel Sharpe" noels@radnetwork.co.uk To: "Giovanni Balasso" giaso@yahoo.it Cc: serusers@lists.iptel.org Sent: Tuesday, November 15, 2005 10:14 AM Subject: Re: [Serusers] Too Many Hops
sounds to me like you have a looping problem in your script. I had something similar when using the example from OnSIP.org. The loose_route bit needed to be inside a condition: if (uri!=myself){ if (loose_route()) { route(1); }; }; xlog/ngrep is your friend here as you will be able to see which message is being sent between the two servers.
Noel
Giovanni Balasso wrote:
Alle 09:47, mercoledì 02 novembre 2005, Matteo Piazza ha scritto:
I have Ser and asterisk on the same machine. When i try to call with a SIP phone registred on asterisk another sip phone also registred on asterisk through SER I receve this error message: Too many hops
Too many hops is usually reached when there is no rule (or no way) to deliver sip message, adding some log(), or better xlog(), to your routing script could help you (and us) debugging and understanding what's wrong, and which method(s) fail.
if (method == "INVITE") { if (uri =~"^sip:0[0-9]*@*"){ log(1, "Check 1 succed Forwarding to Asterisk\n"); rewritehostport("192.168.9.97:5061"); t_relay(); break; }; };
I don't think this will solve your problem but in my experience I had better result with t_relay_to_udp("192.168.9.97","5061") than rewritehostport("192.168.9.97:5061").
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Noel, Thanks for taking the time to document your setup in such detail! In general, the Vias and record-routes must be fixed. The rr parameter enable_double_rr should be 1 (default). AFAIK, mhome=1 should handle the vias. This thread may give some more background: http://lists.iptel.org/pipermail/serdev/2003-April/000003.html
Have you tried using record_route_preset on outgoing (if I understand you setup?) to add the correct (public) address?
Also, unless mhome is on, the source address of the incoming packet will be used when sending out. This will be detected as a martian by the linux kernel (see /var/log/messages). mhome will use the correct source address and fix the vias.
Anyway, if your fix works, you should be fine, but remember that if you change your setup later (or add a new GW, new UAs...), you may run into problems as you are not following the RFC. g-)
----- Original Message ----- From: "Noel Sharpe" noels@radnetwork.co.uk To: "Greger V. Teigre" greger@teigre.com Cc: "'SER Users'" serusers@lists.iptel.org Sent: Wednesday, November 16, 2005 9:52 AM Subject: Re: [Serusers] Too Many Hops
Greger I am trying to get a cascading hierarchy of geographically separated SIP servers. The reason for this is that I am providing services to a wireless community that connect to the internet via many different gateways to the internet. Most of the users are behind a nat device, and connect to a SER proxy on the wireless net work on the 10.0.0.0/8 network. Each SER server keeps a local location database, but forwards any requests that it cannot complete to a sip proxy on the internet (to which each SER proxy replicates all REGISTER's). It looks a bit like this:
UAC(192.168.0.123)--->WIFI_AP(10.1.2.3)---->WIFI_GATEWAY_1--->INTERNET for browsing / email / ftp etc | | v SER_SERVER on WiFi network (10.0.0.123) also has (public IP Address)--->INTERNET GATEWAY for VOIP 1--->SER_SERVER on internet ^ | UAC(192.168.0.234)--->WIFI_AP(10.3.4.5)---->WIFI_GATEWAY_2--->INTERNET for browsing / email / ftp etc | | | | | v | SER_SERVER on WiFi network (10.3.4.123) | also has (public IP Address)--->INTERNET GATEWAY for VOIP 2-----
Each SER server implements it's own far end nat traversal based on nathelper/rtpproxy, which means that expensive internet links are not used to terminate calls between subscribers on the same wifi network. The issue I was having with loose routing appeared to be because the SER_SERVER on the WiFi network was multihomed. When a reply cam back from the ser server on the internet (I think it was only ACK's causing the problem), SER tried to loose_route the reply and the next hop was infact the servers own internal ip address.
After loosing much hair, I worked out that if I included the condition I could get the packet to route through to the correct final destination. I am not sure if it's because there is a REAL issue with loose_route not working with mhomed properly, or if it's a peculiarity of my setup.
Noel
Greger V. Teigre wrote:
Noel, It would be interesting to get a description of the setup that caused this problem. Was that Asterisk as well? Same setup as Giovanni? Dependent on auth/non-auth and how Asterisk has been set up with SER, we have seen different problems with signalling and proxying of RTP. I know there was an lr vs. lr=on issue a while back, but somewhere we don't have RFC compliant behavior (all messages with routes should be loose routed). g-)
----- Original Message ----- From: "Noel Sharpe" noels@radnetwork.co.uk To: "Giovanni Balasso" giaso@yahoo.it Cc: serusers@lists.iptel.org Sent: Tuesday, November 15, 2005 10:14 AM Subject: Re: [Serusers] Too Many Hops
sounds to me like you have a looping problem in your script. I had something similar when using the example from OnSIP.org. The loose_route bit needed to be inside a condition: if (uri!=myself){ if (loose_route()) { route(1); }; }; xlog/ngrep is your friend here as you will be able to see which message is being sent between the two servers.
Noel
Giovanni Balasso wrote:
Alle 09:47, mercoledì 02 novembre 2005, Matteo Piazza ha scritto:
I have Ser and asterisk on the same machine. When i try to call with a SIP phone registred on asterisk another sip phone also registred on asterisk through SER I receve this error message: Too many hops
Too many hops is usually reached when there is no rule (or no way) to deliver sip message, adding some log(), or better xlog(), to your routing script could help you (and us) debugging and understanding what's wrong, and which method(s) fail.
if (method == "INVITE") { if (uri =~"^sip:0[0-9]*@*"){ log(1, "Check 1 succed Forwarding to Asterisk\n"); rewritehostport("192.168.9.97:5061"); t_relay(); break; }; };
I don't think this will solve your problem but in my experience I had better result with t_relay_to_udp("192.168.9.97","5061") than rewritehostport("192.168.9.97:5061").
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Hi Greger
Thanks for the reply. I will try the suggestions you have made. I am using mhome=1. The trouble with the record_route_preset is that the outgoing interface is assigned by dhcp, so I will have to try use dyndns I think. I think it would be quite useful to be able to specify an interface name instead of an address - have not tried this and don't know if it could work. There are two RR entries in each forwarded message (one for the internal interface and one for the external interface). I guess I should do a trace and post that (with and without the if (uri!=myself) bit around the loose_routing. I will try get that done today.
The solution I have seems to work ok, but as you say, I don't know what problems I am making for myself futher along the line, so any feedback is most welcome. Thanks for your interest.
Noel
Greger V. Teigre wrote:
Noel, Thanks for taking the time to document your setup in such detail! In general, the Vias and record-routes must be fixed. The rr parameter enable_double_rr should be 1 (default). AFAIK, mhome=1 should handle the vias. This thread may give some more background: http://lists.iptel.org/pipermail/serdev/2003-April/000003.html
Have you tried using record_route_preset on outgoing (if I understand you setup?) to add the correct (public) address?
Also, unless mhome is on, the source address of the incoming packet will be used when sending out. This will be detected as a martian by the linux kernel (see /var/log/messages). mhome will use the correct source address and fix the vias.
Anyway, if your fix works, you should be fine, but remember that if you change your setup later (or add a new GW, new UAs...), you may run into problems as you are not following the RFC. g-)
----- Original Message ----- From: "Noel Sharpe" noels@radnetwork.co.uk To: "Greger V. Teigre" greger@teigre.com Cc: "'SER Users'" serusers@lists.iptel.org Sent: Wednesday, November 16, 2005 9:52 AM Subject: Re: [Serusers] Too Many Hops
Greger I am trying to get a cascading hierarchy of geographically separated SIP servers. The reason for this is that I am providing services to a wireless community that connect to the internet via many different gateways to the internet. Most of the users are behind a nat device, and connect to a SER proxy on the wireless net work on the 10.0.0.0/8 network. Each SER server keeps a local location database, but forwards any requests that it cannot complete to a sip proxy on the internet (to which each SER proxy replicates all REGISTER's). It looks a bit like this:
UAC(192.168.0.123)--->WIFI_AP(10.1.2.3)---->WIFI_GATEWAY_1--->INTERNET for browsing / email / ftp etc | | v SER_SERVER on WiFi network (10.0.0.123) also has (public IP Address)--->INTERNET GATEWAY for VOIP 1--->SER_SERVER on internet
^
| UAC(192.168.0.234)--->WIFI_AP(10.3.4.5)---->WIFI_GATEWAY_2--->INTERNET for browsing / email / ftp etc | | | | | v | SER_SERVER on WiFi network (10.3.4.123) | also has (public IP Address)--->INTERNET GATEWAY for VOIP 2-----
Each SER server implements it's own far end nat traversal based on nathelper/rtpproxy, which means that expensive internet links are not used to terminate calls between subscribers on the same wifi network. The issue I was having with loose routing appeared to be because the SER_SERVER on the WiFi network was multihomed. When a reply cam back from the ser server on the internet (I think it was only ACK's causing the problem), SER tried to loose_route the reply and the next hop was infact the servers own internal ip address.
After loosing much hair, I worked out that if I included the condition I could get the packet to route through to the correct final destination. I am not sure if it's because there is a REAL issue with loose_route not working with mhomed properly, or if it's a peculiarity of my setup.
Noel
Greger V. Teigre wrote:
Noel, It would be interesting to get a description of the setup that caused this problem. Was that Asterisk as well? Same setup as Giovanni? Dependent on auth/non-auth and how Asterisk has been set up with SER, we have seen different problems with signalling and proxying of RTP. I know there was an lr vs. lr=on issue a while back, but somewhere we don't have RFC compliant behavior (all messages with routes should be loose routed). g-)
----- Original Message ----- From: "Noel Sharpe" noels@radnetwork.co.uk To: "Giovanni Balasso" giaso@yahoo.it Cc: serusers@lists.iptel.org Sent: Tuesday, November 15, 2005 10:14 AM Subject: Re: [Serusers] Too Many Hops
sounds to me like you have a looping problem in your script. I had something similar when using the example from OnSIP.org. The loose_route bit needed to be inside a condition: if (uri!=myself){ if (loose_route()) { route(1); }; }; xlog/ngrep is your friend here as you will be able to see which message is being sent between the two servers.
Noel
Giovanni Balasso wrote:
Alle 09:47, mercoledì 02 novembre 2005, Matteo Piazza ha scritto:
I have Ser and asterisk on the same machine. When i try to call with a SIP phone registred on asterisk another sip phone also registred on asterisk through SER I receve this error message: Too many hops
Too many hops is usually reached when there is no rule (or no way) to deliver sip message, adding some log(), or better xlog(), to your routing script could help you (and us) debugging and understanding what's wrong, and which method(s) fail.
if (method == "INVITE") { if (uri =~"^sip:0[0-9]*@*"){ log(1, "Check 1 succed Forwarding to Asterisk\n"); rewritehostport("192.168.9.97:5061"); t_relay(); break; }; };
I don't think this will solve your problem but in my experience I had better result with t_relay_to_udp("192.168.9.97","5061") than rewritehostport("192.168.9.97:5061").
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Hi Greger
Thanks for the reply. I will try the suggestions you have made. I am using mhome=1. The trouble with the record_route_preset is that the outgoing interface is assigned by dhcp, so I will have to try use dyndns I think. I think it would be quite useful to be able to specify an interface name instead of an address - have not tried this and don't know if it could work. There are two RR entries in each forwarded message (one for the internal interface and one for the external interface). I guess I should do a trace and post that (with and without the if (uri!=myself) bit around the loose_routing. I will try get that done today.
The solution I have seems to work ok, but as you say, I don't know what problems I am making for myself futher along the line, so any feedback is most welcome. Thanks for your interest.
The problem is that you are not loose routing messages that are destined for your SER (uri!=myself). Loose routing means that the Route headers in in-dialog messages are used for forwarding the message. By not loose routing, but (probably) using lookup("location") or whatever you are doing to the messages that should have been loose routed (ex. ACKs), you are overriding the Routes. Your problem is that the routes are wrong in your particular setup, not loose routing is hack that makes your SER behave non-RFC compliant on Route headers and that may jump up and bite you down the road... g-)
Noel
Greger V. Teigre wrote:
Noel, Thanks for taking the time to document your setup in such detail! In general, the Vias and record-routes must be fixed. The rr parameter enable_double_rr should be 1 (default). AFAIK, mhome=1 should handle the vias. This thread may give some more background: http://lists.iptel.org/pipermail/serdev/2003-April/000003.html
Have you tried using record_route_preset on outgoing (if I understand you setup?) to add the correct (public) address?
Also, unless mhome is on, the source address of the incoming packet will be used when sending out. This will be detected as a martian by the linux kernel (see /var/log/messages). mhome will use the correct source address and fix the vias.
Anyway, if your fix works, you should be fine, but remember that if you change your setup later (or add a new GW, new UAs...), you may run into problems as you are not following the RFC. g-)
----- Original Message ----- From: "Noel Sharpe" noels@radnetwork.co.uk To: "Greger V. Teigre" greger@teigre.com Cc: "'SER Users'" serusers@lists.iptel.org Sent: Wednesday, November 16, 2005 9:52 AM Subject: Re: [Serusers] Too Many Hops
Greger I am trying to get a cascading hierarchy of geographically separated SIP servers. The reason for this is that I am providing services to a wireless community that connect to the internet via many different gateways to the internet. Most of the users are behind a nat device, and connect to a SER proxy on the wireless net work on the 10.0.0.0/8 network. Each SER server keeps a local location database, but forwards any requests that it cannot complete to a sip proxy on the internet (to which each SER proxy replicates all REGISTER's). It looks a bit like this:
UAC(192.168.0.123)--->WIFI_AP(10.1.2.3)---->WIFI_GATEWAY_1--->INTERNET for browsing / email / ftp etc | | v SER_SERVER on WiFi network (10.0.0.123) also has (public IP Address)--->INTERNET GATEWAY for VOIP 1--->SER_SERVER on internet
^
| UAC(192.168.0.234)--->WIFI_AP(10.3.4.5)---->WIFI_GATEWAY_2--->INTERNET for browsing / email / ftp etc | | | | | v | SER_SERVER on WiFi network (10.3.4.123) | also has (public IP Address)--->INTERNET GATEWAY for VOIP 2-----
Each SER server implements it's own far end nat traversal based on nathelper/rtpproxy, which means that expensive internet links are not used to terminate calls between subscribers on the same wifi network. The issue I was having with loose routing appeared to be because the SER_SERVER on the WiFi network was multihomed. When a reply cam back from the ser server on the internet (I think it was only ACK's causing the problem), SER tried to loose_route the reply and the next hop was infact the servers own internal ip address.
After loosing much hair, I worked out that if I included the condition I could get the packet to route through to the correct final destination. I am not sure if it's because there is a REAL issue with loose_route not working with mhomed properly, or if it's a peculiarity of my setup.
Noel
Greger V. Teigre wrote:
Noel, It would be interesting to get a description of the setup that caused this problem. Was that Asterisk as well? Same setup as Giovanni? Dependent on auth/non-auth and how Asterisk has been set up with SER, we have seen different problems with signalling and proxying of RTP. I know there was an lr vs. lr=on issue a while back, but somewhere we don't have RFC compliant behavior (all messages with routes should be loose routed). g-)
----- Original Message ----- From: "Noel Sharpe" noels@radnetwork.co.uk To: "Giovanni Balasso" giaso@yahoo.it Cc: serusers@lists.iptel.org Sent: Tuesday, November 15, 2005 10:14 AM Subject: Re: [Serusers] Too Many Hops
sounds to me like you have a looping problem in your script. I had something similar when using the example from OnSIP.org. The loose_route bit needed to be inside a condition: if (uri!=myself){ if (loose_route()) { route(1); }; }; xlog/ngrep is your friend here as you will be able to see which message is being sent between the two servers.
Noel
Giovanni Balasso wrote:
Alle 09:47, mercoledì 02 novembre 2005, Matteo Piazza ha scritto:
> I have Ser and asterisk on the same machine. > When i try to call with a SIP phone registred on asterisk another > sip > phone also registred on asterisk through SER I receve this error > message: > Too many hops >
Too many hops is usually reached when there is no rule (or no way) to deliver sip message, adding some log(), or better xlog(), to your routing script could help you (and us) debugging and understanding what's wrong, and which method(s) fail.
> if (method == "INVITE") { > if (uri =~"^sip:0[0-9]*@*"){ > log(1, "Check 1 succed Forwarding to Asterisk\n"); > rewritehostport("192.168.9.97:5061"); > t_relay(); > break; > }; > }; > >
I don't think this will solve your problem but in my experience I had better result with t_relay_to_udp("192.168.9.97","5061") than rewritehostport("192.168.9.97:5061").
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers