Hi , this is the complete output console when I use this function to retrieve the DID number in a dynamic way
This is the function :
exten => s,1,Goto(from-trunk,${CUT(CUT(PJSIP_HEADER(To),@,1),:,2)},1)
This is the output :
[2016-06-27 09:46:21] ERROR[25793][C-00000001]: res_pjsip_header_funcs.c:465 func_read_header: This function requires a header name.
– Executing [s@from-pstn-toheader:1] Goto(“PJSIP/PJSIP Trunk-00000001”, “from-trunk,1”) in new stack
– Goto (from-trunk,s,1)
– Executing [s@from-trunk:1] NoOp(“PJSIP/PJSIP Trunk-00000001”, “No DID or CID Match”) in new stack
– Executing [s@from-trunk:2] Answer(“PJSIP/PJSIP Trunk-00000001”, “”) in new stack
[2016-06-27 09:46:22] WARNING[25793][C-00000001]: chan_sip.c:22377 func_header_read: This function can only be used on SIP channels.
– Executing [s@from-trunk:3] Log(“PJSIP/PJSIP Trunk-00000001”, "WARNING,Friendly Scanner from ") in new stack
[2016-06-27 09:46:22] WARNING[25793][C-00000001]: Ext. s:3 @ from-trunk: Friendly Scanner from
– Executing [s@from-trunk:4] Wait(“PJSIP/PJSIP Trunk-00000001”, “2”) in new stack
> 0x2cf9de0 – Probation passed - setting RTP source address to X.X.X.X:30202
– Executing [s@from-trunk:5] Playback(“PJSIP/PJSIP Trunk-00000001”, “ss-noservice”) in new stack
– <PJSIP/PJSIP Trunk-00000001> Playing ‘ss-noservice.ulaw’ (language ‘en’)
– Executing [h@from-trunk:1] Macro(“PJSIP/PJSIP Trunk-00000001”, “hangupcall,”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“PJSIP/PJSIP Trunk-00000001”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [s@macro-hangupcall:3] ExecIf(“PJSIP/PJSIP Trunk-00000001”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [s@macro-hangupcall:4] Hangup(“PJSIP/PJSIP Trunk-00000001”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘PJSIP/PJSIP Trunk-00000001’ in macro ‘hangupcall’
== Spawn extension (from-trunk, h, 1) exited non-zero on ‘PJSIP/PJSIP Trunk-00000001’
However , I can make things work if I set up the extensions.conf file in a “hard way” :
exten => s,1,Goto(from-trunk,00334XXXXXXXX,1) --> where the X respresents my num
But ! Next problem , I have 4 nums , that when they are dialed , redirect to my trunk line so I set up :
exten => s,1,Goto(from-trunk,00334XXXXXXX0,1)
exten => s,n,Goto(from-trunk,00334XXXXXXX1,1)
exten => s,n,Goto(from-trunk,00334XXXXXXX2,1)
exten => s,n,Goto(from-trunk,00334XXXXXXX3,1)
It is working well for the first one , but when I dialed for example the second or third one , all the calls are redirected as if I dialed the first in the list ( calls are redirected to the ring group corresponding to the first line in the conf file to be more specific )
So is there a way to make things work in a hard or dynamic way ? No matter wich way lol