<div>Assuming a sip client lands calls in a context named &#39;from-sip&#39;, I would have following sort of logic in dialplan.</div><div><br></div><div>[from-sip]</div><div>exten =&gt; _X.,1,Noop(${EXTEN},${UNIQUEID})</div>
<div>same =&gt; n,System(echo -e &quot;Channel:Local/s@specific-number/n\\nContext:external\\nExtension:s\\npriority:1\\nSet: external_num=${EXTEN}&quot; &gt;/tmp/${UNIQUEID}.call)</div><div>same =&gt; n,System(/bin/mv /tmp/${UNIQUEID}.call /var/spool/asterisk/outgoing/)</div>
<div>same =&gt; n,Hangup()</div><div><br></div><div>[specific-number]</div><div>exten =&gt; s,1,Noop()</div><div>same =&gt; n,Dial(DAHDI/g0/XXXXXXXXXX,30)</div><div><br></div><div>[external]</div><div>exten =&gt; s,1,Noop()</div>
<div>same =&gt; n,Dial(DAHDI/g0/${external_num},30)</div><div><br></div><div>You can also use Asterisk application &#39;originate&#39; in place of callfiles. I normally prefer local channels in Callfiles or Originate so that I can have better call control through dialplan.</div>
<div><br></div><div>--Satish Barot</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Dec 3, 2012 at 3:08 PM, bilal ghayyad <span dir="ltr">&lt;<a href="mailto:bilmar_gh@yahoo.com" target="_blank">bilmar_gh@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All;<br>
<br>
How I can acheive the following:<br>
<br>