Problem for a dial after a background


#1

hello.

I have tried somethinf till this mornig and it does’nt work.

I want asterisk to asnwer
exten => s,1,answer

than play a background (waiting for the caller to enter an extension number)
exten => s,2,background…

but, if the backround prompts finish, i want asterisk to call a local telephone.

i tried
exten => s,3,dial…
or
exten => t,1,dial…

each time, when the prompt finish, it hang up the line.

is there a way to tell him to dial a phone after the background prompt has finished if the caller does’nt enter an extension number ?

thank you.


#2

Hi :smile:

Maybe you need to add parameter “g” to your dial command (see voip-info.org/wiki/index.php … k+cmd+Dial).

HTH, Sancho


#3

thank you for your answer.

but my problem is that asterisk hangs up the caller after the prompt of the background and BEFORE the dial occures.

What i want is that it finish the prompt of the background command and then make ring the local phones. But asterisk hangs up BEFORE any phone rings.

Do you have an idea ?


#4

I think you should add
exten => 1,1,dial
exten => 2,1,dial
instead of
exten => s,3,dial or exten => t,1,dial
becuase exten => s,3,dial will be exec immediately when background start. There may not be an exten. exten => t,1dial will be exec when timeout.

Let’s try.


#5

[incoming]
exten => s,1,Answer
exten => s,2,ResponseTimeout(5)
exten => s,3,Background(mymenu)
exten => s,4,Background(chooseSomething)

exten => t,1,Goto(s,2)

exten => i,1,Playback(pbx-invalid)
exten => i,2,Goto(s,2)

exten => 1,1,DoSomething

exten => 2,1,DoSomethingElse

exten => 3,1,Dial(…)

I think this one is for your purpose. This is background example.