[solved] Calls redirection

Hi all,

I would like to make something like that:
when an extension registered in my asterisk recives a call, if the reciver is busy or has the softphone turned off i want asterisk to redirect the recived call to the personal mobile of the called person before the voicemail starts, if the mobile is off too or it’s busy, i want the voicemail to start.

I know i have to modify the dialplan but i don’t know where i have to madify it. I expecially don’t know what to add and where to add it.

I tought to add something like:

exten=401-NOANSWER,1,Dial (mISDN/1/mobile number)

one line for each extension… but i don’t know if is it right and i don’t know where to add it.

I’m using Asterisk 1.4.4.

Thanks for your help!

Maybe create a macro for the entire group and then assign that macro to each of their extensions (that way you can edit a single dial plan to chage all users).

so yes NOANSWER or BUSY could be used to check if the softphone doesn’t answer. Then if BUSY or NOANSWER, Goto() a new section that forwards to their cell. Then that function calls their cell and if BUSY or NO ANSWER, then goes to voice mail.

Maybe, maybe not.

I wrote a macro to link the mobile numbers to an internal number and one to ring internally, then the mobile and then the voicemail box. It looks something like below. It is not tested but it should work. You can make it as complicated as you like. I hope this helps.

exten => s,1,Macro(internal_mobile,${EXTEN}) ; extension is ment to be the number called
exten => s,n,Macro(route_call,${EXTEN},${MACRO_RESULT})

[macro-internal_mobile]
exten s,1,Goto(s-{ARG1})

exten s-5000,1,Set(MACRO_RESULT=${TRUNK}/0612345678&${TRUNK}/062212345678) ; call two numbers
exten s-5001,n,Set(MACRO_RESULT=0611234567)
; etc.etc.
exten s-XXXX,n,PlayBacl(not_a_valid_number)

[macro-route_call]
exten => s,1,Dial(SIP/${ARG1},10,rt) ; phone rings 10 seconds if ; ; available
exten => s,n,Dial({ARG2},10,rt) ; mobile rings 10 seconds
exten => s,n,VoiceMail(${ARG2}) ; caller enters voicemail

For some reason I couldn’t follow your system, lesouvage. But if it does what you say then it’s the solution the guy wanted.

But how about another method as a simple hack. Just call both his internal extension and his cell phone at the same time. Dial() supports multiple line calling. Then whichever line the Agent wants to answer they can choose. It’s a follow-me line, not great for this situation, but a simple solution if you need something quick.

Hi all and thank you for your replay!

I tried to insert in my dialplan what lesouvage wrote.

Maybe i did something wrong but i simply put it in my dialplan in this way:

[numberplan-custom-1]
plancomment=DialPlan1
exten=s,1,Macro(internal_mobile,${EXTEN})
exten=s,n,Macro(route_call,${EXTEN},${MACRO_RESULT})

include=default
exten=_9. ,1,Dial(mISDN/1/${EXTEN:1})

[Macro-internal_mobile]
exten=s,1,Goto(s-{ARG1})
exten=s-401,n,Set(MACRO_RESULT=349*********)

[Macro-route_call]
exten=s,1,Dial(SIP/${ARG1},10,rt)
exten=s,n,Dial({ARG2},10,rt)
exten=s,n,VoiceMail(${ARG2})

What happen now is that it complitey IGNORE what i added. It means that if a softphone is busy directly starts the voicemail without ringing the mobile.
Does anybody know the reason why?!?
Thanks a lot!!!

Ok, i solved the problem.

I just added into extensions.conf in the Macro that controls my Voicemail something like that:

exten=s-NOANSWER,1,Goto(s-${ARG1},1)
exten=s-401,1,Dial(mISDN/1/349********,20)
exten=s-401,2,Goto(s-NOANSWER,2)

exten=s-NOANSWER,2,Voicemail(${ARG1},u)
exten=s-NOANSWER,3,Goto(default,s,1)
exten=s-BUSY,1,Voicemail(${ARG1},b)
exten=s-BUSY,2,Goto(default,s,1)
exten=_s-.,1,Goto(s-NOANSWER,1)
exten=a,1,VoicemailMain(${ARG1})

one for each extension.

:wink: