7 posts / 0 new
Last post
arunpereira
arunpereira's picture
Joined: 2009/01/26
Points: 0

exten => s,1,Answer
exten => s,2,Wait(1)
exten => s,3,Set(THISEXT=TL/${tenant}${TL_DASH}${CALLERID(num)})
exten => s,4,Playback(last-num-to-call)
exten => s,5,SET(number=${DB(${THISEXT}/lastcallerid)}) ; goto 105 if no lastcaller
exten => s,6,GotoIf($["${number}" = ""]?105)
exten => s,7,SayDigits(${number})
exten => s,8,Hangup
;;exten => s,7,Wait,1
;;exten => s,8,Playback(to-call-num-press)
;;exten => s,9,Playback(digits/1)
;;exten => 1,1,Goto(,1${number},1)
exten => s,105,Playback(unidentified-no-callback)
exten => s,106,Hangup

I had a problem deciding how to dial out so I have left that out for now. I have tested it with scripts version. 1.1.64 which I have been testing. Also, I have added re-invite support to tenant-internal calls only if anyone is interested.

eeman
eeman's picture
Joined: 2007/11/06
Points: 260

most IP phones worth a darn have a call history list of 30+ numbers you can use to return a call. Even modern cordless analog phones have a callerid list to use to return calls. How old was the customer of yours requesting this feature? :) Do they get every line of the song '1985' by Bowling for Soup? hehe

Erik Smith
dCAP
Thirdlane/Asterisk Support available
esmith.bgnv@gmail.com

arunpereira
arunpereira's picture
Joined: 2009/01/26
Points: 0

Rows upon rows of Spa's with never ending lines of analog phones marching with them. I had to re-implement most of the star codes. Lets not go into it. I have nightmares from it.

And there are analog phones that don't do call history but we won't talk about that either will we.

eeman
eeman's picture
Joined: 2007/11/06
Points: 260

I just checked and the SPA's already support *69 at the device level.

btw you cant run a macro as a regular menu because the context it tries to go to is the one prior to entering into a macro. You have to use the read/goto combination instead (take a look at my tl-set-daynight script in scripts.include). Your dialout method should be:

exten => 1,1,Goto(from-inside-redir${TL_DASH}${tenant},${number},1)

you shouldn't prepend digits in front of ${number}. Your outbound routes should already have a way to deal with a 10 digit pattern in the event that some other method of calling someone back is invoked (for example, someone clicks on the callerid # from their cdr records in their user portal). Likewise if your internal-to-internal calls use shorter callerid lengths (ex. 101) then prepending a 1 would have broken that entirely.

This is somewhat academic. Performing extra write operations to the filesystem on every single call that takes place within MTE will cut deep into its scalability. the entry

exten => s,n,Set(DB(${THISEXT}/lastcallerid)=${CALLERID(num)})

needed to be placed in a cloned tl-userexten instead of boot-strapping it into tl-userexten-base so that it can be elected for those running tiny versions of MTE that wont scale beyond a couple hundred concurrent calls.

One of the big projects I intend to tackle for 7.0 MTE is designing dialplan so as to be able to reach theoretical maximums. I want the only limiting factor of reaching 10000 concurrent call legs to be the hardware limitations of the motherboard and network controller card. In theory this could be overcome by bonding a couple $1200 high end server grade network controllers.

Erik Smith
dCAP
Thirdlane/Asterisk Support available
esmith.bgnv@gmail.com

ci_newman
ci_newman's picture
Joined: 2009/03/04
Points: 0

We've had a request from a customer to set this service up for them (fondly known as the 1471 service here in the UK) however I'm having problems in getting the script to do a call back to the caller number.

If I include the call back as an automatic item in the script, it works fine however if I'm trying to do it via a keypress ('1') I simply get an 'invalid extension' error message back from the system.

Script below:

*****

exten => s,1,Answer

exten => s,n,Wait(1)

exten => s,n,Set(THISEXT=TL/${tenant}${TL_DASH}${CALLERID(num)})

;;exten => s,n,Set(THISEXT=TL/${tenant}${TL_DASH}${DIALED_NUMBER})

exten => s,n,Playback(last-num-to-call)

exten => s,n,SET(clinumber=${DB(${THISEXT}/lastcallerid)}) ; goto 105 if no lastcaller

exten => s,n,GotoIf($["${clinumber}" = ""]?105)

exten => s,n,SayDigits(${clinumber})

;;exten => s,n,Hangup

exten => s,n,Wait,1

exten => s,n,Playback(to-call-num-press)

exten => s,n,Playback(digits/1)

exten => 1,1,Goto(from-inside-redir${TL_DASH}${tenant},${number},1)

exten => s,105,Playback(unidentified-no-callback)

exten => s,106,Hangup

*****

If I include the call back line as follows:

exten => n,n,Goto(from-inside-redir${TL_DASH}${tenant},${number},1)

it dials out to the number all ok.

Any suggestions?

eeman
eeman's picture
Joined: 2007/11/06
Points: 260

macro's are not IVR's and therefore pressing '1' is literally pressing 1 in a different context. To get an idea how to fake an IVR out of a macro look at the contributed script i wrote called set-daynight. It uses a READ and GoTo function to reach exten 1 inside the macro.

FYI 1.6 has the ability to use Gosub with additional arguments thus providing a replacemnt for Macro() which subsequently can work exactly like regular IVR programing.

Erik Smith
dCAP
Thirdlane/Asterisk Support available
esmith.bgnv@gmail.com

ci_newman
ci_newman's picture
Joined: 2009/03/04
Points: 0

Thanks for the help Erik, I've made my own additions to the scripts to make this work now:

exten => s,1,Answer

exten => s,n,Wait(1)

exten => s,n,Set(THISEXT=TL/${tenant}${TL_DASH}${CALLERID(num)})

exten => s,n(begin),Playback(last-num-to-call)

exten => s,n,SET(clinumber=${DB(${THISEXT}/lastcallerid)})

exten => s,n,GotoIf($["${clinumber}" = ""]?105) ; goto 105 if no lastcaller

exten => s,n,SayDigits(${clinumber})

exten => s,n,Wait,1

exten => s,n,Playback(to-call-num-press)

exten => s,n,Playback(digits/1)

exten => s,n(begin2),Read(MODE,,1,,,5)

exten => s,n,GotoIf($["${MODE}" != ""]?${MODE},1)

exten => s,n,Goto(s,begin)

exten => s,105,Playback(unidentified-no-callback)

exten => s,106,Hangup

exten => 1,1,Goto(from-inside-redir${TL_DASH}${tenant},${clinumber},1)

exten => _X,1,Playback(please-try-again)

exten => _X,n,Goto(s,begin2)

Works like a charm, cheers!