ring back to transferrer instead of going to voicemail?

JustinHoMi's picture

I have a client who prefers not to use voicemail all the time. Rather than a voicemail message, they would prefer that when a call is transferred, and no one picks up, it will ring back to the person who originally transferred the call. Any ideas on how to do this?

I did find an old post (http://www.freepbx.org/forum/blind-transfer) that explains how to do it on blind transfer, but I'd like to do this for both types of transfer. The code posted in that thread is a bit out of date too.

Thanks!
Justin


__________________


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I need this as well

rwebb616's picture

When I went to that link it looks like it's written in a different language. I have a client that is about to pull the phone system (we just sold it) if we can't get this fixed soon... this means I would have to buy back about 15 polycom IP501s and I really don't want to do that.

There HAS to be a workable solution for this.

-Rich


Try this

jmullinix's picture

I thought this would be a quick few lines of code to help you out. It ended up taking all of a Sunday morning. You may have to play with it a little, but it works on my machine and I like it enough to keep using it.

Put it in extensions_custom.conf. Then put your extensions in custom-from_internal from FreePBX. I am also going to submit this as a feature request for the next FreePBX.

[custom-test_transfer]

; This code will transfer a call and if it is not answered in the time set
; below, it will ring back the original transferor with the call. The time set
; below must be less than the voicemail timeout on the called extension.
; This code will require modification if you have differing extension number lengths
; ie; you have some 3 digit extensions and some four digit extensions.
;
; To use it, put the extensions that you want to have this behaviour in a special context
; of custom-from_internal

exten => _X.,1,NOOP(entering custom-test_transfer)
exten => _X.,n,set(timeoutd=20) ; set timeout in seconds
exten => _X.,n,set(extLeng=${LEN(${EXTEN})})
exten => _X.,n,noop(the extenlength is ${extLeng}
exten => _x.,n,dial(local/${EXTEN}@from-internal,${timeoutd})
exten => _X.,n,Gotoif($["${DIALSTATUS}" = "ANSWER"]?hangup,callback)
exten => _X.,n(callback),dial(local/${BLINDTRANSFER:4:${extLeng}}@from-internal)
exten => _X.,n(hangup),hangup()

[custom-from_internal]

; This context sets a custom transfer context in Asterisk to use the code in
; custom-test_transfer

exten => _x.,1,NOOP(here tiz in custom-from_internal)
exten => _x.,n,set(__TRANSFER_CONTEXT=custom-test_transfer|${EXTEN}|1)
exten => _x.,n,goto(from-internal,${EXTEN},1)

You will also need to include the following line in from-pstn-custom in extensions_custom.conf to make this work with incoming calls.

exten => _x.,n,set(__TRANSFER_CONTEXT=custom-test_transfer|${EXTEN}|1)


__________________

John Mullinix, Cohutta.Com, Inc.
1-706-632-3343 -- sip://17066323343@qth.cohutta.org
Looking for Dundi peers in Baltimore, MD and Lake Wales, FL USA


Great! Thanks for spending

JustinHoMi's picture

Great! Thanks for spending time on this! It excites me enough that I think I will drive to my client tonight and test this.

There might be a typo in the following line:

exten => _X.,n,noop(the extenlength is ${extLeng}

It's missing a closing parenthesis. It should be:

exten => _X.,n,noop(the extenlength is ${extLeng})


That explains why that

jmullinix's picture

That explains why that wasn't showing up in the CLI output. Nice catch. Let me know if you have any trouble with it.


__________________

John Mullinix, Cohutta.Com, Inc.
1-706-632-3343 -- sip://17066323343@qth.cohutta.org
Looking for Dundi peers in Baltimore, MD and Lake Wales, FL USA


Might want to add these to

jmullinix's picture

Might want to add these to make it so you can transfer to a voicemail box.

exten => _*X.,1,dial(local/${EXTEN}@from-internal,15)
exten => _*X.,n,hangup()


__________________

John Mullinix, Cohutta.Com, Inc.
1-706-632-3343 -- sip://17066323343@qth.cohutta.org
Looking for Dundi peers in Baltimore, MD and Lake Wales, FL USA


Where would I put those? I'm

JustinHoMi's picture

Where would I put those? I'm a bit of an asterisk-config-novice.


I put them in the right

jmullinix's picture

I put them in the right place at the bottom of this context.

{{{
[custom-test_transfer]

; This code will transfer a call and if it is not answered in the time set
; below, it will ring back the original transferor with the call. The time set
; below must be less than the voicemail timeout on the called extension.
; This code will require modification if you have differing extension number lengths
; ie; you have some 3 digit extensions and some four digit extensions.
;
; To use it, put the extensions that you want to have this behaviour in a special context
; of custom-from_internal

exten => _X.,1,NOOP(entering custom-test_transfer)
exten => _X.,n,set(timeoutd=20) ; set timeout in seconds
exten => _X.,n,set(extLeng=${LEN(${EXTEN})})
exten => _X.,n,noop(the extenlength is ${extLeng}
exten => _x.,n,dial(local/${EXTEN}@from-internal,${timeoutd})
exten => _X.,n,Gotoif($["${DIALSTATUS}" = "ANSWER"]?hangup,callback)
exten => _X.,n(callback),dial(local/${BLINDTRANSFER:4:${extLeng}}@from-internal)
exten => _X.,n(hangup),hangup()
exten => _*X.,1,dial(local/${EXTEN}@from-internal,15)
exten => _*X.,n,hangup()
}}}


__________________

John Mullinix, Cohutta.Com, Inc.
1-706-632-3343 -- sip://17066323343@qth.cohutta.org
Looking for Dundi peers in Baltimore, MD and Lake Wales, FL USA


I'm at the client, testing

JustinHoMi's picture

I'm at the client, testing it. It's not working, so. I'll past the relevant debug lines and my config:

[Aug 10 16:59:52] VERBOSE[23585] logger.c: -- Started music on hold, class 'default', on Zap/1-1
[Aug 10 16:59:53] WARNING[23561] rtp.c: Unable to set TOS to 184
[Aug 10 16:59:53] VERBOSE[23590] logger.c: -- Executing [127@custom-from_internal:1] NoOp("SIP/121-b790efd0", "here tiz in custom-from_internal") in new stack
[Aug 10 16:59:53] VERBOSE[23590] logger.c: -- Executing [127@custom-from_internal:2] Set("SIP/121-b790efd0", "__TRANSFER_CONTEXT=custom-test_transfer|127|1") in new stack
[Aug 10 16:59:53] WARNING[23590] pbx.c: Setting multiple variables at once within Set is deprecated. Please separate each name/value pair into its own line.
[Aug 10 16:59:53] WARNING[23590] pbx.c: Ignoring entry '127' with no = (and not last 'options' entry)
[Aug 10 16:59:53] VERBOSE[23590] logger.c: -- Executing [127@custom-from_internal:3] Goto("SIP/121-b790efd0", "from-internal|127|1") in new stack
[Aug 10 16:59:53] VERBOSE[23590] logger.c: -- Goto (from-internal,127,1)
[Aug 10 16:59:53] VERBOSE[23590] logger.c: -- Executing [127@from-internal:1] GotoIf("SIP/121-b790efd0", "1?ext-local|127|1") in new stack
[Aug 10 16:59:53] VERBOSE[23590] logger.c: -- Goto (ext-local,127,1)
[Aug 10 16:59:53] VERBOSE[23590] logger.c: -- Executing [127@ext-local:1] Macro("SIP/121-b790efd0", "exten-vm|127|127") in new stack
[Aug 10 16:59:53] VERBOSE[23590] logger.c: -- Executing [s@macro-exten-vm:1] Macro("SIP/121-b790efd0", "user-callerid") in new stack
[custom-test_transfer]

exten => _X.,1,NOOP(entering custom-test_transfer)
exten => _X.,n,set(timeoutd=10) ; set timeout in seconds
exten => _X.,n,set(extLeng=${LEN(${EXTEN})})
exten => _X.,n,noop(the extenlength is ${extLeng})
exten => _x.,n,dial(local/${EXTEN}@from-internal,${timeoutd})
exten => _X.,n,Gotoif($["${DIALSTATUS}" = "ANSWER"]?hangup,callback)
exten => _X.,n(callback),dial(local/${BLINDTRANSFER:4:${extLeng}}@from-internal)
exten => _X.,n(hangup),hangup()
exten => _*X.,1,dial(local/${EXTEN}@from-internal,15)
exten => _*X.,n,hangup()

[custom-from_internal]

exten => _x.,1,NOOP(here tiz in custom-from_internal)
exten => _x.,n,set(__TRANSFER_CONTEXT=custom-test_transfer|${EXTEN}|1)
exten => _x.,n,goto(from-internal,${EXTEN},1)

[from-pstn-custom]
exten => _x.,n,set(__TRANSFER_CONTEXT=custom-test_transfer|${EXTEN}|1)

In freepbx, I disabled followme for the extensions that I'm testing it on. And for each extension i set the context to custom-from_internal. That's everything I did. The phones are set to go to voicemail in 15 seconds, so I changed timeoutd to 10 seconds.

To test it, I called in with my cell phone and answered the call. Then I tried both a blind transfer and a semi-attended transfer (don't know what to call this) to another extension. It is just going to voicemail.

Any ideas?

Justin


Actually, those logs are

JustinHoMi's picture

Actually, those logs are only displayed when I do an attended transfer. I don't see anything with custom-from_internal (except during asterisk initialization) when doing a blind xfer.


Did you add this line to

jmullinix's picture

Did you add this line to from-pstn-custom in extensions_customs.conf?

[from-pstn-custom]
exten => _x.,n,set(__TRANSFER_CONTEXT=custom-test_transfer|${EXTEN}|1)

Also make sure the extensions are in the context custom-from_internal

I will be available until 1900 Eastern time (2300 UTC) if you want to call. We have friends coming over for dinner.


__________________

John Mullinix, Cohutta.Com, Inc.
1-706-632-3343 -- sip://17066323343@qth.cohutta.org
Looking for Dundi peers in Baltimore, MD and Lake Wales, FL USA


Yes, I added the

JustinHoMi's picture

Yes, I added the from-pstn-custom addition to extensions_custom.conf. I'll give you a ring now!

Justin


John - here is the CLI

JustinHoMi's picture

John - here is the CLI output:

Asterisk 1.4.18.1, Copyright (C) 1999 - 2008 Digium, Inc. and others.
Created by Mark Spencer
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
== Parsing '/etc/asterisk/asterisk.conf': Found
Connected to Asterisk 1.4.18.1 currently running on voip (pid = 30056)
Verbosity is at least 8
-- Starting simple switch on 'Zap/1-1'
-- Executing [s@from-zaptel:1] NoOp("Zap/1-1", "Entering from-zaptel with DID == ") in new stack
-- Executing [s@from-zaptel:2] Ringing("Zap/1-1", "") in new stack
-- Executing [s@from-zaptel:3] Set("Zap/1-1", "DID=s") in new stack
-- Executing [s@from-zaptel:4] NoOp("Zap/1-1", "DID is now s") in new stack
-- Executing [s@from-zaptel:5] GotoIf("Zap/1-1", "1?zapok:notzap") in new stack
-- Goto (from-zaptel,s,8)
-- Executing [s@from-zaptel:8] NoOp("Zap/1-1", "Is a Zaptel Channel") in new stack
-- Executing [s@from-zaptel:9] Set("Zap/1-1", "CHAN=1-1") in new stack
-- Executing [s@from-zaptel:10] Set("Zap/1-1", "CHAN=1") in new stack
-- Executing [s@from-zaptel:11] Macro("Zap/1-1", "from-zaptel-1|s|1") in new stack
-- Executing [s@macro-from-zaptel-1:1] NoOp("Zap/1-1", "Entering macro-from-zaptel-1 with DID = s and setting to: 9195551212") in new stack
-- Executing [s@macro-from-zaptel-1:2] Set("Zap/1-1", "__FROM_DID=9195551212") in new stack
-- Executing [s@macro-from-zaptel-1:3] Goto("Zap/1-1", "from-trunk|9195551212|1") in new stack
-- Goto (from-trunk,9195551212,1)
== Channel 'Zap/1-1' jumping out of macro 'from-zaptel-1'
-- Executing [9195551212@from-trunk:1] NoOp("Zap/1-1", "Catch-All DID Match - Found 9195551212 - You probably want a DID for this.") in new stack
-- Executing [9195551212@from-trunk:2] Goto("Zap/1-1", "ext-did|s|1") in new stack
-- Goto (ext-did,s,1)
-- Executing [s@ext-did:1] Set("Zap/1-1", "__FROM_DID=s") in new stack
-- Executing [s@ext-did:2] GotoIf("Zap/1-1", "0 ?cidok") in new stack
-- Executing [s@ext-did:3] Set("Zap/1-1", "CALLERID(name)=") in new stack
-- Executing [s@ext-did:4] NoOp("Zap/1-1", "CallerID is "" <>") in new stack
-- Executing [s@ext-did:5] Set("Zap/1-1", "FAX_RX=disabled") in new stack
-- Executing [s@ext-did:6] Set("Zap/1-1", "__CALLINGPRES_SV=allowed_not_screened") in new stack
-- Executing [s@ext-did:7] SetCallerPres("Zap/1-1", "allowed_not_screened") in new stack
-- Executing [s@ext-did:8] Set("Zap/1-1", "__ALERT_INFO=External") in new stack
-- Executing [s@ext-did:9] Goto("Zap/1-1", "ext-group|601|1") in new stack
-- Goto (ext-group,601,1)
-- Executing [601@ext-group:1] Macro("Zap/1-1", "user-callerid|") in new stack
-- Executing [s@macro-user-callerid:1] NoOp("Zap/1-1", "user-callerid: ") in new stack
-- Executing [s@macro-user-callerid:2] Set("Zap/1-1", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("Zap/1-1", "0?report") in new stack
-- Executing [s@macro-user-callerid:4] ExecIf("Zap/1-1", "1|Set|REALCALLERIDNUM=") in new stack
-- Executing [s@macro-user-callerid:5] NoOp("Zap/1-1", "REALCALLERIDNUM is ") in new stack
-- Executing [s@macro-user-callerid:6] Set("Zap/1-1", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:7] Set("Zap/1-1", "AMPUSERCIDNAME=") in new stack
-- Executing [s@macro-user-callerid:8] GotoIf("Zap/1-1", "1?report") in new stack
-- Goto (macro-user-callerid,s,13)
-- Executing [s@macro-user-callerid:13] NoOp("Zap/1-1", "TTL: ARG1: ") in new stack
-- Executing [s@macro-user-callerid:14] GotoIf("Zap/1-1", "0?continue") in new stack
-- Executing [s@macro-user-callerid:15] Set("Zap/1-1", "__TTL=64") in new stack
-- Executing [s@macro-user-callerid:16] GotoIf("Zap/1-1", "1?continue") in new stack
-- Goto (macro-user-callerid,s,23)
-- Executing [s@macro-user-callerid:23] NoOp("Zap/1-1", "Using CallerID "" <>") in new stack
-- Executing [601@ext-group:2] GotoIf("Zap/1-1", "1?skipdb") in new stack
-- Goto (ext-group,601,4)
-- Executing [601@ext-group:4] Set("Zap/1-1", "__NODEST=") in new stack
-- Executing [601@ext-group:5] Set("Zap/1-1", "__BLKVM_OVERRIDE=BLKVM/601/Zap/1-1") in new stack
-- Executing [601@ext-group:6] Set("Zap/1-1", "__BLKVM_BASE=601") in new stack
-- Executing [601@ext-group:7] Set("Zap/1-1", "DB(BLKVM/601/Zap/1-1)=TRUE") in new stack
-- Executing [601@ext-group:8] Set("Zap/1-1", "RRNODEST=") in new stack
-- Executing [601@ext-group:9] Set("Zap/1-1", "__NODEST=601") in new stack
-- Executing [601@ext-group:10] Set("Zap/1-1", "__ALERT_INFO=External") in new stack
-- Executing [601@ext-group:11] Set("Zap/1-1", "RecordMethod=Group") in new stack
-- Executing [601@ext-group:12] Macro("Zap/1-1", "record-enable|110-111-112-114-115-116-117-118-119-120-121-122-123-124-125-126-127-128-129-130|Group") in new stack
-- Executing [s@macro-record-enable:1] GotoIf("Zap/1-1", "0?2:4") in new stack
-- Goto (macro-record-enable,s,4)
-- Executing [s@macro-record-enable:4] AGI("Zap/1-1", "recordingcheck|20080810-181933|1218406765.39") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
-- AGI Script recordingcheck completed, returning 0
-- Executing [s@macro-record-enable:5] NoOp("Zap/1-1", "No recording needed") in new stack
-- Executing [601@ext-group:13] Set("Zap/1-1", "RingGroupMethod=ringall") in new stack
-- Executing [601@ext-group:14] Macro("Zap/1-1", "dial|20|tr|110-111-112-114-115-116-117-118-119-120-121-122-123-124-125-126-127-128-129-130") in new stack
-- Executing [s@macro-dial:1] GotoIf("Zap/1-1", "1?dial") in new stack
-- Goto (macro-dial,s,3)
-- Executing [s@macro-dial:3] AGI("Zap/1-1", "dialparties.agi") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
dialparties.agi: Starting New Dialparties.agi
== Parsing '/etc/asterisk/manager.conf': Found
== Parsing '/etc/asterisk/manager_additional.conf': Found
== Parsing '/etc/asterisk/manager_custom.conf': Found
== Manager 'admin' logged on from 127.0.0.1
dialparties.agi: Caller ID name is 'unknown' number is 'unknown'
> dialparties.agi: Setting Alert-Info: External
-- AGI Script Executing Application: (SIPAddHeader) Options: (Alert-Info:External)
dialparties.agi: USE_CONFIRMATION: 'FALSE'
dialparties.agi: RINGGROUP_INDEX: ''
dialparties.agi: Methodology of ring is 'ringall'
-- dialparties.agi: Added extension 110 to extension map
-- dialparties.agi: Added extension 111 to extension map
-- dialparties.agi: Added extension 112 to extension map
-- dialparties.agi: Added extension 114 to extension map
-- dialparties.agi: Added extension 115 to extension map
-- dialparties.agi: Added extension 116 to extension map
-- dialparties.agi: Added extension 117 to extension map
-- dialparties.agi: Added extension 118 to extension map
-- dialparties.agi: Added extension 119 to extension map
-- dialparties.agi: Added extension 120 to extension map
-- dialparties.agi: Added extension 121 to extension map
-- dialparties.agi: Added extension 122 to extension map
-- dialparties.agi: Added extension 123 to extension map
-- dialparties.agi: Added extension 124 to extension map
-- dialparties.agi: Added extension 125 to extension map
-- dialparties.agi: Added extension 126 to extension map
-- dialparties.agi: Added extension 127 to extension map
-- dialparties.agi: Added extension 128 to extension map
-- dialparties.agi: Added extension 129 to extension map
-- dialparties.agi: Added extension 130 to extension map
-- dialparties.agi: Extension 110 cf is disabled
-- dialparties.agi: Extension 111 cf is disabled
-- dialparties.agi: Extension 112 cf is disabled
-- dialparties.agi: Extension 114 cf is disabled
-- dialparties.agi: Extension 115 cf is disabled
-- dialparties.agi: Extension 116 cf is disabled
-- dialparties.agi: Extension 117 cf is disabled
-- dialparties.agi: Extension 118 cf is disabled
-- dialparties.agi: Extension 119 cf is disabled
-- dialparties.agi: Extension 120 cf is disabled
-- dialparties.agi: Extension 121 cf is disabled
-- dialparties.agi: Extension 122 cf is disabled
-- dialparties.agi: Extension 123 cf is disabled
-- dialparties.agi: Extension 124 cf is disabled
-- dialparties.agi: Extension 125 cf is disabled
-- dialparties.agi: Extension 126 cf is disabled
-- dialparties.agi: Extension 127 cf is disabled
-- dialparties.agi: Extension 128 cf is disabled
-- dialparties.agi: Extension 129 cf is disabled
-- dialparties.agi: Extension 130 cf is disabled
-- dialparties.agi: Extension 110 do not disturb is disabled
-- dialparties.agi: Extension 111 do not disturb is disabled
-- dialparties.agi: Extension 112 do not disturb is disabled
-- dialparties.agi: Extension 114 do not disturb is disabled
-- dialparties.agi: Extension 115 do not disturb is disabled
-- dialparties.agi: Extension 116 do not disturb is disabled
-- dialparties.agi: Extension 117 do not disturb is disabled
-- dialparties.agi: Extension 118 do not disturb is disabled
-- dialparties.agi: Extension 119 do not disturb is disabled
-- dialparties.agi: Extension 120 do not disturb is disabled
-- dialparties.agi: Extension 121 do not disturb is disabled
-- dialparties.agi: Extension 122 do not disturb is disabled
-- dialparties.agi: Extension 123 do not disturb is disabled
-- dialparties.agi: Extension 124 do not disturb is disabled
-- dialparties.agi: Extension 125 do not disturb is disabled
-- dialparties.agi: Extension 126 do not disturb is disabled
-- dialparties.agi: Extension 127 do not disturb is disabled
-- dialparties.agi: Extension 128 do not disturb is disabled
-- dialparties.agi: Extension 129 do not disturb is disabled
-- dialparties.agi: Extension 130 do not disturb is disabled
> dialparties.agi: extnum 110 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/110 - Caller ID is not defined
> dialparties.agi: extnum 111 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/111 - Caller ID is not defined
> dialparties.agi: extnum 112 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/112 - Caller ID is not defined
> dialparties.agi: extnum 114 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/114 - Caller ID is not defined
> dialparties.agi: extnum 115 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/115 - Caller ID is not defined
> dialparties.agi: extnum 116 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/116 - Caller ID is not defined
> dialparties.agi: extnum 117 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/117 - Caller ID is not defined
> dialparties.agi: extnum 118 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/118 - Caller ID is not defined
> dialparties.agi: extnum 119 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/119 - Caller ID is not defined
> dialparties.agi: extnum 120 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/120 - Caller ID is not defined
> dialparties.agi: extnum 121 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/121 - Caller ID is not defined
> dialparties.agi: extnum 122 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/122 - Caller ID is not defined
> dialparties.agi: extnum 123 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/123 - Caller ID is not defined
> dialparties.agi: extnum 124 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/124 - Caller ID is not defined
> dialparties.agi: extnum 125 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/125 - Caller ID is not defined
> dialparties.agi: extnum 126 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/126 - Caller ID is not defined
> dialparties.agi: extnum 127 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/127 - Caller ID is not defined
> dialparties.agi: extnum 128 has: cw: 0; hascfb: 0 [] hascfu: 0 []
> dialparties.agi: ExtensionState: 0
dialparties.agi: Extension 128 has ExtensionState: 0
-- dialparties.agi: Checking CW and CFB status for extension 128
-- dialparties.agi: DbDel CALLTRACE/128 - Caller ID is not defined
> dialparties.agi: extnum 129 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/129 - Caller ID is not defined
> dialparties.agi: extnum 130 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/130 - Caller ID is not defined
-- dialparties.agi: Filtered ARG3: 110-111-112-114-115-116-117-118-119-120-121-122-123-124-125-126-127-128-129-130
> dialparties.agi: NODEST: 601 adding M(auto-blkvm) to dialopts: trM(auto-blkvm)
> dialparties.agi: NODEST: 601 blkvm enabled macro already in dialopts: trM(auto-blkvm)
== Manager 'admin' logged off from 127.0.0.1
-- AGI Script dialparties.agi completed, returning 0
-- Executing [s@macro-dial:7] Dial("Zap/1-1", "SIP/110&SIP/111&SIP/112&SIP/114&SIP/115&SIP/116&SIP/117&SIP/118&SIP/119&SIP/120&SIP/121&SIP/122&SIP/123&SIP/124&SIP/125&SIP/126&SIP/127&SIP/128&SIP/129&SIP/130|20|trM(auto-blkvm)") in new stack
-- Called 110
-- Called 111
-- Called 112
-- Called 114
-- Called 115
-- Called 116
-- Called 117
-- Called 118
-- Called 119
-- Called 120
-- Called 121
-- Called 122
-- Called 123
-- Called 125
-- Called 126
-- Called 127
-- Called 128
-- Called 129
-- SIP/110-08af9ff0 is ringing
-- SIP/114-08a76268 is ringing
-- SIP/117-08a84aa0 is ringing
-- SIP/118-08ade5c8 is ringing
-- SIP/116-08a7f6d0 is ringing
-- SIP/120-08ae8dd0 is ringing
-- SIP/115-08a7a2e0 is ringing
-- SIP/122-08af3620 is ringing
-- SIP/112-08b02628 is ringing
-- SIP/119-08ae39a8 is ringing
-- SIP/125-08b0e0f0 is ringing
-- SIP/123-08b08cc0 is ringing
-- SIP/121-08aee1f8 is ringing
-- SIP/127-08b17a70 is ringing
-- SIP/126-08b12db0 is ringing
-- SIP/128-08b1c730 is ringing
-- SIP/129-08b213f0 is ringing
-- SIP/111-08afdf68 is ringing
-- SIP/121-08aee1f8 answered Zap/1-1
-- Executing [s@macro-auto-blkvm:1] Set("SIP/121-08aee1f8", "__MACRO_RESULT=") in new stack
-- Executing [s@macro-auto-blkvm:2] Set("SIP/121-08aee1f8", "__CWIGNORE=") in new stack
-- Executing [s@macro-auto-blkvm:3] DBdel("SIP/121-08aee1f8", "BLKVM/601/Zap/1-1") in new stack
-- DBdel: family=BLKVM, key=601/Zap/1-1
-- Started music on hold, class 'default', on Zap/1-1
-- Stopped music on hold on Zap/1-1
== Spawn extension (from-internal-xfer, 127, 0) exited non-zero on 'Zap/1-1' in macro 'dial'
== Spawn extension (from-internal-xfer, 127, 0) exited non-zero on 'Zap/1-1'
-- Executing [127@from-internal-xfer:1] GotoIf("Zap/1-1", "1?ext-local|127|1") in new stack
-- Goto (ext-local,127,1)
-- Executing [127@ext-local:1] Macro("Zap/1-1", "exten-vm|127|127") in new stack
-- Executing [s@macro-exten-vm:1] Macro("Zap/1-1", "user-callerid") in new stack
-- Executing [s@macro-user-callerid:1] NoOp("Zap/1-1", "user-callerid: ") in new stack
-- Executing [s@macro-user-callerid:2] Set("Zap/1-1", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("Zap/1-1", "0?report") in new stack
-- Executing [s@macro-user-callerid:4] ExecIf("Zap/1-1", "1|Set|REALCALLERIDNUM=") in new stack
-- Executing [s@macro-user-callerid:5] NoOp("Zap/1-1", "REALCALLERIDNUM is ") in new stack
-- Executing [s@macro-user-callerid:6] Set("Zap/1-1", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:7] Set("Zap/1-1", "AMPUSERCIDNAME=") in new stack
-- Executing [s@macro-user-callerid:8] GotoIf("Zap/1-1", "1?report") in new stack
-- Goto (macro-user-callerid,s,13)
-- Executing [s@macro-user-callerid:13] NoOp("Zap/1-1", "TTL: 64 ARG1: 127") in new stack
-- Executing [s@macro-user-callerid:14] GotoIf("Zap/1-1", "0?continue") in new stack
-- Executing [s@macro-user-callerid:15] Set("Zap/1-1", "__TTL=63") in new stack
-- Executing [s@macro-user-callerid:16] GotoIf("Zap/1-1", "1?continue") in new stack
-- Goto (macro-user-callerid,s,23)
-- Executing [s@macro-user-callerid:23] NoOp("Zap/1-1", "Using CallerID "" <>") in new stack
-- Executing [s@macro-exten-vm:2] Set("Zap/1-1", "FROMCONTEXT=exten-vm") in new stack
-- Executing [s@macro-exten-vm:3] Set("Zap/1-1", "VMBOX=127") in new stack
-- Executing [s@macro-exten-vm:4] Set("Zap/1-1", "EXTTOCALL=127") in new stack
-- Executing [s@macro-exten-vm:5] Set("Zap/1-1", "CFUEXT=") in new stack
-- Executing [s@macro-exten-vm:6] Set("Zap/1-1", "CFBEXT=") in new stack
-- Executing [s@macro-exten-vm:7] Set("Zap/1-1", "RT=15") in new stack
-- Executing [s@macro-exten-vm:8] Macro("Zap/1-1", "record-enable|127|IN") in new stack
-- Executing [s@macro-record-enable:1] GotoIf("Zap/1-1", "1?2:4") in new stack
-- Goto (macro-record-enable,s,2)
-- Executing [s@macro-record-enable:2] ResetCDR("Zap/1-1", "w") in new stack
-- Executing [s@macro-record-enable:3] StopMonitor("Zap/1-1", "") in new stack
-- Executing [s@macro-record-enable:4] AGI("Zap/1-1", "recordingcheck|20080810-181943|1218406765.39") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
-- Incoming call: Got SIP response 500 "Internal Server Error" back from 192.168.3.195
recordingcheck|20080810-181943|1218406765.39: Inbound recording not enabled
-- AGI Script recordingcheck completed, returning 0
-- Executing [s@macro-record-enable:5] NoOp("Zap/1-1", "No recording needed") in new stack
-- Executing [s@macro-exten-vm:9] Macro("Zap/1-1", "dial|15|tr|127") in new stack
-- Executing [s@macro-dial:1] GotoIf("Zap/1-1", "1?dial") in new stack
-- Goto (macro-dial,s,3)
-- Executing [s@macro-dial:3] AGI("Zap/1-1", "dialparties.agi") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
dialparties.agi: Starting New Dialparties.agi
== Parsing '/etc/asterisk/manager.conf': Found
== Parsing '/etc/asterisk/manager_additional.conf': Found
== Parsing '/etc/asterisk/manager_custom.conf': Found
== Manager 'admin' logged on from 127.0.0.1
dialparties.agi: Caller ID name is 'unknown' number is 'unknown'
> dialparties.agi: Setting Alert-Info: External
-- AGI Script Executing Application: (SIPAddHeader) Options: (Alert-Info:External)
dialparties.agi: USE_CONFIRMATION: 'FALSE'
dialparties.agi: RINGGROUP_INDEX: ''
dialparties.agi: Methodology of ring is 'ringall'
-- dialparties.agi: Added extension 127 to extension map
-- dialparties.agi: Extension 127 cf is disabled
-- dialparties.agi: Extension 127 do not disturb is disabled
> dialparties.agi: extnum 127 has: cw: 1; hascfb: 0 [] hascfu: 0 []
-- dialparties.agi: DbDel CALLTRACE/127 - Caller ID is not defined
-- dialparties.agi: Filtered ARG3: 127
> dialparties.agi: NODEST: 601 adding M(auto-blkvm) to dialopts: trM(auto-blkvm)
> dialparties.agi: NODEST: 601 blkvm enabled macro already in dialopts: trM(auto-blkvm)
== Manager 'admin' logged off from 127.0.0.1
-- AGI Script dialparties.agi completed, returning 0
-- Executing [s@macro-dial:7] Dial("Zap/1-1", "SIP/127|15|trM(auto-blkvm)") in new stack
-- Called 127
-- SIP/127-08b08cc0 is ringing
-- Nobody picked up in 15000 ms
-- Executing [s@macro-dial:8] Set("Zap/1-1", "DIALSTATUS=NOANSWER") in new stack
-- Executing [s@macro-exten-vm:10] Set("Zap/1-1", "SV_DIALSTATUS=NOANSWER") in new stack
-- Executing [s@macro-exten-vm:11] GosubIf("Zap/1-1", "0?docfu|1") in new stack
-- Executing [s@macro-exten-vm:12] GosubIf("Zap/1-1", "0?docfb|1") in new stack
-- Executing [s@macro-exten-vm:13] Set("Zap/1-1", "DIALSTATUS=NOANSWER") in new stack
-- Executing [s@macro-exten-vm:14] NoOp("Zap/1-1", "Voicemail is 127") in new stack
-- Executing [s@macro-exten-vm:15] GotoIf("Zap/1-1", "0?s-NOANSWER|1") in new stack
-- Executing [s@macro-exten-vm:16] NoOp("Zap/1-1", "Sending to Voicemail box 127") in new stack
-- Executing [s@macro-exten-vm:17] Macro("Zap/1-1", "vm|127|NOANSWER") in new stack
-- Executing [s@macro-vm:1] Macro("Zap/1-1", "user-callerid|SKIPTTL") in new stack
-- Executing [s@macro-user-callerid:1] NoOp("Zap/1-1", "user-callerid: ") in new stack
-- Executing [s@macro-user-callerid:2] Set("Zap/1-1", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("Zap/1-1", "0?report") in new stack
-- Executing [s@macro-user-callerid:4] ExecIf("Zap/1-1", "1|Set|REALCALLERIDNUM=") in new stack
-- Executing [s@macro-user-callerid:5] NoOp("Zap/1-1", "REALCALLERIDNUM is ") in new stack
-- Executing [s@macro-user-callerid:6] Set("Zap/1-1", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:7] Set("Zap/1-1", "AMPUSERCIDNAME=") in new stack
-- Executing [s@macro-user-callerid:8] GotoIf("Zap/1-1", "1?report") in new stack
-- Goto (macro-user-callerid,s,13)
-- Executing [s@macro-user-callerid:13] NoOp("Zap/1-1", "TTL: 63 ARG1: SKIPTTL") in new stack
-- Executing [s@macro-user-callerid:14] GotoIf("Zap/1-1", "1?continue") in new stack
-- Goto (macro-user-callerid,s,23)
-- Executing [s@macro-user-callerid:23] NoOp("Zap/1-1", "Using CallerID "" <>") in new stack
-- Executing [s@macro-vm:2] Set("Zap/1-1", "VMGAIN=""") in new stack
-- Executing [s@macro-vm:3] GotoIf("Zap/1-1", "1?vmx|1") in new stack
-- Goto (macro-vm,vmx,1)
-- Executing [vmx@macro-vm:1] GotoIf("Zap/1-1", "0?s-NOANSWER|1") in new stack
-- Executing [vmx@macro-vm:2] Set("Zap/1-1", "MODE=unavail") in new stack
-- Executing [vmx@macro-vm:3] GotoIf("Zap/1-1", "1?notdirect") in new stack
-- Goto (macro-vm,vmx,5)
-- Executing [vmx@macro-vm:5] NoOp("Zap/1-1", "Checking if ext 127 is enabled: ") in new stack
-- Executing [vmx@macro-vm:6] GotoIf("Zap/1-1", "1?s-NOANSWER|1") in new stack
-- Goto (macro-vm,s-NOANSWER,1)
-- Executing [s-NOANSWER@macro-vm:1] Macro("Zap/1-1", "get-vmcontext|127") in new stack
-- Executing [s@macro-get-vmcontext:1] Set("Zap/1-1", "VMCONTEXT=default") in new stack
-- Executing [s@macro-get-vmcontext:2] GotoIf("Zap/1-1", "0?200:300") in new stack
-- Goto (macro-get-vmcontext,s,300)
-- Executing [s@macro-get-vmcontext:300] NoOp("Zap/1-1", "") in new stack
-- Executing [s-NOANSWER@macro-vm:2] VoiceMail("Zap/1-1", "127@default|u") in new stack
-- Playing '/var/spool/asterisk/voicemail/default/127/unavail' (language 'en')
== Spawn extension (macro-vm, s-NOANSWER, 2) exited non-zero on 'Zap/1-1' in macro 'vm'
== Spawn extension (macro-vm, s-NOANSWER, 2) exited non-zero on 'Zap/1-1' in macro 'exten-vm'
== Spawn extension (macro-vm, s-NOANSWER, 2) exited non-zero on 'Zap/1-1'
-- Hungup 'Zap/1-1'


Justin, For some reason, it

jmullinix's picture

Justin,

For some reason, it is not entering the custom code. Do me a favor. On your machine put this in from-internal-custom

exten => 4455,1,noop(Entering Test number)
exten => 4455,n,set(testvar=JohnWasHere)
exten => 4455,n,noop(the contents are $testvar})
exten => 4455,n,setvar(testing=FredWasHere)
exten => 4455,n,noop(testing is ${testing})
exten => 4455,n,hangup()

then dial 4455 and send me the cli output.


__________________

John Mullinix, Cohutta.Com, Inc.
1-706-632-3343 -- sip://17066323343@qth.cohutta.org
Looking for Dundi peers in Baltimore, MD and Lake Wales, FL USA


Hey John. If I understand

JustinHoMi's picture

Here ya go:

-- Executing [4455@custom-from_internal:1] NoOp("SIP/121-0928b4a8", "here tiz in custom-from_internal") in new stack
-- Executing [4455@custom-from_internal:2] Set("SIP/121-0928b4a8", "__TRANSFER_CONTEXT=custom-test_transfer|4455|1") in new stack
-- Executing [4455@custom-from_internal:3] Goto("SIP/121-0928b4a8", "from-internal|4455|1") in new stack
-- Goto (from-internal,4455,1)
-- Executing [4455@from-internal:1] NoOp("SIP/121-0928b4a8", "Entering Test number") in new stack
-- Executing [4455@from-internal:2] Set("SIP/121-0928b4a8", "testvar=JohnWasHere") in new stack
-- Executing [4455@from-internal:3] NoOp("SIP/121-0928b4a8", "the contents are $testvar}") in new stack
== Spawn extension (from-internal, 4455, 4) exited non-zero on 'SIP/121-0928b4a8'
-- Executing [h@from-internal:1] Macro("SIP/121-0928b4a8", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] ResetCDR("SIP/121-0928b4a8", "w") in new stack
-- Executing [s@macro-hangupcall:2] NoCDR("SIP/121-0928b4a8", "") in new stack
-- Executing [s@macro-hangupcall:3] GotoIf("SIP/121-0928b4a8", "1?skiprg") in new stack
-- Goto (macro-hangupcall,s,6)
-- Executing [s@macro-hangupcall:6] GotoIf("SIP/121-0928b4a8", "1?skipblkvm") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [s@macro-hangupcall:9] GotoIf("SIP/121-0928b4a8", "1?theend") in new stack
-- Goto (macro-hangupcall,s,11)
-- Executing [s@macro-hangupcall:11] Hangup("SIP/121-0928b4a8", "") in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/121-0928b4a8' in macro 'hangupcall'
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/121-0928b4a8'


I think there was an error

JustinHoMi's picture

I think there was an error in the above code - a missing {. I edited it and got this output:

-- Executing [4455@custom-from_internal:1] NoOp("SIP/121-08298890", "here tiz in custom-from_internal") in new stack
-- Executing [4455@custom-from_internal:2] Set("SIP/121-08298890", "__TRANSFER_CONTEXT=custom-test_transfer|4455|1") in new stack
-- Executing [4455@custom-from_internal:3] Goto("SIP/121-08298890", "from-internal|4455|1") in new stack
-- Goto (from-internal,4455,1)
-- Executing [4455@from-internal:1] NoOp("SIP/121-08298890", "Entering Test number") in new stack
-- Executing [4455@from-internal:2] Set("SIP/121-08298890", "testvar=JohnWasHere") in new stack
-- Executing [4455@from-internal:3] NoOp("SIP/121-08298890", "the contents are JohnWasHere") in new stack
== Spawn extension (from-internal, 4455, 4) exited non-zero on 'SIP/121-08298890'
-- Executing [h@from-internal:1] Macro("SIP/121-08298890", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] ResetCDR("SIP/121-08298890", "w") in new stack
-- Executing [s@macro-hangupcall:2] NoCDR("SIP/121-08298890", "") in new stack
-- Executing [s@macro-hangupcall:3] GotoIf("SIP/121-08298890", "1?skiprg") in new stack
-- Goto (macro-hangupcall,s,6)
-- Executing [s@macro-hangupcall:6] GotoIf("SIP/121-08298890", "1?skipblkvm") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [s@macro-hangupcall:9] GotoIf("SIP/121-08298890", "1?theend") in new stack
-- Goto (macro-hangupcall,s,11)
-- Executing [s@macro-hangupcall:11] Hangup("SIP/121-08298890", "") in new stack


OK, you can delete my 4455

jmullinix's picture

OK, you can delete my 4455 code. Set works and SetVar doesn't. The extension is entering my context, so it must be the PSTN that is not getting into my context. Take a look and see what context your incoming calls are coming in on and get that one line of code into that context somehow.

On my machine, the custom code for inbound is from-pstn-custom, but yours may be different.

Off to light the grill and open the wine.

Have a great evening.


__________________

John Mullinix, Cohutta.Com, Inc.
1-706-632-3343 -- sip://17066323343@qth.cohutta.org
Looking for Dundi peers in Baltimore, MD and Lake Wales, FL USA


I was wondering if that was

JustinHoMi's picture

I was wondering if that was the problem. I think they are coming in on from-trunk. If I add your line to [from-trunk] in extensions.conf, then it works.

However, I wonder if from-trunk is some all-encompassing context. I know it's not safe to put anything in extensions.conf, so if from-trunk is the correct context, then I'll just have to figure out another way to get it in there.

By the way, I upgraded asterisk to 1.4.21. Towards the end of the PBXIAF update script I got a lovely kernel panic, and fully expected many horrors to ensue. however, everything seems to work well. I'm hoping that it panic'd after everything was done updating.

Thanks again for your help!


[from-trunk] simply includes

SkykingOH's picture

[from-trunk] simply includes [from-pstn]

Would it work if you added a new context in extensions_custom, ended the code with a goto(from_trunk) and then change the context of your inbound trunk?

Just an idea.


from-trunk is just a

jmullinix's picture

from-trunk is just a placeholder and includes from-pstn. Here is the snippet from my extensions.conf

[from-trunk] ; just an alias since VoIP shouldn't be called PSTN
include => from-pstn

[from-pstn]
include => from-pstn-custom ; create this context in extensions_custom.conf to include customizations
include => ext-did
include => from-did-direct ; MODIFICATOIN (PL) for findmefollow if enabled, should be bofore ext-local
include => ext-did-catchall ; THIS MUST COME AFTER ext-did
exten => fax,1,Goto(ext-fax,in_fax,1)

As you see, [from-pstn] has an include for from-pstn-custom. You should be able to put the following in extensions_custom.conf

[from-pstn-custom]

exten => _x.,n,set(__TRANSFER_CONTEXT=custom-test_transfer|${EXTEN}|1)

and that should do it. If you leave it in from-trunk in extensions.conf, it will get overwritten the next time you reload FreePBX. If this doesn't fix it, try Scott's way. Create a context in extensions_custom.conf and call it say from-trunk-special. Put this in it.

[from-trunk-special]

exten => _x.,n,set(__TRANSFER_CONTEXT=custom-test_transfer|${EXTEN}|1)
exten => _X.,n,goto(from-pstn,${EXTEN},1)

Then put your trunks in the context from-trunk-special.

While typing this, I noticed a potential mistake. My line:

[from-pstn-custom]

exten => _x.,n,set(__TRANSFER_CONTEXT=custom-test_transfer|${EXTEN}|1)

should be:

[from-pstn-custom]

exten => _x.,1,set(__TRANSFER_CONTEXT=custom-test_transfer|${EXTEN}|1) ;note change n to 1

Might want to try this change first. It won't be the first time I have fat-fingered code.

Have a great day and feel free to call if you have questions.


__________________

John Mullinix, Cohutta.Com, Inc.
1-706-632-3343 -- sip://17066323343@qth.cohutta.org
Looking for Dundi peers in Baltimore, MD and Lake Wales, FL USA


John, Nice piece of code...

fskrotzki's picture

John,

Nice piece of code... You know if it was bundled as a patch and submitted you could ask for a additional checkbox to be added in the general setting page to enable/disable this code and get it included permanently...

What would be even nicer is a way to do it at a extension by extension bases as that is how our CEO would like it, but we'd not want it working that way for the rest of the company.

just my $.02.


Thanks Fred, I did submit it

jmullinix's picture

Thanks Fred,

I did submit it but I am not a PHP/Pear guru, so I will have to leave it to someone else to actually add it to the project. I am with you, it would be really cool to have a tickbox to turn it on and off. I am still debugging it, but I think I will make it work.


__________________

John Mullinix, Cohutta.Com, Inc.
1-706-632-3343 -- sip://17066323343@qth.cohutta.org
Looking for Dundi peers in Baltimore, MD and Lake Wales, FL USA


what is the ticket number.

fskrotzki's picture

what is the ticket number. I'll keep a eye on it also. Not a great dial plan coder but I can hack my way through perl and php most of the time I'm finding...


t

JustinHoMi's picture

Ah, I bet it was the missing 1! When I put that line in [from-trunk] I changed the n to a 1, but I didn't do that when I had it in [from-pstn].

I'll try that tonight.

Another idea for the script (which you don't have to implement) would be to put some prefix on the callerid for calls that "ring back". Something like "RB: ". That might be a good simple project to help me learn asterisk scripting....


Fred, I added It to ticket

jmullinix's picture

Fred,

I added It to ticket #2678

Justin,

Let me know if it works as expected. If so, I will make a final copy of it and post it for all to use.


__________________

John Mullinix, Cohutta.Com, Inc.
1-706-632-3343 -- sip://17066323343@qth.cohutta.org
Looking for Dundi peers in Baltimore, MD and Lake Wales, FL USA


So far so good! Here is a

JustinHoMi's picture

So far so good!

Here is a small change in the script to prefix "RB:" to the callerid when the call is coming back to the original transferrer:

exten => _X.,1,NOOP(entering custom-test_transfer)
exten => _X.,n,set(timeoutd=10) ; set timeout in seconds
exten => _X.,n,set(extLeng=${LEN(${EXTEN})})
exten => _X.,n,noop(the extenlength is ${extLeng})
exten => _x.,n,dial(local/${EXTEN}@from-internal,${timeoutd})
exten => _X.,n,Gotoif($["${DIALSTATUS}" = "ANSWER"]?hangup,callback)
exten => _X.,n,Set(CALLERID(name)=RB:${CALLERID(name)})
exten => _X.,n(callback),dial(local/${BLINDTRANSFER:4:${extLeng}}@from-internal)
exten => _X.,n(hangup),hangup()
exten => _*X.,1,dial(local/${EXTEN}@from-internal,15)
exten => _*X.,n,hangup()

The only problem with the code is that UNKNOWN caller id's come up as "RB:", rather than "RB:UNKNOWN". I'm not sure how to fix that.


A scenario that we might

JustinHoMi's picture

A scenario that we might want to consider is if neither the transferee nor the transferrer answer the phone. The caller would get the transferrer's voicemail rather than the transferee's voicemail. Would it be more clear to the caller if it went to the transferee's voicemail in the situation that the transferrer does not answer the phone on a call back?

There's a very good chance that what I just said makes no sense at all....

I think that's beyond my scripting capabilities.

Either way, the script works great! It is installed, and I'll provide feedback from my client if they have any.

Oh... I should mention that asterisk hung up on me a couple times when testing this out. I'm not sure if it's related to the script or not.


Interesting... I just

JustinHoMi's picture

Interesting... I just realized that this is working without changing the context of each extension. They are all set to from-internal. Is it actually necessary to change the context?


Justin, You made a neat

jmullinix's picture

Justin,

You made a neat discovery. You cannot put the internal extensions in the special transfer context. If you do, it won't work with outside calls. When I put everything back in the from-internal context, the ringback worked perfectly with outside calls. So the final thoughts are:

[from-pstn-custom]
exten => _x.,1,set(__TRANSFER_CONTEXT=custom-test_transfer|${EXTEN}|1)

[custom-test_transfer]
exten => _X.,1,NOOP(entering custom-test_transfer)
exten => _X.,n,set(timeoutd=10) ; set timeout in seconds
exten => _X.,n,set(extLeng=${LEN(${EXTEN})})
exten => _X.,n,noop(the extenlength is ${extLeng})
exten => _x.,n,dial(local/${EXTEN}@from-internal,${timeoutd})
exten => _X.,n,Gotoif($["${DIALSTATUS}" = "ANSWER"]?hangup,callback)
exten => _X.,n,Set(CALLERID(name)=RB:${CALLERID(name)})
exten => _X.,n(callback),dial(local/${BLINDTRANSFER:4:${extLeng}}@from-internal)
exten => _X.,n(hangup),hangup()
exten => _*X.,1,dial(local/${EXTEN}@from-internal,15)
exten => _*X.,n,hangup()

Fred, I put this code on ticket number 2678


__________________

John Mullinix, Cohutta.Com, Inc.
1-706-632-3343 -- sip://17066323343@qth.cohutta.org
Looking for Dundi peers in Baltimore, MD and Lake Wales, FL USA


Call back not working when call is from Queue

draguzet's picture

If incoming call go to queue, and extension answer and transfer to busy extension, caller hear message "user on the extension 23 is on the phone, beep" , and call hangup.

Any help to go call back even is call coming from queue ?


No problem with Queue, only X-lite working !?

draguzet's picture

I think problem is with Queue, but no, if answer a call on X-lite, and transfer to busy extension call back work ok, if answer on phone (eg. Cisco 7960, Siemens 450IP...) caller hear message: "user on the extension 23 is on the phone, beep"

-- Goto (macro-hangupcall,s,11)
-- Executing [s@macro-hangupcall:11] Hangup("Local/26@from-internal-4170,2", "") in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'Local/26@from-internal-4170,2' in macro 'hangupcall'
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'Local/26@from-internal-4170,2'
-- Nobody picked up in 1000 ms
-- Unregistered SIP '24'
-- Registered SIP '24' at 192.168.10.119 port 5060 expires 60
dialparties.agi: Extension 27 has ExtensionState: 0
-- dialparties.agi: Checking CW and CFB status for extension 27
dialparties.agi: Extension 21 has ExtensionState: 1
-- dialparties.agi: Checking CW and CFB status for extension 21
dialparties.agi: Extension 21 is not available to be called
dialparties.agi: Extension 21 has call waiting disabled
== Manager 'admin' logged off from 127.0.0.1
-- dialparties.agi: dbset CALLTRACE/27 to 0915014747
== Manager 'admin' logged off from 127.0.0.1
-- AGI Script dialparties.agi completed, returning 0
-- Executing [s@macro-dial:10] Dial("Local/23@from-internal-d509,2", "SIP/23|15|trTM(auto-blkvm)") in new stack
-- Called 23
-- Local/23@from-internal-d509,1 is ringing
-- SIP/23-b6300468 is ringing
-- SIP/23-b6300468 answered Local/23@from-internal-d509,2
-- Executing [s@macro-auto-blkvm:1] Set("SIP/23-b6300468", "__MACRO_RESULT=") in new stack
-- Executing [s@macro-auto-blkvm:2] DBdel("SIP/23-b6300468", "BLKVM/09/mISDN/3-u58") in new stack
-- DBdel: family=BLKVM, key=09/mISDN/3-u58
-- Local/23@from-internal-d509,1 answered mISDN/3-u58
== Spawn extension (macro-dial, s, 3) exited non-zero on 'Local/21@from-internal-8b2c,2' in macro 'dial'
== Spawn extension (macro-dial, s, 3) exited non-zero on 'Local/21@from-internal-8b2c,2' in macro 'exten-vm'
== Spawn extension (macro-dial, s, 3) exited non-zero on 'Local/21@from-internal-8b2c,2'
-- Stopped music on hold on mISDN/3-u58
== Spawn extension (macro-dial, s, 10) exited non-zero on 'Local/33@from-internal-39d3,2' in macro 'dial'
== Spawn extension (macro-dial, s, 10) exited non-zero on 'Local/33@from-internal-39d3,2' in macro 'exten-vm'
== Spawn extension (macro-dial, s, 10) exited non-zero on 'Local/33@from-internal-39d3,2'
-- Executing [h@macro-dial:1] Macro("Local/33@from-internal-39d3,2", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] ResetCDR("Local/33@from-internal-39d3,2", "w") in new stack
-- Executing [s@macro-hangupcall:2] NoCDR("Local/33@from-internal-39d3,2", "") in new stack
-- Executing [s@macro-hangupcall:3] GotoIf("Local/33@from-internal-39d3,2", "1?skiprg") in new stack
-- Goto (macro-hangupcall,s,6)
-- Executing [s@macro-hangupcall:6] GotoIf("Local/33@from-internal-39d3,2", "1?skipblkvm") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [s@macro-hangupcall:9] GotoIf("Local/33@from-internal-39d3,2", "1?theend") in new stack
-- Goto (macro-hangupcall,s,11)
-- Executing [s@macro-hangupcall:11] Hangup("Local/33@from-internal-39d3,2", "") in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'Local/33@from-internal-39d3,2' in macro 'hangupcall'
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'Local/33@from-internal-39d3,2'
-- Executing [h@macro-dial:1] Macro("Local/21@from-internal-8b2c,2", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] ResetCDR("Local/21@from-internal-8b2c,2", "w") in new stack
-- Executing [s@macro-hangupcall:2] NoCDR("Local/21@from-internal-8b2c,2", "") in new stack
-- Executing [s@macro-hangupcall:3] GotoIf("Local/21@from-internal-8b2c,2", "1?skiprg") in new stack
-- Goto (macro-hangupcall,s,6)
-- Executing [s@macro-hangupcall:6] GotoIf("Local/21@from-internal-8b2c,2", "1?skipblkvm") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [s@macro-hangupcall:9] GotoIf("Local/21@from-internal-8b2c,2", "1?theend") in new stack
-- Goto (macro-hangupcall,s,11)
-- Executing [s@macro-hangupcall:11] Hangup("Local/21@from-internal-8b2c,2", "") in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'Local/21@from-internal-8b2c,2' in macro 'hangupcall'
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'Local/21@from-internal-8b2c,2'
== Spawn extension (macro-dial, s, 9) exited non-zero on 'Local/27@from-internal-7f44,2' in macro 'dial'
== Spawn extension (macro-dial, s, 9) exited non-zero on 'Local/27@from-internal-7f44,2' in macro 'exten-vm'
== Spawn extension (macro-dial, s, 9) exited non-zero on 'Local/27@from-internal-7f44,2'
-- Executing [h@macro-dial:1] Macro("Local/27@from-internal-7f44,2", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] ResetCDR("Local/27@from-internal-7f44,2", "w") in new stack
-- Executing [s@macro-hangupcall:2] NoCDR("Local/27@from-internal-7f44,2", "") in new stack
-- Executing [s@macro-hangupcall:3] GotoIf("Local/27@from-internal-7f44,2", "1?skiprg") in new stack
-- Goto (macro-hangupcall,s,6)
-- Executing [s@macro-hangupcall:6] GotoIf("Local/27@from-internal-7f44,2", "1?skipblkvm") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [s@macro-hangupcall:9] GotoIf("Local/27@from-internal-7f44,2", "1?theend") in new stack
-- Goto (macro-hangupcall,s,11)
-- Executing [s@macro-hangupcall:11] Hangup("Local/27@from-internal-7f44,2", "") in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'Local/27@from-internal-7f44,2' in macro 'hangupcall'
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'Local/27@from-internal-7f44,2'
-- Started music on hold, class 'Muzika', on Local/23@from-internal-d509,2
-- Playing 'pbx-transfer' (language 'en')
-- Stopped music on hold on Local/23@from-internal-d509,2
== Channel 'Local/23@from-internal-d509,2' jumping out of macro 'dial'
== Channel 'Local/23@from-internal-d509,2' jumping out of macro 'exten-vm'
-- Executing [21@custom-test_transfer:1] NoOp("Local/23@from-internal-d509,2", "entering custom-test_transfer") in new stack
-- Executing [21@custom-test_transfer:2] Set("Local/23@from-internal-d509,2", "timeoutd=20") in new stack
-- Executing [21@custom-test_transfer:3] Set("Local/23@from-internal-d509,2", "extLeng=2") in new stack
-- Executing [21@custom-test_transfer:4] NoOp("Local/23@from-internal-d509,2", "the extenlength is 2") in new stack
-- Executing [21@custom-test_transfer:5] Dial("Local/23@from-internal-d509,2", "local/21@from-internal|20") in new stack
-- Called 21@from-internal
-- Executing [21@from-internal:1] Set("Local/21@from-internal-06ef,2", "__RINGTIMER=45") in new stack
-- Executing [21@from-internal:2] Macro("Local/21@from-internal-06ef,2", "exten-vm|novm|21") in new stack
-- Executing [s@macro-exten-vm:1] Macro("Local/21@from-internal-06ef,2", "user-callerid") in new stack
-- Executing [s@macro-user-callerid:1] NoOp("Local/21@from-internal-06ef,2", "user-callerid: 0915014747 0915014747") in new stack
-- Executing [s@macro-user-callerid:2] Set("Local/21@from-internal-06ef,2", "AMPUSER=0915014747") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("Local/21@from-internal-06ef,2", "1?report") in new stack
-- Goto (macro-user-callerid,s,13)
-- Executing [s@macro-user-callerid:13] NoOp("Local/21@from-internal-06ef,2", "TTL: 63 ARG1: novm") in new stack
-- Executing [s@macro-user-callerid:14] GotoIf("Local/21@from-internal-06ef,2", "0?continue") in new stack
-- Executing [s@macro-user-callerid:15] Set("Local/21@from-internal-06ef,2", "__TTL=62") in new stack
-- Executing [s@macro-user-callerid:16] GotoIf("Local/21@from-internal-06ef,2", "1?continue") in new stack
-- Goto (macro-user-callerid,s,23)
-- Executing [s@macro-user-callerid:23] NoOp("Local/21@from-internal-06ef,2", "Using CallerID "0915014747" <0915014747>") in new stack
-- Executing [s@macro-exten-vm:2] Set("Local/21@from-internal-06ef,2", "FROMCONTEXT=exten-vm") in new stack
-- Executing [s@macro-exten-vm:3] Set("Local/21@from-internal-06ef,2", "VMBOX=novm") in new stack
-- Executing [s@macro-exten-vm:4] Set("Local/21@from-internal-06ef,2", "EXTTOCALL=21") in new stack
-- Executing [s@macro-exten-vm:5] Set("Local/21@from-internal-06ef,2", "CFUEXT=") in new stack
-- Executing [s@macro-exten-vm:6] Set("Local/21@from-internal-06ef,2", "CFBEXT=") in new stack
-- Executing [s@macro-exten-vm:7] Set("Local/21@from-internal-06ef,2", "RT=""") in new stack
-- Executing [s@macro-exten-vm:8] Macro("Local/21@from-internal-06ef,2", "record-enable|21|IN") in new stack
-- Executing [s@macro-record-enable:1] GotoIf("Local/21@from-internal-06ef,2", "0?2:4") in new stack
-- Goto (macro-record-enable,s,4)
-- Executing [s@macro-record-enable:4] AGI("Local/21@from-internal-06ef,2", "recordingcheck|20090320-101144|1237540304.328") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck|20090320-101144|1237540304.328: Inbound recording not enabled
-- AGI Script recordingcheck completed, returning 0
-- Executing [s@macro-record-enable:5] NoOp("Local/21@from-internal-06ef,2", "No recording needed") in new stack
-- Executing [s@macro-exten-vm:9] Macro("Local/21@from-internal-06ef,2", "dial||trT|21") in new stack
-- Executing [s@macro-dial:1] GotoIf("Local/21@from-internal-06ef,2", "0?dial") in new stack
-- Executing [s@macro-dial:2] SetMusicOnHold("Local/21@from-internal-06ef,2", "Muzika") in new stack
-- Executing [s@macro-dial:3] AGI("Local/21@from-internal-06ef,2", "dialparties.agi") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
dialparties.agi: Starting New Dialparties.agi
== Parsing '/etc/asterisk/manager.conf': Found
== Parsing '/etc/asterisk/manager_custom.conf': Found
== Manager 'admin' logged on from 127.0.0.1
dialparties.agi: Caller ID name is '0915014747' number is '0915014747'
dialparties.agi: Methodology of ring is 'none'
-- dialparties.agi: Added extension 21 to extension map
-- dialparties.agi: Extension 21 cf is disabled
-- dialparties.agi: Extension 21 do not disturb is disabled
dialparties.agi: Extension 21 has ExtensionState: 1
-- dialparties.agi: Checking CW and CFB status for extension 21
dialparties.agi: Extension 21 is not available to be called
dialparties.agi: Extension 21 has call waiting disabled
== Manager 'admin' logged off from 127.0.0.1
-- AGI Script dialparties.agi completed, returning 0
-- Executing [s@macro-dial:4] NoOp("Local/21@from-internal-06ef,2", "Returned from dialparties with no extensions to call and DIALSTATUS: BUSY") in new stack
-- Executing [s@macro-exten-vm:10] Set("Local/21@from-internal-06ef,2", "SV_DIALSTATUS=BUSY") in new stack
-- Executing [s@macro-exten-vm:11] GosubIf("Local/21@from-internal-06ef,2", "0?docfu|1") in new stack
-- Executing [s@macro-exten-vm:12] GosubIf("Local/21@from-internal-06ef,2", "0?docfb|1") in new stack
-- Executing [s@macro-exten-vm:13] Set("Local/21@from-internal-06ef,2", "DIALSTATUS=BUSY") in new stack
-- Executing [s@macro-exten-vm:14] NoOp("Local/21@from-internal-06ef,2", "Voicemail is novm") in new stack
-- Executing [s@macro-exten-vm:15] GotoIf("Local/21@from-internal-06ef,2", "1?s-BUSY|1") in new stack
-- Goto (macro-exten-vm,s-BUSY,1)
-- Executing [s-BUSY@macro-exten-vm:1] NoOp("Local/21@from-internal-06ef,2", "Extension is reporting BUSY and not passing to Voicemail") in new stack
-- Executing [s-BUSY@macro-exten-vm:2] PlayTones("Local/21@from-internal-06ef,2", "busy") in new stack
-- Executing [s-BUSY@macro-exten-vm:3] Busy("Local/21@from-internal-06ef,2", "20") in new stack
-- Local/21@from-internal-06ef,1 is busy
== Everyone is busy/congested at this time (1:1/0/0)
-- Executing [21@custom-test_transfer:6] GotoIf("Local/23@from-internal-d509,2", "0?hangup|callback") in new stack
-- Executing [21@custom-test_transfer:7] Set("Local/23@from-internal-d509,2", "CALLERID(name)=RB:0915014747") in new stack
-- Executing [21@custom-test_transfer:8] Dial("Local/23@from-internal-d509,2", "local/23@from-internal") in new stack
-- Called 23@from-internal
-- Executing [23@from-internal:1] Macro("Local/23@from-internal-f859,2", "exten-vm|23|23") in new stack
-- Executing [s@macro-exten-vm:1] Macro("Local/23@from-internal-f859,2", "user-callerid") in new stack
-- Executing [s@macro-user-callerid:1] NoOp("Local/23@from-internal-f859,2", "user-callerid: RB:0915014747 0915014747") in new stack
-- Executing [s@macro-user-callerid:2] Set("Local/23@from-internal-f859,2", "AMPUSER=0915014747") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("Local/23@from-internal-f859,2", "1?report") in new stack
-- Goto (macro-user-callerid,s,13)
-- Executing [s@macro-user-callerid:13] NoOp("Local/23@from-internal-f859,2", "TTL: 63 ARG1: 23") in new stack
-- Executing [s@macro-user-callerid:14] GotoIf("Local/23@from-internal-f859,2", "0?continue") in new stack
-- Executing [s@macro-user-callerid:15] Set("Local/23@from-internal-f859,2", "__TTL=62") in new stack
-- Executing [s@macro-user-callerid:16] GotoIf("Local/23@from-internal-f859,2", "1?continue") in new stack
-- Goto (macro-user-callerid,s,23)
-- Executing [s@macro-user-callerid:23] NoOp("Local/23@from-internal-f859,2", "Using CallerID "RB:0915014747" <0915014747>") in new stack
-- Executing [s@macro-exten-vm:2] Set("Local/23@from-internal-f859,2", "FROMCONTEXT=exten-vm") in new stack
-- Executing [s@macro-exten-vm:3] Set("Local/23@from-internal-f859,2", "VMBOX=23") in new stack
-- Executing [s@macro-exten-vm:4] Set("Local/23@from-internal-f859,2", "EXTTOCALL=23") in new stack
-- Executing [s@macro-exten-vm:5] Set("Local/23@from-internal-f859,2", "CFUEXT=") in new stack
-- Executing [s@macro-exten-vm:6] Set("Local/23@from-internal-f859,2", "CFBEXT=") in new stack
-- Executing [s@macro-exten-vm:7] Set("Local/23@from-internal-f859,2", "RT=15") in new stack
-- Executing [s@macro-exten-vm:8] Macro("Local/23@from-internal-f859,2", "record-enable|23|IN") in new stack
-- Executing [s@macro-record-enable:1] GotoIf("Local/23@from-internal-f859,2", "0?2:4") in new stack
-- Goto (macro-record-enable,s,4)
-- Executing [s@macro-record-enable:4] AGI("Local/23@from-internal-f859,2", "recordingcheck|20090320-101144|1237540304.330") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
== Spawn extension (macro-exten-vm, s-BUSY, 3) exited non-zero on 'Local/21@from-internal-06ef,2' in macro 'exten-vm'
== Spawn extension (macro-exten-vm, s-BUSY, 3) exited non-zero on 'Local/21@from-internal-06ef,2'
recordingcheck|20090320-101144|1237540304.330: Inbound recording not enabled
-- AGI Script recordingcheck completed, returning 0
-- Executing [s@macro-record-enable:5] NoOp("Local/23@from-internal-f859,2", "No recording needed") in new stack
-- Executing [s@macro-exten-vm:9] Macro("Local/23@from-internal-f859,2", "dial|15|trT|23") in new stack
-- Executing [s@macro-dial:1] GotoIf("Local/23@from-internal-f859,2", "0?dial") in new stack
-- Executing [s@macro-dial:2] SetMusicOnHold("Local/23@from-internal-f859,2", "Muzika") in new stack
-- Executing [s@macro-dial:3] AGI("Local/23@from-internal-f859,2", "dialparties.agi") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
dialparties.agi: Starting New Dialparties.agi
== Parsing '/etc/asterisk/manager.conf': Found
== Parsing '/etc/asterisk/manager_custom.conf': Found
== Manager 'admin' logged on from 127.0.0.1
dialparties.agi: Caller ID name is 'RB:0915014747' number is '0915014747'
dialparties.agi: Methodology of ring is 'none'
-- dialparties.agi: Added extension 23 to extension map
-- dialparties.agi: Extension 23 cf is disabled
-- dialparties.agi: Extension 23 do not disturb is disabled
dialparties.agi: Extension 23 has ExtensionState: 0
-- dialparties.agi: Checking CW and CFB status for extension 23
-- dialparties.agi: dbset CALLTRACE/23 to 0915014747
== Manager 'admin' logged off from 127.0.0.1
-- AGI Script dialparties.agi completed, returning 0
-- Executing [s@macro-dial:10] Dial("Local/23@from-internal-f859,2", "SIP/23|15|trTM(auto-blkvm)") in new stack
-- Called 23
-- Local/23@from-internal-f859,1 is ringing
-- Got SIP response 486 "Busy Here" back from 192.168.10.122
-- SIP/23-0a089f88 is busy
== Everyone is busy/congested at this time (1:1/0/0)
-- Executing [s@macro-dial:11] Set("Local/23@from-internal-f859,2", "DIALSTATUS=BUSY") in new stack
-- Executing [s@macro-exten-vm:10] Set("Local/23@from-internal-f859,2", "SV_DIALSTATUS=BUSY") in new stack
-- Executing [s@macro-exten-vm:11] GosubIf("Local/23@from-internal-f859,2", "0?docfu|1") in new stack
-- Executing [s@macro-exten-vm:12] GosubIf("Local/23@from-internal-f859,2", "0?docfb|1") in new stack
-- Executing [s@macro-exten-vm:13] Set("Local/23@from-internal-f859,2", "DIALSTATUS=BUSY") in new stack
-- Executing [s@macro-exten-vm:14] NoOp("Local/23@from-internal-f859,2", "Voicemail is 23") in new stack
-- Local/23@from-internal-f859,1 stopped sounds
-- Executing [s@macro-exten-vm:15] GotoIf("Local/23@from-internal-f859,2", "0?s-BUSY|1") in new stack
-- Executing [s@macro-exten-vm:16] NoOp("Local/23@from-internal-f859,2", "Sending to Voicemail box 23") in new stack
-- Executing [s@macro-exten-vm:17] Macro("Local/23@from-internal-f859,2", "vm|23|BUSY") in new stack
-- Executing [s@macro-vm:1] Macro("Local/23@from-internal-f859,2", "user-callerid|SKIPTTL") in new stack
-- Executing [s@macro-user-callerid:1] NoOp("Local/23@from-internal-f859,2", "user-callerid: RB:0915014747 0915014747") in new stack
-- Executing [s@macro-user-callerid:2] Set("Local/23@from-internal-f859,2", "AMPUSER=0915014747") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("Local/23@from-internal-f859,2", "1?report") in new stack
-- Goto (macro-user-callerid,s,13)
-- Executing [s@macro-user-callerid:13] NoOp("Local/23@from-internal-f859,2", "TTL: 62 ARG1: SKIPTTL") in new stack
-- Executing [s@macro-user-callerid:14] GotoIf("Local/23@from-internal-f859,2", "1?continue") in new stack
-- Goto (macro-user-callerid,s,23)
-- Executing [s@macro-user-callerid:23] NoOp("Local/23@from-internal-f859,2", "Using CallerID "RB:0915014747" <0915014747>") in new stack
-- Executing [s@macro-vm:2] Set("Local/23@from-internal-f859,2", "VMGAIN=""") in new stack
-- Executing [s@macro-vm:3] GotoIf("Local/23@from-internal-f859,2", "1?vmx|1") in new stack
-- Goto (macro-vm,vmx,1)
-- Executing [vmx@macro-vm:1] GotoIf("Local/23@from-internal-f859,2", "0?s-BUSY|1") in new stack
-- Executing [vmx@macro-vm:2] Set("Local/23@from-internal-f859,2", "MODE=busy") in new stack
-- Executing [vmx@macro-vm:3] GotoIf("Local/23@from-internal-f859,2", "1?notdirect") in new stack
-- Goto (macro-vm,vmx,5)
-- Executing [vmx@macro-vm:5] NoOp("Local/23@from-internal-f859,2", "Checking if ext 23 is enabled: ") in new stack
-- Executing [vmx@macro-vm:6] GotoIf("Local/23@from-internal-f859,2", "1?s-BUSY|1") in new stack
-- Goto (macro-vm,s-BUSY,1)
-- Executing [s-BUSY@macro-vm:1] NoOp("Local/23@from-internal-f859,2", "BUSY voicemail") in new stack
-- Executing [s-BUSY@macro-vm:2] Macro("Local/23@from-internal-f859,2", "get-vmcontext|23") in new stack
-- Executing [s@macro-get-vmcontext:1] Set("Local/23@from-internal-f859,2", "VMCONTEXT=default") in new stack
-- Executing [s@macro-get-vmcontext:2] GotoIf("Local/23@from-internal-f859,2", "0?200:300") in new stack
-- Goto (macro-get-vmcontext,s,300)
-- Executing [s@macro-get-vmcontext:300] NoOp("Local/23@from-internal-f859,2", "") in new stack
-- Executing [s-BUSY@macro-vm:3] VoiceMail("Local/23@from-internal-f859,2", "23@default|sb") in new stack
-- Playing 'vm-theperson' (language 'en')
-- Local/23@from-internal-f859,1 answered Local/23@from-internal-d509,2
-- Playing 'digits/2' (language 'en')
-- Playing 'digits/3' (language 'en')
-- Playing 'vm-isonphone' (language 'en')
-- Playing 'beep' (language 'en')
-- Recording the message
-- x=0, open writing: /var/spool/asterisk/voicemail/default/23/tmp/OYFIpK format: wav49, 0xa0277c0
-- x=1, open writing: /var/spool/asterisk/voicemail/default/23/tmp/OYFIpK format: wav, 0xa0537a0
== Spawn extension (ext-queues, 09, 11) exited non-zero on 'mISDN/3-u58'
-- User hung up
-- Recording was 1 seconds long but needs to be at least 3 - abandoning
== Spawn extension (macro-vm, s-BUSY, 3) exited non-zero on 'Local/23@from-internal-f859,2' in macro 'vm'
== Spawn extension (macro-vm, s-BUSY, 3) exited non-zero on 'Local/23@from-internal-f859,2' in macro 'exten-vm'
== Spawn extension (macro-vm, s-BUSY, 3) exited non-zero on 'Local/23@from-internal-f859,2'
== Spawn extension (custom-test_transfer, 21, 8) exited non-zero on 'Local/23@from-internal-d509,2'


Solved: Need pause before call back !

draguzet's picture

Problem before are because the transferee phone is in "busy" , because call back is so fast that session on transferee phone is in progress, and transferee report busy.

Pause 3-4 sec before calling back solve this problem, i think !


Transfer again after callback not working

draguzet's picture

Operator transfer call with blind transfer (#) on ext 21, number 21 no answer, operator retrieve call back call and # no function anymore to transfer again or on different ext.


Automatic ring back

prasadnainala's picture

Can I make automatic ring back of internal number if it is busy?


I had problems getting the

leet's picture

I had problems getting the Ring Bad to work, with the following code ...

[from-pstn-custom]
exten => _x.,1,set(__TRANSFER_CONTEXT=custom-test_transfer|${EXTEN}|1)

I had to change it to ...
[from-pstn-custom]
exten => s,1,set(__TRANSFER_CONTEXT=custom-test_transfer|${EXTEN}|1)

What is the difference between _X., _x. and s?

Thanks

P.S. The link to ticket is http://www.freepbx.org/trac/ticket/2678 which is linked wrong further up the article.