Asterisk: incoming calls

Hi everybody :smile:…
I’ve just begin with Asterisk, and i’ve some problems…
I must do manage incoming calls in this mode: when the internal phone is busy then playback a message (example “the phone is busy”), when not answer then playback a message (example “wait”).
After 10 seconds try to see if the phone is busy yet or no answer.

this is my context ringin “extensions.conf”

[ringroups-custom-4]
gui_ring_groupname=test
exten=s,1,NoOp(RINGGROUP)
exten=s,n,Dial(SIP/6011,10)
exten=s,n,GotoIf($["${DIALSTATUS}" = “BUSY”]?busy:unavail)
exten=s,n(unavail),Playback(no-answer)
exten=s,n,Wait(10)
exten=s,n,Goto(ringroups-custom-4,s,1)
exten=s,n,Hangup()
exten=s,n(busy),Playback(phone-busy)
exten=s,n,Wait(10)
exten=s,n,Goto(ringroups-custom-4,s,1)
exten=s,n,Hangup()

I try this, but the phone rings for 10 seconds - playback “no answer” - wait 10 seconds (during the wait of 10 seconds the phone dosn’t ring…) - goto dial - and restart…

And the state of “busy” is not correct because the phone rings though i have up the phone…

…I’M SORRY FOR MY ENGLISH :unamused:

PLEASE HELP ME… :frowning:

What You’ve produced is a kind of an endless loop which could only be stoped if the call is either answered or the caller hangs up. I don’t know if this is really Your intention :question:
Second:

is not a good assumption as there are a lot of possible dialstates i.e. not beeing “BUSY” does not really imply “UNAVAIL” but may also be e.g. “CHANUNAVAIL”, “CONGESTION” or “CANCEL” which maybe should be treated in another way.

However in You example the BUSY-case should (beside the endless-loop-effect) work as expected: Ring max 10 seconds, 10 seconds break, ring again a.s.o.
And for all other cases where there is not an ANSWER from Your station it should end up in the same proceduree but using the other soundfile.
In the ANSWER-case this should work as the Commands after the Dial won’t get exeecuted in this case.

[quote=“abw1oim”]What You’ve produced is a kind of an endless loop which could only be stoped if the call is either answered or the caller hangs up. I don’t know if this is really Your intention :question:
Second:

is not a good assumption as there are a lot of possible dialstates i.e. not beeing “BUSY” does not really imply “UNAVAIL” but may also be e.g. “CHANUNAVAIL”, “CONGESTION” or “CANCEL” which maybe should be treated in another way.

However in You example the BUSY-case should (beside the endless-loop-effect) work as expected: Ring max 10 seconds, 10 seconds break, ring again a.s.o.
And for all other cases where there is not an ANSWER from Your station it should end up in the same proceduree but using the other soundfile.
In the ANSWER-case this should work as the Commands after the Dial won’t get exeecuted in this case.[/quote]

Thanks for your answer :wink:

I would realize this: when incoming a call there are two cases (the phone is busy or no answer, e.g. i’m not in office), when the phone is busy then hear a vocal message to the caller (e.g. “the phone is busy”), and when the phone rings but there isn’t answer then hear a vocal message to the caller (e.g. “no answer wait”).

i must to do only this two cases…can you write me a code please…

You’ve got it already. If You delete the looping goto-stateements, then the announces are give only once and the caller will be hung up afterwards. Your original post leeds to the assumption that You want to have the loop as it was coded by You.
Thus I actually not realize what exactly You want and where Your actual impleementation doesn’t meet Your requireements :question: