<div>Assuming a sip client lands calls in a context named 'from-sip', I would have following sort of logic in dialplan.</div><div><br></div><div>[from-sip]</div><div>exten => _X.,1,Noop(${EXTEN},${UNIQUEID})</div>
<div>same => n,System(echo -e "Channel:Local/s@specific-number/n\\nContext:external\\nExtension:s\\npriority:1\\nSet: external_num=${EXTEN}" >/tmp/${UNIQUEID}.call)</div><div>same => n,System(/bin/mv /tmp/${UNIQUEID}.call /var/spool/asterisk/outgoing/)</div>
<div>same => n,Hangup()</div><div><br></div><div>[specific-number]</div><div>exten => s,1,Noop()</div><div>same => n,Dial(DAHDI/g0/XXXXXXXXXX,30)</div><div><br></div><div>[external]</div><div>exten => s,1,Noop()</div>
<div>same => n,Dial(DAHDI/g0/${external_num},30)</div><div><br></div><div>You can also use Asterisk application 'originate' 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"><<a href="mailto:bilmar_gh@yahoo.com" target="_blank">bilmar_gh@yahoo.com</a>></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>