[Asterisk-Users] How to do Call Forwarding

Ben Higley pbx at itsngroup.com
Wed Oct 26 12:45:42 MST 2005


This is a portion of my extensions..

i have also in my mysql db extensions table a
exten => _*23.,1,SetVar(CF_DEST=${EXTEN:3} )
exten => _*23.,2,Noop(Call forwarding to ${CF_DEST} for exten:
${CALLERIDNUM})


then write that value into the database, for that extension that is
calling, ${CALLERIDNUM}



[macro-dial-call-forwarding-number]
exten => s,1,SetCallerID(${CALLERIDNUM:1})
;if the password is balnk then just use the TECHNOLOGY/PROVIDER_USER_NAME
exten => s,2,GotoIf($["${LD_PROVIDER_PASSWORD}" = ""]?3:6)
exten =>
s,3,Dial(${LD_PROVIDER_TECHNOLOGY}/${LD_PROVIDER_USERNAME}@${LD_PROVIDER_NAME}/${ARG1}|${CALL_FWD_TIMEOUT}|mtT)
exten => s,4,Goto(s|7)
exten => s,5,Hangup
exten =>
s,6,Dial(${LD_PROVIDER_TECHNOLOGY}/${LD_PROVIDER_USERNAME}:${LD_PROVIDER_PASSWORD}@${LD_PROVIDER_NAME}/${ARG1}|${CALL_FWD_TIMEOUT}|mtT)
exten => s,7,Cepstral("The calling party did not answer, and has no
mailbox, please try your call again later, thank you")
exten => s,8,Congestion
exten => s,9,Hangup

[macro-check-for-call-forwarding]
exten => s,1,NoOp(Looking up forward for exten: ${ARG1})
exten => s,2,NoOp
exten => s,3,MYSQL(Connect connid ${MYSQL_HOST} ${MYSQL_USER}
${MYSQL_PASS} ${MYSQL_DB})

;set the select so that feature_id=1 (call_forwarding) and status=1 (enabled)
exten => s,4,MYSQL(Query resultid ${connid} select\ data\ from\
extension_features\ where\ extension='${ARG1}'\ AND\ feature_id='1'\ AND\
status='1')
exten => s,5,MYSQL(Fetch foundRow ${resultid} number) ; fetch row
exten => s,6,GotoIf($["${foundRow}" = "1"]?7:9) ; leave loop if no row found
exten => s,7,NoOp(${number})
exten => s,8,Set(CF_DEST=${number})
exten => s,9,Macro(disconnect-mysql|${resultid}|${connid})
exten => s,10,MacroExit


>  What does your extensions.conf look like now to try and implement this?
> Some prior examples that were based on jumping priorities may not work so
> well with a stock 1.2b install where priorityjumping=no in
> extensions.conf.
>
> On 10/26/05, Ben Higley <pbx at itsngroup.com> wrote:
>>
>>
>> yes.. that is what i was talkinga bout.. it's *xx keysequence followed
>> by
>> number.. where you dial it from the extension you are trying to forward.
>>
>> ./Ben
>>
>> > I was hoping there would be something considerably more simple.
>> >
>> > For example, on my legacy PBX, all I need do is press the "Call Fwd"
>> > button on my phone, followed by an extension. Something similar (like
>> > *72#<ext>) would be nice.
>> >
>> >
>> > David A. Morrow
>> > Technical Systems Lead
>> > Autodata Solutions Company
>> > David.Morrow at Autodata.Net
>> > http://www.autodata.net
>> > Tel: (519) 951-6079
>> > Fax: (519) 451-6615
>> >
>> > < Poor planning on your part does not necessarily constitute an
>> > emergency on my part! >
>> >
>> > This message has originated from Autodata Solutions. The attached
>> > material is the Confidential and Proprietary Information of Autodata
>> > Solutions. This email and any files transmitted with it are
>> confidential
>> > and intended solely for the use of the individual or entity to whom
>> they
>> > are addressed. If you have received this email in error please delete
>> > this message and notify the Autodata system administrator at
>> > Administrator at autodata.net <mailto:Administrator at autodata.net>
>> >
>> > -----Original Message-----
>> > From: asterisk-users-bounces at lists.digium.com
>> > [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Ben
>> Higley
>> > Sent: Wednesday, October 26, 2005 1:34 PM
>> > To: Asterisk Users Mailing List - Non-Commercial Discussion
>> > Subject: Re: [Asterisk-Users] How to do Call Forwarding
>> >
>> >
>> > i have implemented something using mysql.. and thus i have a
>> > phone-features page that allows me to login / authenticate using the
>> > voicemail-users table for the pin and extension.. and then set the
>> > destination number, and then turn it on or off.
>> >
>> > then in the dialplan, mysql kicks in and checks to see if there is an
>> > enabled destination number and re-routes the incoming call WITH their
>> > caller id to that new destination.. works great... contact me off line
>> > if you would like some information.
>> >
>> > ./Ben
>> >
>> >> Hi all. I am attempting to setup a dial plan which will allow me to
>> >> forward an extension using the handset. I have followed the
>> >> instructions in
>> >> http://www.voip-info.org/wiki/index.php?page=Asterisk%20call%20forward
>> >> ing however it does not work correctly. Does anyone have some
>> >> expertise they could lend.
>> >> Not sure if it matters, but when I setup as in these instructions,
>> and
>> >
>> >> attempt to call forward my phone, asterisk logs when in fact I am
>> >> attempting to forward to extension 8001 ; == Spawn extension
>> (default,
>> >
>> >> *21*800, 4) exited non-zero on 'SIP/8001-9be7'
>> >>
>> >>
>> >> David A. Morrow
>> >> Technical Systems Lead
>> >> Autodata Solutions Company
>> >> David.Morrow at Autodata.Net
>> >> http://www.autodata.net
>> >> Tel: (519) 951-6079
>> >> Fax: (519) 451-6615
>> >>
>> >> < Poor planning on your part does not necessarily constitute an
>> >> emergency on my part! >
>> >>
>> >> This message has originated from Autodata Solutions. The attached
>> >> material is the Confidential and Proprietary Information of Autodata
>> > Solutions.
>> >> This email and any files transmitted with it are confidential and
>> >> intended solely for the use of the individual or entity to whom they
>> > are addressed.
>> >> If you have received this email in error please delete this message
>> >> and notify the Autodata system administrator at
>> >> Administrator at autodata.net <mailto:Administrator at autodata.net>
>> >>
>> >> _______________________________________________
>> >> --Bandwidth and Colocation sponsored by
>> Easynews.com<http://Easynews.com>--
>> >>
>> >> Asterisk-Users mailing list
>> >> Asterisk-Users at lists.digium.com
>> >> http://lists.digium.com/mailman/listinfo/asterisk-users
>> >> To UNSUBSCRIBE or update options visit:
>> >> http://lists.digium.com/mailman/listinfo/asterisk-users
>> >
>> >
>> > _______________________________________________
>> > --Bandwidth and Colocation sponsored by
>> Easynews.com<http://Easynews.com>--
>> >
>> > Asterisk-Users mailing list
>> > Asterisk-Users at lists.digium.com
>> > http://lists.digium.com/mailman/listinfo/asterisk-users
>> > To UNSUBSCRIBE or update options visit:
>> > http://lists.digium.com/mailman/listinfo/asterisk-users
>> > _______________________________________________
>> > --Bandwidth and Colocation sponsored by
>> Easynews.com<http://Easynews.com>--
>> >
>> > Asterisk-Users mailing list
>> > Asterisk-Users at lists.digium.com
>> > http://lists.digium.com/mailman/listinfo/asterisk-users
>> > To UNSUBSCRIBE or update options visit:
>> > http://lists.digium.com/mailman/listinfo/asterisk-users
>> >
>>
>>
>> _______________________________________________
>> --Bandwidth and Colocation sponsored by Easynews.com
>> <http://Easynews.com>--
>>
>> Asterisk-Users mailing list
>> Asterisk-Users at lists.digium.com
>> http://lists.digium.com/mailman/listinfo/asterisk-users
>> To UNSUBSCRIBE or update options visit:
>> http://lists.digium.com/mailman/listinfo/asterisk-users
>>
> _______________________________________________
> --Bandwidth and Colocation sponsored by Easynews.com --
>
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users





More information about the asterisk-users mailing list