Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Asterisk Call Forwarding


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
mgliyanage.rc at gmail...
Guest





PostPosted: Wed Mar 02, 2016 9:51 pm    Post subject: [asterisk-users] Asterisk Call Forwarding Reply with quote

HiI have to setup call forwarding. How do we setup Call forwarding in asterisk?. Eg. user dials a number and insert some mobile number for forwarding and dial another number to cancel the forwarding. thanks a lot.  

Best Regards,

Madushan
Back to top
phil-asterisk at tinsl...
Guest





PostPosted: Thu Mar 03, 2016 5:43 am    Post subject: [asterisk-users] Asterisk Call Forwarding Reply with quote

On Thu, 3 Mar 2016 08:21:14 +0530
Madushan Geethanga <mgliyanage.rc@gmail.com> wrote:

Quote:
Hi
I have to setup call forwarding. How do we setup Call forwarding in
asterisk?. Eg. user dials a number and insert some mobile number for
forwarding and dial another number to cancel the forwarding. thanks a
lot.

I implemented this like so in my default context:

exten => _*21.,1,Answer()
same => n,GotoIf($["${CALLERID(num)}"="<redacted>"]?divert:void)
same => n(divert),Set(DB(divert/${CALLERID(num):-4})=${EXTEN:3})
same => n,Gosub(divertactive,1)
same => n,Hangup()
same => n(void),Gosub(divertvoid,1)
exten => _#21,1,Answer()
same => n,GotoIf($["${CALLERID(num)}"="<redacted>"]?divert:void)
same => n(divert),Verbose(0,${DB_DELETE(divert/${CALLERID(num):-4})})
same => n,Gosub(divertoff,1)
same => n,Hangup()
same => n(void),Gosub(divertvoid,1)

(note: use whatever you need in the GotoIf to validate that the phone
the call is from is permitted to set up call forwarding - unless you're
allowing it for all that can reach the context)

The divert{off,active,void} subroutines are where I handle the
announcements - but you could probably easily implement your own.

At the top of my [voicemail] context, I do this:

exten=>s,1,GotoIf(${DB_EXISTS(divert/${ARG3})}?outbound-standard,${DB_RESULT},1)

(ARG3 contains the last four digits of the number the call came to in
my case, and a success passes the call via the "outbound-standard"
context which is in my dialplan. Your exact requirements may vary but
this may help.)

--
Phil Reynolds
mail: phil-asterisk@tinsleyviaduct.com
Web: http://phil.tinsleyviaduct.com/

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
mgliyanage.rc at gmail...
Guest





PostPosted: Thu Mar 03, 2016 12:29 pm    Post subject: [asterisk-users] Asterisk Call Forwarding Reply with quote

Hi,


Thanks Phil, I will implement this and get back to you.


Best Regards,
Madushan
On Thu, Mar 3, 2016 at 4:12 PM, Phil Reynolds <phil-asterisk@tinsleyviaduct.com (phil-asterisk@tinsleyviaduct.com)> wrote:
Quote:
On Thu, 3 Mar 2016 08:21:14 +0530
Madushan Geethanga <mgliyanage.rc@gmail.com (mgliyanage.rc@gmail.com)> wrote:

Quote:
Hi
I have to setup call forwarding. How do we setup Call forwarding in
asterisk?. Eg. user dials a number and insert some mobile number for
forwarding and dial another number to cancel the forwarding. thanks a
lot.

I implemented this like so in my default context:

exten => _*21.,1,Answer()
same => n,GotoIf($["${CALLERID(num)}"="<redacted>"]?divert:void)
same => n(divert),Set(DB(divert/${CALLERID(num):-4})=${EXTEN:3})
same => n,Gosub(divertactive,1)
same => n,Hangup()
same => n(void),Gosub(divertvoid,1)
exten => _#21,1,Answer()
same => n,GotoIf($["${CALLERID(num)}"="<redacted>"]?divert:void)
same => n(divert),Verbose(0,${DB_DELETE(divert/${CALLERID(num):-4})})
same => n,Gosub(divertoff,1)
same => n,Hangup()
same => n(void),Gosub(divertvoid,1)

(note: use whatever you need in the GotoIf to validate that the phone
the call is from is permitted to set up call forwarding - unless you're
allowing it for all that can reach the context)

The divert{off,active,void} subroutines are where I handle the
announcements - but you could probably easily implement your own.

At the top of my [voicemail] context, I do this:

exten=>s,1,GotoIf(${DB_EXISTS(divert/${ARG3})}?outbound-standard,${DB_RESULT},1)

(ARG3 contains the last four digits of the number the call came to in
my case, and a success passes the call via the "outbound-standard"
context which is in my dialplan. Your exact requirements may vary but
this may help.)

--
Phil Reynolds
mail: phil-asterisk@tinsleyviaduct.com (phil-asterisk@tinsleyviaduct.com)
Web: http://phil.tinsleyviaduct.com/

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
mgliyanage.rc at gmail...
Guest





PostPosted: Thu Mar 03, 2016 1:41 pm    Post subject: [asterisk-users] Asterisk Call Forwarding Reply with quote

Hi

What is redacted means?


same => n,GotoIf($["${CALLERID(num)}"="<redacted>"]?divert:void)



Thanks
Best Regards,
Madushan


On Thu, Mar 3, 2016 at 10:58 PM, Madushan Geethanga <mgliyanage.rc@gmail.com (mgliyanage.rc@gmail.com)> wrote:
Quote:

Hi,


Thanks Phil, I will implement this and get back to you.


Best Regards,
Madushan
On Thu, Mar 3, 2016 at 4:12 PM, Phil Reynolds <phil-asterisk@tinsleyviaduct.com (phil-asterisk@tinsleyviaduct.com)> wrote:
Quote:
On Thu, 3 Mar 2016 08:21:14 +0530
Madushan Geethanga <mgliyanage.rc@gmail.com (mgliyanage.rc@gmail.com)> wrote:

Quote:
Hi
I have to setup call forwarding. How do we setup Call forwarding in
asterisk?. Eg. user dials a number and insert some mobile number for
forwarding and dial another number to cancel the forwarding. thanks a
lot.

I implemented this like so in my default context:

exten => _*21.,1,Answer()
same => n,GotoIf($["${CALLERID(num)}"="<redacted>"]?divert:void)
same => n(divert),Set(DB(divert/${CALLERID(num):-4})=${EXTEN:3})
same => n,Gosub(divertactive,1)
same => n,Hangup()
same => n(void),Gosub(divertvoid,1)
exten => _#21,1,Answer()
same => n,GotoIf($["${CALLERID(num)}"="<redacted>"]?divert:void)
same => n(divert),Verbose(0,${DB_DELETE(divert/${CALLERID(num):-4})})
same => n,Gosub(divertoff,1)
same => n,Hangup()
same => n(void),Gosub(divertvoid,1)

(note: use whatever you need in the GotoIf to validate that the phone
the call is from is permitted to set up call forwarding - unless you're
allowing it for all that can reach the context)

The divert{off,active,void} subroutines are where I handle the
announcements - but you could probably easily implement your own.

At the top of my [voicemail] context, I do this:

exten=>s,1,GotoIf(${DB_EXISTS(divert/${ARG3})}?outbound-standard,${DB_RESULT},1)

(ARG3 contains the last four digits of the number the call came to in
my case, and a success passes the call via the "outbound-standard"
context which is in my dialplan. Your exact requirements may vary but
this may help.)

--
Phil Reynolds
mail: phil-asterisk@tinsleyviaduct.com (phil-asterisk@tinsleyviaduct.com)
Web: http://phil.tinsleyviaduct.com/

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users






Back to top
asterisk.org at sedwar...
Guest





PostPosted: Thu Mar 03, 2016 1:44 pm    Post subject: [asterisk-users] Asterisk Call Forwarding Reply with quote

On Fri, 4 Mar 2016, Madushan Geethanga wrote:

Quote:
What is redacted means?

same => n,GotoIf($["${CALLERID(num)}"="<redacted>"]?divert:void)

Censored. Ususally for political reasons. In this case, the OP didn't want
to put a real phone number in a public list.

--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards sedwards@sedwards.com Voice: +1-760-468-3867 PST

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services