Retry Call if not response or read DTMF if response

Hi all,

I’m new and would like to implement a new DialPlan for my office.
Today, in case of problems, the first level technician is called and if he doesn’t respond after 3 tests I forward it to the second level technician, using the files call under Outgoing e OutoGoing_Done

I would like to expand the escalation function also with the use of the DTMF function.

Specifically, without using call files, I would like to implement a dial plan with these functions:

To a problem, I call the user with the number MSISDN1
If he doesn’t answer, I wait 120 seconds and recall MSISDN1 for three times.
If he doesn’t answer I try call the MSISDN2 number for twice.

In the event that MSISDN1 or MSISDN2 responds in the attempts, I read the pushed key (ex 9) and in the positive case I hang up.

I’m using this dial plan, but it doesn’t work and I don’t understand where I’m going wrong.

[ZXB]
exten => s,n,Goto(s,1)
exten => _x.,1,Dial(SIP/${RepSYS}@SIPtrunkCiscoxH,15,t)
	same => n,NoOp( Dial Status: ${DIALSTATUS})
	same => n,GotoIf($["${DIALSTATUS}"!="ANSWER"]?redial1
	same => n,GotoIf($["${DIALSTATUS}"="ANSWER"]?response1

exten => _x.,2(redial1),Dial(SIP/${RepSYS}@SIPtrunkCiscoxH,15,t)
	same => n,NoOp( Dial Status: ${DIALSTATUS})
	same => n,GotoIf($["${DIALSTATUS}"!="ANSWER"]?redial2)
	same => n,GotoIf($["${DIALSTATUS}"="ANSWER"]?response1

exten => _x.,3(redial2),Dial(SIP/${RepSYS}@SIPtrunkCiscoxH,15,t)
	same => n,NoOp( Dial Status: ${DIALSTATUS})
    same => n,GotoIf($["${DIALSTATUS}"!="ANSWER"]?redial3)
    same => n,GotoIf($["${DIALSTATUS}"="ANSWER"]?response1
	
exten => _x.,4(redial3),Dial(SIP/${RepII}@SIPtrunkCiscoxH,15,t)
	same => n,NoOp( Dial Status: ${DIALSTATUS})
    same => n,GotoIf($["${DIALSTATUS}"!="ANSWER"]?redial4)
    same => n,GotoIf($["${DIALSTATUS}"="ANSWER"]?response1

exten => _x.,5(redial4),Dial(SIP/${RepII}@SIPtrunkCiscoxH,15,t)
	same => n,NoOp( Dial Status: ${DIALSTATUS})
    same => n,GotoIf($["${DIALSTATUS}"!="ANSWER"]?redial5)
    same => n,GotoIf($["${DIALSTATUS}"="ANSWER"]?response1

exten => _x.,6(redial5),Dial(SIP/${RepIII}@SIPtrunkCiscoxH,15,t)
	same => n,NoOp( Dial Status: ${DIALSTATUS})
	same => n,GotoIf($["${DIALSTATUS}"!="ANSWER"]?redial6)
	same => n,GotoIf($["${DIALSTATUS}"="ANSWER"]?response1

exten => _x.,7(redial6),Dial(SIP/${RepIII}@SIPtrunkCiscoxH,15,t)
	same => n,NoOp( Dial Status: ${DIALSTATUS})
	same => n,GotoIf($["${DIALSTATUS}"!="ANSWER"]?redial6)
	same => n,GotoIf($["${DIALSTATUS}"="ANSWER"]?response1
	
exten => _x.,8(response1),Background(you-press-number)
exten => _x.,9,Read(NUMBER,9)
	same => n,GotoIf($[${NUMBER}==9]?Hangup)

exten => _x.,10(Hangup),Hangup

Help me!!!

In the first instance I would recommend that you expand upon “it doesn’t work”.

Tell us what does happen.

In the second instance I would recommend that you upgrade from chan_sip (which
is both deprecated and unsupported) to chan_pjsip, otherwise as time goes by
you will simply run out of people here who know how to help with questions.

Finally, I don’t think you’ve quite got the hang of context / extension /
priority.

You have a context called ZXB

In that you have an extension _x. which I suspect you actually want to be _X.

That extension starts with priority 1 - good.

That’s followed by three “same => n”, which will create priorities 2, 3 and 4.

However you then define extension _x. all over again, and start with priority
2.

I suggest you try the command “asterisk -Rx ‘dialplan show ZXB’” in order to
see what Asterisk thinks you meant by all of this.

Regards,

Antony.

Where is s,1 ?

And what was the priority immediately before that line?

I’m afraid you need to retake Asterisk 101; you have fundamental misunderstandings about Asterisk “priorities”, and you also don’t understand how Dial handles successful calls.

Taking this fragment

It is equivalent to:

I apologize for my mistakes but I’m new in Asterisk and make stupid mistakes.

However I simplified the dial plan and changed the priorities.

I will study well the extention and if necessary I will come back to you with other questions, hopefully not stupid ones.

Sorry and thanks again for your suggestions

I would recommend that when you are this new to Asterisk you start with
something much simpler and build things up gradually, rather than trying to do
too much all at once (and then having very little clue where the problem could
be, because there are too many unfamiliar things all at once).

Antony.

Hi Antony, thanks for your suggestion. I try not to do difficult things, but it is stronger than me. hahaha

However, I think I succeeded. in the next post, I will explain what I did and I accept suggestions for possible improvements.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.