Ring back to transferrer instead of going to voicemail?

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.

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 [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 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,

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 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.

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…

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 #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.

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 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 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 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

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.

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 ?

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
– <SIP/23-b6300468> 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
– <Local/23@from-internal-f859,2> Playing ‘vm-theperson’ (language ‘en’)
– Local/23@from-internal-f859,1 answered Local/23@from-internal-d509,2
– <Local/23@from-internal-f859,2> Playing ‘digits/2’ (language ‘en’)
– <Local/23@from-internal-f859,2> Playing ‘digits/3’ (language ‘en’)
– <Local/23@from-internal-f859,2> Playing ‘vm-isonphone’ (language ‘en’)
– <Local/23@from-internal-f859,2> 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’

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 !

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

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.