My calling repeat twice time

exten=>.,1,Set(CALLERID(num)=${cid})
exten=>
.,n,Gosub(monitor,${EXTEN},1)
same => _X!,1,Answer()
same => n,WaitForSilence(1500,1)
same => n,Playback(voice0)
same => n,Read(dtmfno,voice0,20)
same => n,NoOp(${dtmfno})
same => n,AGI(cx_agi/11111.py,${CALLERID(number)},${EXTEN},${dtmfno})
same => n,WaitForSilence(1500,1)
same => n,BackGround(voice0.wav)
same => n,WaitForSilence(1500,1)
same => n,hangup()

[monitor]
exten=>.,1,set(path=/var/www/html/rec/)
same=>n,Mixmonitor(${path}${STRFTIME(${EPOCH},%Y-%m-%d
%H-%M-%S)}-${EXTEN}${type}${src}.wav)
same=>n,return()

how to do to make standard dialplan? and how to stop repeat call flow?

Please don’t ask people questions using PMs. (This was also posted direct to me.)

I am urgent.
so i sent PM to you.
plz understand and help me

Please post a full call trace via pastebin

– Called 99904443453888000@out1/n
– Executing [99904443453888000@out1:1] Set(“Local/99904443453888000@out1-00000000;2”, “CALLERID(num)=443453888000”) in new stack
– Executing [99904443453888000@out1:2] Gosub(“Local/99904443453888000@out1-00000000;2”, “monitor,99904443453888000,1”) in new stack
– Executing [99904443453888000@monitor:1] Set(“Local/99904443453888000@out1-00000000;2”, “path=/var/www/html/rec/”) in new stack
– Executing [99904443453888000@monitor:2] MixMonitor(“Local/99904443453888000@out1-00000000;2”, “/var/www/html/rec/2022-06-29_21-43-06-99904443453888000__99904443453888000.wav”) in new stack
– Executing [99904443453888000@monitor:3] Return(“Local/99904443453888000@out1-00000000;2”, “”) in new stack
– Executing [99904443453888000@out1:3] Answer(“Local/99904443453888000@out1-00000000;2”, “”) in new stack
== Begin MixMonitor Recording Local/99904443453888000@out1-00000000;2
– Local/99904443453888000@out1-00000000;1 answered
– Executing [99904447931792413@out2:1] ResetCDR(“Local/99904443453888000@out1-00000000;1”, “”) in new stack
– Executing [99904447931792413@out2:2] Set(“Local/99904443453888000@out1-00000000;1”, “CALLERID(num)=443453888000”) in new stack
– Executing [99904447931792413@out2:3] Set(“Local/99904443453888000@out1-00000000;1”, “CALLERID(name)=”) in new stack
– Executing [99904447931792413@out2:4] Dial(“Local/99904443453888000@out1-00000000;1”, “SIP/99904447931792413@IDT”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called SIP/99904447931792413@IDT
– Executing [99904443453888000@out1:4] WaitForSilence(“Local/99904443453888000@out1-00000000;2”, “1500,1”) in new stack
– Waiting 1 time(s) for 1500ms of silence with 0s timeout
> 0x7f2abc013540 – Strict RTP learning after remote address set to: 169.132.218.152:20662
– SIP/IDT-00000000 is making progress passing it to Local/99904443453888000@out1-00000000;1
> 0x7f2abc013540 – Strict RTP learning after remote address set to: 169.132.218.152:20662
– SIP/IDT-00000000 is making progress passing it to Local/99904443453888000@out1-00000000;1
> 0x7f2abc013540 – Strict RTP switching to RTP target address 169.132.218.152:20662 as source
– SIP/IDT-00000000 is ringing
> 0x7f2abc013540 – Strict RTP learning complete - Locking on source address 169.132.218.152:20662
– SIP/IDT-00000000 answered Local/99904443453888000@out1-00000000;1
– Channel SIP/IDT-00000000 joined ‘simple_bridge’ basic-bridge
– Channel Local/99904443453888000@out1-00000000;1 joined ‘simple_bridge’ basic-bridge
– Exiting with 1500ms of silence >= 1500ms required
– Executing [99904443453888000@out1:5] Playback(“Local/99904443453888000@out1-00000000;2”, “voice0.wav”) in new stack
[2022-06-29 21:43:19] DEBUG[6330][C-00000001]: format_wav.c:192 check_header: Skipping unknown block ‘LIST’
– <Local/99904443453888000@out1-00000000;2> Playing ‘voice0.wav.slin’ (language ‘en’)
– Executing [99904443453888000@out1:6] Read(“Local/99904443453888000@out1-00000000;2”, “dtmfno,voice0.wav,20”) in new stack
– Accepting a maximum of 20 digits.
[2022-06-29 21:43:29] DEBUG[6330][C-00000001]: format_wav.c:192 check_header: Skipping unknown block ‘LIST’
– <Local/99904443453888000@out1-00000000;2> Playing ‘voice0.wav.slin’ (language ‘en’)
– Channel SIP/IDT-00000000 left ‘simple_bridge’ basic-bridge
– Channel Local/99904443453888000@out1-00000000;1 left ‘simple_bridge’ basic-bridge
== Spawn extension (out2, 99904447931792413, 4) exited non-zero on ‘Local/99904443453888000@out1-00000000;1’
– Executing [h@out2:1] ResetCDR(“Local/99904443453888000@out1-00000000;1”, “”) in new stack
– Executing [h@out2:2] Set(“Local/99904443453888000@out1-00000000;1”, “CALLERID(num)=443453888000”) in new stack
– Executing [h@out2:3] Set(“Local/99904443453888000@out1-00000000;1”, “CALLERID(name)=”) in new stack
– Executing [h@out2:4] Dial(“Local/99904443453888000@out1-00000000;1”, “SIP/h@IDT”) in new stack
– Caller hung up before dial.
== Spawn extension (out2, h, 4) exited non-zero on ‘Local/99904443453888000@out1-00000000;1’
– User disconnected
– Executing [h@out1:1] Set(“Local/99904443453888000@out1-00000000;2”, “CALLERID(num)=443453888000”) in new stack
– Executing [h@out1:2] Gosub(“Local/99904443453888000@out1-00000000;2”, “monitor,h,1”) in new stack
– Executing [h@monitor:1] Set(“Local/99904443453888000@out1-00000000;2”, “path=/var/www/html/rec/”) in new stack
– Executing [h@monitor:2] MixMonitor(“Local/99904443453888000@out1-00000000;2”, “/var/www/html/rec/2022-06-29_21-43-48-h__99904443453888000.wav”) in new stack
– Executing [h@monitor:3] Return(“Local/99904443453888000@out1-00000000;2”, “”) in new stack
– Executing [h@out1:3] Answer(“Local/99904443453888000@out1-00000000;2”, “”) in new stack
== Spawn extension (out1, h, 3) exited non-zero on ‘Local/99904443453888000@out1-00000000;2’

Show me the [out2] context in your dialplan

[out2]
exten=>.,1,ResetCDR()
exten=>
.,n,Set(CALLERID(num)=${cid})
exten=>_.,n,Set(CALLERID(name)=${cidname})
same=> n,Dial(SIP/${EXTEN}@${trunk})
same=> n,Answer()
same => n,WaitForSilence(1500,1)
same => n,Playback(voice0)
same=>n,hangup()

Should be ‘exten’ not ‘same’.

[out1]
exten=>.,1,Set(CALLERID(num)=${cid})
exten=>
.,n,Gosub(monitor,${EXTEN},1)
exten=> _X!,1,Answer()
same => n,WaitForSilence(1500,1)
same => n,Playback(voice0.wav)
same => n,Read(dtmfno,voice0.wav,20)
same => n,NoOp(${dtmfno})
same => n,AGI(cx_agi/dtmf.py,${CALLERID(number)},${EXTEN},${dtmfno})
same => n,WaitForSilence(1500,1)
same => n,BackGround(voice0.wav)
same => n,WaitForSilence(1500,1)
same => n,hangup()

so like this?

Yes.
‘same’ could be used if the ‘_X!’ was not specified and ‘n’ was used and not ‘1’.

will try with above way

“same => n,hangup()”
this is last line.
in out 1 plan, have tosame => n,hangup() or n,Dial(SIP/${EXTEN}) ?
I am not sure about this too.
about this, could you explain shortly?

My comment was purely about syntax not functionality.
The ‘hangup’ and ‘dial’ apps do what you would expect them to do. ‘Dial’ would probably be ringing a phone and ‘hangup’ would not!

These line run [out2] again when the call hangup:

[out2]
exten=>.,1,ResetCDR()
exten=>.,n,Set(CALLERID(num)=${cid})
exten=>_.,n,Set(CALLERID(name)=${cidname})

exten => ., and exten =>_., catch everything, including h (hangup event)

Try this:
[out2]
exten =>_X.,1,ResetCDR()
same => n,Set(CALLERID(num)=${cid})
same => n,Set(CALLERID(name)=${cidname})

Apply these change to [out1] and [monitor], or other contexts too, if you don’t want any trouble

Not as written. There would have to be _'s before all the .'s. As written, they are unlikely to be executed, as it is difficult to send a phone number consisting of a dot.

You are right, then the [out2] is:
[out2]
exten=> _.,1,ResetCDR()
exten=> _.,n,Set(CALLERID(num)=${cid})
exten=> _.,n,Set(CALLERID(name)=${cidname})

And the op post it wrong

In the future, please try to post via pastebin, as mentioned.

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