{"id":124,"date":"2016-06-03T18:37:01","date_gmt":"2016-06-03T18:37:01","guid":{"rendered":"http:\/\/symbioticindia.in\/docu\/?p=124"},"modified":"2016-06-03T18:37:01","modified_gmt":"2016-06-03T18:37:01","slug":"asterisk-call-file-auto-dialing-using-asterisk","status":"publish","type":"post","link":"http:\/\/symbioticindia.in\/docu\/2016\/06\/03\/asterisk-call-file-auto-dialing-using-asterisk\/","title":{"rendered":"asterisk .call file (auto dialing using asterisk)"},"content":{"rendered":"<div class=\"adsense-aside\"><\/div>\n<div class=\"article-header\">\n<h1 class=\"title entry-title\"><\/h1>\n<\/div>\n<div class=\"article-content entry-content\">\n<div dir=\"ltr\">\n<div>How to create Asterisk .call file ( how to automatically generate calls in asterisk)<\/div>\n<div class=\"content_title\">\n<h1>Asterisk Call Files<\/h1>\n<div>Asterisk call files are structured files which, when moved to the appropriate directory, are able to automatically place calls using Asterisk. Call files are a great way place calls automatically without using more complex Asterisk features like the AGI, AMI, and dialplan, and require very little technical knowledge to use.<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0Call files are like a shell script for Asterisk. A user or application writes a call file into \/var\/spool\/asterisk\/outgoing\/ where Asterisk processes it immediately<\/div>\n<div><\/div>\n<div><b><i><u>Asterisk .call demonstration<\/u><\/i><\/b><\/div>\n<div>Let&#8217;s demonstrate the .call file principle with an example. Assume that we have a SIP phone registered with the number 1000 in Asterisk. In addition, we have the following dialplan in extensions.conf :<\/div>\n<div>for more information about dialplan click this <a href=\"http:\/\/striker24x7.blogspot.in\/2015\/07\/vicidial-or-goautodial-dialplan-entry.html\">Link<\/a><\/div>\n<div><\/div>\n<div>\n<div class=\"para\">\n<pre class=\"programlisting\">[voicebroadcast]\r\nexten =&gt; 777,1,Answer()\r\nexten =&gt; 777,n,Wait(1)\r\nexten =&gt; 777,n,Playback(hello-world)\r\nexten =&gt; 777,n,Wait(1)\r\nexten =&gt; 777,n,Hangup()<\/pre>\n<\/div>\n<div class=\"para\"><\/div>\n<div class=\"para\">We create a call file called\u00a0<code class=\"filename\">broadcast.call<\/code>\u00a0in\u00a0<code class=\"filename\">\/tmp\/<\/code>\u00a0with the following content: vi \/tmp\/broadcast.call<\/div>\n<div class=\"para\">save the file<\/div>\n<div class=\"para\">\n<pre class=\"programlisting\">Channel: SIP\/1000\r\nMaxRetries: 2\r\nRetryTime: 60\r\nWaitTime: 30\r\nContext: voicebroadcast\r\nExtension: 777<\/pre>\n<\/div>\n<div class=\"para\">Now we move this file with\u00a0<code class=\"command\">mv \/tmp\/broadcast.call \/var\/spool\/asterisk\/outgoing\/<\/code><\/div>\n<div class=\"para\">\n<pre class=\"screen\">root@striker24x7:~&gt;mv \/tmp\/boradcast.call \/var\/spool\/asterisk\/outgoing\/<\/pre>\n<\/div>\n<div class=\"para\"><\/div>\n<div class=\"para\">The following happens:<\/div>\n<div class=\"itemizedlist\">\n<ul>\n<li class=\"listitem\">\n<div class=\"para\">Asterisk polls the\u00a0<code class=\"filename\">\/var\/spool\/asterisk\/outgoing\/<\/code>\u00a0for new call files and processes any it finds.<\/div>\n<\/li>\n<li class=\"listitem\">\n<div class=\"para\">Asterisk opens a connection to device\u00a0<code class=\"code\">SIP\/1000<\/code>. If the device is in use or not answered, Asterisk tries two more times (see<em class=\"parameter\"><code>MaxRetries<\/code><\/em>).<\/div>\n<\/li>\n<li class=\"listitem\">\n<div class=\"para\">If someone answers\u00a0<code class=\"code\">SIP\/1000<\/code>, Asterisk begins processing extension\u00a0<code class=\"code\">777<\/code>\u00a0in the context\u00a0<em class=\"parameter\"><code>[voicebroadcast]<\/code><\/em>. In this case, Asterisk plays\u00a0<code class=\"filename\">hello-world<\/code>\u00a0to the answering party.<\/div>\n<\/li>\n<\/ul>\n<\/div>\n<div id=\"call-file-parameter\" class=\"section\" title=\"Parameters\">\n<div class=\"titlepage\">\n<h3 id=\"call-file-parameter\" class=\"title\">Parameters<\/h3>\n<\/div>\n<div class=\"para\">\n<div class=\"variablelist\">\n<dl>\n<dd>\n<table class=\"CALSTABLE\" border=\"1\" cellspacing=\"0\" cellpadding=\"4\" bgcolor=\"#E0E0E0\">\n<thead>\n<tr>\n<th>Name<\/th>\n<th>Explanation\/Notes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Channel: &lt;channel&gt;<\/td>\n<td>The channel upon which to initiate the call<\/td>\n<\/tr>\n<tr>\n<td>Callerid: &lt;id&gt;<\/td>\n<td>The caller ID to be used for the call.<\/td>\n<\/tr>\n<tr>\n<td>WaitTime: &lt;seconds&gt;<\/td>\n<td>Number of seconds the system waits for the call to be answered. If not specified, defaults to 45 seconds.<\/td>\n<\/tr>\n<tr>\n<td>MaxRetries: &lt;integer&gt;<\/td>\n<td>Maximum number of dial retries (if an attempt fails because the device is busy or not reachable). If not specified, defaults to 0 (only one attempt is made).<\/td>\n<\/tr>\n<tr>\n<td>RetryTime: &lt;seconds&gt;<\/td>\n<td>Number of seconds to wait until the next dial attempt. If not specified, defaults to 300 seconds.<\/td>\n<\/tr>\n<tr>\n<td>Account: &lt;account&gt;<\/td>\n<td>The account code for the CDR.<\/td>\n<\/tr>\n<tr>\n<td>Context: &lt;context&gt;<\/td>\n<td>The destination context.<\/td>\n<\/tr>\n<tr>\n<td>Extension: &lt;exten&gt;<\/td>\n<td>The destination extension, in which dialplan execution begins if the device is answered.<\/td>\n<\/tr>\n<tr>\n<td>Priority: &lt;priority&gt;<\/td>\n<td>The destination priority. If not specified, defaults to 1.<\/td>\n<\/tr>\n<tr>\n<td>Setvar: &lt;var=value&gt;<\/td>\n<td>lets you set one or more channel variables<\/td>\n<\/tr>\n<tr>\n<td>Archive: &lt;yes|no&gt;<\/td>\n<td>By default, call files are deleted immediately upon execution. If Archive: yes is set, they are copied into\u00a0\/var\/spool\/asterisk\/outgoing_done\/ instead. Asterisk adds a line to the call file which describes the result:Status: &lt;Expired|Completed|Failed&gt;<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/dd>\n<\/dl>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div><b><i><u>Troubleshooting<\/u><\/i><\/b><\/div>\n<div><b><i><u>\u00a0<\/u><\/i><\/b><\/div>\n<div>If the call is not processed follow the below steps<\/div>\n<div>1. Permission to outgoing directory<\/div>\n<div>\u00a0 \u00a0 \u00a0chmod 777 \/var\/spool\/asterisk\/outgoing<\/div>\n<div>2. change the ownership to the .call file<\/div>\n<div>\u00a0 \u00a0 \u00a0chown asterisk:asterisk \/var\/spool\/asterisk\/outgoing\/broadcast.call<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>How to create Asterisk .call file ( how to automatically generate calls in asterisk) Asterisk Call Files Asterisk call files are structured files which, when moved to the\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-124","post","type-post","status-publish","format-standard","hentry","category-asterisk"],"_links":{"self":[{"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/posts\/124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/comments?post=124"}],"version-history":[{"count":1,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/posts\/124\/revisions"}],"predecessor-version":[{"id":125,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/posts\/124\/revisions\/125"}],"wp:attachment":[{"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/media?parent=124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/categories?post=124"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/symbioticindia.in\/docu\/wp-json\/wp\/v2\/tags?post=124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}