NO JOY combination of callback and calltrough

Dr. Kupka

New Member
Joined
Jul 3, 2013
Messages
22
Reaction score
7
Hello,

Right now I´m using callback to my cellphone and DISA (incrediblepi-3.11) without problems.

To make this more comfortably I tried to set up a calltrough solution without using DTMF / DISA.

To evoke the callback call I use a trunking number that can be extended by 2 digits (XX). Asterisk can strip this last two digits in the (in incrediblepi-3.11 already pre-configured) context "from-pstn-toheader":

exten => _X.,1,Goto(from-test,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1)

and then create a new extension ("from-test") to dial out with a second trunk using an additional prefix "**7" (this second trunk is my landline ATA with speed dial function).

After I got the callback call on my cellphone the asterisk should start dial "**7XX". So the handmade DISA-dialing of "**7XX" wouldn´t be necessary.

My extensions_custom.conf:

[from-test]
exten => _trunkingnumberXX,1,Set(OWN=cellphonenumber)
exten => _trunkingnumberXX,2,Set(calltrough=${EXTEN:-2})
exten => _trunkingnumberXX,3,GotoIf($["${CALLERID(num)}" = "${OWN}"]?yes:no)
exten => _trunkingnumberXX,100(yes),NoOp("cellphonecalling")
exten =>_trunkingnumberXX,101,Dial(SIP/**7${calltrough}@secondtrunk)
exten => _trunkingnumberXX,200(no),NoOp("notme")

Without callback this works perfect (inbound route destination set to "secondtrunk"; incoming context is set to "context=from-pstn-toheader"): if dialing trunkingnumberXX from outside the asterisk calls directly **7XX using the second trunk.

But I have no idea (after a couple of weeks...) how to combine this with callback. As a rookie I don´t know where to place this code in the dialplan...

Any help or advice is most welcome!

Kind regards
Dr. Kupka
 
As an old hand, with brain cells dwindling into atrophy, I am a bit confused. Can you state your objective in plain english, without any technical info on trunking etc? It sounds like you want to call inbound with your cellphone, disconnect, have PIAF call the cell phone back and connect to a particular extension? If that is correct, how are you trying to indicate to PIAF which extension to connect to?
Bear with me if I am just being a bit slow. Been fighting with a new router brand in a 41 point hub and spoke VPN all day :)
 
you want to call inbound with your cellphone, disconnect, have PIAF call the cell phone back and connect to a particular extension:)

Thats it!

The inbound number is a so called "trunking number" which can be extended by two digits. The call can catch the endpoint by dialling the base number (e.g. ...12345) OR by dialling ...12345XX (e.g. ...1234599 or ...1234577) (XX = 01 to 99). So the PIAF can strip the last two digits of the dialled number and use this as speed dial number for the outgoing trunk (PSTN-linked ATA) by dialling these two digits (or in detail **7XX).

So when I evoke a callback call by dialing ...12345XX the PIAF can call my cellphone back and connect to the trunk dialing the speed dial number **7XX. It`would be a much more faster solution than using DISA (and cheaper than calling directly with my cellphone...) YES I´m grasping and lazy...:rolleyes:

Kind regards
Dr. Kupka
 
So...if I call 678-123-456712, the 12 is the speed dial number which should trigger where the callback goes?
 
So...if I call 678-123-456712, the 12 is the speed dial number which should trigger where the callback goes?

Yes.

The first leg of the callback is the "normal" one (going everytime to my cellphone). The second leg should dial the last two digits of the called trunking number. The asterisk can extract these 2 digits from the SIP header in the context:

exten => _X.,1,Goto(from-test,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1)

This works.

My problem: I don´t know where to place the code of the "second leg" (mentioned in my first post as context [from-test] or something like that).

In a tested pure calltrough solution the above code to extract from SIP header works (incoming call is forwarded to a new extension using the last two digits of the SIP header).

But how to combine this "calltrough" with "callback" ??

Regards
 
Not even one guru ?

The PIAF has to call back my cellphone AND after this to call a number extracted from SIP header of the initial call:

The PIAF has

1. to extract the last two digits of the SIP header of the initial call (this works already!):​

[from-pstn-toheader]
exten => _X.,1,Goto(from-test,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1)

2. and to callback my cellphone (this works too - not suprisingly - with the callback function)​
3. AND - using trunk1 - to call **7 followed by the extracted 2 digits (see 1.)
I´m not familiar enough with asterisk to modify and place the following code (or something like that):​

[from-test]
exten => trunk1,1,Set(calltrough=${EXTEN:-2})
exten => trunk1,n,Dial(SIP/**7${calltrough}@trunk1)

I do not bring it up and running even after weeks...


desperate greetings
 
First off _X. is an open invitation to trouble.. At the very least use something like

EXTN => _770123NNNNNNN

So you care comparing against the area Code and NPA of the Cell Phone. An the the NXXX and Extension are matched limited.

Once you have the first leg up redirect it to the Extension you want --

http://www.voip-info.org/wiki/view/Asterisk+cmd+ChannelRedirect

EXTN => _X.,1, ChannelRedirect(${CHANNEL},7${callthrough},1)

Alternatively you may want a bridge instead of a redirect.

http://www.voip-info.org/wiki/view/Asterisk+cmd+Bridge

Good Luck --
 
Thanks for reply and effort.

After a couple of hard days (and nights...) I´ve found a solution.

1. incoming trunk (if matched against my cellphone number):
context=from-pstn-toheader

2. Destination after callback:
Trunks / trunk1

3. inserting in "extensions_override_freepbx.conf" (only colored details are specified against the original context included in extensions.conf / extensions_additional.conf):

[from-pstn-toheader]

exten => _X.,1,Set(GLOBAL(calltrough)=${EXTEN:-2}) # extracts the last 2 digits of the dialled number; stored as "calltrough" string
exten => _X.,n,Goto(from-trunk,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1) # unchanged compared with pre-configured context

#if not set as GLOBAL the "calltrough" string es empty due to channel change when dialplan reaches the "second" callback leg

[ext-trunk]
include => ext-trunk-custom
exten => 1,1,Set(TDIAL_STRING=SIP/trunk1)
exten => 1,n,Set(DIAL_TRUNK=2)
exten => 1,n,Goto(ext-trunk,_mytrunkingnumberXX,1)

exten => _mytrunkingnumberXX,1,Set(OUTBOUND_GROUP=OUT_${DIAL_TRUNK})
exten => _mytrunkingnumberXX,n,GotoIf($["${OUTMAXCHANS_${DIAL_TRUNK}}" = ""]?nomax)
exten => _mytrunkingnumberXX,n,GotoIf($[${GROUP_COUNT(OUT_${DIAL_TRUNK})} >= ${OUTMAXCHANS_${DIAL_TRUNK}}]?hangit)
exten => _mytrunkingnumberXX,n(nomax),ExecIf($["${CALLINGPRES_SV}" != ""]?Set(CALLERPRES()=${CALLINGPRES_SV}))
exten => _mytrunkingnumberXX,n,GosubIf($["${PREFIX_TRUNK_${DIAL_TRUNK}}" != ""]?sub-flp-${DIAL_TRUNK},s,1())
exten => _mytrunkingnumberXX,n,Set(OUTNUM=${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER})
exten => _mytrunkingnumberXX,n,Set(DIAL_TRUNK_OPTIONS=${IF($["${DB_EXISTS(TRUNK/${DIAL_TRUNK}/dialopts)}" = "1"]?${DB_RESULT}:${TRUNK_OPTIONS})})
exten => _mytrunkingnumberXX,n,Dial(SIP/**7${calltrough}@trunk1) #**7 says to trunk1 to use the speed dial function of connected ATA, followed by the last to digits of the initially dialled number
exten => _mytrunkingnumberXX,n,Set(CALLERID(number)=${CALLERID(number):0:40})
exten => _mytrunkingnumberXX,n,Set(CALLERID(name)=${CALLERID(name):0:40})
exten => _mytrunkingnumberXX,n(hangit),Hangup

;--== end of [ext-trunk] ==--;


That´s it.

My "trunkingnumber" as a special SIP account feature. It allows not only to dial the original number but up to 100 numbers extended by 2 digits (e.g. original number = 12345; extended numbers could range from 12345 00 through 12345 99). So the dialed (extended) number can trigger where the callback goes after receiving the callback on my cellphone.
 

Members online

Forum statistics

Threads
26,687
Messages
174,411
Members
20,257
Latest member
Dempan
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top