<div dir="ltr">Hi<div><br></div><div>What is redacted means?</div><div><br></div><div><span style="font-size:12.8px">same => n,GotoIf($["${CALLERID(num)}"=</span><span style="font-size:12.8px">"<b><redacted></b>"]?divert:void)</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Thanks</span></div><div><span style="font-size:12.8px">Best Regards,</span></div><div><span style="font-size:12.8px">Madushan</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 3, 2016 at 10:58 PM, Madushan Geethanga <span dir="ltr"><<a href="mailto:mgliyanage.rc@gmail.com" target="_blank">mgliyanage.rc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra">Hi,</div><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks Phil, I will implement this and get back to you.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Best Regards,</div><div class="gmail_extra">Madushan<div><div class="h5"><br><div class="gmail_quote">On Thu, Mar 3, 2016 at 4:12 PM, Phil Reynolds <span dir="ltr"><<a href="mailto:phil-asterisk@tinsleyviaduct.com" target="_blank">phil-asterisk@tinsleyviaduct.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Thu, 3 Mar 2016 08:21:14 +0530<br>
Madushan Geethanga <<a href="mailto:mgliyanage.rc@gmail.com" target="_blank">mgliyanage.rc@gmail.com</a>> wrote:<br>
<br>
> Hi<br>
> I have to setup call forwarding. How do we setup Call forwarding in<br>
> asterisk?. Eg. user dials a number and insert some mobile number for<br>
> forwarding and dial another number to cancel the forwarding. thanks a<br>
> lot.<br>
<br>
</span>I implemented this like so in my default context:<br>
<br>
exten => _*21.,1,Answer()<br>
same => n,GotoIf($["${CALLERID(num)}"="<redacted>"]?divert:void)<br>
same => n(divert),Set(DB(divert/${CALLERID(num):-4})=${EXTEN:3})<br>
same => n,Gosub(divertactive,1)<br>
same => n,Hangup()<br>
same => n(void),Gosub(divertvoid,1)<br>
exten => _#21,1,Answer()<br>
same => n,GotoIf($["${CALLERID(num)}"="<redacted>"]?divert:void)<br>
same => n(divert),Verbose(0,${DB_DELETE(divert/${CALLERID(num):-4})})<br>
same => n,Gosub(divertoff,1)<br>
same => n,Hangup()<br>
same => n(void),Gosub(divertvoid,1)<br>
<br>
(note: use whatever you need in the GotoIf to validate that the phone<br>
the call is from is permitted to set up call forwarding - unless you're<br>
allowing it for all that can reach the context)<br>
<br>
The divert{off,active,void} subroutines are where I handle the<br>
announcements - but you could probably easily implement your own.<br>
<br>
At the top of my [voicemail] context, I do this:<br>
<br>
exten=>s,1,GotoIf(${DB_EXISTS(divert/${ARG3})}?outbound-standard,${DB_RESULT},1)<br>
<br>
(ARG3 contains the last four digits of the number the call came to in<br>
my case, and a success passes the call via the "outbound-standard"<br>
context which is in my dialplan. Your exact requirements may vary but<br>
this may help.)<br>
<span><font color="#888888"><br>
--<br>
Phil Reynolds<br>
mail: <a href="mailto:phil-asterisk@tinsleyviaduct.com" target="_blank">phil-asterisk@tinsleyviaduct.com</a><br>
Web: <a href="http://phil.tinsleyviaduct.com/" rel="noreferrer" target="_blank">http://phil.tinsleyviaduct.com/</a><br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" rel="noreferrer" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</font></span></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>