Transfer bounce back feature for blind transfer

Applicable Device

Device Model: P series(P550/560/570, P SE, P Cloud)

Firmware Version: Not required

 

Description

As we all know, if you using Yeastar PBX's Attended transfer feature code to transfer a call, the transfer bounce back feature is working fine.

However, if some customers want to use the IP phone's Transfer button to transfer a call, then the transfer bounce back feature will not work. This guide will guide you on how to make a script to make it work. 

1. When extensions A and B are on the call

2. Extension B press the Transfer button on the IP phone then dials extension C's number and then presses the Transfer button again

3. Then extension B hangup, and extension C is ringing

4. After extension C ring timeout and doesn't answer the call, the call will back to ring extension B

 

Solution

1. Loing the Yeastar PBX via SSH

2. Type command 'cat /etc/asterisk/extensions.conf', then find and copy the content under '[macro-realstexten]'

3. Type command 'vi /ysdisk/support/customcfg/extensions_custom.conf', paste the copied content. 

4. Then replace 

exten = s-NOANSWER,1,Gotoif(${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFN)}>0?follow-me-noanswer,1:2-out,1)
exten = s-BUSY,1,Gotoif($[${APIDIALSTATUS}==BUSY]?h,1)
exten = s-BUSY,2,Set(SFHANGUPCAUSE=USER_BUSY)
exten = s-BUSY,3,Gotoif(${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFB)}>0?follow-me-busy,1:1-out,1)

with

exten = s-NOANSWER,1,Gotoif(${LEN(${BLINDTRANSFER})} > 0?ringback1,1:2)
exten = s-NOANSWER,2,Gotoif(${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFN)}>0?follow-me-noanswer,1:2-out,1)
exten = ringback1,1,Goto(from-outside,${BUILTINTRANSFROM},1)
exten = s-BUSY,1,Gotoif($[${APIDIALSTATUS}==BUSY]?h,1)
exten = s-BUSY,2,Gotoif(${LEN(${BLINDTRANSFER})} > 0?ringback2,1:3)
exten = s-BUSY,3,Set(SFHANGUPCAUSE=USER_BUSY)
exten = s-BUSY,4,Gotoif(${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFB)}>0?follow-me-busy,1:1-out,1)
exten = s-BUSY,5,Hangup()
exten = ringback2,1,Goto(from-outside,${BUILTINTRANSFROM},1)

5. Save the changes, go to the Yeastar PBX web page, create an extension then delete it then click on Apply. 

 

Code

[macro-realstexten]
exten = s,1,Set(CHECKCALLERNUM=${IF(${LEN(${CHECKCALLERNUM})>0}?${CHECKCALLERNUM}:${CALLERID(num)})})
exten = s,2,Set(REALCALLERNUM=${IF(${LEN(${REALCALLERNUM})>0}?${REALCALLERNUM}:${CALLERID(num)})})
exten = s,3,Set(TIMEOUT(absolute)=${ABSOLUTE_TIMEOUT})
exten = s,4,Gotoif(${LEN(${IsSystemFunc})}>0?6:5)
exten = s,5,YsWalkContext(whitelist-internal,${PBXDIALNUM},1,${REALCALLERNUM},internal)
exten = s,6,Set(CALLERID(num)=${CHECKCALLERNUM})
exten = s,n,DelVar(RINGGROUPS)
exten = s,n,Gotoif($["${CALLERID(num)}" = "Conference"]?conf,1)
exten = s,n,GotoIf($["${IgnoreFollowMe}" = "yes"]?+2:+1)
exten = s,n,Gotoif(${EXTEN_CONFIG(${ARG1},${FORWARDPREFIX}CFA)}>0?follow-me-always,1)
exten = s,n,Gotoif(${EXTEN_CONFIG(${ARG1},DND)}>0?dnd,1)
exten = s,n,Set(CLIPONCE=no)
exten = s,n,set(CDR(srcaddr)=${PJSIPGETIP()})
exten = s,n,Gotoif(${EXTEN_CONFIG(${ARG1},SIPFORKING)}?forking:dial)
exten = s,n(forking),Gotoif(${CHANNEL(api_to_caller)} = 1?dial:+1)
exten = s,n,NoOp(Group counts of ${ARG1} is ${GROUP_COUNT(${ARG1})})
exten = s,n,NoOp(Group counts of ${SRCEXTENSION} is ${GROUP_COUNT(${SRCEXTENSION})})
exten = s,n,Gotoif($[${GROUP_COUNT(${ARG1})}>0]?s-BUSY,1)
exten = s,n(dial),DistinctiveCid()
exten = s,n,ExecIf($["${IgnoreUpdateCallee}" = "yes"]?Noop("no need updatecallee"):UserEvent(UpdateCallee,Callee: ${PBXDIALNUM}))
exten = s,n,Set(RINGTIMEOUT=${IF($[${LEN(${CUSTOM_VAR(RINGTIME_${PBXDIALNUM})})}>0]?${CUSTOM_VAR(RINGTIME_${PBXDIALNUM})}:${RINGTIME_GLOBAL})})
exten = s,n,Dial(${ARG2},${RINGTIMEOUT},${ARG3}${RINGTONE}b(local_add_diversion,add_diversion,1(${SRCTRUNKNAME},${PBXDIALNUM},${SRCEXTENSION}))${MEETMEING},,${RINGINGPRIORITY_${PBXDIALNUM}})
exten = s,n,Gotoif(${LEN(${CONFER_INVITER})}>1?1-out,1)
exten = s,n,GotoIf($[x${IgnoreFollowMe}=xyes]?1-out,1:+1)
exten = s,n,GotoIf($[x${SCHEDULEPAGE}=xyes]?1-out,1:+1)
exten = s,n,Goto(s-${DIALSTATUS},1)
exten = s-CHANUNAVAIL,1,Goto(s-NOANSWER,1)
;Below blue marked need to be deleted
;exten = s-ANSWER,1,Hangup()

;exten = s-NOANSWER,1,Gotoif(${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFN)}>0?follow-me-noanswer,1:2-out,1)
;exten = s-BUSY,1,Gotoif($[${APIDIALSTATUS}==BUSY]?h,1)
;exten = s-BUSY,2,Set(SFHANGUPCAUSE=USER_BUSY)
;exten = s-BUSY,3,Gotoif(${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFB)}>0?follow-me-busy,1:1-out,1)

;Below red marked are the content that we added
exten = s-NOANSWER,1,Gotoif(${LEN(${BLINDTRANSFER})} > 0?ringback1,1:2)
exten = s-NOANSWER,2,Gotoif(${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFN)}>0?follow-me-noanswer,1:2-out,1)
exten = ringback1,1,Goto(from-outside,${BUILTINTRANSFROM},1)
exten = s-BUSY,1,Gotoif($[${APIDIALSTATUS}==BUSY]?h,1)
exten = s-BUSY,2,Gotoif(${LEN(${BLINDTRANSFER})} > 0?ringback2,1:3)
exten = s-BUSY,3,Set(SFHANGUPCAUSE=USER_BUSY)
exten = s-BUSY,4,Gotoif(${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFB)}>0?follow-me-busy,1:1-out,1)
exten = s-BUSY,5,Hangup()
exten = ringback2,1,Goto(from-outside,${BUILTINTRANSFROM},1)
exten = dnd,1,UserEvent(CallFailed,Cause: DND)
exten = dnd,2,Set(CDR(dnd)=yes)
exten = dnd,3,Set(CDR(dstname)=${PJSIP_GET_ENPOINT_INFO(${PBXDIALNUM},calleridname)})
exten = dnd,4,Hangup()
exten = follow-me-always,1,Gotoif(${LEN(${CONFER_INVITER})}>1?1-out,1)
exten = follow-me-always,n,Gotoif($[x${SCHEDULEPAGE}=xyes]?1-out,1)
exten = follow-me-always,n,Set(CDR(callflow)=followme_always)
exten = follow-me-always,n,Set(CDR(dstname)=${PJSIP_GET_ENPOINT_INFO(${PBXDIALNUM},calleridname)})
exten = follow-me-always,n,Gotoif(${EXTEN_CONFIG(${PBXDIALNUM},SIPFORKING)}?+1:+2)
exten = follow-me-always,n,NoOp(Group counts of ${PBXDIALNUM} is ${GROUP_COUNT(${PBXDIALNUM})})
exten = follow-me-always,n,Gotoif(${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFAH)}>0?2-out,1)
exten = follow-me-always,n,Gotoif(${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}ACFD)}>0?follow-me-always-vm,1)
exten = follow-me-always,n,Set(CFNUM=${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFANUM)})
exten = follow-me-always,n,Gotoif($[${LEN(${CFNUM})}<1]?follow-me-always-vm,1)
exten = follow-me-always,n,Gotoif($["${CFNUM}" = "${PBXDIALNUM}"]?follow-me-always-vm,1)
exten = follow-me-always,n,Gotoif($["${CFNUM}" = "play_greeting"]?+1:+4)
exten = follow-me-always,n,Set(TLOOP=${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFAPLAYTIME)})
exten = follow-me-always,n,Set(PLAYGREETING=${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFAPLAYFILE)})
exten = follow-me-always,n,Goto(play_greeting_then_exit,play_file,1)
exten = follow-me-always,n,Set(IsFollowme=${IF($[${IsFromOutside} = 1]?1:0)})
exten = follow-me-always,n,Set(_NOCHANGEDOD=${IF($[${IsFromOutside} = 1]?${NOPBXDIALNUM}:0)})
exten = follow-me-always,n,Followme(${PBXDIALNUM}-a${FORWARDPREFIX},n)
exten = follow-me-always,n,Hangup()
exten = follow-me-always-vm,1,ForkCDR(erv)
exten = follow-me-always-vm,n,Set(ORIGPBXDIALNUM=${PBXDIALNUM})
exten = follow-me-always-vm,n,GotoIf($[x${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFANUM)}!=x]?resetdialnum:keepdialnum)
exten = follow-me-always-vm,n(resetdialnum),Set(PBXDIALNUM=${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFANUM)})
exten = follow-me-always-vm,n(keepdialnum),Goto(vm-operate-dst,vm-u,1)
exten = follow-me-noanswer,1,Set(CDR(callflow)=followme)
exten = follow-me-noanswer,2,Gotoif(${EXTEN_CONFIG(${PBXDIALNUM},SIPFORKING)}?3:4)
exten = follow-me-noanswer,3,NoOp(Group counts of ${PBXDIALNUM} is ${GROUP_COUNT(${PBXDIALNUM})})
exten = follow-me-noanswer,4,Gotoif(${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}NCFD)}>0?follow-me-noanswer-vm,1)
exten = follow-me-noanswer,5,Set(CFNUM=${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFNNUM)})
exten = follow-me-noanswer,6,Gotoif($[${LEN(${CFNUM})}<1]?follow-me-noanswer-vm,1)
exten = follow-me-noanswer,7,Gotoif($["${CFNUM}" = "${PBXDIALNUM}"]?follow-me-noanswer-vm,1)
exten = follow-me-noanswer,8,Gotoif($["${CFNUM}" = "play_greeting"]?9:12)
exten = follow-me-noanswer,9,Set(TLOOP=${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFNPLAYTIME)})
exten = follow-me-noanswer,10,Set(PLAYGREETING=${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFNPLAYFILE)})
exten = follow-me-noanswer,11,Goto(play_greeting_then_exit,play_file,1)
exten = follow-me-noanswer,12,Set(IsFollowme=${IF($[${IsFromOutside} = 1]?1:0)})
exten = follow-me-noanswer,13,Set(_NOCHANGEDOD=${IF($[${IsFromOutside} = 1]?${NOPBXDIALNUM}:0)})
exten = follow-me-noanswer,n,Followme(${PBXDIALNUM}-n${FORWARDPREFIX},n)
exten = follow-me-noanswer,n,Hangup()
exten = follow-me-noanswer-vm,1,GotoIf($[${DIALSTATUS}=CHANUNAVAIL]?2:4)
exten = follow-me-noanswer-vm,2,Set(CDR(dstname)=${PJSIP_GET_ENPOINT_INFO(${PBXDIALNUM},calleridname)})
exten = follow-me-noanswer-vm,3,ForkCDR(erv)
exten = follow-me-noanswer-vm,n,Set(ORIGPBXDIALNUM=${PBXDIALNUM})
exten = follow-me-noanswer-vm,n,GotoIf($[x${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFNNUM)}!=x]?resetdialnum:keepdialnum)
exten = follow-me-noanswer-vm,n(resetdialnum),Set(PBXDIALNUM=${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFNNUM)})
exten = follow-me-noanswer-vm,n(keepdialnum),Goto(vm-operate-dst,vm-u,1)
exten = follow-me-busy,1,Set(CDR(callflow)=followme)
exten = follow-me-busy,2,Gotoif(${EXTEN_CONFIG(${PBXDIALNUM},SIPFORKING)}?3:4)
exten = follow-me-busy,3,NoOp(Group counts of ${PBXDIALNUM} is ${GROUP_COUNT(${PBXDIALNUM})})
exten = follow-me-busy,4,Gotoif(${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}BCFD)}>0?vm-operate-dst,vm-b,1)
exten = follow-me-busy,5,Set(CFNUM=${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFBNUM)})
exten = follow-me-busy,6,Gotoif($[${LEN(${CFNUM})}<1]?vm-operate-dst,vm-b,1)
exten = follow-me-busy,7,Gotoif($["${CFNUM}" = "${PBXDIALNUM}"]?vm-operate-dst,vm-b,1)
exten = follow-me-busy,8,Gotoif($["${CFNUM}" = "play_greeting"]?9:12)
exten = follow-me-busy,9,Set(TLOOP=${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFBPLAYTIME)})
exten = follow-me-busy,10,Set(PLAYGREETING=${EXTEN_CONFIG(${PBXDIALNUM},${FORWARDPREFIX}CFBPLAYFILE)})
exten = follow-me-busy,11,Goto(play_greeting_then_exit,play_file,1)
exten = follow-me-busy,12,Set(IsFollowme=${IF($[${IsFromOutside} = 1]?1:0)})
exten = follow-me-busy,13,Set(_NOCHANGEDOD=${IF($[${IsFromOutside} = 1]?${NOPBXDIALNUM}:0)})
exten = follow-me-busy,n,Followme(${PBXDIALNUM}-b${FORWARDPREFIX},n)
exten = follow-me-busy,n,Hangup()
exten = 1-out,1,Set(CDR(ignore)=yes)
exten = 1-out,2,Gotoif(${LEN(${MEETMEING})}>1?1-out,3:1-out,5)
exten = 1-out,3,ExecIf($[x${DIALSTATUS}!=xANSWER]?Set(MEETME_INVITE_RESULT=failed))
exten = 1-out,4,ChannelRedirect(${CHANNEL(name)},conferences_invite,${CONFERENCENO},1)
exten = 1-out,5,ExecIf($[${SFHANGUPCAUSE}=USER_BUSY]?Hangup(USER_BUSY):Hangup())
exten = 2-out,1,Hangup(NO_ANSWER)
exten = conf,1,Gotoif(${EXTEN_CONFIG(${ARG1},${FORWARDPREFIX}CFA)}>0?8:2)
exten = conf,2,Set(RINGTIMEOUT=${IF($[${LEN(${CUSTOM_VAR(RINGTIME_${PBXDIALNUM})})}>0]?${CUSTOM_VAR(RINGTIME_${PBXDIALNUM})}:${RINGTIME_GLOBAL})})
exten = conf,3,Gotoif($[${AutoAnswer}=1]?6:4)
exten = conf,4,Dial(${ARG2},${RINGTIMEOUT},${ARG3}${RINGTONE}b(conf-pjsip-addheader,add_header,1(${AutoAnswer},${CONFID},${MEMBERINFO},${CONFINFO})),,${RINGTYPE})
exten = conf,5,Hangup()
exten = conf,6,Set(ringstrategy=2)
exten = conf,7,Dial(${ARG2},${RINGTIMEOUT},${ARG3}${RINGTONE}b(conf-pjsip-addheader,add_header,1(${AutoAnswer},${CONFID},${MEMBERINFO},${CONFINFO})),,${RINGTYPE})
exten = conf,8,Hangup()

 

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.