I have a dialplan like that:
[from-internal-custom]
include => voiping
[voiping]
exten => 5002,1,noop()
exten => 5002,n,agi(senarios/specific-call.php)
exten => 5002,n,hangup()
exten => h,1,agi(senarios/update-table.php)
but when i try a call, hangupcall macro is executed and my call is hangedup.
this is my logs:
[2024-04-22 06:17:21] VERBOSE[7768][C-00000004] netsock2.c: Using SIP RTP TOS bits 184
[2024-04-22 06:17:21] VERBOSE[7768][C-00000004] netsock2.c: Using SIP RTP CoS mark 5
[2024-04-22 06:17:21] VERBOSE[17818][C-00000004] pbx.c: Executing [5002@from-internal:1] NoOp("SIP/200-00000008", "") in new stack
[2024-04-22 06:17:21] VERBOSE[17818][C-00000004] pbx.c: Executing [5002@from-internal:2] AGI("SIP/200-00000008", "senarios/specific-call.php") in new stack
[2024-04-22 06:17:21] VERBOSE[17818][C-00000004] res_agi.c: Launched AGI Script /var/lib/asterisk/agi-bin/senarios/specific-call.php
[2024-04-22 06:17:21] VERBOSE[17818][C-00000004] res_agi.c: senarios/specific-call.php: *************** test *********************
[2024-04-22 06:17:21] VERBOSE[17818][C-00000004] res_agi.c: senarios/specific-call.php: *************** 200 *********************
[2024-04-22 06:17:21] VERBOSE[17818][C-00000004] res_agi.c: senarios/specific-call.php: ************* Extension number from dstchannel(asteriskcdrdb database): 202 *****************
[2024-04-22 06:17:21] VERBOSE[17818][C-00000004] res_agi.c: AGI Script Executing Application: (Dial) Options: (SIP/202)
[2024-04-22 06:17:21] VERBOSE[17818][C-00000004] netsock2.c: Using SIP RTP TOS bits 184
[2024-04-22 06:17:21] VERBOSE[17818][C-00000004] netsock2.c: Using SIP RTP CoS mark 5
[2024-04-22 06:17:21] VERBOSE[17818][C-00000004] app_dial.c: Called SIP/202
[2024-04-22 06:17:22] VERBOSE[17818][C-00000004] app_dial.c: SIP/202-00000009 is ringing
[2024-04-22 06:17:23] VERBOSE[17830] manager.c: Manager 'admin' logged on from 127.0.0.1
[2024-04-22 06:17:23] VERBOSE[17830] manager.c: Manager 'admin' logged off from 127.0.0.1
[2024-04-22 06:17:26] VERBOSE[17818][C-00000004] app_dial.c: SIP/202-00000009 answered SIP/200-00000008
[2024-04-22 06:17:26] VERBOSE[17840][C-00000004] bridge_channel.c: Channel SIP/202-00000009 joined 'simple_bridge' basic-bridge <9be0c0ee-a6b1-4af9-bc10-1930c92325a1>
[2024-04-22 06:17:26] VERBOSE[17818][C-00000004] bridge_channel.c: Channel SIP/200-00000008 joined 'simple_bridge' basic-bridge <9be0c0ee-a6b1-4af9-bc10-1930c92325a1>
[2024-04-22 06:17:29] VERBOSE[17818][C-00000004] bridge_channel.c: Channel SIP/200-00000008 left 'simple_bridge' basic-bridge <9be0c0ee-a6b1-4af9-bc10-1930c92325a1>
[2024-04-22 06:17:29] VERBOSE[17840][C-00000004] bridge_channel.c: Channel SIP/202-00000009 left 'simple_bridge' basic-bridge <9be0c0ee-a6b1-4af9-bc10-1930c92325a1>
[2024-04-22 06:17:29] VERBOSE[17818][C-00000004] res_agi.c: <SIP/200-00000008>AGI Script senarios/specific-call.php completed, returning 4
[2024-04-22 06:17:29] VERBOSE[17818][C-00000004] pbx.c: Spawn extension (from-internal, 5002, 2) exited non-zero on 'SIP/200-00000008'
[2024-04-22 06:17:29] VERBOSE[17818][C-00000004] pbx.c: Executing [h@from-internal:1] Macro("SIP/200-00000008", "hangupcall") in new stack
[2024-04-22 06:17:29] VERBOSE[17818][C-00000004] pbx.c: Executing [s@macro-hangupcall:1] GotoIf("SIP/200-00000008", "1?theend") in new stack
[2024-04-22 06:17:29] VERBOSE[17818][C-00000004] pbx_builtins.c: Goto (macro-hangupcall,s,3)
[2024-04-22 06:17:29] VERBOSE[17818][C-00000004] pbx.c: Executing [s@macro-hangupcall:3] ExecIf("SIP/200-00000008", "0?Set(CDR(recordingfile)=)") in new stack
[2024-04-22 06:17:29] VERBOSE[17818][C-00000004] pbx.c: Executing [s@macro-hangupcall:4] NoOp("SIP/200-00000008", "SIP/202-00000009 montior file= ") in new stack
[2024-04-22 06:17:29] VERBOSE[17818][C-00000004] pbx.c: Executing [s@macro-hangupcall:5] GotoIf("SIP/200-00000008", "1?skipagi") in new stack
[2024-04-22 06:17:29] VERBOSE[17818][C-00000004] pbx_builtins.c: Goto (macro-hangupcall,s,7)
[2024-04-22 06:17:29] VERBOSE[17818][C-00000004] pbx.c: Executing [s@macro-hangupcall:7] Hangup("SIP/200-00000008", "") in new stack
[2024-04-22 06:17:29] VERBOSE[17818][C-00000004] app_macro.c: Spawn extension (macro-hangupcall, s, 7) exited non-zero on 'SIP/200-00000008' in macro 'hangupcall'
[2024-04-22 06:17:29] VERBOSE[17818][C-00000004] pbx.c: Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/200-00000008'
I tried another and simple h extention too but I had the same result.