VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
jwinius at umrk.to Guest
|
Posted: Sat Apr 26, 2008 8:32 am Post subject: [asterisk-users] Roaming callback? |
|
|
Hi list,
Regarding callback functionality, it seems that Asterisk only includes
a provision for callback in the voicemail configuration, for
authorization purposes, but not an actual callback mechanism. For
that, there are various
free 3rd party AGI (Asterisk Gateway Interface) scripts available:
* Asterisk tips callback
http://www.voip-info.org/wiki/view/Asterisk+tips+callback
* capi Callback
http://www.junghanns.net/en/callback.html
Looking at the scripts, they don't seem too difficult to implement,
but they don't exactly work as I was hoping either. First, they
require your system to have a dedicated callback number that you ring
once and then hang up. The system then calls you back at a predefined
number, e.g. your mobile phone. Not a very flexible solution.
What I had in mind was an option in the voicemail menu that would
allow you to dial a number -- any number -- at which the system would
call you back. I'd call this roaming callback. Is anything like this
available for Asterisk?
Cheers,
Jaap |
|
Back to top |
|
|
ger at JerryH.us Guest
|
Posted: Sun Apr 27, 2008 4:28 pm Post subject: [asterisk-users] Roaming callback? |
|
|
Hi Jaap,
There is an additional alternative for a ringback to a caller, which is to use the Call File capability as noted in Van Meggelen's "Future of Telephone"; 2nd ed, p306.
There is quite a deal of flexibility with this method, and it keeps all the instructions in the dial plan and only calls (not counting the System calls) one Bash script of 3 simple lines with a System application call:
sleep 8s
mv "$1" "$2"
exit 0
As you can see, all the paths and file names are set up in extensions.conf.
In my case, when the caller calls in to 'asterisk', he is prompted for the number he wishes to call. The caller can be at a US or international number, and he can call any US or international number, WITH or WITHOUT ringback. In other words the caller designates whether this is a direct connect call, or a ringback (and then bridge the called number). I have the complete flexibility of my dial plan extensions to do as I wish with the phone numbers.
But, if most of my code were in AGI scripts, then I would probably stick with AGI scripts.
I think Van Meggelen's book is clear enough, but if you would like some of my extension examples, please let me know, and I'll be more than happy to supply them.
Thanks for listening,
Gerald Harshany
Using current Asterisk version: SVN-branch-1.6.0-r114304 (on Ubuntu-Gutsy with AMD X2 4000+) and Zaptel current branch SVN 1.4 (with digium's TDM400P)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080427/0e7be33e/attachment.htm |
|
Back to top |
|
|
jwinius at umrk.to Guest
|
Posted: Mon Apr 28, 2008 10:49 am Post subject: [asterisk-users] Roaming callback? |
|
|
Quoting Jerry Harshany <ger at JerryH.us>:
Quote: | There is an additional alternative for a ringback to a caller, which
is to use the Call File capability as noted in Van Meggelen's
"Future of Telephone"; 2nd ed, p306.
|
As it says in the book, call files allow calls to be created through
the Linux shell. If you've used this to create a roaming callback
service, then you must have created something that allows users to
submit a phone number to be called back on, after which a .call file
is created and moved to the /var/spool/asterisk/outgoing/ directory.
Quote: | sleep 8s
mv "$1" "$2"
exit 0
|
This looks like the step that moves the newly created call file to the
aforementioned directory.
Quote: | In my case, when the caller calls in to 'asterisk', he is prompted
for the number he wishes to call. The caller can be at a US or
international number, and he can call any US or international
number, WITH or WITHOUT ringback. In other words the caller
designates whether this is a direct connect call, or a ringback (and
then bridge the called number). I have the complete flexibility of
my dial plan extensions to do as I wish with the phone numbers.
|
This is what I'm really interested in! How did you manage this? Would
you be willing to share how you did this?
Cheers,
Jaap |
|
Back to top |
|
|
sip at arcdiv.com Guest
|
Posted: Mon Apr 28, 2008 12:25 pm Post subject: [asterisk-users] Roaming callback? |
|
|
Jaap Winius wrote:
Quote: | Quoting Jerry Harshany <ger at JerryH.us>:
Quote: | There is an additional alternative for a ringback to a caller, which
is to use the Call File capability as noted in Van Meggelen's
"Future of Telephone"; 2nd ed, p306.
|
As it says in the book, call files allow calls to be created through
the Linux shell. If you've used this to create a roaming callback
service, then you must have created something that allows users to
submit a phone number to be called back on, after which a .call file
is created and moved to the /var/spool/asterisk/outgoing/ directory.
Quote: | sleep 8s
mv "$1" "$2"
exit 0
|
This looks like the step that moves the newly created call file to the
aforementioned directory.
Quote: | In my case, when the caller calls in to 'asterisk', he is prompted
for the number he wishes to call. The caller can be at a US or
international number, and he can call any US or international
number, WITH or WITHOUT ringback. In other words the caller
designates whether this is a direct connect call, or a ringback (and
then bridge the called number). I have the complete flexibility of
my dial plan extensions to do as I wish with the phone numbers.
|
This is what I'm really interested in! How did you manage this? Would
you be willing to share how you did this?
|
I would imagine if it's a callback, it creates a callfile. If it's not,
it just connects the call as it would normally. We have a similar thing
for our business customers built using a reasonably simple agi script to
do verification of the caller/account and creation of the call files. A
rather simple Dial command can handle the direct connection after
verification, and a rather simple call file can handle the callback. The
hardest part was getting the DTMF reading to work well.
N. |
|
Back to top |
|
|
ger at jerryh.us Guest
|
Posted: Tue Apr 29, 2008 12:43 am Post subject: [asterisk-users] Roaming callback? |
|
|
Hi Jaap,
Here is a portion of my coding. Hope I didn't 'break' anything in moving
sections around.
I tried to leave only what is material to answering your question.
One caveat - I did add the CALL FILE functionality on my V1.6.0 (branch
SVN)
asterisk box; so, maybe they changed some 'underlying' code that would be
different from V1.4.x. But, go ahead and try it. The obvious syntax change
I've noted in the comments below.
[voicepulse-in]; this is an incoming PSTN call from the VOIP provider
; VoicePulse Connect, which from their servers
; in either SIP or IAX protocol.
; .........................................................
; This section catches calls coming in through VoicePulse.
; The EXTEN here is only of interest if I subscribe to multiple
; PSTN-SIP/IAX lines from VoicePulse CONNECT.
; .........................................................
exten => _XX.,1,Set(GLOBAL(VP_CALLERIDNUM)=${CALLERID(num)})
exten => _XX.,n,Set(GLOBAL(VP_CALLERIDNAME)=${CALLERID(name)})
exten => _XX.,n,Set(GLOBAL(VP_TRUNKINNUM)=${EXTEN})
exten => _XX.,n,Set(ALLOWJERRY_ALL=2)
. ; all I do here is verify that I have a known/approved user dialing in
. ; or invalid user
.
exten => _XX.,n,Log(
NOTICE|CALLINLOG vp-in id=${CALLERID(num)} nam=${CALLERID(name)})
exten => _XX.,n(dobckgrd),NoOp()
exten => _XX.,n,GoTo(process-digit-vpin,s,1)
[process-digit-vpin]
; prompt and wait for digits to be entered
exten => s,1,Answer()
exten => s,n,Macro(sayhi,${CALLERID(num)})
exten => s,n,Background(pls-entr-num-uwish2-call,m)
exten => s,n,WaitExten()
;check if we are making a local call
;
exten => *,1,Playback(star)
.
. ; set up for calls to local phone extensions
.
exten => *,n,GoTo(call-local,s,1)
;check for long distance & INTERNAT call-US-canada
;users always enter 10digit number for ld
;
exten => _NXXNXXXXXX,1,NoOp()
exten => _NXXNXXXXXX,n,Set(newnumber=${EXTEN})
.
. ; just some housekeeping
.
;exten => _NXXNXXXXXX,n,GoTo(dial-long-dist)
exten => _0X.,1,NoOp()
.
. ; just some housekeeping
.
exten => _0X.,n,GoTo(call-asia,s,1)
; RINGBACK SECTION-
;
exten => _1*,1,NoOp() ; this is local call with ringback
.
.
exten => _1NXXNXXXXXX,1,NoOp() ; this is Long Distance call with ringback
exten => _1NXXNXXXXXX,n,Set(GLOBAL(CallERringbackID)=${CALLERID(num)})
exten => _1NXXNXXXXXX,n,Set(GLOBAL(CallERringbackNAME)=${CALLERID(name)})
; the next variable is the number to call
exten => _1NXXNXXXXXX,n,Set(GLOBAL(CallEEringbackID)=${EXTEN:1})
;exten => _1NXXNXXXXXX,n,Playback(jp-hup-and-will-call-back-10sec)
;exten => _1NXXNXXXXXX,n,Wait(2)
exten => _1NXXNXXXXXX,n,GoTo(process-ringbacknum,s,1)
exten => _10X.*,1,NoOp() ; this is International call with ringback
.
.
exten => i,1,Playback(vm-goodbye)
exten => i,n,Hangup()
exten => t,1,Playback(connection-timed-out)
exten => t,n,Hangup()
; FOR RINGBACK- CallerID=CallERringbackID- CalleeID=CallEEringbackID
;
[process-ringbacknum]
exten => s,1,Verbose(SSS- entered context process-ringbacknum)
; get a NEW UNIQUE path+file name, such as "/tmp/ringback17.call"
;
exten => s,n,Macro(AdvCallFileNum)
exten => s,n,Set(_CurCallfileName=${GLOBAL(CUR_CALLFILE_NAME)})
; NOTE-need to find out where caller is, and where he wants to call
; as some outgoing lines are cheaper for international calls
; also, determine if channels are available, etc.
;
.
. ; logic for accomplishing the above NOTE - is site-dependent
.
. ; NOTE-2- the follow exten is my 'development' call with 'constants',
. ; so you will want to use variables for the paramters
. ; Also, believe GOSUB with parameters was new in asterisk V1.6.0,
. ; so, in an earlier version you can easily make the adjustment
.
exten => s,n,GoSub(write-callfile,s,1("Zap/3/1407474xxxx","20","1","1",
"doringback","s","1","Jerry 4074747xxxx","DialNumber=407474xxxx",
"whatever documentation for write callfile",${CurCallfileName}))
exten => s,n,Hangup() ;done with setup, so hangup the caller
[write-callfile] ; GOSUB for writing a CALL FILE
;you may wish to check return status from the system calls
;
exten => s,1,Verbose(WCWC-reached context write-callfile)
exten => s,n,Set(FromPathFile=${ARG11})
exten => s,n,TrySystem(echo "Channel: ${ARG1} \n" > ${FromPathFile})
exten => s,n,TrySystem(echo "WaitTime: ${ARG2} \n" >> ${FromPathFile})
exten => s,n,TrySystem(echo "RetryTime: ${ARG3} \n" >> ${FromPathFile})
exten => s,n,TrySystem(echo "MaxRetries: ${ARG4} \n" >> ${FromPathFile})
exten => s,n,TrySystem(echo "Context: ${ARG5} \n" >> ${FromPathFile})
exten => s,n,TrySystem(echo "Extension: ${ARG6} \n" >> ${FromPathFile})
exten => s,n,TrySystem(echo "Priority: ${ARG7} \n" >> ${FromPathFile})
exten => s,n,TrySystem(echo "CallerID: ${ARG8} \n" >> ${FromPathFile})
exten => s,n,TrySystem(echo "SetVar: ${ARG9} \n" >> ${FromPathFile})
exten => s,n,TrySystem(echo "Account: ${ARG10} \n" >> ${FromPathFile})
exten => s,n,Set(DestPathFile=${FromPathFile})
exten => s,n,Set(DestPathFile=${CALLFILE_PATH}${DestPathFile:4})
exten => s,n,System(nohup "${AGI_BIN_PATH}"/agi-exec-bckgd-for-move.sh
"${FromPathFile}" "${DestPathFile}" 1>/dev/null 2>&1 &);one long line
exten => s,n,Return()
[doringback] ; in a NEW CHANNEL NOW-the call-file created channel Zap/3
exten => s,1,Verbose(== in context doringback ready to dial ring back
caller)
; THE Zap/2 CALL WILL OCCUR (USUALLY) BEFORE THE CALL-FILE CALL
;
exten => s,n,Dial(Zap/2,20,r)
; check DIALSTATUS etc
exten => s,n,Hangup()
Hope this helps,
Gerald Harshany
Quote: | Quote: | -------- Original Message --------
Subject: [SPAM] Re: [asterisk-users] Roaming callback?
From: SIP <sip at arcdiv.com>
Date: Mon, April 28, 2008 1:25 pm
To: Asterisk Users Mailing List - Non-Commercial Discussion
<asterisk-users at lists.digium.com>
Cc: Jerry Harshany <ger at JerryH.us>
Jaap Winius wrote:
Quote: | Quoting Jerry Harshany <ger at JerryH.us>:
Quote: | There is an additional alternative for a ringback to a caller, which
is to use the Call File capability as noted in Van Meggelen's
"Future of Telephone"; 2nd ed, p306.
|
As it says in the book, call files allow calls to be created through
the Linux shell. If you've used this to create a roaming callback
service, then you must have created something that allows users to
submit a phone number to be called back on, after which a .call file
is created and moved to the /var/spool/asterisk/outgoing/ directory.
Quote: | sleep 8s
mv "$1" "$2"
exit 0
|
This looks like the step that moves the newly created call file to the
aforementioned directory.
Quote: | In my case, when the caller calls in to 'asterisk', he is prompted
for the number he wishes to call. The caller can be at a US or
international number, and he can call any US or international
number, WITH or WITHOUT ringback. In other words the caller
designates whether this is a direct connect call, or a ringback (and
then bridge the called number). I have the complete flexibility of
my dial plan extensions to do as I wish with the phone numbers.
|
This is what I'm really interested in! How did you manage this? Would
you be willing to share how you did this?
| I would imagine if it's a callback, it creates a callfile. If it's not,
it just connects the call as it would normally. We have a similar thing
for our business customers built using a reasonably simple agi script to
do verification of the caller/account and creation of the call files. A
rather simple Dial command can handle the direct connection after
verification, and a rather simple call file can handle the callback. The
hardest part was getting the DTMF reading to work well.
N. |
|
|
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|