<?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>HostSeries</title>
	<atom:link href="http://hostseries.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://hostseries.com</link>
	<description></description>
	<lastBuildDate>Thu, 24 Dec 2009 19:13:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Solving:Transferring Calls from Queues, Agents stay busy</title>
		<link>http://hostseries.com/solvingtransferring-calls-from-queues-agents-stay-busy/</link>
		<comments>http://hostseries.com/solvingtransferring-calls-from-queues-agents-stay-busy/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 14:04:14 +0000</pubDate>
		<dc:creator>Author</dc:creator>
				<category><![CDATA[Asterisk PBX]]></category>

		<guid isPermaLink="false">http://hostseries.com/?p=85</guid>
		<description><![CDATA[The subject doesn&#8217;t really describe the problem good enough. So here it is&#8230; basically you have agents (whether you are using AgentCallBackLogin, or a setup like my alternative.)  The problem was that if the Agent transferred the call to another agent, Asterisk qould still show the agent has &#8216;busy.&#8217; If you listed channels, it would [...]]]></description>
			<content:encoded><![CDATA[<p>The subject doesn&#8217;t really describe the problem good enough. So here it is&#8230; basically you have agents (whether you are using AgentCallBackLogin, or a setup like <a href="http://hostseries.com/agentcallbacklogin-alternative/">my alternative.</a>)  The problem was that if the Agent transferred the call to another agent, Asterisk qould still show the agent has &#8216;busy.&#8217; If you listed channels, it would even show the first Agent involved in the call. Keep in mind, which seemed to know be a problem if it was an attended transfer. (Or for us of us, we like to use the &#8216;xfer&#8217; botton on our IP Phones&#8230; it was a problem then too.)  Well, it&#8217;s no longer a problem. You can find the solution below&#8230;<span id="more-85"></span></p>
<p>Keep in mind this will only working with 1.4.23 or higher. It was originally only added to 1.6, but the community decided it was needed as a backport into 1.4.  I hope this is helpful to someone. It took me 3 days of googling to find a working solution. Suspense is killing you I know. The answer is state_interface. This basically allows you to set which device/extension to watch. With AgentCallBackLogin and my alternative using Local Extensions, you still have to tell everyone which SIP or IAX phone/device the agent is sitting at. When this value is placed in the state_interface, Asterisk will check that device to determine if the agent is indeed &#8216;busy.&#8217; Clever huh?  Here&#8217;s how to set it up&#8230;</p>
<p><strong>Using Asterisk Realtime &#8211; Queue Members</strong><br />
If you using Asterisk Realtime queue_members, you will need to modify the table structure just a bit. You will need to add a column &#8217;state_interface&#8217; after the &#8216;pause&#8217; column. So your table will look something like this:</p>
<blockquote><p>CREATE TABLE IF NOT EXISTS `queue_members` (<br />
`uniqueid` int(10) unsigned NOT NULL auto_increment,<br />
`membername` varchar(40) default NULL,<br />
`queue_name` varchar(128) default NULL,<br />
`interface` varchar(128) default NULL,<br />
`penalty` int(11) default NULL,<br />
`paused` int(1) default NULL,<br />
`state_interface` varchar(128) NOT NULL,<br />
PRIMARY KEY  (`uniqueid`),<br />
UNIQUE KEY `queue_interface` (`queue_name`,`interface`)<br />
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=23 ;</p></blockquote>
<p>Then when you add your agents to the table, make sure you set the state_interface. Example:</p>
<blockquote><p>INSERT INTO `queue_members` (`uniqueid`, `membername`, `queue_name`, `interface`, `penalty`, `paused`, `state_interface`) VALUES<br />
(23, &#8216;Robert&#8217;, &#8216;CSR1&#8242;, &#8216;local/1005@agents/n&#8217;, 5, NULL, &#8216;SIP/100&#8242;);</p></blockquote>
<p>Robert is logged into CSR1 queue with his local extension being: local/1005@agents/n, but he&#8217;s on device SIP/100. Asterisk will be checking SIP/100 for the device status. Is he really &#8216;busy&#8217; after that call transfer? Probably not. <img src='http://hostseries.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><strong>Using AddQueueMember</strong><br />
In my alternative and some of the examples on voip-info.org, you use AddQueueMember. Well, if you are already running the required version, you probably noted the additions. Layout looks like this:</p>
<blockquote><p><span style="font-family: monospace;">AddQueueMember(queuename[,interface[,penalty[,options[,membername[,stateinterface]]]]]))</span></p></blockquote>
<p>So, using the same info as my previous example, I would create the following in my dialplan:</p>
<blockquote><p>exten =&gt; 701, 1,AddQueueMember(CSR1|local/1005@agents/n|5||Robert|SIP/100)</p></blockquote>
<p><strong>Using Asterisk CLi</strong><br />
Of course, you can always add the member by CLi:</p>
<blockquote><p>add queue member local/1005@agents/n to CSR1 as Robert state_interface SIP/100</p></blockquote>
<p>I hope this has helped someone. I know it was a big pain for us for a long time. And I spent a good amount of time searching for a solution. Well, now you have a solution!</p>
]]></content:encoded>
			<wfw:commentRss>http://hostseries.com/solvingtransferring-calls-from-queues-agents-stay-busy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is an SPF Record?</title>
		<link>http://hostseries.com/what-is-an-spf-record/</link>
		<comments>http://hostseries.com/what-is-an-spf-record/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 22:59:06 +0000</pubDate>
		<dc:creator>Author</dc:creator>
				<category><![CDATA[Hosting]]></category>

		<guid isPermaLink="false">http://hostseries.com/?p=78</guid>
		<description><![CDATA[I often hear this question. What is an SPF Record?
The complicated answer to the above question is this:
SPF means Sender Policy Framework.

What does that mean?  Well, I&#8217;ll make it as simple as I can. It&#8217;s basically a DNS record that is put in place that lists the allows mail servers (SMTP Servers) that you have [...]]]></description>
			<content:encoded><![CDATA[<p>I often hear this question. What is an SPF Record?</p>
<p>The complicated answer to the above question is this:<br />
SPF means Sender Policy Framework.<br />
<br />
What does that mean?  Well, I&#8217;ll make it as simple as I can. It&#8217;s basically a DNS record that is put in place that lists the allows mail servers (SMTP Servers) that you have authorized to send email for your domain. Why would you want this? Simply to help fight the war against forged or spoofed messages.  How so? Basically, the receiving mail server (or host) if they are checking for SPF records, it will make sure the message it&#8217;s receiving is coming from the allowed hosts.<br />
<br />
So for example, for hostseries.com, I only want messages to be accepted if it&#8217;s coming from the mail server: mailserver2.hostseries.com &#8211; I could create an SPF record only allowing this host. When a message is sent to Yahoo Mail, they will check to make sure the message is from mailserver2.hostseries.com.  You can find out how to create an SPF record at <a href="http://www.openspf.org" target="_blank">www.openspf.org</a><br />
<br />
If you want to be able to check to see if a domain has an SPF record, you can use a validation tool like this <a href="http://www.kitterman.com/spf/validate.html" target="_blank">one.</a><br />
<br />
I hope that helps.</p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://hostseries.com/what-is-an-spf-record/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connecting Two Asterisk Servers via SIP</title>
		<link>http://hostseries.com/connecting-to-asterisk-servers-via-sip/</link>
		<comments>http://hostseries.com/connecting-to-asterisk-servers-via-sip/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 02:00:07 +0000</pubDate>
		<dc:creator>Author</dc:creator>
				<category><![CDATA[Asterisk PBX]]></category>

		<guid isPermaLink="false">http://hostseries.com/?p=51</guid>
		<description><![CDATA[You have two offices, each with their own Asterisk Server. And you want to be able to call between the two. How do you do this? How do you set this up with SIP? A few people have requested this article. Well, here it is.
Actually, I hadn&#8217;t done this before myself, before writing this article. [...]]]></description>
			<content:encoded><![CDATA[<p>You have two offices, each with their own Asterisk Server. And you want to be able to call between the two. How do you do this? How do you set this up with SIP? A few people have requested this article. Well, here it is.<span id="more-51"></span></p>
<p>Actually, I hadn&#8217;t done this before myself, before writing this article. In my search of the web, I didn&#8217;t find many good tutorials. One useful resource that I did find was the <a href="http://hostseries.com/oreilly-asterisk-the-future-of-telephony-second-edition/">O&#8217;Reilly Asterisk: The Future of Telephony, Second Edition</a>.  This book is truly a great find. It&#8217;s a great addition to your library of &#8216;must haves.&#8217;  Okay, so let&#8217;s get right into it.</p>
<p>To keep things simple, I&#8217;m going to say that you have two locations: LocationA and LocationB. And at each of those locations, you have ServerA and ServerB. Now for this to work, each location must have it&#8217;s own set of employee extensions. So let&#8217;s say, ServerA has employee extensions: 1000-1999 and ServerB has employee extensions: 2000-2999. Now that we&#8217;ve setup the scenario, let&#8217;s get busy.</p>
<p></p>
<p>On ServerA, let&#8217;s make the below additions to the sip.conf. Under the general context, we&#8217;ll add the following register line, which will register this server to ServerB, and we&#8217;ll setup the peer too.</p>
<pre><code>register =&gt; serverA:serverApass@<strong>&lt;hostname-or-ip-of-serverB&gt;</strong>/serverB

[serverB]
type=friend
secret=serverBpass
context=serverB_incoming
host=dynamic
disallow=all
allow=ulaw
</code></pre>
<p>We&#8217;ll make the following additions to the extensions.conf on ServerA as well:</p>
<pre><code>[agents]
exten =&gt; 1050,1,Set(AGENT_SIP=${DB(agent_sip/1050)})
exten =&gt; 1050,n,Dial(SIP/${AGENT_SIP})

exten =&gt; 1100,1,Set(AGENT_SIP=${DB(agent_sip/1100)})
exten =&gt; 1100,n,Dial(SIP/${AGENT_SIP})

exten =&gt; 1150,1,Set(AGENT_SIP=${DB(agent_sip/1150)})
exten =&gt; 1150,n,Dial(SIP/${AGENT_SIP})

[phones]
include =&gt; agents
include =&gt; remote

[remote]
exten =&gt; _2XXX,1,Dial(SIP/serverB/${EXTEN},30)
exten =&gt; _2XXX,2,Hangup()

[serverB_incoming]
include =&gt; agents
</code></pre>
<p>Okay, so I&#8217;ll explain all of the above.  We have a &#8216;phones&#8217; context, which we have all of our SIP Phones apart of.  The &#8216;phones&#8217; context also includes our &#8216;agents&#8217; context and &#8216;remote&#8217; context.  The  &#8216;agents&#8217; context is where we have our agent extensions, and they dial the SIP Phones.  (I&#8217;m assuming that you have your agents context created based on my article discussed <a href="http://hostseries.com/agentcallbacklogin-alternative/">here.</a>)  We also have a &#8216;remote&#8217; context which is what makes the connection to ServerB if we dial one of the 2XXX extensions.  If we dial a 1XXX extension, it will ring the local (ServerA) agent.  We have the &#8217;serverB_incoming&#8217; context including the &#8216;agents&#8217; context, because this is where calls are routed to if dialed from ServerB</p>
<p>Now let&#8217;s setup ServerB. The sip.conf will have the following additions:</p>
<pre><code>
register =&gt; serverB:serverBpass@<strong><strong>&lt;hostname-or-ip-of-serverA&gt;</strong></strong>/serverA

[serverA]
type=friend
secret=serverApass
context=serverA_incoming
host=dynamic
disallow=all
allow=ulaw
</code></pre>
<p>And the extensions.conf:</p>
<pre><code>[phones]
include =&gt; agents
include =&gt; remote

[agents]
exten =&gt; 2050,1,Set(AGENT_SIP=${DB(agent_sip/2050)})
exten =&gt; 2050,n,Dial(SIP/${AGENT_SIP})
exten =&gt; 2100,1,Set(AGENT_SIP=${DB(agent_sip/2100)})
exten =&gt; 2100,n,Dial(SIP/${AGENT_SIP})

exten =&gt; 2150,1,Set(AGENT_SIP=${DB(agent_sip/2150)})
exten =&gt; 2150,n,Dial(SIP/${AGENT_SIP})
[remote]
exten =&gt; _1XXX,1,Dial(SIP/serverA/${EXTEN})
exten =&gt; _1XXX,2,Hangup()

[serverA_incoming]
include =&gt; agents
</code></pre>
<p>So for explaination, we have basically the reversed on ServerB. We have the same contexts. If someone on ServerA dials a 2XXX extension, it will route through the &#8216;remote&#8217; context to ServerB, which will ring the local extension on ServerB.</p>
<p>Boy, that can look confusing. But it does work, and works rather well. You can do the samething with IAX for connecting two Asterisk Servers together. You simply need to setup your peers and register lines within iax.conf, and change the &#8216;remote&#8217; context within extensions.conf</p>
<p>I hope this is useful to everyone.</p>
]]></content:encoded>
			<wfw:commentRss>http://hostseries.com/connecting-to-asterisk-servers-via-sip/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>LookupBlackList Alternative</title>
		<link>http://hostseries.com/lookupblacklist-alternative/</link>
		<comments>http://hostseries.com/lookupblacklist-alternative/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 21:17:42 +0000</pubDate>
		<dc:creator>Author</dc:creator>
				<category><![CDATA[Asterisk PBX]]></category>

		<guid isPermaLink="false">http://hostseries.com/?p=49</guid>
		<description><![CDATA[In a previous post, I mentioned that I came up with a solution for the disadvantages to the LookupBlackList Application. This could also be viewed as an alternative solution, seeing how the LookupBlackList has been depreciated, and set to be removed for a future release of Asterisk.  Let&#8217;s not waste any time. Let&#8217;s get [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://hostseries.com/using-lookupblacklist-application/">previous post</a>, I mentioned that I came up with a solution for the disadvantages to the LookupBlackList Application. This could also be viewed as an alternative solution, seeing how the LookupBlackList has been depreciated, and set to be removed for a future release of Asterisk.  Let&#8217;s not waste any time. Let&#8217;s get right into it.<br />
<span id="more-49"></span></p>
<p>I previous mentioned a disadvantage being that you can&#8217;t block calls per destination DID or phone number. This was a problem for me. I wanted to be able to block callers from calling one of the phone numbers in my PBX, but not another number. So I came up with the following solution. You can modify the solution according to your requirements. I&#8217;ll give two ways of doing this, in addition to simple alternative for LookupBlackList &#8211; so it functions the same way.</p>
<p>First off, we can store our numbers to be blocked within a SQL database or AstDB. This will determine which method we&#8217;ll be using. We&#8217;ll start with AstDB.We also need to determine how we want to filter the callers: By caller id name, or caller id number? I personally like the number. This is generally the most unique caller id characteristic.</p>
<p></p>
<p>In this example, we have given each DID an unique id. For this example, I&#8217;m going to call it a &#8216;company&#8217; (assuming each DID is a different company.)</p>
<p>Let&#8217;s add our callers to be blocked into AstDB:</p>
<pre><code>
database put &lt;companyid&gt; &lt;numberblocked&gt; 1
database put 100 4801115432 1
database put 150 6023321444 1
</code></pre>
<p>Now, let&#8217;s put together our dialplans:</p>
<pre><code>
exten =&gt; 18003337123,1,Set(COMPANY=100)
exten =&gt; 18003337123,2,Set(CID=${CALLERID(num)})
exten =&gt; 18003337123,3,Gotoif($["${DB(${COMPANY}/${CID})}" = "1"]?goaway,1,1)
exten =&gt; 18003337123,4,Queue(CSR1)

exten =&gt; 18004447123,1,Set(COMPANY=150)
exten =&gt; 18004447123,2,Set(CID=${CALLERID(num)})
exten =&gt; 18004447123,3,Gotoif($["${DB(${COMPANY}/${CID})}" = "1"]?goaway,1,1)
exten =&gt; 18004447123,4,Queue(CSR1)

[goaway]
exten =&gt; 1,1,Playback(not-taking-your-call)
exten =&gt; 1,2,Playback(vm-goodbye)
exten =&gt; 1,3,Hangup()
</code></pre>
<p>Now, to example the above dialplan example&#8230; We first create a variable &#8216;COMPANY&#8217; &#8211; this is where we set a Company ID for this DID. Second priority, we set the CallerID Number. We are only taking the number from the caller id, because that&#8217;s what we&#8217;res blocked based on. If we were blocking based on the name, we would change that to show: CALLERID(nam)  &#8211; I have not successfully got it to work with CALLERID(all). Third priority, we check to see if the calling party is added to the AstDB for blocking. If so, it will jump to the &#8216;goaway&#8217; context, to playback a message telling the caller they are blocked. Otherwise it will continue to the 4th priority, where it enters the caller in the queue.   The important thing is, that it&#8217;s only looking for blocked calls setup in AstDB for that Company ID. This gives you more control over the blocking per phone number (DID.)  That&#8217;s it. Pretty simple.</p>
<p>Now, let&#8217;s assume that we want to use MySQL for doing the samething. We can do the same thing. I&#8217;m one of those that likes to use MySQL for everything. This allows me to create a PHP/MySQL GUI for easy management. I haven&#8217;t tested how resource intense this is, so use at your own risk.</p>
<p>Let&#8217;s create our database and table first:</p>
<pre><code>
CREATE DATABASE asterisk;
GRANT ALL PRIVILEGES ON asterisk.* TO 'asterisk'@'localhost' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;

CREATE TABLE IF NOT EXISTS `blacklist` (
`company_id` varchar(3) NOT NULL,
`phonenum` varchar(30) NOT NULL,
PRIMARY KEY  (`company_id`,`phonenum`),
FULLTEXT KEY `phonenum` (`phonenum`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
</code></pre>
<p>Now, we can add our blocked numbers. Again, this relies on the company id for it to function.</p>
<pre><code>
INSERT INTO `asterisk`.`blacklist` (`company_id`, `phonenum`) VALUES ('100', '16021231141');
INSERT INTO `asterisk`.`blacklist` (`company_id`, `phonenum`) VALUES ('150', '14801231141');

</code></pre>
<p>Now let&#8217;s setup the dialplan:</p>
<pre><code>
[incoming]
exten =&gt; 18003337123,1,Set(DID=${EXTEN})
exten =&gt; 18003337123,2,Set(CID=100)
exten =&gt; 18003337123,3,Goto(cblock,1,1)
exten =&gt; 18003337123,5,Queue(CSR1)

exten =&gt; 18004447123,1,Set(DID=${EXTEN})
exten =&gt; 18004447123,2,Set(CID=150)
exten =&gt; 18004447123,3,Goto(cblock,1,1)
exten =&gt; 18004447123,5,Queue(CSR1)

[cblock]
exten =&gt; 1,1,MYSQL(Connect connid localhost asterisk yourpassword asterisk)
exten =&gt; 1,2,MYSQL(Query resultid ${connid} SELECT\ 'phonenum'\ FROM\ 'blacklist'\ WHERE\ 'company_id'\='${CID}'\ AND 'phonenum'\='${CALLERID(num)}'\)
exten =&gt; 1,3,MYSQL(Fetch fetchid ${resultid} BLACKLIST)
exten =&gt; 1,4,MYSQL(Clear ${resultid})
exten =&gt; 1,5,MYSQL(Disconnect ${connid})
exten =&gt; 1,6,GotoIf($["${CALLERID(num)}" = "${BLACKLIST}"]?goaway,1,1:cblock,1,8)
exten =&gt; 1,7,Goto(incoming,${DID},5)

[goaway]
exten =&gt; 1,1,Playback(not-taking-your-call)
exten =&gt; 1,2,Playback(vm-goodbye)
exten =&gt; 1,3,Hangup()
</code></pre>
<p>So in the above example we first set the company extension or DID in a variable, so we can redirect our dialplan back to it later. Then we set the company id as a variable. Next we forward to the call blocking context to see if the caller is allowed through. We query the MySQL database for the phone number. If it appears in the database for the company id, we forward them to the &#8216;go away&#8217; message/context. If it doesn&#8217;t appear, we redirect them back to the next step in the DID&#8217;s dialplan.</p>
<p>What if you want to filter for all the phone numbers (DIDs) coming into Asterisk? Okay, so you can simply use the following:</p>
<p>Use AstDB &#8211; it will be quicker. Use the following to input the numbers into the blacklist:</p>
<pre><code>
database put blacklist &lt;blockednumber&gt; 1
database put blacklist 4801115432 1
database put blacklist 6023321444 1
</code></pre>
<p>And your dialplan will be as follows:</p>
<pre><code>
exten =&gt; 18003337123,1,Set(CID=${CALLERID(num)})
exten =&gt; 18003337123,2,Gotoif($["${DB(blacklist/${CID})}" = "1"]?goaway,1,1)
exten =&gt; 18003337123,3,Queue(CSR1)

exten =&gt; 18004447123,1,Set(CID=${CALLERID(num)})
exten =&gt; 18004447123,2,Gotoif($["${DB(blacklist/${CID})}" = "1"]?goaway,1,1)
exten =&gt; 18004447123,3,Queue(CSR1)

[goaway]
exten =&gt; 1,1,Playback(not-taking-your-call)
exten =&gt; 1,2,Playback(vm-goodbye)
exten =&gt; 1,3,Hangup()
</code></pre>
<p>I hope this is useful to someone. I would like to hear your comments. <img src='http://hostseries.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://hostseries.com/lookupblacklist-alternative/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using LookupBlackList() Application</title>
		<link>http://hostseries.com/using-lookupblacklist-application/</link>
		<comments>http://hostseries.com/using-lookupblacklist-application/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 16:03:04 +0000</pubDate>
		<dc:creator>Author</dc:creator>
				<category><![CDATA[Asterisk PBX]]></category>

		<guid isPermaLink="false">http://hostseries.com/?p=47</guid>
		<description><![CDATA[At times we get those annoying callers. They usually end up being a waste of our time and resources. So what can you do? You can block them from calling in. Asterisk has an application in place to make this an easy task. It&#8217;s called: LookupBlackList()

It&#8217;s actually an older application. But in trying to use [...]]]></description>
			<content:encoded><![CDATA[<p>At times we get those annoying callers. They usually end up being a waste of our time and resources. So what can you do? You can block them from calling in. Asterisk has an application in place to make this an easy task. It&#8217;s called: LookupBlackList()<br />
<span id="more-47"></span></p>
<p>It&#8217;s actually an older application. But in trying to use it, I didn&#8217;t see many examples for using it, or the options that can be used with it. And for good reason. It seems it&#8217;s depreciated, in favor of using the GotoIf application. However, I did find it will available with Asterisk 1.4.x so I thought I would give a quick writeup, in the event someone wants to use it.   I&#8217;ll also be posting about it&#8217;s limitations, and soon will post an article with my quick &#8217;solution&#8217; to the problems I faced with LookupBlackList app.  So let&#8217;s dive right in.</p>
<p>First thing is first. We need to setup our table of callers to block. It&#8217;s going to be using AstDB for this. So from the Asterisk CLi:</p>
<pre><code>
database put blacklist &lt;blockednumber&gt; 1
database put blacklist 4801115432 1
database put blacklist John Smith 1</code></pre>
<p>Okay, so the tables are set. Once we have the rest of our dialplan setup, any calls coming from the callerid &#8216;4801115432&#8242; or from &#8216;John Smith&#8217; will be blocked.</p>
<p>Okay, so let&#8217;s switch over to our dialplan. I&#8217;ll assume that you are using extensions.conf for your dialplans.</p>
<pre><code>exten =&gt; 18003337123,1,Answer()
exten =&gt; 18003337123,2,LookupBlacklist(j)
exten =&gt; 18003337123,3,Queue(CSR1)

exten =&gt; 18003337123,103,Playback(not-taking-your-call)
exten =&gt; 18003337123,104,Playback(vm-goodbye)
exten =&gt; 18003337123,105,Hangup()</code></pre>
<p>To explain the above, 18003337123 is of course, my incoming phone number. First it answers the call, and then runs the LookupBlacklist app. There&#8217;s only one option for this app that I could fine &#8211; the &#8216;j&#8217; option, which will jump the dialplan if the callerid is found in the blacklist database. Otherwise, it will take the caller into a queue that I have created. When it comes to jumping, it will always jump within the same context, and extension. It just jumps priorities. It will add 101 priority to whatever the current priority is. So in this case: priority 2 + 101 = 103 as the starting priority. Here I can tell Asterisk want to do with the blocked caller. In the above example, I&#8217;m playing an audio file that informs them that I&#8217;m not accepting their call, it says goodbye, and then hangs up.</p>
<p></p>
<p>If you are like me, you hate recording your own messages. Luckily there&#8217;s already one there. The default Asterisk install doesn&#8217;t have it in the sounds directory. But I found one in an older Asterisk Sounds zip. Here&#8217;s the file I used above in gsm format. Download it <a href="http://hostseries.com/wp-content/uploads/2008/12/not-taking-your-call.gsm">here.</a></p>
<p>Disadvantages to this application is that it doesn&#8217;t allow you to block callers on a per DID bases. What I mean by that, is this&#8230; Say you have multiple phone numbers coming into your PBX. You want to allow John Smith to call this phone number, but not another number coming into the PBX. This isn&#8217;t so easy with this application &#8211; in fact it doesn&#8217;t have this ability.  What to do this? Check back shortly for a followup article of my little &#8216;alternative&#8217; solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://hostseries.com/using-lookupblacklist-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AgentLogin powered by MySQL</title>
		<link>http://hostseries.com/agentlogin-powered-by-mysql/</link>
		<comments>http://hostseries.com/agentlogin-powered-by-mysql/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 17:15:14 +0000</pubDate>
		<dc:creator>Author</dc:creator>
				<category><![CDATA[Asterisk PBX]]></category>

		<guid isPermaLink="false">http://hostseries.com/?p=45</guid>
		<description><![CDATA[In a previous article, I showed an alternative method of AgentCallBackLogin. In that example, the agents were authenticated via voicemail.conf. I made a comment that I would create a dialplan with it authenticating against a MySQL database.
So let&#8217;s start by creating our database:
CREATE TABLE IF NOT EXISTS `asterisk`.`agent_users` (
`id` int(11) NOT NULL auto_increment,
`user` varchar(10) NOT [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous <a href="http://hostseries.com/agentcallbacklogin-alternative/">article,</a> I showed an alternative method of AgentCallBackLogin. In that example, the agents were authenticated via voicemail.conf. I made a <a href="http://hostseries.com/agentcallbacklogin-alternative/#comment-535">comment</a> that I would create a dialplan with it authenticating against a MySQL database.</p>
<p><span id="more-45"></span>So let&#8217;s start by creating our database:</p>
<pre><code>CREATE TABLE IF NOT EXISTS `asterisk`.`agent_users` (
`id` int(11) NOT NULL auto_increment,
`user` varchar(10) NOT NULL default '',
`pass` varchar(32) NOT NULL default '',
`name` varchar(50) NOT NULL default '',
PRIMARY KEY  (`id`)
) ENGINE=MyISAM</code></pre>
<p>And I&#8217;ll go ahead and drop same data into that database:</p>
<pre><code>INSERT INTO `asterisk`.`agent_users` (`id`, `user`, `pass`, `name`) VALUES
(1, '1050', '1234', 'Robert');</code></pre>
<p>Now for our dialplan:</p>
<pre><code>exten =&gt; login,1,Answer()
exten =&gt; login,2,Read(user|/home/Sounds/user-id)  ; I created an audio file which asks for the user id.
exten =&gt; login,3,Read(pass|/home/Sounds/user-pass) ; I created an audio file which asks for the user password.
exten =&gt; login,4,MYSQL(Connect connid localhost dbuser dbpassword asterisk)
exten =&gt; login,5,MYSQL(Query resultid ${connid} SELECT\ 'pass'\ FROM\ 'agent_users'\ WHERE\ 'user'\='${user}'\)
exten =&gt; login,6,MYSQL(Fetch fetchid ${resultid} password)
exten =&gt; login,7,NoOp(Password is: ${password}) ; This line isn't required, but I have it here to output the results of our query.
exten =&gt; login,8,MYSQL(Clear ${resultid})
exten =&gt; login,9,MYSQL(Disconnect ${connid})
exten =&gt; login,10,GotoIf($["${password}" = "${pass}"]?incorrect,1:login,11)
exten =&gt; login,11,AddQueueMember(SALES|local/${user}@agents/n)
exten =&gt; login,12,AddQueueMember(SUPPORT|local/${user}@agents/n)
exten =&gt; login,13,Playback(goodbye)
exten =&gt; login,14,Hangup()

exten =&gt; incorrect,1,Playback(/home/Sounds/incorrect-pass) ; This is an audio file to tell that the password is incorrect
exten =&gt; incorrect,2,Goto(login,1)</code></pre>
<p>Yes, this dialplan is a little longer. But you won&#8217;t have to worry with voicemail.conf being your authentication method, or of VMAuthenticate depreciating.</p>
<p>In addition to the above, you can always port voicemail.conf to MySQL via Asterisk Realtime. You can learn more Asterisk Realtime <a href="http://hostseries.com/asterisk-realtime-installation-guide/">here.</a></p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://hostseries.com/agentlogin-powered-by-mysql/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Opinions of Parallels Recent Activity</title>
		<link>http://hostseries.com/opinions-of-parallels-recent-activity/</link>
		<comments>http://hostseries.com/opinions-of-parallels-recent-activity/#comments</comments>
		<pubDate>Tue, 20 May 2008 14:20:24 +0000</pubDate>
		<dc:creator>Author</dc:creator>
				<category><![CDATA[Hosting]]></category>

		<guid isPermaLink="false">http://hostseries.com/?p=42</guid>
		<description><![CDATA[So I wanted to share my thoughts on Parallel&#8217;s recent activity, or perhaps it&#8217;s not so recent.
SWSoft is renamed Parallels.
I have mixed feelings about this move by Parallels. To me, I think they will always be SWSoft. And why not? SWSoft makes me think of a software company, which is basically what Parallels is. Other [...]]]></description>
			<content:encoded><![CDATA[<p>So I wanted to share my thoughts on Parallel&#8217;s recent activity, or perhaps it&#8217;s not so recent.</p>
<p><strong>SWSoft is renamed Parallels.</strong><br />
I have mixed feelings about this move by Parallels. To me, I think they will always be SWSoft. And why not? SWSoft makes me think of a software company, which is basically what Parallels is. Other obvious reasons that I wouldn&#8217;t have left the brand behind is of course the massive amount of money was was poured into building the previous brand name.</p>
<p>I understand Parallel&#8217;s reasons for the change. They want to unify their offerings. It seems they are renaming everything to &#8220;Parallels BlahBlah.&#8221;  Seems like another way to confuse customers with your offerings. Anyway, more power to them, they seem to know what they are doing. And with over $100Million in revenues last year, I&#8217;m not going to question their tactics.</p>
<p><strong>Parallels Aquires ModernBill.</strong><br />
This is a rather interesting move for Parallels. In my honest opinion Modernbill had alot to be desired before the acquisition. Their support was fairly useless, with their rather confusing documentation. Shortly after the acquisition, the site is moved, and the old documentation is taken offline. They have started to put a new one online, but even after weeks it&#8217;s still mainly incomplete.</p>
<p>I only hope that Modernbill turns around from it&#8217;s previous self. At Parallels Summit 2008, they announced ModernBill will be integrated more fully into other Parallels products. Maybe at the sametime they will start reworking the core product, without losing support for the other control panels &#8211; namely cPanel.</p>
<p><strong>Parallels Summit 2008</strong><br />
Overall I think it&#8217;s a good conference. The speakers most be good, as the exhibit hall was only full during the coffee breaks and during lunch. Otherwise, it was rather slow. The number in attendance was around 500-600 including Parallels employees. The food was good, and the boat ride Monday evening was entertaining.</p>
<p>You can really tell from the conference that Parallels is really working to improve their image and their company relationships. They repeatedly mentioned they want to help their customers and partners grow their business &#8211; not worrying about Parallels pocket books &#8211; which I find hard to believe, but I&#8217;m buying into it. I&#8217;m still rather bias to cPanel, but will be keeping a closer eye on Parallels and what they are doing for the next coming years. The industry is moving forward, and Parallels is keeping right up with it I believe.</p>
<p>Feel free to post your comments and opinions on Parallels as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://hostseries.com/opinions-of-parallels-recent-activity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linksys SPA941 IP Phones</title>
		<link>http://hostseries.com/linksys-spa941-ip-phones/</link>
		<comments>http://hostseries.com/linksys-spa941-ip-phones/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 19:11:29 +0000</pubDate>
		<dc:creator>Author</dc:creator>
				<category><![CDATA[IP Phones]]></category>

		<guid isPermaLink="false">http://hostseries.com/?p=18</guid>
		<description><![CDATA[So we bought some Grandstream GXP2000 IP Phones first for the office.  They were fine for starting out, however as our call center grew, we found increasing issues with them &#8211; primarily with transferring calls to external Asterisk boxes. So we purchased a box of Linksys SPA941 IP Phones. These were about the same [...]]]></description>
			<content:encoded><![CDATA[<p>So we bought some <a href="http://www.voipsupply.com/idevaffiliate/idevaffiliate.php?id=298_24_21_1" target="_blank">Grandstream GXP2000</a> IP Phones first for the office.  They were fine for starting out, however as our call center grew, we found increasing issues with them &#8211; primarily with transferring calls to external Asterisk boxes. So we purchased a box of <a href="http://www.voipsupply.com/idevaffiliate/idevaffiliate.php?id=298_400_21_1" target="_blank">Linksys SPA941</a> IP Phones. These were about the same money at <a href="http://www.voipsupply.com/idevaffiliate/idevaffiliate.php?id=298" target="_blank">VOIPSupply</a> as the Grandstream Phones. I think now the Grandstreams are a bit cheaper. However, comparing apples to oranges, Linksys has put out another great product.<br />
<br />
Some basic features that you can expect with the Linksys SPA941:</p>
<p>4 Lines (or extensions)<br />
DND (Do Not Disturb) Button<br />
Transfer Button<br />
Hold and Mute Button<br />
Caller ID<br />
Call Timer<br />
Custom Ring Tones<br />
2.5mm Headset Jack<br />
And Much More!</p>
<p>
One great thing I love about the Linksys phones are that I&#8217;m in full control. From within the Advanced GUI, I can disable buttons if I want. For example, we opted to disable the DND button. We didn&#8217;t want employees misusing the DND button, so we simply disabled it. We have enough wrapup time on the queue, to allow them to finish up a call before getting the next.<br />
<br />
I think with our next purchase order, we&#8217;ll get the Linksys SPA942 model. It&#8217;s basically the same, but has 2 Ethernet ports, so the PC can be plugged into the phone. I&#8217;ll post about the SPA942 once we get some of those in the office. <img src='http://hostseries.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><img class="alignnone size-medium wp-image-27" title="LinksysSPA941" src="http://hostseries.com/wp-content/uploads/2007/11/spa941_lrg.jpg" alt="" width="292" height="300" /></p>
]]></content:encoded>
			<wfw:commentRss>http://hostseries.com/linksys-spa941-ip-phones/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Asterisk Apps: OrderlyStats</title>
		<link>http://hostseries.com/asterisk-apps-orderlystats/</link>
		<comments>http://hostseries.com/asterisk-apps-orderlystats/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 14:07:15 +0000</pubDate>
		<dc:creator>Author</dc:creator>
				<category><![CDATA[Asterisk PBX]]></category>

		<guid isPermaLink="false">http://hostseries.com/asterisk-apps-orderlystats/</guid>
		<description><![CDATA[In my previous article, I made mention of using the CDR Database to generate reports. Unless you have the time, resources, and skills to develop some killer apps, you might begin looking at 3rd party applications to make your reports &#8220;pretty&#8221; and presentation worthy.
OrderlyQ has put together some rather great software.
OrderlyStats is a free product [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous article, I made mention of using the CDR Database to generate reports. Unless you have the time, resources, and skills to develop some killer apps, you might begin looking at 3rd party applications to make your reports &#8220;pretty&#8221; and presentation worthy.</p>
<p><a href="http://orderlyq.com" target="_blank">OrderlyQ</a> has put together some rather great software.<span id="more-37"></span></p>
<p>OrderlyStats is a free product that they offer, kinda as a lost leader, in hopes that you will signup for their paid service: OrderlyQ. OrderlyStats basically connects via Asterisk Manager, and intelligently discovers your agents and queues. You have a realtime monitor of the queues, agents logged into the queues, and calls being answered and waiting to be answered. You can also generate reports for each queue. Reports give you details like: holdtimes, percentage of answered calls, average call lengths, number of repeat calls, etc. You even get a daily email with the number of answered calls for that day, etc.</p>
<p>Sounds almost too good to be true right? Well it is to some degree. It&#8217;s a free application, but you will find OrderlyQ bugging you about signing up for their paid service. And rightfully so, but still&#8230;.  Another disadvantage is that it&#8217;s connecting to your server. If you have your Asterisk box running on the LAN, you are hopeless. And depending on how secure you have your system, (and how secure OrderlyQ&#8217;s system is), you open yourself up to security risks. OrderlyQ COULD have complete control over your phone system.</p>
<p>Nonetheless, it&#8217;s great for the reports. I like making use of OrderlyQ. Give it a try!</p>
<p><a href="http://hostseries.com/wp-content/uploads/2008/03/orderlyq_queue.jpg" title="OrderlyQ Queue"><img src="http://hostseries.com/wp-content/uploads/2008/03/orderlyq_queue.jpg" alt="OrderlyQ Queue" height="130" width="662" /></a></p>
<p><a href="http://hostseries.com/wp-content/uploads/2008/03/orderlyq_reports.jpg" title="OrderlyQ Report"><img src="http://hostseries.com/wp-content/uploads/2008/03/orderlyq_reports.jpg" alt="OrderlyQ Report" height="366" width="519" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://hostseries.com/asterisk-apps-orderlystats/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Asterisk &#8211; Getting Results from CDR Database!</title>
		<link>http://hostseries.com/asterisk-getting-results-from-cdr-database/</link>
		<comments>http://hostseries.com/asterisk-getting-results-from-cdr-database/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 00:32:15 +0000</pubDate>
		<dc:creator>Author</dc:creator>
				<category><![CDATA[Asterisk PBX]]></category>

		<guid isPermaLink="false">http://hostseries.com/asterisk-getting-results-from-cdr-database/</guid>
		<description><![CDATA[So in my previous article, I said I would provide some sample scripts to view information from our CDR database.  My script is written in PHP, and we&#8217;re just going to do a quick query of the database for answered calls.  
To make things neat, I like to write the mysql connection string [...]]]></description>
			<content:encoded><![CDATA[<p>So in my <a href="http://hostseries.com/asterisk-cdr-logging-in-mysql/">previous article</a>, I said I would provide some sample scripts to view information from our CDR database.  My script is written in PHP, and we&#8217;re just going to do a quick query of the database for answered calls.  <span id="more-33"></span></p>
<p>To make things neat, I like to write the mysql connection string and variables in seperate files. So my config.php will maintain the database connection information:</p>
<pre class="code"><code>&lt;?php
// This is an example of config.php
$dbhost = 'localhost';
$dbuser = 'asterisk';
$dbpass = 'yourpassword';
$dbname = 'asterisk';
?&gt;</code></pre>
<p>Now the mysql connection strings, first to open the connection, the second to close the connection:</p>
<pre class="code"><code>&lt;?php
// This is an example opendb.php
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die
('Error connecting to mysql');
mysql_select_db($dbname);
?&gt;</code></pre>
<pre class="code"><code>&lt;?php
// an example of closedb.php
// it does nothing but closing
// a mysql database connection
mysql_close($conn);
?&gt;</code></pre>
<p>The above files will be included or used in any script we use to query the database. Now let&#8217;s get to the queries&#8230;<br />
To gather the information of what I&#8217;m querying for, I put together a simple HTML form.  You can view the form <a href="http://hostseries.com/wp-content/uploads/2008/02/cdr_html.html">here.</a> And download it&#8217;s code <a href="http://hostseries.com/wp-content/uploads/2008/02/cdr_html.txt">here.</a>   The form will POST to our process.php which will be discussed in a moment.  You will notice several fields on the html form. The only fields that are required are the start date/time and the end date/time.</p>
<p></p>
<p>The PHP that queries the database and outputs the results can be found <a href="http://hostseries.com/wp-content/uploads/2008/02/process.php.txt">here.</a></p>
<p>And the results are something like this:</p>
<p><a href="http://hostseries.com/wp-content/uploads/2008/02/cdr_results.png" title="CDR Results"><img src="http://hostseries.com/wp-content/uploads/2008/02/cdr_results.png" alt="CDR Results" height="383" width="749" /></a></p>
<p>That&#8217;s it! You can download the files mentioned in this article <a href="http://hostseries.com/wp-content/uploads/2008/02/cdr_script.zip">here.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://hostseries.com/asterisk-getting-results-from-cdr-database/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
