Asterisk ivr transfer problem

running Asterisk 1.4.36.
problem when incoming call from pstn to ivr.
when ivr answer and after background/playback then transfer caller to extension 1000.
while ext 1000 ringing the caller hangup but ext 1000 still ringing…
if i remove the ivr menu and inbound route to ext 1000 i had no problem with the hangup my asterisk wil detect busy signal and hangup.

here is the dialplan.

[from-pstn-menu]
exten => _.,1,Answer()
exten => _.,n,Background(custom/pstnmenu)
exten => _.,n,Background(silence/3)
exten => _.,n,Dial(SIP/1000,20,treifg)
exten => h,1,Hangup()

and asterisk cli.

    -- Starting simple switch on 'DAHDI/2-1'
    -- Executing [s@from-pstn-menu:1] Answer("DAHDI/2-1", "") in new stack
    -- Executing [s@from-pstn-menu:2] BackGround("DAHDI/2-1", "custom/pstnmenu") in new stack
    -- <DAHDI/2-1> Playing 'custom/pstnmenu' (language 'en')
    -- Executing [s@from-pstn-menu:3] BackGround("DAHDI/2-1", "silence/3") in new stack
    -- <DAHDI/2-1> Playing 'silence/3' (language 'en')
    -- Executing [s@from-pstn-menu:4] Dial("DAHDI/2-1", "SIP/1000|20|treifg") in new stack
    -- Called 1000
    -- SIP/1000-00000046 is ringing
    -- Nobody picked up in 20000 ms
  == Auto fallthrough, channel 'DAHDI/2-1' status is 'NOANSWER'
    -- Executing [h@from-pstn-menu:1] Hangup("DAHDI/2-1", "") in new stack
  == Spawn extension (from-pstn-menu, h, 1) exited non-zero on 'DAHDI/2-1'
    -- Hungup 'DAHDI/2-1'

please help… thanks…

anyone could give me a hand?

Generally speaking, using the _. is dangerous in that it matches everything. So for instance, when your Dial command times out, it comes back to the context and tries to do a t, which tries to execute the instructions again since t is a match for the _. pattern.

In any event, I think you you change your _. to s. you will have better results. Also, after you execute the dial, if it comes back, then hangup there.

So it would look like this…

[from-pstn-menu]
exten => s,1,Answer()
exten => s,n,Background(custom/pstnmenu)
exten => s,n,Background(silence/3)
exten => s,n,Dial(SIP/1000,20,treifg)
exten => s,n,Hangup()

mazzic i tried what u said change _. to s. i still getting the same result… any others solution please??

    -- Starting simple switch on 'DAHDI/2-1'
    -- Executing [s@from-pstn-menu:1] Answer("DAHDI/2-1", "") in new stack
    -- Executing [s@from-pstn-menu:2] BackGround("DAHDI/2-1", "custom/pstnmenu") in new stack
    -- <DAHDI/2-1> Playing 'custom/pstnmenu' (language 'en')
    -- Executing [s@from-pstn-menu:3] BackGround("DAHDI/2-1", "silence/3") in new stack
    -- <DAHDI/2-1> Playing 'silence/3' (language 'en')
    -- Executing [s@from-pstn-menu:4] Dial("DAHDI/2-1", "SIP/1000|20|treifg") in new stack
    -- Called 1000
    -- SIP/1000-00000001 is ringing
    -- Nobody picked up in 20000 ms
    -- Executing [s@from-pstn-menu:5] Hangup("DAHDI/2-1", "") in new stack
  == Spawn extension (from-pstn-menu, s, 5) exited non-zero on 'DAHDI/2-1'
    -- Hungup 'DAHDI/2-1'

I’d try changing your dial command to drop the options.

I had tried your initial code on my test system (1.6.2.6) and received similar results with the continued ringing since the _. was reexecuting the dial command on a timeout. After I made the changes I mentioned, it seemed to work. But on my dial line I had not options.

So it was just

Perhaps one of those options is causing the odd result.

Besides, I don’t think you need g (continue executing next context command when called party hangsup), e (execute h as peer when call ends), or r (indicate ringing). Atleast based on the provided code.

i tried removing the option still d same…

exten => s,1,Answer() ;;if i remove this line exten => s,n,Dial(SIP/1000,20) ;;and change this to s,1,Dial(SIP/1000,20) exten => s,n,Hangup()
then the hang up work perfectly…

if the dialplan like this im having problem with the hang up
after the background 5 sec and ext 1000 ring i hang up.

exten => s,1,Background(silence/5)
exten => s,n,Dial(SIP/1000,20)
exten => s,n,Hangup()

;;cli
 -- Starting simple switch on 'DAHDI/2-1'
    -- Executing [s@from-pstn-menu:1] BackGround("DAHDI/2-1", "silence/5") in new stack
    -- <DAHDI/2-1> Playing 'silence/5' (language 'en')
    -- Executing [s@from-pstn-menu:2] Dial("DAHDI/2-1", "SIP/1000|20") in new stack
    -- Called 1000
    -- SIP/1000-0000000c is ringing
    -- Nobody picked up in 20000 ms
    -- Executing [s@from-pstn-menu:3] Hangup("DAHDI/2-1", "") in new stack
  == Spawn extension (from-pstn-menu, s, 3) exited non-zero on 'DAHDI/2-1'
    -- Hungup 'DAHDI/2-1'

could u try this dial command please??
thanks