<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>La Cofradía Digital &#187; Tips técnicos</title>
	<atom:link href="http://cofradia.org/category/tips-tecnicos/feed/" rel="self" type="application/rss+xml" />
	<link>http://cofradia.org</link>
	<description>Hermandad informática</description>
	<lastBuildDate>Thu, 02 Sep 2010 01:17:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Utilizando 3 capas de autentificación en SSH</title>
		<link>http://cofradia.org/2010/09/01/utilizando-3-capas-de-autentificacion-en-ssh/</link>
		<comments>http://cofradia.org/2010/09/01/utilizando-3-capas-de-autentificacion-en-ssh/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 17:32:44 +0000</pubDate>
		<dc:creator>solrac</dc:creator>
				<category><![CDATA[Paranoia Fan Club]]></category>
		<category><![CDATA[Seguridad Informática]]></category>
		<category><![CDATA[Tips técnicos]]></category>
		<category><![CDATA[AIX]]></category>
		<category><![CDATA[HP-UX]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=3694</guid>
		<description><![CDATA[Nos mandan un artículo de como crear un metodo de autentificación de varias capas usando SSH y PAM para hacer mas seguros los accesos a nuestros sistemas Security always requires a multi-layered scheme. SSH is a good example of this. Methods range from simple sshd configuration through the use of PAM to specify who can [...]]]></description>
			<content:encoded><![CDATA[<p>Nos mandan un artículo de como crear un metodo de autentificación de varias capas usando SSH y PAM para hacer mas seguros los accesos a nuestros sistemas</p>
<blockquote><p>
Security always requires a multi-layered scheme. SSH is a good example of this. Methods range from simple sshd configuration through the use of PAM to specify who can use SSH, to application of port-knocking techniques, or to hide the fact that SSH access even exists. Applying <a href="http://www.ibm.com/developerworks/aix/library/au-sshlocks/index.html?cmp=dw&amp;cpb=dwaix&amp;ct=dwgra-3SSHlocks&amp;cr=lnxw13&amp;ccy=us">these techniques</a> can make life much harder for possible intruders, who will have to go past three unusual barriers.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2010/09/01/utilizando-3-capas-de-autentificacion-en-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mantenimiento del File system de Linux</title>
		<link>http://cofradia.org/2010/08/25/mantenimiento-del-file-system-de-linux/</link>
		<comments>http://cofradia.org/2010/08/25/mantenimiento-del-file-system-de-linux/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 03:14:25 +0000</pubDate>
		<dc:creator>solrac</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sistemas Operativos]]></category>
		<category><![CDATA[Tips técnicos]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Filesystems]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[SUSE]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=3650</guid>
		<description><![CDATA[Nos mandan un artículo introductorio al mantenimiento del sistema de archivos en sistemas con Linux&#8230; Learn how to check the integrity of your Linux filesystems, monitor free space, and fix simple problems. Use the material in this article to study for the Linux Professional Institute (LPI) 101 exam for Linux system administrator certification—or just to [...]]]></description>
			<content:encoded><![CDATA[<p>Nos mandan un artículo introductorio al mantenimiento del sistema de archivos en sistemas con Linux&#8230;</p>
<blockquote><p>
Learn how to <a href="http://www.ibm.com/developerworks/linux/library/l-lpic1-v3-104-2/index.html?ca=dgr-lnxw13TracjLXFilesystems">check the integrity of your Linux filesystems</a>, monitor free space, and fix simple problems. Use the material in this article to study for the Linux Professional Institute (LPI) 101 exam for Linux system administrator certification—or just to check your filesystems and keep them in good working order, especially after a system crash or power loss.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2010/08/25/mantenimiento-del-file-system-de-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducción a esquemas de Fail-Over usando PowerHA</title>
		<link>http://cofradia.org/2010/08/24/introduccion-a-esquemas-de-fail-over-usando-powerha/</link>
		<comments>http://cofradia.org/2010/08/24/introduccion-a-esquemas-de-fail-over-usando-powerha/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 17:05:30 +0000</pubDate>
		<dc:creator>solrac</dc:creator>
				<category><![CDATA[Sistemas Operativos]]></category>
		<category><![CDATA[Tips técnicos]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[AIX]]></category>
		<category><![CDATA[HP-UX]]></category>
		<category><![CDATA[Power]]></category>
		<category><![CDATA[PowerHA]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[sysAdmin]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=3629</guid>
		<description><![CDATA[Nos mandan un artículo sobre como implementar esquemas de Fail-over en sistemas AIX. Independientemente del operativo que menciona, se me hace una buena referencia introductoria a esquemas de Fail-over para cualquier sistema operativo: PowerHA for AIX is the new name for HACMP (High Availability Cluster Multiprocessing). HACMP is an application that makes system fault resilient [...]]]></description>
			<content:encoded><![CDATA[<p>Nos mandan un artículo sobre como implementar esquemas de Fail-over en sistemas AIX. Independientemente del operativo que menciona, se me hace una buena referencia introductoria a esquemas de Fail-over para cualquier sistema operativo:</p>
<blockquote><p>
PowerHA for AIX is the new name for HACMP (High Availability Cluster Multiprocessing). HACMP is an application that makes system fault resilient and reduces downtime of applications. <a href="http://www.ibm.com/developerworks/aix/library/au-powerhaintro/index.html?ca=dgr-lnxw13POWER-HACMPdth-AIX">This article introduces PowerHA</a> and provides a detailed explanation of how to configure a two node cluster. This document is very useful for understanding PowerHA and setting up a two node cluster.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2010/08/24/introduccion-a-esquemas-de-fail-over-usando-powerha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bazaar: Un poderoso control de versiones para desarrolladores</title>
		<link>http://cofradia.org/2010/08/20/bazaar-un-poderoso-control-de-versiones-para-desarrolladores/</link>
		<comments>http://cofradia.org/2010/08/20/bazaar-un-poderoso-control-de-versiones-para-desarrolladores/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 15:54:24 +0000</pubDate>
		<dc:creator>solrac</dc:creator>
				<category><![CDATA[Programacion]]></category>
		<category><![CDATA[Tips técnicos]]></category>
		<category><![CDATA[AIX]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[HP-UX]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[SUSE]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=3619</guid>
		<description><![CDATA[Nosn mandan un artículo introductorio a Bazaar, que es un sistema controlador de versiones tipo CVS, Subversion, GIT, etc. Bazaar is used to produce the Ubuntu Linux distribution, which is an enormous software project with thousands of components. If you&#8217;re using a UNIX or Linux system, chances are that your distribution offers a pre-built Bazaar [...]]]></description>
			<content:encoded><![CDATA[<p>Nosn mandan un artículo introductorio a <A HREF="http://bazaar.canonical.com/en/">Bazaar</A>, que es un sistema controlador de versiones tipo CVS, Subversion, GIT, etc.</p>
<blockquote><p>
Bazaar is used to produce the Ubuntu Linux distribution, which is an enormous software project with thousands of components. If you&#8217;re using a UNIX or Linux system, chances are that your distribution offers a pre-built Bazaar package. Bazaar is flexible enough to accommodate Subversion &#8211; a centralized system and Git &#8211; a decentralized system. This article <a href="http://www.ibm.com/developerworks/aix/library/au-spunix_bazaar/index.html?ca=dgr-lnxw13Bazaardth-LX">introduces you to Bazaar</a>&#8216;s many appealing features.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2010/08/20/bazaar-un-poderoso-control-de-versiones-para-desarrolladores/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aprendiendo FC++: La libreria de &#8220;functional programming&#8221; de C++</title>
		<link>http://cofradia.org/2010/08/18/aprendiendo-fc-la-libreria-de-functional-programming-de-c/</link>
		<comments>http://cofradia.org/2010/08/18/aprendiendo-fc-la-libreria-de-functional-programming-de-c/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 17:29:39 +0000</pubDate>
		<dc:creator>solrac</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[Tips técnicos]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=3596</guid>
		<description><![CDATA[Nos mandan esta nota sobre FC++, que es una programación funcional utilizando C++: C++ is usually synonymous with object-oriented programming (OOP), and further replenished in no small measure by popular technical literature. This article tries something different—functional programming with C++ using the open source FC++ library from Yannis Smaragdakis and Brian McNamara. Learn how you [...]]]></description>
			<content:encoded><![CDATA[<p>Nos mandan esta nota sobre FC++, que es una programación funcional utilizando C++:</p>
<blockquote><p>
C++ is usually synonymous with object-oriented programming (OOP), and further replenished in no small measure by popular technical literature. This article tries something different—functional programming with C++ <a href="http://www.ibm.com/developerworks/aix/library/au-learningfc/index.html?ca=dgr-lnxw13FCPPdth-AIX">using the open source FC++ library</a> from Yannis Smaragdakis and Brian McNamara. Learn how you can use FC++ to implement basic functional programming.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2010/08/18/aprendiendo-fc-la-libreria-de-functional-programming-de-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cambiando el tamaño de particiones con Gparted</title>
		<link>http://cofradia.org/2010/08/14/cambiando-el-tamano-de-particiones-con-gparted/</link>
		<comments>http://cofradia.org/2010/08/14/cambiando-el-tamano-de-particiones-con-gparted/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 06:32:37 +0000</pubDate>
		<dc:creator>solrac</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sistemas Operativos]]></category>
		<category><![CDATA[Tips técnicos]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[SUSE]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=3581</guid>
		<description><![CDATA[Nos mandan un artículo sobre como cambiar el tamaño de particiones en un file system previamente creado: Several tools exist to Resizing Linux partitions, but there are a number of potential pitfalls and restrictions that can make the task more difficult than it might at first seem. This article guides you through the task of [...]]]></description>
			<content:encoded><![CDATA[<p>Nos mandan un artículo sobre como cambiar el tamaño de particiones en un file system previamente creado:</p>
<blockquote><p>
Several tools exist to Resizing Linux partitions, but there are a number of potential pitfalls and restrictions that can make the task more difficult than it might at first seem. This article guides you through <a href="http://www.ibm.com/developerworks/linux/library/l-resizing-partitions-1/index.html?ca=dgr-lnxw13LXPartitionsdth-LX">the task of resizing Linux partitions</a>, beginning with basic preparations and moving on to common resizing scenarios using graphical user interface (GUI) tools.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2010/08/14/cambiando-el-tamano-de-particiones-con-gparted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>El poder de la linea de comando en UNIX</title>
		<link>http://cofradia.org/2010/08/12/el-poder-de-la-linea-de-comando-en-unix/</link>
		<comments>http://cofradia.org/2010/08/12/el-poder-de-la-linea-de-comando-en-unix/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 01:02:25 +0000</pubDate>
		<dc:creator>solrac</dc:creator>
				<category><![CDATA[Sistemas Operativos]]></category>
		<category><![CDATA[Tips técnicos]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Discover the essential UNIX utilities that deliver the entire world to your command line]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=3536</guid>
		<description><![CDATA[One of the most novel and differentiating features of a UNIX system is its command line. With just a few keystrokes, including a bit of &#8220;glue&#8221;, you can use the command line to combine the finite set of UNIX utilities into innumerable, impromptu data transforms. These articles will teach you the basics of the UNIX [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>
One of the most novel and differentiating features of a UNIX system is its command line. With just a few keystrokes, including a bit of &#8220;glue&#8221;, you can use the command line to combine the finite set of UNIX utilities into innumerable, impromptu data transforms. These articles will teach you the basics of the UNIX shell and discover how you can use the command line:</p>
<ul>
<li> <a href="http://www.ibm.com/developerworks/aix/library/au-unix-commandline/index.html?ca=dgr-lnxw13UX-Shell-CMDline1DTH-AIX"> Command the power of the command line </a> </li>
<li> <a href="http://www.ibm.com/developerworks/aix/library/au-speakingunix3.html?ca=dgr-lnxw13UX-Shell-CMDline2DTH-AIX"> Do everything right from the command line </a> </li>
<li> <a href="http://www.ibm.com/developerworks/aix/library/au-speakingunix7.html?ca=dgr-lnxw13UX-Shell-CMDline3DTH-AIX"> Command-line locution &#8211; Expand your UNIX vocabulary </a> </li>
<li> <a href="http://www.ibm.com/developerworks/aix/library/au-speakingunix13/index.html?ca=dgr-lnxw13UX-Shell-CMDline4DTH-AIX"> Ten more command-line concoctions </a> </li>
</ul>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2010/08/12/el-poder-de-la-linea-de-comando-en-unix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Demo de marcación automática con Asterisk para Campus Party</title>
		<link>http://cofradia.org/2010/08/10/demo-de-marcacion-automatica-con-asterisk-para-campus-party/</link>
		<comments>http://cofradia.org/2010/08/10/demo-de-marcacion-automatica-con-asterisk-para-campus-party/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 14:00:08 +0000</pubDate>
		<dc:creator>El Pop</dc:creator>
				<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[Humor]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[Tips técnicos]]></category>
		<category><![CDATA[VoIP]]></category>
		<category><![CDATA[Campus Party]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=3542</guid>
		<description><![CDATA[Cuando salga esta nota, yo estaré impartinedo una conferencia en Campus Party 2010 sobre marcación automática usando Asterisk. Hice un pequeño programa en perl llamado &#8220;joder.pl&#8221; que hace exactamente lo que su nombre dice. Pones un número a marcar y el lapso en segundos y marca a un teléfono victima y repite esto hasta que [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cofradia.org/wp-content/uploads/2010/08/cp_2.jpg"><img src="http://cofradia.org/wp-content/uploads/2010/08/cp_2-300x199.jpg" alt="" title="cp_2" width="300" height="199" class="alignleft size-medium wp-image-3556" /></a></p>
<p>Cuando salga esta nota, yo estaré impartinedo una conferencia en <A HREF="http://www.campus-party.com.mx/2010/index.html">Campus Party 2010</A> sobre marcación automática usando Asterisk.</p>
<p>Hice un pequeño programa en perl llamado &#8220;joder.pl&#8221; que hace exactamente lo que su nombre dice. </p>
<p>Pones un número a marcar y el lapso en segundos y marca a un teléfono victima y repite esto hasta que interrumpes el programa.</p>
<p>Es una versión muy simplificada de un marcador, pero es para mostrar las posibilidades infinitas para crear programas interesantes&#8230;<br />
<span id="more-3542"></span></p>
<p>Antes que nada es necesario tener una instalación de <A HREF="http://www.asterisk.org/">Asterisk</A> operando y con lo siguiente en sus archivos de configuración:</p>
<p>en el archivo /etc/asterisk/manager.conf deben de tener algo así:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[general]
displaysystemname = yes
enabled = yes
;webenabled = yes
port = 5038
bindaddr = 0.0.0.0
&nbsp;
[test]
secret = test
writetimeout = 100000
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user</pre></div></div>

<p>En el archivo de dialplan de Asterisk conocido como /etc/asterisk/extensions.conf debera estar algo así:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[dial]
exten =&gt; 666,1,Playback(tt-monkeys)
exten =&gt; 666,n,hangup</pre></div></div>

<p>Al invocar el programa así:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">./joder.pl 56581111 30</pre></div></div>

<p>El programa marca a la Profeco y cada 30 segundos hace lo mismo, al contestar toca un audio de &#8220;changos&#8221;, hasta que interrumpimos el programa con un control+C.</p>
<p>En este caso estamos usando un API de Asterisk conocidop como <A HREF="http://www.voip-info.org/wiki/view/Asterisk+manager+API">AMI</A> (Asterisk Manager Interface).</p>
<p>El programa se deja para fines didácticos y no nos hacemos responsables de su uso, y menos del gasto telefónico que esto genere.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
<span style="color: #666666; font-style: italic;">#====================================================================#</span>
<span style="color: #666666; font-style: italic;"># Program =&gt; joder.pl                                  (In Perl 5.x) #</span>
<span style="color: #666666; font-style: italic;">#====================================================================#</span>
<span style="color: #666666; font-style: italic;"># Autor         =&gt; Fernando &quot;El Pop&quot; Romo         (pop@cofradia.org) #</span>
<span style="color: #666666; font-style: italic;"># Creation date =&gt; 10/Aug/2010                                       #</span>
<span style="color: #666666; font-style: italic;">#--------------------------------------------------------------------#</span>
<span style="color: #666666; font-style: italic;"># Info =&gt; This program is a litle demostration of automatic dialing. #</span>
<span style="color: #666666; font-style: italic;">#         take the phone argument and make a lot of disturbing       #</span>
<span style="color: #666666; font-style: italic;">#         calls.                                                     #</span>
<span style="color: #666666; font-style: italic;">#--------------------------------------------------------------------#</span>
<span style="color: #666666; font-style: italic;">#               (c) 2010 - Fernando Romo / Incuvox                   #</span>
<span style="color: #666666; font-style: italic;">#--------------------------------------------------------------------#</span>
<span style="color: #666666; font-style: italic;"># This code are released under the GPL License. Any change must be   #</span>
<span style="color: #666666; font-style: italic;"># report to the authors                                              #</span>
<span style="color: #666666; font-style: italic;">#====================================================================#</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Load Modules</span>
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> POSIX<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> IO<span style="color: #339933;">::</span><span style="color: #006600;">Socket</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Socket<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Fcntl<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># signal traps</span>
<span style="color: #0000ff;">$SIG</span><span style="color: #009900;">&#123;</span>PIPE<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'IGNORE'</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$SIG</span><span style="color: #009900;">&#123;</span>INT<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$SIG</span><span style="color: #009900;">&#123;</span>TERM<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$SIG</span><span style="color: #009900;">&#123;</span>HUP<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'Terminate'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Number to dial</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$Number_To_Dial</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$Delay</span>          <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Socket handler for Asterisk</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$asterisk_handler</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Flags to connect to Asterisk</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$manager_connect_flag</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#--------------------------------------------------------------------</span>
<span style="color: #666666; font-style: italic;"># [Pop] Developer Note: The Sys_Parms() load the necesary values from</span>
<span style="color: #666666; font-style: italic;"># the Parameter table in the DB. I left this values comment for test</span>
<span style="color: #666666; font-style: italic;"># and documentation purposes.</span>
<span style="color: #666666; font-style: italic;">#--------------------------------------------------------------------</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">%Parm</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Dial parametrs</span>
<span style="color: #0000ff;">$Parm</span><span style="color: #009900;">&#123;</span>dialer<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>timeout<span style="color: #009900;">&#125;</span>          <span style="color: #339933;">=</span> <span style="color: #cc66cc;">30000</span><span style="color: #339933;">;</span>        <span style="color: #666666; font-style: italic;"># Dial Timeout</span>
<span style="color: #0000ff;">$Parm</span><span style="color: #009900;">&#123;</span>dialer<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>absolute_timeout<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">180</span><span style="color: #339933;">;</span>          <span style="color: #666666; font-style: italic;"># absolute max time of a call in seconds, 0 = no limit</span>
<span style="color: #0000ff;">$Parm</span><span style="color: #009900;">&#123;</span>dialer<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>caller_id<span style="color: #009900;">&#125;</span>        <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;5556581111&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;"># Caller_ID to report to carrier (for SIP trunking)</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#  Asterisk manager parameters</span>
<span style="color: #0000ff;">$Parm</span><span style="color: #009900;">&#123;</span>asterisk<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>host<span style="color: #009900;">&#125;</span>     <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;127.0.0.1&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;"># IP address of * Server</span>
<span style="color: #0000ff;">$Parm</span><span style="color: #009900;">&#123;</span>asterisk<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>port<span style="color: #009900;">&#125;</span>     <span style="color: #339933;">=</span> <span style="color: #cc66cc;">5038</span><span style="color: #339933;">;</span>        <span style="color: #666666; font-style: italic;"># * manager port</span>
<span style="color: #0000ff;">$Parm</span><span style="color: #009900;">&#123;</span>asterisk<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>user<span style="color: #009900;">&#125;</span>     <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;test&quot;</span><span style="color: #339933;">;</span>      <span style="color: #666666; font-style: italic;"># * Manager user</span>
<span style="color: #0000ff;">$Parm</span><span style="color: #009900;">&#123;</span>asterisk<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>pass<span style="color: #009900;">&#125;</span>     <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;test&quot;</span><span style="color: #339933;">;</span>      <span style="color: #666666; font-style: italic;"># * Manager password</span>
<span style="color: #0000ff;">$Parm</span><span style="color: #009900;">&#123;</span>asterisk<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>events<span style="color: #009900;">&#125;</span>   <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>           <span style="color: #666666; font-style: italic;"># Flag to request event log to * manager</span>
<span style="color: #0000ff;">$Parm</span><span style="color: #009900;">&#123;</span>asterisk<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>trunk<span style="color: #009900;">&#125;</span>    <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;Zap/g1&quot;</span><span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;"># Outgoing calls resource</span>
<span style="color: #0000ff;">$Parm</span><span style="color: #009900;">&#123;</span>asterisk<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>context<span style="color: #009900;">&#125;</span>  <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;dial&quot;</span><span style="color: #339933;">;</span>      <span style="color: #666666; font-style: italic;"># Context of the dial</span>
<span style="color: #0000ff;">$Parm</span><span style="color: #009900;">&#123;</span>asterisk<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>exten<span style="color: #009900;">&#125;</span>    <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;666&quot;</span><span style="color: #339933;">;</span>       <span style="color: #666666; font-style: italic;"># Context of the dial</span>
<span style="color: #666666; font-style: italic;">#--------------------------------------------------------------------</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#---------------------------------------------------------#</span>
<span style="color: #666666; font-style: italic;">#  Function: Terminate()                                  #</span>
<span style="color: #666666; font-style: italic;">#---------------------------------------------------------#</span>
<span style="color: #666666; font-style: italic;"># Objetive: catch the {INT}  signal and close connection  #</span>
<span style="color: #666666; font-style: italic;">#           to sockets and terminate program.             #</span>
<span style="color: #666666; font-style: italic;">#   Params: none                                          #</span>
<span style="color: #666666; font-style: italic;">#    Usage:                                               #</span>
<span style="color: #666666; font-style: italic;">#          $SIG{INT}  = 'Terminate';                      #</span>
<span style="color: #666666; font-style: italic;">#---------------------------------------------------------#</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> Terminate <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$asterisk_handler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>         <span style="color: #666666; font-style: italic;"># destroy asterisk manager conection</span>
    <span style="color: #000066;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>                          <span style="color: #666666; font-style: italic;"># Exit without error</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#-----------------------------------------------#</span>
<span style="color: #666666; font-style: italic;">#  Function: Nonblock([TCP socket handler])     #</span>
<span style="color: #666666; font-style: italic;">#-----------------------------------------------#</span>
<span style="color: #666666; font-style: italic;"># Objetive: puts socket into nonblocking mode   #</span>
<span style="color: #666666; font-style: italic;">#   Params: [TCP Socket Handler]                #</span>
<span style="color: #666666; font-style: italic;">#    Usage:                                     #</span>
<span style="color: #666666; font-style: italic;">#          Nonblock($socket);                   #</span>
<span style="color: #666666; font-style: italic;">#-----------------------------------------------#</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> Nonblock <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$socket</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$flags</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #0000ff;">$flags</span> <span style="color: #339933;">=</span> <span style="color: #000066;">fcntl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$socket</span><span style="color: #339933;">,</span> F_GETFL<span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
        <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Can't get flags for socket: $!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000066;">fcntl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$socket</span><span style="color: #339933;">,</span> F_SETFL<span style="color: #339933;">,</span> <span style="color: #0000ff;">$flags</span> <span style="color: #339933;">|</span> O_NONBLOCK<span style="color: #009900;">&#41;</span>
        <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Can't make socket nonblocking: $!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#-----------------------------------------------#</span>
<span style="color: #666666; font-style: italic;">#  Function: Manager_Login                      #</span>
<span style="color: #666666; font-style: italic;">#-----------------------------------------------#</span>
<span style="color: #666666; font-style: italic;"># Objetive: Send Login Action to Asterisk API   #</span>
<span style="color: #666666; font-style: italic;">#   Params: none                                #</span>
<span style="color: #666666; font-style: italic;">#    Usage:                                     #</span>
<span style="color: #666666; font-style: italic;">#          Manager_Login();                     #</span>
<span style="color: #666666; font-style: italic;">#-----------------------------------------------#</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> Manager_Login <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$command</span>  <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;Action: Login<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$command</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;Username: $Parm{asterisk}{user}<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$command</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;Secret: $Parm{asterisk}{pass}<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$command</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;Events: &quot;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$Parm</span><span style="color: #009900;">&#123;</span>asterisk<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>events<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #0000ff;">$command</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">'on'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #0000ff;">$command</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">'off'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> 
    <span style="color: #0000ff;">$command</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
    Send_To_Asterisk<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">\$command</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#--------------------------------------------------#</span>
<span style="color: #666666; font-style: italic;"># Function: Connect_To_Asterisk()                  #</span>
<span style="color: #666666; font-style: italic;">#--------------------------------------------------#</span>
<span style="color: #666666; font-style: italic;"># Objetive: connect program with asterisk manager  #</span>
<span style="color: #666666; font-style: italic;">#   Params: None                                   #</span>
<span style="color: #666666; font-style: italic;">#    Usage:                                        #</span>
<span style="color: #666666; font-style: italic;">#          Connect_To_Asterisk();                  #</span>
<span style="color: #666666; font-style: italic;">#--------------------------------------------------#</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> Connect_To_Asterisk <span style="color: #009900;">&#123;</span>
    <span style="color: #0000ff;">$asterisk_handler</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> IO<span style="color: #339933;">::</span><span style="color: #006600;">Socket</span><span style="color: #339933;">::</span><span style="color: #006600;">INET</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span> PeerAddr <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$Parm</span><span style="color: #009900;">&#123;</span>asterisk<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>host<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
                                                   PeerPort <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$Parm</span><span style="color: #009900;">&#123;</span>asterisk<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#123;</span>port<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
                                                   Proto    <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;tcp&quot;</span><span style="color: #339933;">,</span>
                                                   ReuseAddr <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
                                                   Type     <span style="color: #339933;">=&gt;</span> SOCK_STREAM <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$asterisk_handler</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #0000ff;">$asterisk_handler</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">autoflush</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        Nonblock<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$asterisk_handler</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">return</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    	<span style="color: #000066;">return</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#--------------------------------------------------------#</span>
<span style="color: #666666; font-style: italic;"># Function: Send_To_Asterisk([message])                  #</span>
<span style="color: #666666; font-style: italic;">#--------------------------------------------------------#</span>
<span style="color: #666666; font-style: italic;"># Objetive: Send  message to Asterik manager             #</span>
<span style="color: #666666; font-style: italic;">#   Params: message, socket_handler                      #</span>
<span style="color: #666666; font-style: italic;">#    Usage:                                              #</span>
<span style="color: #666666; font-style: italic;">#          Send_To_Asterisk(\$message)                   #</span>
<span style="color: #666666; font-style: italic;">#--------------------------------------------------------#</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> Send_To_Asterisk <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$command_ref</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">unless</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$$command_ref</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #0000ff;">$manager_connect_flag</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;"># if the socket exists send data, if not, turn on reconnection flag</span>
        <span style="color: #666666; font-style: italic;"># if (defined(getpeername($asterisk_handler))) {</span>
        <span style="color: #b1b100;">unless</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$asterisk_handler</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$rv</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$asterisk_handler</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">send</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$$command_ref</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">unless</span> <span style="color: #009900;">&#40;</span><span style="color: #000066;">defined</span> <span style="color: #0000ff;">$rv</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #666666; font-style: italic;"># if send fails, turn on reconnection flag</span>
                <span style="color: #0000ff;">$manager_connect_flag</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #0000ff;">$manager_connect_flag</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#---------------------------------------------------#</span>
<span style="color: #666666; font-style: italic;"># Function: Dial([phone number])                    #</span>
<span style="color: #666666; font-style: italic;">#---------------------------------------------------#</span>
<span style="color: #666666; font-style: italic;"># Objetive: originate a phone call via the asterisk #</span>
<span style="color: #666666; font-style: italic;">#                                                   #</span>
<span style="color: #666666; font-style: italic;">#   Params: phone number                            #</span>
<span style="color: #666666; font-style: italic;">#    Usage:                                         #</span>
<span style="color: #666666; font-style: italic;">#          Dial('56581111');                        #</span>
<span style="color: #666666; font-style: italic;">#---------------------------------------------------#</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> Dial <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$Number</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$command</span>  <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;Action: Originate<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
       <span style="color: #0000ff;">$command</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;Channel: $Parm{asterisk}{trunk}/$Number<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
       <span style="color: #0000ff;">$command</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;Context: $Parm{asterisk}{context}<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
       <span style="color: #0000ff;">$command</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;Exten: $Parm{asterisk}{exten}<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
       <span style="color: #0000ff;">$command</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;Priority: 1<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
       <span style="color: #0000ff;">$command</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;Async: true<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
       <span style="color: #0000ff;">$command</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;Timeout: $Parm{dialer}{timeout}<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
       <span style="color: #0000ff;">$command</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;Variable: TIMEOUT(absolute)=$Parm{dialer}{absolute_timeout}<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
       <span style="color: #0000ff;">$command</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;Callerid: $Parm{dialer}{caller_id}<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
    Send_To_Asterisk<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">\$command</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#======================#</span>
<span style="color: #666666; font-style: italic;">#      Main block      #</span>
<span style="color: #666666; font-style: italic;">#======================#</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$Number_To_Dial</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #0000ff;">$Delay</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;"># Main loop #</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$manager_connect_flag</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #0000ff;">$manager_connect_flag</span> <span style="color: #339933;">=</span> Connect_To_Asterisk<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">unless</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$manager_connect_flag</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                Manager_Login<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span> 
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;"># Check if the dialer can send calls to asterisk using a semaphore</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$manager_connect_flag</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$Number_To_Dial</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                Dial<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$Number_To_Dial</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000066;">sleep</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$Delay</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;"># End of main loop</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Usage =&gt; joder.pl [Number to dial] [wait time in seconds]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">#------------- End of main block ----------</span></pre></td></tr></table></div>

<p>Enjoy!</p>
<p>Saludos&#8230; Fernando &#8220;El Pop&#8221; Romo</p>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2010/08/10/demo-de-marcacion-automatica-con-asterisk-para-campus-party/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Guía básica de como particionar en Linux</title>
		<link>http://cofradia.org/2010/08/09/guia-basica-de-como-particionar-en-linux/</link>
		<comments>http://cofradia.org/2010/08/09/guia-basica-de-como-particionar-en-linux/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 21:00:43 +0000</pubDate>
		<dc:creator>solrac</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sistemas Operativos]]></category>
		<category><![CDATA[Tips técnicos]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[SUSE]]></category>
		<category><![CDATA[sys admin]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=3515</guid>
		<description><![CDATA[Nos mandan una guía básica de como particionar discos duros bajo Linux: In this article learn how to create partitions on a disk drive and how to format them for use on a Linux system as swap or data space. In this related article on Hard disk Layout you can learn how to design a [...]]]></description>
			<content:encoded><![CDATA[<p>Nos mandan una guía básica de como particionar discos duros bajo Linux:</p>
<blockquote><p>
In this article learn how to <a href="http://www.ibm.com/developerworks/linux/library/l-lpic1-v3-104-1/index.html?ca=dgr-lnxw13LX-HD-Partitionsdth-LX">create partitions</a> on a disk drive and how to format them for use on a Linux system as swap or data space. In this related article on <a href="http://www.ibm.com/developerworks/linux/library/l-lpic1-v3-102-1/?ca=dgr-lnxw13LX-HD-Layoutdth-LX">Hard disk Layout</a> you can learn how to design a partition layout for disks on a Linux system.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2010/08/09/guia-basica-de-como-particionar-en-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alta disponibilidad usando DRBD (Distributed Replicated Block Device) en Linux</title>
		<link>http://cofradia.org/2010/08/06/alta-disponibilidad-usando-drbd-distributed-replicated-block-device-en-linux/</link>
		<comments>http://cofradia.org/2010/08/06/alta-disponibilidad-usando-drbd-distributed-replicated-block-device-en-linux/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 15:03:38 +0000</pubDate>
		<dc:creator>solrac</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sistemas Operativos]]></category>
		<category><![CDATA[Tips técnicos]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[SUSE]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://cofradia.org/?p=3498</guid>
		<description><![CDATA[Nos mandan un artículo de como utilizar en Linux una nueva característica llamada DRBD (Distributed Replicated Block Device), que permite copiar bloques de información por red y crear esquemas de fail-over: The 2.6.33 Linux kernel has introduced a useful new service called the DRBD &#8211; Distributed Replicated Block Device. This service mirrors an entire block [...]]]></description>
			<content:encoded><![CDATA[<p>
Nos mandan un artículo de como utilizar en Linux una nueva característica llamada DRBD (Distributed Replicated Block Device), que permite copiar bloques de información por red y crear esquemas de fail-over:
</p>
<blockquote><p>
The 2.6.33 Linux kernel has introduced a <a href="http://www.ibm.com/developerworks/linux/library/l-drbd/index.html?ca=dgr-lnxw13LX-DRBD">useful new service called the DRBD</a> &#8211; Distributed Replicated Block Device. This service mirrors an entire block device to another networked host during run time, permitting the development of high-availability clusters for block data. Explore the ideas behind the DRBD and its implementation in the Linux kernel.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://cofradia.org/2010/08/06/alta-disponibilidad-usando-drbd-distributed-replicated-block-device-en-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
