GoSub & Call Forwarding problem

try use transfer from CALLING work ok BUT when
CALLER try transfer after press# listen transfer BUT after press
first number for transfer transfer canceled and hear pbx-invalid !

[ul]-- Called 102
– SIP/102-b7b05af0 is ringing
– SIP/102-b7b05af0 answered SIP/101-092cbe08
– Started music on hold, class ‘default’, on SIP/102-b7b05af0
– <SIP/101-092cbe08> Playing ‘pbx-transfer.gsm’ (language ‘en’)
– Unable to find extension ‘1’ in context ‘recchannel’
– <SIP/101-092cbe08> Playing ‘pbx-invalid.gsm’ (language ‘en’)
– Stopped music on hold on SIP/102-b7b05af0
– Executing [h@recchannel:1] StopMixMonitor(“SIP/101-092cbe08”, “”) in new stack[/ul]

[code][recchannel]
exten => s,1,NoOp(Start stdexten W RECORD)
exten => s,n,Set(ext=${ARG1})
exten => s,n,Set(dev=${ARG2})
exten => s,n,Set(cid=${ARG3})
;exten => s,n,Set(ctx=${ARG4})
exten => s,n,NoOp(parameter ext=${ext} dev=${dev} cid=${cid})
exten => s,n,set(FILENAME=${REC_PATH}${dev}-${cid}-${ext}-${STRFTIME(${EPOCH},%Y%m%d-%H%M%S)})
exten => s,n,NoOp(filename : ${FILENAME})
exten => s,n,Set(mbx="${ext}"$["${ctx}" ? “@${ctx}” :: “”])
exten => s,n,MixMonitor(${FILENAME}.wav)
exten => s,n,Dial(${dev}/${ext},20,tTwWkK) ; Ring the interface, 20 seconds maximum
exten => s,n,Hangup()
exten => s,n,Return
exten => h,1 ,StopMixMonitor
exten => h,n ,System(cd ${REC_PATH})
exten => h,n ,System(lame -v -V 9 --lowpass 9 --quiet ${FILENAME}.wav ${FILENAME}.mp3)
exten => h,n ,System(rm -f ${FILENAME}.wav)
(NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => h,n,Return

[Dialinternal]
exten => _1xx,1,NoOp()
exten => _1xx,n,GOSUB(recchannel,s,1(${EXTEN},SIP,${CALLERID(num)}))
;exten => _1xx,n,Dial(SIP/${EXTEN},20,tTwWkK) ; Ring the interface, 20 seconds maximum
exten => _1xx,n,Hangup() [/code]

This happen because you don’t have any extension in recchannel context start with 1.
whenever you start to enter the extension which you want to transfer to, asterisk will start evaluating your input digit by digit until it reach one of two points, either the sequence of digits you’ve entered determine an extension and in this case it will transferred the user to that extension , or the sequence of digits doesn’t match any prefix of any extension in the specified context and in that case it will give you the error you’ve just got.

IF you are looking for extensions in Dialinternal context then try to include that context in recchannel like this:

[recchannel]
include => Dialinternal

There is also a channel variable you can set that specifies the context to use when interpreting transfer target numbers.

Hi david55

can explain me more ?
what use of this channel variable ?

Can’t remember.

[quote=“Mustafa_saa”]This happen because you don’t have any extension in recchannel context start with 1.
whenever you start to enter the extension which you want to transfer to, asterisk will start evaluating your input digit by digit until it reach one of two points, either the sequence of digits you’ve entered determine an extension and in this case it will transferred the user to that extension , or the sequence of digits doesn’t match any prefix of any extension in the specified context and in that case it will give you the error you’ve just got.

IF you are looking for extensions in Dialinternal context then try to include that context in recchannel like this:

[recchannel]
include => Dialinternal[/quote]

BUT
i call GoSub from 4 different context then adding one of it not help me …