title: How to use asterisk Include statement the right way?
body: <p>I'm new to asterisk, and I have an issue about using include statement. <br/><br/>
  I have a context named "app-calltrace-perform" from FreePBX, used when people press *69 to trace their call.</p>
  
  <blockquote>
    <p>[app-calltrace-perform]<br/>
    include => app-calltrace-perform-custom<br/>
    exten => s,1,Answer<br/>
    ...<br/>
    exten => t,n,Macro(hangupcall,)<br/></p>
  </blockquote>
  
  <p>The "app-calltrace-perform" written in <strong><em>extensions_additional.conf</em></strong> which will be overwritten when users submit something about dialplan on the Web gui. So I have to write my own context "app-calltrace-perform-custom" on another file called <strong><em>extensions_custom.conf</em></strong><br/></p>
  
  <blockquote>
    <p>[app-calltrace-perform-custom]<br/>
    exten => s,1,Answer()<br/>
          same => n,VERBOSE("Something here")<br/>
          same => n,Playback(hello-world)<br/>
          same => n,Hangup()<br/></p>
  </blockquote>
  
  <p>Note that <strong><em>extensions_additional.conf</em></strong> and <strong><em>extensions_custom.conf</em></strong> was already included from <strong><em>extensions.conf</em></strong> <br/></p>
  
  <p>Then I do <code>dialplan reload</code> and try again, but dialplan do not play my context at all (no verbose, no play hello-world).<br/></p>
  
  <p>I've found something useful in <a href="https://wiki.asterisk.org/wiki/display/AST/Include+Statements+Basics" rel="nofollow">https://wiki.asterisk.org/wiki/display/AST/Include+Statements+Basics</a></p>
  
  <blockquote>
    <p>Asterisk will always try to find a matching extension in the current context first, and only follow the include statement to a new context if there isn't anything that matches in the current context.</p>
  </blockquote>
  
  <p>So now I dont know how to use my custom context for stuffs like this. Sorry if this a dumb question, but if you have any idea, pleas guide me through.</p>
  
  <p><strong>Edit</strong> <br/>
  This is where <code>app-calltrace-perform</code> called from<br/></p>
  
  <p><code>[app-calltrace]
  include =&gt; app-calltrace-custom
  exten =&gt; *69,1,Goto(app-calltrace-perform,s,1)</code></p>
  
  <p>Now i'm using another extension (*12345) defined in context <code>app-calltrace-custom</code>, It works well but is hard coded so cannot modified by the Web Gui</p>
  
  <p><strong>End Edit</strong></p>
  
  <p>Thanks in advance <br/>
  Loi Dang</p>