define('DISALLOW_FILE_EDIT', true);
define('DISALLOW_FILE_MODS', true);{"id":69,"date":"2011-02-25T02:41:08","date_gmt":"2011-02-25T01:41:08","guid":{"rendered":"http:\/\/www.monovarlinux.org\/?p=69"},"modified":"2012-05-29T02:14:43","modified_gmt":"2012-05-29T01:14:43","slug":"asterisk-audio-en-un-solo-sentido","status":"publish","type":"post","link":"http:\/\/www.monovarlinux.org\/?p=69","title":{"rendered":"Asterisk.  Audio en un solo sentido llamadas entrantes. Incoming Calls"},"content":{"rendered":"<p>Hola.<\/p>\n<p>Sigo con mi implementaci\u00f3n de asterisk en gentoo y vengo a contar como solucionar un problemita con este&#8230;<\/p>\n<p>Actualmente estoy saliendo a la Red Telefonica B\u00e1sica (<strong>RTB<\/strong>), red de telefonia de toda la vida, por un <strong>proveedor voip<\/strong>.<br \/>\nPara enrutar llamadas por este, no hubo m\u00e1s problemas. Registrar nuestro asterisk con el proveedor, a\u00f1adir un canal para este en sip.conf y crear un dialplan para sacar llamadas por ahi y FIN.<\/p>\n<p>El problema no era ese, el problema era al intentar recibir llamadas. Tengo varios numeros <strong>DID<\/strong> asignados a varias extensiones de mi asterisk con lo cual es fundamental que puedan entrar llamadas, y estas lo hacian, pero solo tenia audio en 1 sentido (de dentro hacia fuera), el usuario que me llamaba yo no lo podia escuchar, el a mi perfectamente&#8230;<\/p>\n<p>*Problema de <strong>NAT<\/strong> no era, ya que estaba trabajando fuera de un entorno con <strong>NAT<\/strong><br \/>\n**por lo menos por mi parte, parece ser que por la del operador de n\u00fameros <strong>DID<\/strong> no<\/p>\n<p>Lo primero que hice en este caso fu\u00e9 entrar a la consola de asterik:<\/p>\n<blockquote><p>asterisk -r<\/p><\/blockquote>\n<p>Y hacer un <strong>debug<\/strong> del protocolo <strong>RTP<\/strong> para ver que es lo que estaba pasando con los paquetes&#8230;.<\/p>\n<blockquote style=\"text-align: left;\"><p>rtp set debug on<\/p><\/blockquote>\n<p>He aqui el resultado:<\/p>\n<blockquote><p>Got\u00a0 RTP packet from\u00a0\u00a0\u00a0 192.168.10.15:16406 (type 08, seq 014191, ts 392580221, len 000160)<br \/>\nSent RTP packet to\u00a0\u00a0\u00a0\u00a0\u00a0 46.19.209.78:17962 (type 08, seq 026450, ts 392580216, len 000160)<br \/>\nGot\u00a0 RTP packet from\u00a0\u00a0\u00a0 192.168.10.15:16406 (type 08, seq 014192, ts 392580381, len 000160)<br \/>\nSent RTP packet to\u00a0\u00a0\u00a0\u00a0\u00a0 46.19.209.78:17962 (type 08, seq 026451, ts 392580376, len 000160)<br \/>\nGot\u00a0 RTP packet from\u00a0\u00a0\u00a0 192.168.10.15:16406 (type 08, seq 014193, ts 392580541, len 000160)<br \/>\nSent RTP packet to\u00a0\u00a0\u00a0\u00a0\u00a0 46.19.209.78:17962 (type 08, seq 026452, ts 392580536, len 000160)<br \/>\nGot\u00a0 RTP packet from\u00a0\u00a0\u00a0 192.168.10.15:16406 (type 08, seq 014194, ts 392580701, len 000160)<br \/>\nSent RTP packet to\u00a0\u00a0\u00a0\u00a0\u00a0 46.19.209.78:17962 (type 08, seq 026453, ts 392580696, len 000160)<br \/>\nGot\u00a0 RTP packet from\u00a0\u00a0\u00a0 192.168.10.15:16406 (type 08, seq 014195, ts 392580861, len 000160)<br \/>\nSent RTP packet to\u00a0\u00a0\u00a0\u00a0\u00a0 46.19.209.78:17962 (type 08, seq 026454, ts 392580856, len 000160)<br \/>\nGot\u00a0 RTP packet from\u00a0\u00a0\u00a0 192.168.10.15:16406 (type 08, seq 014196, ts 392581021, len 000160)<br \/>\nSent RTP packet to\u00a0\u00a0\u00a0\u00a0\u00a0 46.19.209.78:17962 (type 08, seq 026455, ts 392581016, len 000160)<br \/>\nGot\u00a0 RTP packet from\u00a0\u00a0\u00a0 192.168.10.15:16406 (type 08, seq 014197, ts 392581181, len 000160)<br \/>\nSent RTP packet to\u00a0\u00a0\u00a0\u00a0\u00a0 46.19.209.78:17962 (type 08, seq 026456, ts 392581176, len 000160)<br \/>\nGot\u00a0 RTP packet from\u00a0\u00a0\u00a0 192.168.10.15:16406 (type 08, seq 014198, ts 392581341, len 000160)<br \/>\nSent RTP packet to\u00a0\u00a0\u00a0\u00a0\u00a0 46.19.209.78:17962 (type 08, seq 026457, ts 392581336, len 000160)<br \/>\nGot\u00a0 RTP packet from\u00a0\u00a0\u00a0 192.168.10.15:16406 (type 08, seq 014199, ts 392581501, len 000160)<br \/>\nSent RTP packet to\u00a0\u00a0\u00a0\u00a0\u00a0 46.19.209.78:17962 (type 08, seq 026458, ts 392581496, len 000160)<br \/>\nGot\u00a0 RTP packet from\u00a0\u00a0\u00a0 192.168.10.15:16406 (type 08, seq 014200, ts 392581661, len 000160)<br \/>\nSent RTP packet to\u00a0\u00a0\u00a0\u00a0\u00a0 46.19.209.78:17962 (type 08, seq 026459, ts 392581656, len 000160)<\/p><\/blockquote>\n<p>Me pus\u00e9 a leer de cabo a rabo el fichero sip.conf que trae asterisk de ejemplo y me encuentro con:<\/p>\n<blockquote><p>;directmedia=yes\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ; Asterisk by default tries to redirect the<br \/>\n; RTP media stream to go directly from<br \/>\n; the caller to the callee.\u00a0 Some devices do not<br \/>\n; support this (especially if one of them is behind a NAT).<br \/>\n; The default setting is YES. If you have all clients<br \/>\n; behind a NAT, or for some other reason want Asterisk to<br \/>\n; stay in the audio path, you may want to turn this off.<\/p><\/blockquote>\n<p>Nos dice que asterisk querr\u00e1 establecer una conexi\u00f3n <strong>DIRECTA<\/strong> con el usuario que llama y el usuario que contesta a la llamada. Esto no es soportable por algunos dispositivos,especialmente si estan detr\u00e1s de <strong>NAT<\/strong>&#8230;&#8230;.. Esta opci\u00f3n es interesante cuando nos encontramos en un entorno LAN sin dispositivos NAT por enmedio, ya que la comunicaci\u00f3n se har\u00e1 directamente entre los 2 interlocutores. Si hay dispositivos NAT por enmedio es MUY recomendable desactivar dicha opci\u00f3n. (por defecto <strong>directmedia<\/strong> esta en<strong> YES<\/strong>)<\/p>\n<p>Ahi tenia la respuesta&#8230;directmedia estaba en yes por defecto&#8230;. fu\u00ed al fichero sip.conf y a\u00f1ad\u00ed:<\/p>\n<blockquote><p>[general]<br \/>\ndirectmedia=off<\/p><\/blockquote>\n<p>Reinicio asterisk con:<\/p>\n<blockquote><p>asterisk -r<br \/>\ncore restart now<\/p><\/blockquote>\n<p>&#8230;&#8230;..Realizo la llamada desde el exterior, descuelgo el telefono que suena y olalalal!!!!! funci\u00f3na el audio en 2 sentidos..<br \/>\nSi ahora hacemos un: debug de rtp observamos lo siguiente&#8230;.<\/p>\n<blockquote><p>Sent RTP P2P packet to 46.19.209.76:19818 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 192.168.10.15:16410 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 46.19.209.76:19818 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 192.168.10.15:16410 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 46.19.209.76:19818 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 192.168.10.15:16410 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 46.19.209.76:19818 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 192.168.10.15:16410 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 46.19.209.76:19818 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 192.168.10.15:16410 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 46.19.209.76:19818 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 192.168.10.15:16410 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 46.19.209.76:19818 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 192.168.10.15:16410 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 46.19.209.76:19818 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 192.168.10.15:16410 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 46.19.209.76:19818 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 192.168.10.15:16410 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 46.19.209.76:19818 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 192.168.10.15:16410 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 46.19.209.76:19818 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 192.168.10.15:16410 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 46.19.209.76:19818 (type 08, len 000160)<br \/>\nSent RTP P2P packet to 192.168.10.15:16410 (type 08, len 000160)<\/p><\/blockquote>\n<p>Esto es todo por hoy, espero que mis cabezazos contra la pared impidan que otros se los de por esto jeje.<\/p>\n<p>Un saludo.<\/p>\n<div class=\"be-social\" data-url=\"http:\/\/www.monovarlinux.org\/?p=69\" data-base=\"\" data-title=\"Asterisk.  Audio en un solo sentido llamadas entrantes. Incoming Calls\" data-track=\"true\" data-via=\"\" data-show=\"{&quot;facebook&quot;:true,&quot;twitter&quot;:true,&quot;google&quot;:true,&quot;reddit&quot;:true,&quot;linkedin&quot;:true,&quot;meneame&quot;:true}\" ><h2 class=\"be-social-title\">Share<\/h2><\/div>","protected":false},"excerpt":{"rendered":"<p>Hola. Sigo con mi implementaci\u00f3n de asterisk en gentoo y vengo a contar como solucionar un problemita con este&#8230; Actualmente estoy saliendo a la Red Telefonica B\u00e1sica (RTB), red de telefonia de toda la vida, por un proveedor voip. Para &hellip; <a href=\"http:\/\/www.monovarlinux.org\/?p=69\">Sigue leyendo <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[],"_links":{"self":[{"href":"http:\/\/www.monovarlinux.org\/index.php?rest_route=\/wp\/v2\/posts\/69"}],"collection":[{"href":"http:\/\/www.monovarlinux.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.monovarlinux.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.monovarlinux.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.monovarlinux.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=69"}],"version-history":[{"count":7,"href":"http:\/\/www.monovarlinux.org\/index.php?rest_route=\/wp\/v2\/posts\/69\/revisions"}],"predecessor-version":[{"id":71,"href":"http:\/\/www.monovarlinux.org\/index.php?rest_route=\/wp\/v2\/posts\/69\/revisions\/71"}],"wp:attachment":[{"href":"http:\/\/www.monovarlinux.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=69"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.monovarlinux.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=69"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.monovarlinux.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}