<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Priority is a required parameter.  In your call file you are telling Asterisk to <o:p></o:p></span></p><p class=MsoNormal>&gt; Channel: DAHDI/g0/0312xxxxxxx<br>&gt; MaxRetries: 0<br>&gt; RetryTime: 60<br>&gt; Context: asteriskgw_fax<br>&gt; Extension: s<br><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Go to context asteriskgw_fax, extension s.  Priority tells Asterisk where to start in asteriskgw_fax.  Since C would assume 0 and contexts start with 1, priority: 1 tells it to go to line 1.  Another use for this would be to tell Asterisk to start further down to skip a wait or something.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Sample:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>[asteriskgw_fax]<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Exten =&gt; s,1,answer()<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Exten =&gt; s,n,wait(5)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Exten =&gt; s,n,playback(sending-fax)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>You could use priority 1 for DAHDI to compensate for PSTN delays and priority 3 for SIP calls.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] <b>On Behalf Of </b>Necati Demir<br><b>Sent:</b> Thursday, November 29, 2012 8:50 AM<br><b>To:</b> Asterisk Users Mailing List - Non-Commercial Discussion<br><b>Subject:</b> Re: [asterisk-users] Disappearing Call Files / Two threads dealing with my call files<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><p class=MsoNormal>Should I use priority in call files? How the lack of priority causes this problem?<o:p></o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p>&nbsp;</o:p></p><div><p class=MsoNormal>On 29 November 2012 12:48, Matt Riddell (lists) &lt;<a href="mailto:lists@venturevoip.com" target="_blank">lists@venturevoip.com</a>&gt; wrote:<o:p></o:p></p><p class=MsoNormal>There's no priority in your call file.<br><br>Sent from my iPhone<o:p></o:p></p><div><div><p class=MsoNormal><br>On 29/11/2012, at 11:12 PM, Necati Demir &lt;<a href="mailto:ndemir@demir.web.tr" target="_blank">ndemir@demir.web.tr</a>&gt; wrote:<br><br>&gt; Hello,<br>&gt;<br>&gt; I noticed that when i move a call file to outgoing directory, two asterisk threads are dealing with it.<br>&gt;<br>&gt; ]# grep FAX_44731.call /var/log/asterisk/full.2<br>&gt;<br>&gt; [Nov 27 09:23:10] WARNING[26842] pbx_spool.c: Unable to set utime on /var/spool/asterisk/outgoing/FAX_44731.call: Operation not permitted<br>&gt; [Nov 27 09:23:25] VERBOSE[18852] pbx.c: &nbsp; &nbsp; -- Executing [s@asteriskgw_fax:1] System(&quot;DAHDI/i1/0312xxxxxxx-b08&quot;, &quot;echo &quot;Set: UNIQUEID=1354000990.39861&quot; &gt;&gt; /var/spool/asterisk/outgoing/FAX_44731.call&quot;) in new stack<br>&gt; [Nov 27 09:25:33] VERBOSE[18852] pbx.c: &nbsp; &nbsp; -- Executing [s@asteriskgw_fax:3] System(&quot;DAHDI/i1/0312xxxxxxx-b08&quot;, &quot;echo &quot;Set: FAXSTATUS=SUCCESS&quot; &gt;&gt; /var/spool/asterisk/outgoing/FAX_44731.call&quot;) in new stack<br>&gt; [Nov 27 09:25:33] WARNING[26842] pbx_spool.c: At least one of app or extension must be specified, along with tech and dest in file /var/spool/asterisk/outgoing/FAX_44731.call<br>&gt; [Nov 27 09:25:33] WARNING[26842] pbx_spool.c: Invalid file contents in /var/spool/asterisk/outgoing/FAX_44731.call, deleting<br>&gt;<br>&gt; As you see there are two thread dealing with my call file. Now let's inspect the thread 18852.<br>&gt;<br>&gt; ]# grep &quot;\[18852\]&quot; /var/log/asterisk/full.2<br>&gt; [Nov 27 09:23:10] VERBOSE[18852] pbx_spool.c: &nbsp; &nbsp; -- Attempting call on DAHDI/g0/0312xxxxxxx for s@asteriskgw_fax:1 (Retry 1)<br>&gt; [Nov 27 09:23:10] DEBUG[18852] sig_pri.c: sig_pri_request 5<br>&gt; [Nov 27 09:23:10] DEBUG[18852] sig_pri.c: CALLER NAME: &nbsp;NUM: 90312xxxxxxx<br>&gt; [Nov 27 09:23:10] VERBOSE[18852] sig_pri.c: &nbsp; &nbsp; -- Requested transfer capability: 0x00 - SPEECH<br>&gt; [Nov 27 09:23:25] VERBOSE[18852] pbx.c: &nbsp; &nbsp; -- Executing [s@asteriskgw_fax:1] System(&quot;DAHDI/i1/0312xxxxxxx-b08&quot;, &quot;echo &quot;Set: UNIQUEID=1354000990.39861&quot; &gt;&gt; /var/spool/asterisk/outgoing/FAX_44731.call&quot;) in new stack<br>&gt; [Nov 27 09:23:25] VERBOSE[18852] pbx.c: &nbsp; &nbsp; -- Executing [s@asteriskgw_fax:2] SendFAX(&quot;DAHDI/i1/0312xxxxxxx-b08&quot;, &quot;/tmp/Qg90Ox5YGF5kYkJu.tif,zdfs&quot;) in new stack<br>&gt; [Nov 27 09:23:25] VERBOSE[18852] res_fax.c: &nbsp; &nbsp; -- Channel 'DAHDI/i1/0312xxxxxxx-b08' sending FAX:<br>&gt; [Nov 27 09:23:25] VERBOSE[18852] res_fax.c: &nbsp; &nbsp; -- &nbsp; &nbsp;/tmp/Qg90Ox5YGF5kYkJu.tif<br>&gt; [Nov 27 09:25:33] VERBOSE[18852] pbx.c: &nbsp; &nbsp; -- Executing [s@asteriskgw_fax:3] System(&quot;DAHDI/i1/0312xxxxxxx-b08&quot;, &quot;echo &quot;Set: FAXSTATUS=SUCCESS&quot; &gt;&gt; /var/spool/asterisk/outgoing/FAX_44731.call&quot;) in new stack<br>&gt; [Nov 27 09:25:33] VERBOSE[18852] pbx.c: &nbsp; &nbsp; -- Auto fallthrough, channel 'DAHDI/i1/0312xxxxxxx-b08' status is 'UNKNOWN'<br>&gt; [Nov 27 09:25:33] VERBOSE[18852] chan_dahdi.c: &nbsp; &nbsp; -- Hungup 'DAHDI/i1/0312xxxxxxx-b08'<br>&gt; [Nov 27 09:25:33] NOTICE[18852] pbx_spool.c: Call completed to DAHDI/g0/0312xxxxxxx<br>&gt;<br>&gt; It seems that the thread 18852 executes it normally but the thread 26842 deletes my call file. And when I inspected the asterisk log file, i saw that the thread 26842 is deleting all my call files.<br>&gt;<br>&gt; Here is my custom_extensions.conf file:<br>&gt;<br>&gt; [asteriskgw_fax]<br>&gt; exten =&gt; s,1,System(echo &quot;Set: UNIQUEID=${CDR(uniqueid)}&quot; &gt;&gt; /var/spool/asterisk/outgoing/FAX_${ID}.call)<br>&gt; exten =&gt; s,2,SendFAX(${FAXFILE},zdfs)<br>&gt; exten =&gt; s,3,System(echo &quot;Set: FAXSTATUS=${FAXSTATUS}&quot; &gt;&gt; /var/spool/asterisk/outgoing/FAX_${ID}.call)<br>&gt;<br>&gt; And here is a sample of call file:<br>&gt;<br>&gt; Channel: DAHDI/g0/0312xxxxxxx<br>&gt; MaxRetries: 0<br>&gt; RetryTime: 60<br>&gt; Context: asteriskgw_fax<br>&gt; Extension: s<br>&gt; Set: FAXFILE=/tmp/8Mg3yihXahZVejDf.tif<br>&gt; Set: ID=44884<br>&gt; Callerid: 90312xxxxxxx<br>&gt; Archive: Yes<br>&gt;<br>&gt;<br>&gt;<br>&gt; --<br>&gt; Necati DEMİR<br>&gt; --------------------<o:p></o:p></p></div></div><p class=MsoNormal>&gt; --<br>&gt; _____________________________________________________________________<br>&gt; -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>&gt; New to Asterisk? Join us for a live introductory webinar every Thurs:<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>&gt;<br>&gt; asterisk-users mailing list<br>&gt; To UNSUBSCRIBE or update options visit:<br>&gt; &nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br><br>--<br>_____________________________________________________________________<br>-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>New to Asterisk? Join us for a live introductory webinar every Thurs:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br>&nbsp; &nbsp;<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><o:p></o:p></p></div><p class=MsoNormal><br><br clear=all><o:p></o:p></p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><p class=MsoNormal>-- <br>Necati DEMİR<br>--------------------<o:p></o:p></p></div></div></body></html>