Originate to extension can´t remote hang up

Hi,

I am using Asterisk Java to create a remote call to a telephone that is outside of my network

asteriskServer.originateToExtension(“DAHDI/g0/myNumber”, “default”, “2501”, 1, 10000);

The problem that I have is that the agent is able to finish the call, but the one that is called is not able to finish the call.

This is the output of the cli. Please let me know if more info is needed.

    -- Executing [2501@default:1] Macro("DAHDI/i1/myNumber-33", "exten-vm,novm,2501") in new stack
    -- Executing [s@macro-exten-vm:1] Macro("DAHDI/i1/myNumber-33", "user-callerid,") in new stack
    -- Executing [s@macro-user-callerid:1] Set("DAHDI/i1/myNumber-33", "AMPUSER=") in new stack
    -- Executing [s@macro-user-callerid:2] GotoIf("DAHDI/i1/myNumber-33", "0?report") in new stack
    -- Executing [s@macro-user-callerid:3] ExecIf("DAHDI/i1/myNumber-33", "1?Set(REALCALLERIDNUM=)") in new stack
    -- Executing [s@macro-user-callerid:4] Set("DAHDI/i1/myNumber-33", "AMPUSER=") in new stack
    -- Executing [s@macro-user-callerid:5] Set("DAHDI/i1/myNumber-33", "AMPUSERCIDNAME=") in new stack
    -- Executing [s@macro-user-callerid:6] GotoIf("DAHDI/i1/myNumber-33", "1?report") in new stack
    -- Goto (macro-user-callerid,s,10)
    -- Executing [s@macro-user-callerid:10] GotoIf("DAHDI/i1/myNumber-33", "0?continue") in new stack
    -- Executing [s@macro-user-callerid:11] Set("DAHDI/i1/myNumber-33", "__TTL=64") in new stack
    -- Executing [s@macro-user-callerid:12] GotoIf("DAHDI/i1/myNumber-33", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,19)
    -- Executing [s@macro-user-callerid:19] Set("DAHDI/i1/myNumber-33", "CALLERID(number)=") in new stack
    -- Executing [s@macro-user-callerid:20] Set("DAHDI/i1/myNumber-33", "CALLERID(name)=") in new stack
    -- Executing [s@macro-user-callerid:21] NoOp("DAHDI/i1/myNumber-33", "Using CallerID "" <>") in new stack
    -- Executing [s@macro-exten-vm:2] Set("DAHDI/i1/myNumber-33", "RingGroupMethod=none") in new stack
    -- Executing [s@macro-exten-vm:3] Set("DAHDI/i1/myNumber-33", "VMBOX=novm") in new stack
    -- Executing [s@macro-exten-vm:4] Set("DAHDI/i1/myNumber-33", "__EXTTOCALL=2501") in new stack
    -- Executing [s@macro-exten-vm:5] Set("DAHDI/i1/myNumber-33", "CFUEXT=") in new stack
    -- Executing [s@macro-exten-vm:6] Set("DAHDI/i1/myNumber-33", "CFBEXT=") in new stack
    -- Executing [s@macro-exten-vm:7] Set("DAHDI/i1/myNumber-33", "RT=""") in new stack
    -- Executing [s@macro-exten-vm:8] Macro("DAHDI/i1/myNumber-33", "record-enable,2501,IN") in new stack
    -- Executing [s@macro-record-enable:1] GotoIf("DAHDI/i1/myNumber-33", "1?check") in new stack
    -- Goto (macro-record-enable,s,4)
    -- Executing [s@macro-record-enable:4] ExecIf("DAHDI/i1/myNumber-33", "0?MacroExit()") in new stack
    -- Executing [s@macro-record-enable:5] GotoIf("DAHDI/i1/myNumber-33", "0?Group:OUT") in new stack
    -- Goto (macro-record-enable,s,15)
    -- Executing [s@macro-record-enable:15] GotoIf("DAHDI/i1/myNumber-33", "1?IN") in new stack
    -- Goto (macro-record-enable,s,20)
    -- Executing [s@macro-record-enable:20] ExecIf("DAHDI/i1/myNumber-33", "1?MacroExit()") in new stack
    -- Executing [s@macro-exten-vm:9] Macro("DAHDI/i1/myNumber-33", "dial-one,"",,2501") in new stack
    -- Executing [s@macro-dial-one:1] Set("DAHDI/i1/myNumber-33", "DEXTEN=2501") in new stack
    -- Executing [s@macro-dial-one:2] Set("DAHDI/i1/myNumber-33", "DIALSTATUS_CW=") in new stack
    -- Executing [s@macro-dial-one:3] GosubIf("DAHDI/i1/myNumber-33", "0?screen,1") in new stack
    -- Executing [s@macro-dial-one:4] GosubIf("DAHDI/i1/myNumber-33", "0?cf,1") in new stack
    -- Executing [s@macro-dial-one:5] GotoIf("DAHDI/i1/myNumber-33", "1?skip1") in new stack
    -- Goto (macro-dial-one,s,8)
    -- Executing [s@macro-dial-one:8] GotoIf("DAHDI/i1/myNumber-33", "0?nodial") in new stack
    -- Executing [s@macro-dial-one:9] GotoIf("DAHDI/i1/myNumber-33", "0?continue") in new stack
    -- Executing [s@macro-dial-one:10] Set("DAHDI/i1/myNumber-33", "EXTHASCW=") in new stack
    -- Executing [s@macro-dial-one:11] GotoIf("DAHDI/i1/myNumber-33", "1?next1:cwinusebusy") in new stack
    -- Goto (macro-dial-one,s,12)
    -- Executing [s@macro-dial-one:12] GotoIf("DAHDI/i1/myNumber-33", "0?docfu:skip3") in new stack
    -- Goto (macro-dial-one,s,16)
    -- Executing [s@macro-dial-one:16] GotoIf("DAHDI/i1/myNumber-33", "1?next2:continue") in new stack
    -- Goto (macro-dial-one,s,17)
    -- Executing [s@macro-dial-one:17] GotoIf("DAHDI/i1/myNumber-33", "1?continue") in new stack
    -- Goto (macro-dial-one,s,25)
    -- Executing [s@macro-dial-one:25] GotoIf("DAHDI/i1/myNumber-33", "0?nodial") in new stack
    -- Executing [s@macro-dial-one:26] GosubIf("DAHDI/i1/myNumber-33", "1?dstring,1:dlocal,1") in new stack
    -- Executing [dstring@macro-dial-one:1] Set("DAHDI/i1/myNumber-33", "DSTRING=") in new stack
    -- Executing [dstring@macro-dial-one:2] Set("DAHDI/i1/myNumber-33", "DEVICES=2501") in new stack
    -- Executing [dstring@macro-dial-one:3] ExecIf("DAHDI/i1/myNumber-33", "0?Return()") in new stack
    -- Executing [dstring@macro-dial-one:4] ExecIf("DAHDI/i1/myNumber-33", "0?Set(DEVICES=501)") in new stack
    -- Executing [dstring@macro-dial-one:5] Set("DAHDI/i1/myNumber-33", "LOOPCNT=1") in new stack
    -- Executing [dstring@macro-dial-one:6] Set("DAHDI/i1/myNumber-33", "ITER=1") in new stack
    -- Executing [dstring@macro-dial-one:7] Set("DAHDI/i1/myNumber-33", "THISDIAL=SIP/2501") in new stack
    -- Executing [dstring@macro-dial-one:8] GosubIf("DAHDI/i1/myNumber-33", "0?zap2dahdi,1") in new stack
    -- Executing [dstring@macro-dial-one:9] Set("DAHDI/i1/myNumber-33", "DSTRING=SIP/2501&") in new stack
    -- Executing [dstring@macro-dial-one:10] Set("DAHDI/i1/myNumber-33", "ITER=2") in new stack
    -- Executing [dstring@macro-dial-one:11] GotoIf("DAHDI/i1/myNumber-33", "0?begin") in new stack
    -- Executing [dstring@macro-dial-one:12] Set("DAHDI/i1/myNumber-33", "DSTRING=SIP/2501") in new stack
    -- Executing [dstring@macro-dial-one:13] Return("DAHDI/i1/myNumber-33", "") in new stack
    -- Executing [s@macro-dial-one:27] GotoIf("DAHDI/i1/myNumber-33", "0?nodial") in new stack
    -- Executing [s@macro-dial-one:28] GotoIf("DAHDI/i1/myNumber-33", "0?skiptrace") in new stack
    -- Executing [s@macro-dial-one:29] GosubIf("DAHDI/i1/myNumber-33", "0?ctset,1:ctclear,1") in new stack
    -- Executing [ctclear@macro-dial-one:1] NoOp("DAHDI/i1/myNumber-33", "Deleting: CALLTRACE/2501 ") in new stack
    -- Executing [ctclear@macro-dial-one:2] Return("DAHDI/i1/myNumber-33", "") in new stack
    -- Executing [s@macro-dial-one:30] Set("DAHDI/i1/myNumber-33", "D_OPTIONS=") in new stack
    -- Executing [s@macro-dial-one:31] ExecIf("DAHDI/i1/myNumber-33", "0?SIPAddHeader(Alert-Info: )") in new stack
    -- Executing [s@macro-dial-one:32] ExecIf("DAHDI/i1/myNumber-33", "0?SIPAddHeader()") in new stack
    -- Executing [s@macro-dial-one:33] ExecIf("DAHDI/i1/myNumber-33", "0?Set(CHANNEL(musicclass)=)") in new stack
    -- Executing [s@macro-dial-one:34] GosubIf("DAHDI/i1/myNumber-33", "0?qwait,1") in new stack
    -- Executing [s@macro-dial-one:35] Set("DAHDI/i1/myNumber-33", "__CWIGNORE=") in new stack
    -- Executing [s@macro-dial-one:36] Set("DAHDI/i1/myNumber-33", "__KEEPCID=TRUE") in new stack
    -- Executing [s@macro-dial-one:37] Dial("DAHDI/i1/myNumber-33", "SIP/2501,"",") in new stack

What line type does the number terminate on? What is your network policy on called party clearing?

Typical network policy is not to release a call until the called party has been on hook for 3 minutes (BT are in the process of reducing this to a few seconds, as few people re-answer on a new extension these days).

If you use ISDN, you would get a CLEAR signal, but I don’t know whether, and how, Asterisk uses this, but CLEAR cannot be communicated to an analogue caller, except as in band audio.

Please use Asterisk Supprt for support questions.

Sorry, and thank you for answering.

I would like to connect a Sip phone from my network connected to Asterisk with the pstn throw a dahdi channel using a bri card.

I don´t know if it is the spected behaviour or not but what I spected was I originate a call using :
asteriskServer.originateToExtension(“DAHDI/g0/myNumber”, “default”, “2501”, 1, 10000);
Where myNumber is de number that is in the pstn.

If 2501 hangs up, the Asterisk detec the event, but if myNumber hungs up I don´t see anything. Indeed, sometimes the telphone in the pstn start ringing again.

I have seen that in some cases it is possible to config dahdi channel editing chan_dahdi.conf but nothing works :frowning:

answeronpolarityswitch=yes
hanguponpolarityswitch=yes
 
;Uncomment these lines if you have problems with the disconection of your analog lines
busydetect=yes
busycount=3

Thank you very much for your help again

BRI is not analogue. Those options apply to detecting remote parties releasing an real analogue lines.

I don’t know whether Asterisk can be configured to release on CLEAR, but, in any case, whether you even get that may depend on not just the card but the signalling system used. You should enable low level tracing to see if you are receiving a clear. If not, there is probably little you can do. If you get the clear, you can think about investigating whether Asterisk can be made to respond to it.

Some systems treat CLEAR as HOLD.