Hi all, need some help with the below please:
Macro in dialplan:
[macro-callforwarding]
;Unconditional call forward
exten => s,1,Set(temp=${DB(CFIM/${ARG1})})
exten => s,n,GotoIf(${temp}?cfi:nocfi)
exten => s,n(cfi),NoOp( CFI Found)
exten => s,n,Set(CallerIDString=${CALLERID})
exten => s,n,Dial(SIP/${temp})
exten => s,n,Dial(SIP/${temp}@DC2N16OTP37076_A1)
exten => s,n,Hangup()
exten => s,n(nocfi),NoOp(No CFI found)
Number being called from outbound (working)
Using SIP RTP CoS mark 5
> 0x7fb314045400 -- Strict RTP learning after remote address set to: 10.8.0.8:12064
-- Executing [************@support:1] Set("SIP/203-00000851", "CALLERID(all)="Xiria Technical Support" <************>") in new stack
-- Executing [XXXXXXXXXXXX@support:2] SIPAddHeader("SIP/203-00000851", "Alert-Info: <Bellcore-dr1>") in new stack
-- Executing [XXXXXXXXXXXX@support:3] MixMonitor("SIP/203-00000851", "/var/www/html/recordings/outgoing/XXXXXXXXXXXX-12122019-16:37:48.wav") in new stack
-- Executing [************@support:4] Dial("SIP/203-00000851", "SIP/DC2N16OTP37076_A1/************,120") in new stack
== Begin MixMonitor Recording SIP/203-00000851
== Using SIP RTP CoS mark 5
-- Called SIP/DC2N16OTP37076_A1/XXXXXXXXXXXX
== Using SIP RTP CoS mark 5
> 0x7fb3140508a0 -- Strict RTP learning after remote address set to: XXX.XXX.XXX.XXX:21200
-- Executing [************@incoming:1] GotoIfTime("SIP/DC2N16OTP37076_A1-00000853", "09:00-17:30,mon-fri,*,?support,1:supportooa,1") in new stack
-- Goto (incoming,support,1)
-- Executing [support@incoming:1] SIPAddHeader("SIP/DC2N16OTP37076_A1-00000853", "Alert-Info: <SUPPORT:>") in new stack
-- Executing [support@incoming:2] Playback("SIP/DC2N16OTP37076_A1-00000853", "/var/lib/asterisk/sounds/custom/Xiria Technical Support") in new stack
> 0x7fb310003c50 -- Strict RTP learning after remote address set to: XXX.XXX.XXX.XXX:21202
-- SIP/DC2N16OTP37076_A1-00000852 answered SIP/203-00000851
-- Channel SIP/DC2N16OTP37076_A1-00000852 joined 'simple_bridge' basic-bridge <68c43240-eb11-438a-93f5-26db3b21cdec>
-- Channel SIP/203-00000851 joined 'simple_bridge' basic-bridge <68c43240-eb11-438a-93f5-26db3b21cdec>
> 0x7fb314045400 -- Strict RTP switching to RTP target address 10.8.0.8:12064 as source
> 0x7fb3140508a0 -- Strict RTP switching to RTP target address XXX.XXX.XXX.XXX:21200 as source
[Dec 12 16:37:48] WARNING[7005][C-000002e9]: mp3/interface.c:217 decodeMP3: Junk at the beginning of frame 49443304
-- <SIP/DC2N16OTP37076_A1-00000853> Playing '/var/lib/asterisk/sounds/custom/Xiria Technical Support.slin' (language 'en_GB')
> 0x7fb310003c50 -- Strict RTP switching to RTP target address XXX.XXX.XXX.XXX:21202 as source
> 0x7fb314045400 -- Strict RTP learning complete - Locking on source address 10.8.0.8:12064
> 0x7fb3140508a0 -- Strict RTP learning complete - Locking on source address XXX.XXX.XXX.XXX:21200
> 0x7fb310003c50 -- Strict RTP learning complete - Locking on source address 8XXX.XXX.XXX.XXX:21202
-- Executing [support@incoming:3] Macro("SIP/DC2N16OTP37076_A1-00000853", "callforwarding,202") in new stack
-- Executing [s@macro-callforwarding:1] Set("SIP/DC2N16OTP37076_A1-00000853", "temp=ForwardedNumber") in new stack
-- Executing [s@macro-callforwarding:2] GotoIf("SIP/DC2N16OTP37076_A1-00000853", "ForwardedNumber?cfi:nocfi") in new stack
-- Goto (macro-callforwarding,s,3)
-- Executing [s@macro-callforwarding:3] NoOp("SIP/DC2N16OTP37076_A1-00000853", " CFI Found") in new stack
-- Executing [s@macro-callforwarding:4] Set("SIP/DC2N16OTP37076_A1-00000853", "CallerIDString=") in new stack
-- Executing [s@macro-callforwarding:5] Dial("SIP/DC2N16OTP37076_A1-00000853", "SIP/ForwardedNumber") in new stack
[Dec 12 16:37:58] WARNING[7005][C-000002e9]: chan_sip.c:6274 create_addr: Purely numeric hostname (ForwardedNumber), and not a peer--rejecting!
[Dec 12 16:37:58] WARNING[7005][C-000002e9]: app_dial.c:2527 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [s@macro-callforwarding:6] Dial("SIP/DC2N16OTP37076_A1-00000853", "SIP/ForwardedNumber@DC2N16OTP37076_A1") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/ForwardedNumber@DC2N16OTP37076_A1
> 0x7fb31800aac0 -- Strict RTP learning after remote address set to: XXX.XXX.XXX.XXX:21326
-- SIP/DC2N16OTP37076_A1-00000854 is making progress passing it to SIP/DC2N16OTP37076_A1-00000853
-- SIP/DC2N16OTP37076_A1-00000854 is ringing
> 0x7fb31800aac0 -- Strict RTP switching to RTP target address XXX.XXX.XXX.XXX:21326 as source
-- SIP/DC2N16OTP37076_A1-00000854 is ringing
-- Channel SIP/203-00000851 left 'simple_bridge' basic-bridge <68c43240-eb11-438a-93f5-26db3b21cdec>
-- Channel SIP/DC2N16OTP37076_A1-00000852 left 'simple_bridge' basic-bridge <68c43240-eb11-438a-93f5-26db3b21cdec>
== Spawn extension (support, ************, 4) exited non-zero on 'SIP/203-00000851'
== MixMonitor close filestream (mixed)
== End MixMonitor Recording SIP/203-00000851
== Spawn extension (macro-callforwarding, s, 6) exited non-zero on 'SIP/DC2N16OTP37076_A1-00000853' in macro 'callforwarding'
== Spawn extension (incoming, support, 3) exited non-zero on 'SIP/DC2N16OTP37076_A1-00000853'
Number being called internally:
== Using SIP RTP CoS mark 5
> 0x7fb314045400 -- Strict RTP learning after remote address set to: 10.8.0.8:12066
-- Executing [202@support:1] SIPAddHeader("SIP/203-00000855", "Alert-Info: <Bellcore-dr1>") in new stack
-- Executing [202@support:2] Set("SIP/203-00000855", "CallerIDString=") in new stack
-- Executing [202@support:3] Macro("SIP/203-00000855", "callforwarding,202") in new stack
-- Executing [s@macro-callforwarding:1] Set("SIP/203-00000855", "temp=ForwardedNumber") in new stack
-- Executing [s@macro-callforwarding:2] GotoIf("SIP/203-00000855", "ForwardedNumber?cfi:nocfi") in new stack
-- Goto (macro-callforwarding,s,3)
-- Executing [s@macro-callforwarding:3] NoOp("SIP/203-00000855", " CFI Found") in new stack
-- Executing [s@macro-callforwarding:4] Set("SIP/203-00000855", "CallerIDString=") in new stack
-- Executing [s@macro-callforwarding:5] Dial("SIP/203-00000855", "SIP/ForwardedNumber") in new stack
[Dec 12 16:43:16] WARNING[7015][C-000002ea]: chan_sip.c:6274 create_addr: Purely numeric hostname (ForwardedNumber), and not a peer--rejecting!
[Dec 12 16:43:16] WARNING[7015][C-000002ea]: app_dial.c:2527 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [s@macro-callforwarding:6] Dial("SIP/203-00000855", "SIP/ForwardedNumber@DC2N16OTP37076_A1") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/ForwardedNumber@DC2N16OTP37076_A1
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [s@macro-callforwarding:7] Hangup("SIP/203-00000855", "") in new stack
== Spawn extension (macro-callforwarding, s, 7) exited non-zero on 'SIP/203-00000855' in macro 'callforwarding'
== Spawn extension (support, 202, 3) exited non-zero on 'SIP/203-00000855'
It works fine when being called from an outside line, the config for which is below:
exten => support,1,SIPAddHeader(Alert-Info: <SUPPORT:>)
exten => support,n,Playback(/var/lib/asterisk/sounds/custom/Xiria Technical Support)
exten => support,n,Macro(callforwarding,202)
exten => support,n,Macro(callforwarding,203)
exten => support,n,Mixmonitor(/var/www/html/recordings/${CONTEXT}-${CALLERID(number)}-${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)}.wav)
exten => support,n,Queue(${EXTEN})
exten => support,n,Voicemail(200) ;To use custom, do ,busy or ,unavail
Though not when called from an internal number. Any ideas?