Estimados amigos del foro,
Anteriormente había tenido problemas en hacer un forward desde SER a Asterisk, este tema ya quedo resuelto. El problema que estoy teniendo ahora es el siguiente, detallo la estructura de mi red.
cliente sip-------internet------OpenSER------Internet-----Asterisk----- LAN
El efectuar una llamada desde cliente sip que esta en internet con una ip publica hacia un cliente sip que esta en la lan, esto funciona perfecto, en este caso el cliente esta registrado en OpenSer; ahora cuando un cliente de la lan que esta registrado en Asterisk quiere llamar a un cliente que esta registrado en open ser tengo problemas de loop, porque el INVITE de open ser hay un rewritehostport("xxx.xxx. xxx.xxx:5060"); al Asterisk. La pregunta es como puedo llamar de mi Asterisk a clientes que estan registrados en Open Ser.
Detallo config de OpenSER
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"); exit; }; if (msg:len >= max_len ) { sl_send_reply("513", "Message too big"); exit; };
# 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 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); exit; };
if (!uri==myself) { # mark routing logic in request append_hf("P-hint: outbound\r\n"); route(1); exit; }; if (is_method("INVITE")) { #record_route(); ## #force_rtp_proxy(); ##
rewritehostport("xxx.xxx.xxx.xxx:5060"); #t_on_reply("1"); ## t_relay(); return; #exit; }
# if the request is for other domain use UsrLoc # (in case, it does not work, use the following command # with proper names and addresses in it) if (uri==myself) { if (method=="REGISTER") { # digest authentication if (!www_authorize("", "subscriber")) { www_challenge("", "0"); exit; };
save("location"); exit; };
lookup("aliases"); if (!uri==myself) { append_hf("P-hint: outbound alias\r\n"); route(1); exit; };
# native SIP destinations are handled using our USRLOC DB if (!lookup("location")) { sl_send_reply("404", "Not Found"); exit; }; }; append_hf("P-hint: usrloc applied\r\n"); route(1); }
route[1] { # send it out now; use stateful forwarding as it works reliably # even for UDP2TCP if (!t_relay()) { sl_reply_error(); };
Saludos,
Si tu problema es el loop detected, consulta el historial de l alista, que hoy mismo lo ha comentado Iñaki en otro hilo. El problema es relativo a la incapacidad de Asterisk para gestionar la espiral SIP.
El Jueves, 24 de Enero de 2008, andresdb@adinet.com.uy escribió:
Piensa que Asterisk es un B2BUA, así que NO es el cliente LAN registrado en Asterisk el que llama al cliente registrado en OpenSer, es ASTERISK el que llama a ese cliente de OpenSer (y OpenSer sólo ruta la llamada).
Ahora, si cuando OpenSer recibe ese INVITE desde **ASTERISK** hace un: rewritehostport("IP_ASTERISK:5060")
entonces ocurrirá un loop que Asterisk no sabe detectar. Pero sobre todo, ¿por qué **** haces ese "rewritehostport"? es un error tuyo. Si quieres que ese INVITE desde Asterisk llegue al usuario registrado en OpenSer ¿por qué no haces un lookup("location")?
Buenas a todos de nuevo
Acabo de instalar Openser en una nueva máquina. Lo arranco y me cercioro que lo tengo arrancado en el 5060. Pero a la hora de hacer un Register (con un eyebeam) no me contesta, y depués de que éste hace varios intentos me acaba devolviendo un 408 Request Timeout. Con el Ethereal he visto que llegan las tramas a la máquina al 5060, así que no entiendo por qué el openser no las trata. El openser.cfg sólo lo he tocado para añadir esta línea disable_dns_blacklist=true ¿Alguna idea? Un saludo.
Puedes pegar la sección de tu cfg en la que manejas los REGISTER?
2008/1/25 David Vicente dvf231@tid.es:
Te pego el route, está sin tocar de la descarga, así que imagino que debería contestar, o a lo mejor me equivoco y no tiene implementado ni el Register (soy nuevo, hasta ahora solo había trabajado con instalaciones ya hechas).
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"); exit; };
if (msg:len >= 2048 ) { sl_send_reply("513", "Message too big"); exit; };
# 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 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); };
if (!uri==myself) { # mark routing logic in request append_hf("P-hint: outbound\r\n"); # if you have some interdomain connections via TLS #if(uri=~"@tls_domain1.net") { # t_relay("tls:domain1.net"); # exit; #} else if(uri=~"@tls_domain2.net") { # t_relay("tls:domain2.net"); # exit; #} route(1); };
# if the request is for other domain use UsrLoc # (in case, it does not work, use the following command # with proper names and addresses in it) if (uri==myself) {
if (method=="REGISTER") {
# Uncomment this if you want to use digest authentication #if (!www_authorize("openser.org", "subscriber")) { # www_challenge("openser.org", "0"); # exit; #};
save("location"); exit; };
lookup("aliases"); if (!uri==myself) { append_hf("P-hint: outbound alias\r\n"); route(1); };
# native SIP destinations are handled using our USRLOC DB if (!lookup("location")) { sl_send_reply("404", "Not Found"); exit; }; append_hf("P-hint: usrloc applied\r\n"); };
route(1); }
route[1] { # send it out now; use stateful forwarding as it works reliably # even for UDP2TCP if (!t_relay()) { sl_reply_error(); }; exit; }
Saúl Ibarra escribió:
Mira el ejemplo de aquí: http://siprouter.onsip.org/doc/gettingstarted/ch07.html
Creo que tienes que pedirle el auth, consume_credentials y tal...
PD: Mierda!!, estoy empezando ha medio-olvidar kosas!!!!!!!!!!
On Friday 25 January 2008 10:15:42 David Vicente wrote:
plis plisss... Para iniciar un nuevo hilo no le des a " Responder" sobre cualquier otro correo (aunque le cambies el asunto y borres el cuerpo) ya que en los clientes de correo que ordena por hilos siguiendo los estándares tu correo aparece colgando de otro hilo al que no pertenece: "Llamadas de Asterisk a OpenSER"
;)
Hola,
Pon el debug=9 y verás si el proxy está haciendo algo con esos REGISTER.
Saludos JesusR.
------------------------------------ Jesus Rodriguez VozTelecom Sistemas, S.L. jesusr@voztele.com http://www.voztele.com Tel. 902360305 -------------------------------------
Buenas de nuevo:
En primer lugar disculpas por haber creado mal el hilo, pensé que borrando todo lo cogería como un hilo.
He puesto el debug=9 y estas son las trazas que me salen, no veo a que se puede deber. Un saludo.
Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: Found param type 235, <rport> = <n/a>; state=17 Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: end of header reached, state=5 Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: parse_headers: Via found, flags=2 Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: parse_headers: this is the first via Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: After parse_msg... Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: preparing to run routing scripts... Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: parse_headers: flags=100 Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: get_hdr_field: cseq <CSeq>: <1> <REGISTER> Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: DEBUG:maxfwd:is_maxfwd_present: value = 70 Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: parse_headers: flags=200 Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: DEBUG: get_hdr_body : content_length=0 Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: found end of header Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: find_first_route: No Route headers found Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: loose_route: There is no Route HF Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: grep_sock_info - checking if host==us: 12==9 && [flanders-bis] == [127.0.0.1] Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: grep_sock_info - checking if port 5060 matches port 5060 Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: grep_sock_info - checking if host==us: 12==12 && [flanders-bis] == [10.95.46.240] Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: grep_sock_info - checking if port 5060 matches port 5060 Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: grep_sock_info - checking if host==us: 12==9 && [flanders-bis] == [127.0.0.1] Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: grep_sock_info - checking if port 5060 matches port 5060 Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: grep_sock_info - checking if host==us: 12==12 && [flanders-bis] == [10.95.46.240] Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: grep_sock_info - checking if port 5060 matches port 5060 Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: DEBUG:check_self: host != me Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: parse_headers: flags=ffffffffffffffff Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: DEBUG: t_newtran: T on entrance=0xffffffff Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: parse_headers: flags=ffffffffffffffff Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: parse_headers: flags=78 Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: t_lookup_request: start searching: hash=24338, isACK=0 Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: DEBUG: RFC3261 transaction matched, tid=-d87543-60819847-1--d87543- Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: DEBUG:tm:REF_UNSAFE: after is 1 Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: DEBUG: t_lookup_request: transaction found (T=0xb3f208d0) Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: DEBUG:tm:t_retransmit_reply: nothing to retransmit Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: DEBUG:tm:UNREF_UNSAFE: after is 0 Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: DEBUG:destroy_avp_list: destroying list (nil) Jan 25 09:38:47 flanders-bis /usr/sbin/openser[11221]: receive_msg: cleaning up
Jesus Rodriguez escribió:
Hola,
No, porque las cabeceras del mail (que normalmente tu cliente de mail no te enseña) son las mismas.
He puesto el debug=9 y estas son las trazas que me salen, no veo a que se puede deber.
Parece que tu proxy no considera como local el dominio que le estás enviado.
Saludos JesusR.
Saludos JesusR.
------------------------------------ Jesus Rodriguez VozTelecom Sistemas, S.L. jesusr@voztele.com http://www.voztele.com Tel. 902360305 -------------------------------------
Hola:
Nada, ando un poco desesperado. He metido el dominio que uso (que es el mismo nombre que el de la maquina para que los dns lo resuelvan bien) en el fichero openserctlrc, pero nada, no me devuelve el triste 200 ok.
(os dejo el log del Register por si veis algo que a mi se me escapa) Un saludo y gracias.
Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: SIP Request: Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: method: <REGISTER> Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: uri: sip:flanders-bis Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: version: <SIP/2.0> Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: parse_headers: flags=2 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: DEBUG:parse_to:end of header reached, state=10 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: DBUG:parse_to: display={luis}, ruri={sip:luis@flanders-bis} Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: DEBUG: get_hdr_field: <To> [29]; uri=[sip:luis@flanders-bis] Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: DEBUG: to body [luissip:luis@flanders-bis^M ] Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: Found param type 232, <branch> = <z9hG4bK-d87543-866019965-1--d87543->; state=6 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: Found param type 235, <rport> = <n/a>; state=17 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: end of header reached, state=5 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: parse_headers: Via found, flags=2 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: parse_headers: this is the first via Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: After parse_msg... Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: preparing to run routing scripts... Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: parse_headers: flags=100 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: get_hdr_field: cseq <CSeq>: <1> <REGISTER> Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: DEBUG:maxfwd:is_maxfwd_present: value = 70 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: parse_headers: flags=200 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: DEBUG: get_hdr_body : content_length=0 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: found end of header Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: find_first_route: No Route headers found Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: loose_route: There is no Route HF Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: grep_sock_info - checking if host==us: 12==9 && [flanders-bis] == [127.0.0.1] Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: grep_sock_info - checking if port 5060 matches port 5060 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: grep_sock_info - checking if host==us: 12==12 && [flanders-bis] == [10.95.46.240] Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: grep_sock_info - checking if port 5060 matches port 5060 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: grep_sock_info - checking if host==us: 12==9 && [flanders-bis] == [127.0.0.1] Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: grep_sock_info - checking if port 5060 matches port 5060 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: grep_sock_info - checking if host==us: 12==12 && [flanders-bis] == [10.95.46.240] Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: grep_sock_info - checking if port 5060 matches port 5060 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: DEBUG:check_self: host != me Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: URI!=MYSELF .............. Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: parse_headers: flags=ffffffffffffffff Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: DEBUG: t_newtran: T on entrance=0xffffffff Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: parse_headers: flags=ffffffffffffffff Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: parse_headers: flags=78 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: t_lookup_request: start searching: hash=21152, isACK=0 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: DEBUG: RFC3261 transaction matched, tid=-d87543-866019965-1--d87543- Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: DEBUG:tm:REF_UNSAFE: after is 1 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: DEBUG: t_lookup_request: transaction found (T=0xb3e72b00) Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: DEBUG:tm:t_retransmit_reply: nothing to retransmit Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: DEBUG:tm:UNREF_UNSAFE: after is 0 Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: DEBUG:destroy_avp_list: destroying list (nil) Jan 25 11:08:41 flanders-bis /usr/sbin/openser[2044]: receive_msg: cleaning up Jan 25 11:08:42 flanders-bis /usr/sbin/openser[2048]: DEBUG: timer routine:0,tl=0xb3e72c68 next=(nil), timeout=475 Jan 25 11:08:42 flanders-bis /usr/sbin/openser[2048]: DEBUG: final_response_handler:stop retr. and send CANCEL (0xb3e72b00) Jan 25 11:08:42 flanders-bis /usr/sbin/openser[2048]: DEBUG:tm:t_should_relay_response: T_code=0, new_code=408 Jan 25 11:08:42 flanders-bis /usr/sbin/openser[2048]: DEBUG:tm:t_pick_branch: picked branch 0, code 408 Jan 25 11:08:42 flanders-bis /usr/sbin/openser[2048]: DEBUG:tm:t_should_relay_response: dns-failover test: branch=0, last_recv=408, flags=0 Jan 25 11:08:42 flanders-bis /usr/sbin/openser[2048]: DEBUG:tm:t_should_relay_response: trying DNS-based failover Jan 25 11:08:42 flanders-bis /usr/sbin/openser[2048]: DEBUG:tm:relay_reply: branch=0, save=0, relay=0 Jan 25 11:08:42 flanders-bis /usr/sbin/openser[2048]: parse_headers: flags=ffffffffffffffff Jan 25 11:08:42 flanders-bis /usr/sbin/openser[2048]: check_via_address(10.95.44.27, 10.95.44.27, 0) Jan 25 11:08:42 flanders-bis /usr/sbin/openser[2048]: WARNING:vqm_resize: resize(0) called Jan 25 11:08:42 flanders-bis /usr/sbin/openser[2048]: DEBUG: add_to_tail_of_timer[2]: 0xb3e72b48 (480) Jan 25 11:08:42 flanders-bis /usr/sbin/openser[2048]: DEBUG:tm:relay_reply: sent buf=0x813ba28: SIP/2.0 4..., shmem=0xb3e74418: SIP/2.0 4 Jan 25 11:08:42 flanders-bis /usr/sbin/openser[2048]: DEBUG: final_response_handler : done Jan 25 11:08:45 flanders-bis /usr/sbin/openser[2048]: DEBUG: timer routine:7,tl=0xb3e72c4c next=(nil), timeout=477400000 Jan 25 11:08:47 flanders-bis /usr/sbin/openser[2048]: DEBUG: timer routine:2,tl=0xb3e72b48 next=(nil), timeout=480 Jan 25 11:08:47 flanders-bis /usr/sbin/openser[2048]: DEBUG: wait_handler : removing 0xb3e72b00 from table Jan 25 11:08:47 flanders-bis /usr/sbin/openser[2048]: DEBUG: delete transaction 0xb3e72b00 Jan 25 11:08:47 flanders-bis /usr/sbin/openser[2048]: DEBUG: wait_handler : done
Jesus Rodriguez escribió:
On Friday 25 January 2008 12:17:37 David Vicente wrote:
Una pista: OpenSer no hace una consulta DNS para saber si es responsable de un dominio.
Mira el uso de "if (uri==myself)", de los parámetros "alias" (en el core-book) y más adelante el módulo "domain".
Buenos días de nuevo: Sigo dando vueltas al tema. Por lo que me dijiste deduzco que lo normal es que entrara en el if(uri==myself). Lo que me liaba mucho y no entendía es que entrara en el otro if(!uri==myself). Yo supongo que si en el sip-phone pongo como proxy la máquina donde está el ser y no lleva ninguna cabecera record-route ni nada por el estilo, debería entrar en el if que tú comentas. Por eso me he liado bastante. He puesto antes estas líneas y ya me registra bien, pero claro, es un poco apaño.
if(method=="REGISTER") { save("location"); exit; }
No sé si teneis alguna idea. Un saludo y gracias.
Iñaki Baz Castillo escribió:
On Monday 28 January 2008 10:11:44 David Vicente wrote:
¿Pero ya has buscado lo que significa "myself" exactamente? http://www.openser.org/dokuwiki/doku.php/core-cookbook:1.3.x#myself
sr-users-es@lists.kamailio.org