[Asterisk-Users] Call forwarding

justin justin123 at optushome.com.au
Wed Mar 24 01:51:12 MST 2004


hey

ive got call forwarding working using the example below. The first part is 
basicaly my dialplan for all users... and does the call forward checking. 
first it checks if its going to forward to an external number ( use IAX) 
then it checks if it has to forward localy ( use SIP) then it rings the 
number, then voicemail etc etc..
The second part is how you enable/disable your forwarding.

Hope this works for you to.

exten => s,1,SetAccount(LOCAL-EXTEN)
exten => s,2,DBget(temp=CFIMIAX/${ARG1})
exten => s,3,Dial(IAX/XXXX:XXXXX at X.X.X.X/${temp}@XXXX,80)
exten => s,4,DBget(temp=CFIM/${ARG1})
exten => s,5,Dial(SIP/${temp},16)
exten => s,6,Dial(SIP/${ARG1},16)
exten => s,7,Voicemail(u${ARG1})

exten => s,103,Goto(s,4)
exten => s,105,Goto(s,6)

--------------------------------------------

[forwarding]
exten => _**88XXXX,1,NoCDR()
exten => _**88XXXX,2,DBput(CFIM/${CALLERIDNUM}=${EXTEN:4})
exten => _**88XXXX,3,DBdel(CFIMIAX/${CALLERIDNUM})
exten => _**88XXXX,4,Answer
exten => _**88XXXX,5,Playback(fwd2apu)
exten => _**88XXXX,6,SayDigits(${EXTEN:4})
exten => _**88XXXX,7,Hangup

;delete
exten => _**89,1,NoCDR()
exten => _**89,2,DBdel(CFIM/${CALLERIDNUM})
exten => _**89,3,DBdel(CFIMIAX/${CALLERIDNUM})
exten => _**89,4,Answer
exten => _**89,5,Playback(fwdisabapu)
exten => _**89,6,Hangup

[forwarding-pstn]
;checks to see if number is mroe than 4 xxxx's than assumes its pstn
exten => _**88XXXXXX.,1,NoCDR()
exten => _**88XXXXXX.,2,DBput(CFIMIAX/${CALLERIDNUM}=${EXTEN:4})
exten => _**88XXXXXX.,3,DBdel(CFIM/${CALLERIDNUM})
exten => _**88XXXXXX.,4,Answer
exten => _**88XXXXXX.,5,Playback(fwd2apu)
exten => _**88XXXXXX.,6,SayDigits(${EXTEN:4})
exten => _**88XXXXXX.,7,Hangup



Justin

At 09:31 PM 23/03/2004 -0700, you wrote:

>We're are trying to get call forwarding working on our Asterisk
>PBX. I've found some examples like this:
>
>exten => _*72.,1,DBput(CFIM/${CALLERIDNUM}=${EXTEN:3})
>exten => _*72.,2,Answer
>exten => _*72.,3,Wait(1)
>exten => _*72.,4,SayDigits(${CALLERIDNUM})
>exten => _*72.,5,SayDigits(${EXTEN:3})
>exten => _*72.,6,Hangup
>
>However this doesn't seem to work. I read that Asterisk
>uses a Berkeley DB1 internally. This should be built into
>it with the source? Are there any examples to get this
>working correctly?
>
>Thank you,
>
>Jeroen Moetwil
>_______________________________________________
>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