Hello,
This simple callfile and dialplan makes the hangup extension be called twice. Can someone tell me why, and how can I make it a single invocation? I think it is because two channels are hung up, Local and PJSIP, so may be it cannot be avoided. If so, is there a way to tell which channel is currently meant? The variable ${CHANNEL}
does not give me the right value.
Dialplan:
[fax_caller]
exten => faxout,1,NoOp(** Fax caller **)
same => n,Dial(PJSIP/mysipprovider/sip:${ReceiverPhoneNr}@mysipprovider.com)
exten => faxsend,1,NoOp(** Sending fax **)
exten => h,1,NoOp(** Channel ${CHANNEL} hung up with Fax status ${FAXSTATUS} with cause ${HANGUPCAUSE} **)
Callfile:
Channel:Local/faxout@fax_caller
MaxRetries:0
WaitTime:45
Context:fax_caller
Extension:faxsend
Priority:1
Setvar:ReceiverPhoneNr=+430000000000
This is the log:
-- Attempting call on Local/faxout@fax_caller for faxsend@fax_caller:1 (Retry 1)
-- Called faxout@fax_caller
-- Executing [faxout@fax_caller:1] NoOp("Local/faxout@fax_caller-00000005;2", "** Fax caller **") in new stack
-- Executing [faxout@fax_caller:2] Dial("Local/faxout@fax_caller-00000005;2", "PJSIP/mysipprovider/sip:RECEIVERPHONENR@mysipprovider.com:5084,,b(fax_outgoing_init^faxout^1(SENDERPHONENR,mysipprovider.com:5084))") in new stack
-- PJSIP/mysipprovider-00000004 Internal Gosub(fax_outgoing_init,faxout,1(SENDERPHONENR,mysipprovider.com:5084)) start
-- Executing [faxout@fax_outgoing_init:1] NoOp("PJSIP/mysipprovider-00000004", "** Pre dial settings **") in new stack
-- Executing [faxout@fax_outgoing_init:2] Set("PJSIP/mysipprovider-00000004", "PJSIP_HEADER(add,P-Preferred-Identity)="<sip:SENDERPHONENR@mysipprovider.com:5084>"") in new stack
-- Executing [faxout@fax_outgoing_init:3] Return("PJSIP/mysipprovider-00000004", "") in new stack
== Spawn extension (from-external, faxout, 1) exited non-zero on 'PJSIP/mysipprovider-00000004'
-- PJSIP/mysipprovider-00000004 Internal Gosub(fax_outgoing_init,faxout,1(SENDERPHONENR,mysipprovider.com:5084)) complete GOSUB_RETVAL=
-- Called PJSIP/mysipprovider/sip:RECEIVERPHONENR@mysipprovider.com:5084
-- PJSIP/mysipprovider-00000004 is ringing
-- Local/faxout@fax_caller-00000005;1 is ringing
-- PJSIP/mysipprovider-00000004 is ringing
> 0x7f37f8017ca0 -- Strict RTP learning after remote address set to: 193.84.65.208:12214
-- PJSIP/mysipprovider-00000004 answered Local/faxout@fax_caller-00000005;2
-- Local/faxout@fax_caller-00000005;1 answered
-- Executing [faxsend@fax_caller:1] NoOp("Local/faxout@fax_caller-00000005;1", "** Sending fax **") in new stack
-- Auto fallthrough, channel 'Local/faxout@fax_caller-00000005;1' status is 'UNKNOWN'
-- Executing [h@fax_caller:1] NoOp("Local/faxout@fax_caller-00000005;1", "** Channel Local/faxout@fax_caller-00000005;1 hung up with Fax status with cause 0 **") in new stack
[Sep 26 17:38:34] NOTICE[12922][C-0000000c]: pbx_spool.c:463 attempt_thread: Call completed to Local/faxout@fax_caller
-- Channel PJSIP/mysipprovider-00000004 joined 'simple_bridge' basic-bridge <e0397daf-0c9f-49d9-b977-0a4225581829>
-- Channel Local/faxout@fax_caller-00000005;2 joined 'simple_bridge' basic-bridge <e0397daf-0c9f-49d9-b977-0a4225581829>
-- Channel Local/faxout@fax_caller-00000005;2 left 'simple_bridge' basic-bridge <e0397daf-0c9f-49d9-b977-0a4225581829>
-- Channel PJSIP/mysipprovider-00000004 left 'simple_bridge' basic-bridge <e0397daf-0c9f-49d9-b977-0a4225581829>
== Spawn extension (fax_caller, faxout, 2) exited non-zero on 'Local/faxout@fax_caller-00000005;2'
-- Executing [h@fax_caller:1] NoOp("Local/faxout@fax_caller-00000005;2", "** Channel Local/faxout@fax_caller-00000005;2 hung up with Fax status with cause 16 **") in new stack