A Broadband and ADSL forum. BroadbanterBanter

Welcome to BroadbanterBanter.

You are currently viewing as a guest which gives you limited access to view most discussions and other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today.

Go Back   Home » BroadbanterBanter forum » Newsgroup Discussions » uk.telecom.voip (UK VOIP)
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

uk.telecom.voip (UK VOIP) (uk.telecom.voip) Discussion of topics relevant to packet based voice technologies including Voice over IP (VoIP), Fax over IP (FoIP), Voice over Frame Relay (VoFR), Voice over Broadband (VoB) and Voice on the Net (VoN) as well as service providers, hardware and software for use with these technologies. Advertising is not allowed.

Asterisk v 1.4 Call Trace



 
 
Thread Tools Display Modes
  #1  
Old March 14th 09, 05:29 PM posted to uk.telecom.voip
Jono
external usenet poster
 
Posts: 1,539
Default Asterisk v 1.4 Call Trace

Hello,

Am having a bit of a thick moment.

How do I modify the below to allow me to dial in and listen to the last caller to extension 204?

[custom-app-1871]
exten = s,1,Answer
exten = s,n,Wait(1)
exten = s,n,Macro(user-callerid,)
exten = s,n,Playback(info-about-last-call&telephone-number)
exten = s,n,Set(lastcaller=${DB(CALLTRACE/${AMPUSER})})
exten = s,n,GotoIf($[ $[ "${lastcaller}" = "" ] | $[ "${lastcaller}" = "unknown" ] ]?noinfo)
exten = s,n,SayDigits(${lastcaller})
exten = s,n,Set(TIMEOUT(digit)=3)
exten = s,n,Set(TIMEOUT(response)=7)
exten = s,n,Background(to-call-this-number&press-1)
exten = s,n,Goto(fin)
exten = s,n(noinfo),Playback(from-unknown-caller)
exten = s,n,Macro(hangupcall,)
exten = s,n(fin),Noop(Waiting for input)
exten = s,n,WaitExten(60,)
exten = s,n,Playback(sorry-youre-having-problems&goodbye)
exten = 1,1,Goto(from-internal,${lastcaller},1)
exten = i,1,Playback(vm-goodbye)
exten = i,n,Macro(hangupcall,)
exten = t,1,Playback(vm-goodbye)
exten = t,n,Macro(hangupcall,)


  #2  
Old March 14th 09, 06:10 PM posted to uk.telecom.voip
Phil Reynolds
external usenet poster
 
Posts: 21
Default Asterisk v 1.4 Call Trace

On Sat, 14 Mar 2009 17:29:00 +0000, Jono wrote:

How do I modify the below to allow me to dial in and listen to the last
caller to extension 204?


Just to clarify, are you trying to do "call return" like 1471 (BT)?

If so I could give you my routine together with an explanation of how it
works.

--
Phil Reynolds
mail:
PLEASE FOLLOWUP IN NEWS
  #3  
Old March 14th 09, 07:12 PM posted to uk.telecom.voip
Jono
external usenet poster
 
Posts: 1,539
Default Asterisk v 1.4 Call Trace

Phil Reynolds explained on 14/03/2009 :
On Sat, 14 Mar 2009 17:29:00 +0000, Jono wrote:

How do I modify the below to allow me to dial in and listen to the last
caller to extension 204?


Just to clarify, are you trying to do "call return" like 1471 (BT)?

If so I could give you my routine together with an explanation of how it
works.


Sort of.

I have calls into my PBX forwarded to my mobile. Because the ITSPs do
not forward the caller's CLI, if I miss a call, I can't find out who
called.

So, i thought it would be useful to dial in remotely to a DISA and then
do *69 or whatever....


  #4  
Old March 15th 09, 12:37 AM posted to uk.telecom.voip
Phil Reynolds
external usenet poster
 
Posts: 21
Default Asterisk v 1.4 Call Trace

On Sat, 14 Mar 2009 19:12:28 +0000, Jono wrote:

Sort of.

I have calls into my PBX forwarded to my mobile. Because the ITSPs do
not forward the caller's CLI, if I miss a call, I can't find out who
called.

So, i thought it would be useful to dial in remotely to a DISA and then
do *69 or whatever....


Well, my routine may be helpful then... have a look at this - it does
work if using DISA if you set the callerid correctly:

exten = 1471,1,Set(TECHNOLOGY=${CUT(CHANNEL,/,1)}) ; I add some 2 sec
delays iff technology is SIP
exten = 1471,n,Answer()
exten = 1471,n,ExecIf($["${TECHNOLOGY}"="SIP"],Wait,2)
exten = 1471,n,GotoIf($["${DB(lastcall/${CALLERID(num):-4}):0:1}"="0"]?
num:nonum) ; whether there was a number declared on last call to the
caller ID of this phone (last 4 digits are my internal extensions - I
have a small DID block)
exten = 1471,n,Playback(/var/lib/asterisk/sounds/custom/telno) ;
"Telephone number"
exten = 1471,n,SayDigits(${DB(lastcall/${CALLERID(num):-4})})
exten = 1471,n,Playback(/var/lib/asterisk/sounds/custom/called) ;
"called"
exten = 1471,n,SayUnixTime(${DB(lastcalltime/${CALLERID
(num):-4})},Europe/London,q \'digits/at\' IMp)
exten = 1471,n,Read(RESP,/var/lib/asterisk/sounds/custom/returncall,1) ;
"To return the call, press 3" and awaits a digit
exten = 1471,n,GotoIf($["${RESP}" = "3"]?${CONTEXT},${DB(lastcall/
${CALLERID(num):-4})},1) ; dial as would be normal context for this phone
exten = 1471,n,Hangup()
exten = 1471,n(nonum),Playback(/var/lib/asterisk/sounds/custom/
youwerecalled) ; "You were called"
exten = 1471,n,SayUnixTime(${DB(lastcalltime/${CALLERID
(num):-4})},Europe/London,q \'digits/at\' IMp)
exten = 1471,n,Goto(${DB(lastcall/${CALLERID(num):-4})}) ; see incoming
call routine
exten = 1471,n,Hangup()
exten = 1471,n(Withheld),Playback(/var/lib/asterisk/sounds/custom/
withheld) ; "The caller withheld their number"
exten = 1471,n,ExecIf($["${TECHNOLOGY}"="SIP"],Wait,2)
exten = 1471,n,Hangup()
exten = 1471,n(Unavailable),Playback(/var/lib/asterisk/sounds/custom/
donothave) ; "We do not have the caller's number to return the call"
exten = 1471,n,ExecIf($["${TECHNOLOGY}"="SIP"],Wait,2)
exten = 1471,n,Hangup()
exten = 1471,n(International),Playback(/var/lib/asterisk/sounds/custom/
international) ; "The call was from abroad" (if caller ID is available,
the call is treated as normal)
exten = 1471,n,ExecIf($["${TECHNOLOGY}"="SIP"],Wait,2)

My voicemail macro (similar to the idea in the book) sets values in the
dbi (ARG1 is the called user's channels, ARG2 his timeout - I have a user
who needs a longer timeout) similar to this:

[macro-voicemail]
exten = s,1,GotoIf($["${CALLERID(num)}"=""]?nonum:withnumber)
exten = s,n(nonum),ExecIf($["${CALLERID(name)}"="UNAVAILABLE"],Set,DB
(lastcall/${MACRO_EXTEN})=Unavailable)
exten = s,n,ExecIf($["${CALLERID(name)}"="INTERNATIONAL"],Set,DB
(lastcall/${MACRO_EXTEN})=International)
exten = s,n,ExecIf($["${CALLERID(name)}"="" | "${CALLERID
(name)}"="anonymous" | "${CALLERID(name)" = "WITHHELD"],Set,DB(lastcall/
${MACRO_EXTEN})=Withheld)
exten = s,n,SetCallerPres(allowed)
exten = s,n,Goto(calltime)
exten = s,n(withnumber),Set(DB(lastcall/${MACRO_EXTEN})=${CALLERID(num)})
exten = s,n(calltime),Set(DB(lastcalltime/${MACRO_EXTEN})=${EPOCH})
exten = s,n,ExecIf($["${CALLERID(name)}"=""],Set,CALLERID(name)=${DB
(cidname/${CALLERID(num)})}) ; if you do not look up caller names in the
db this line is optional
exten = s,n,Dial(${ARG1},${ARG2},otwW)
exten = s,n,GotoIf($["${DIALSTATUS}"="BUSY"]?busy)
exten = s,n,VoiceMail(${MACRO_EXTEN},u)
exten = s,n,MacroExit()
exten = s,n(busy),VoiceMail(${MACRO_EXTEN},b)





--
Phil Reynolds
mail:
PLEASE followup news posts in news
- that's what it's here for
  #5  
Old March 15th 09, 04:00 AM posted to uk.telecom.voip
Jono
external usenet poster
 
Posts: 1,539
Default Asterisk v 1.4 Call Trace

Phil Reynolds brought next idea :
On Sat, 14 Mar 2009 19:12:28 +0000, Jono wrote:

Sort of.

I have calls into my PBX forwarded to my mobile. Because the ITSPs do
not forward the caller's CLI, if I miss a call, I can't find out who
called.

So, i thought it would be useful to dial in remotely to a DISA and then
do *69 or whatever....


Well, my routine may be helpful then... have a look at this - it does
work if using DISA if you set the callerid correctly:


Thanks, Phil.

.....where do I specify ext 204...? somewhere here?

exten = 1471,n,GotoIf($["${DB(lastcall/${CALLERID(num):-4}):0:1}"="0"]?num:nonum) ; whether there was a number declared on last call to the caller ID of this phone (last 4 digits are my internal extensions - I have a small DID block)


  #6  
Old March 15th 09, 10:10 AM posted to uk.telecom.voip
Phil Reynolds
external usenet poster
 
Posts: 21
Default Asterisk v 1.4 Call Trace

On Sun, 15 Mar 2009 04:00:11 +0000, Jono wrote:

....where do I specify ext 204...? somewhere here?


exten =
1471,n,GotoIf($["${DB(lastcall/${CALLERID(num):-4}):0:1}"="0"]?

num:nonum)
; whether there was a number declared on last call to the caller ID of
this phone (last 4 digits are my internal extensions - I have a small
DID block)


You could hardcode these occurrences as "lastcall/204" or arrange things
so that when you hit the DISA, your callerid ends "204" and recode them
as lastcall/${CALLERID(num):-3.

I set mine using:

exten = 8,1,VMauthenticate()
exten = 8,n,Set(CALLERID(num)=(my DID prefix)${AUTH_MAILBOX})
exten = 8,n,DISA(no-password,default)

If your AUTH_MAILBOX were 204, ${CALLERID(num):-3 would be 204. My
default context supports internal service codes and free calls only. You
could of course just set it to ${AUTH_MAILBOX} if you do not have
outbound calling possible through your DISA.

--
Phil Reynolds
mail:
PLEASE followup news posts in news
- that's what it's here for
  #7  
Old March 15th 09, 11:11 AM posted to uk.telecom.voip
Jono
external usenet poster
 
Posts: 1,539
Default Asterisk v 1.4 Call Trace

Phil Reynolds explained :
On Sun, 15 Mar 2009 04:00:11 +0000, Jono wrote:

....where do I specify ext 204...? somewhere here?


exten =
1471,n,GotoIf($["${DB(lastcall/${CALLERID(num):-4}):0:1}"="0"]? num:nonum)
; whether there was a number declared on last call to the caller ID of
this phone (last 4 digits are my internal extensions - I have a small
DID block)


You could hardcode these occurrences as "lastcall/204" or arrange things
so that when you hit the DISA, your callerid ends "204" and recode them
as lastcall/${CALLERID(num):-3.

I set mine using:

exten = 8,1,VMauthenticate()
exten = 8,n,Set(CALLERID(num)=(my DID prefix)${AUTH_MAILBOX})
exten = 8,n,DISA(no-password,default)

If your AUTH_MAILBOX were 204, ${CALLERID(num):-3 would be 204. My
default context supports internal service codes and free calls only. You
could of course just set it to ${AUTH_MAILBOX} if you do not have
outbound calling possible through your DISA.


::-)

Pretend I'm /really/ new to this...made the changes, recorded the sounds

exten = 1871,1,Set(TECHNOLOGY=${CUT(CHANNEL,/,1)}) ; I add some 2 sec delays if technology is SIP
exten = 1871,n,Answer()
exten = 1871,n,ExecIf($["${TECHNOLOGY}"="SIP"],Wait,2)
exten = 1871,n,GotoIf($["${DB(lastcall/204):0:1}"="0"]?num:nonum) ; whether there was a number declared on last call to the caller ID of this phone (last 4 digits are my internal extensions - I have a small DID block)
exten = 1871,n,Playback(/var/lib/asterisk/sounds/custom/telno) ; "Telephone number"
exten = 1871,n,SayDigits(${DB(lastcall/204)})
exten = 1871,n,Playback(/var/lib/asterisk/sounds/custom/called) ; "called"
exten = 1871,n,SayUnixTime(${DB(lastcalltime/204)},Europe/London,q \'digits/at\' IMp)
exten = 1871,n,Read(RESP,/var/lib/asterisk/sounds/custom/returncall,1) ; "To return the call, press 3" and awaits a digit
exten = 1871,n,GotoIf($["${RESP}" = "3"]?${CONTEXT},${DB(lastcall/204)},1) ; dial as would be normal context for this phone
exten = 1871,n,Hangup()
exten = 1871,n(nonum),Playback(var/lib/asterisk/sounds/customyouwerecalled) ; "You were called"
exten = 1871,n,SayUnixTime(${DB(lastcalltime/204)},Europe/London,q \'digits/at\' IMp)
exten = 1871,n,Goto(${DB(lastcall/204)}) ; see incoming call routine
exten = 1871,n,Hangup()
exten = 1871,n(Withheld),Playback(var/lib/asterisk/sounds/customwithheld) ; "The caller withheld their number"
exten = 1871,n,ExecIf($["${TECHNOLOGY}"="SIP"],Wait,2)
exten = 1871,n,Hangup()
exten = 1871,n(Unavailable),Playback(var/lib/asterisk/sounds/customdonothave) ; "We do not have the caller's number to return the call"
exten = 1871,n,ExecIf($["${TECHNOLOGY}"="SIP"],Wait,2)
exten = 1871,n,Hangup()
exten = 1871,n(International),Playback(var/lib/asterisk/sounds/custominternational) ; "The call was from abroad" (if caller ID is available, the call is treated as normal)
exten = 1871,n,ExecIf($["${TECHNOLOGY}"="SIP"],Wait,2)


Aall I hear is "at 11 oh 4 am" (well, whatever the current time is)

-- Executing [[email protected]:1] Set("SIP/204-b7206af0", "TECHNOLOGY=SIP") in new stack
-- Executing [[email protected]:2] Answer("SIP/204-b7206af0", "") in new stack
-- Executing [[email protected]:3] ExecIf("SIP/204-b7206af0", "1|Wait|2") in new stack
-- Executing [[email protected]:4] GotoIf("SIP/204-b7206af0", "0?num:nonum") in new stack
-- Goto (from-internal,1871,12)
-- Executing [[email protected]:12] Playback("SIP/204-b7206af0", "var/lib/asterisk/sounds/customyouwerecalled") in new stack
-- Executing [[email protected]:13] SayUnixTime("SIP/204-b7206af0", "|Europe/London|q 'digits/at' IMp") in new stack
-- SIP/204-b7206af0 Playing 'digits/at' (language 'en_GB')
-- SIP/204-b7206af0 Playing 'digits/11' (language 'en_GB')
-- SIP/204-b7206af0 Playing 'digits/oh' (language 'en_GB')
-- SIP/204-b7206af0 Playing 'digits/4' (language 'en_GB')
-- SIP/204-b7206af0 Playing 'digits/a-m' (language 'en_GB')
-- Executing [[email protected]:14] Goto("SIP/204-b7206af0", "") in new stack
== Spawn extension (from-internal, 1871, 14) exited non-zero on 'SIP/204-b7206af0'
-- Executing [[email protected]:1] Macro("SIP/204-b7206af0", "hangupcall") in new stack
-- Executing [[email protected]:1] ResetCDR("SIP/204-b7206af0", "w") in new stack
-- Executing [[email protected]:2] NoCDR("SIP/204-b7206af0", "") in new stack
-- Executing [[email protected]:3] GotoIf("SIP/204-b7206af0", "1?skiprg") in new stack
-- Goto (macro-hangupcall,s,6)
-- Executing [[email protected]:6] GotoIf("SIP/204-b7206af0", "1?skipblkvm") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [[email protected]:9] GotoIf("SIP/204-b7206af0", "1?theend") in new stack
-- Goto (macro-hangupcall,s,11)
-- Executing [[email protected]:11] Hangup("SIP/204-b7206af0", "") in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/204-b7206af0' in macro 'hangupcall'
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/204-b7206af0'


  #8  
Old March 15th 09, 11:39 AM posted to uk.telecom.voip
Jono
external usenet poster
 
Posts: 1,539
Default Asterisk v 1.4 Call Trace

Jono wrote :
Phil Reynolds explained :
On Sun, 15 Mar 2009 04:00:11 +0000, Jono wrote:

....where do I specify ext 204...? somewhere here?


So, I've modified the original with your /204 suggestion and it is
doing what I need....except the time stamp - always reads the current
time and not the time of the call...

[custom-app-1871]
exten = s,1,Answer
exten = s,n,Wait(1)
exten = s,n,Macro(user-callerid,)
exten = s,n,SayUnixTime(${DB(lastcalltime/204)},Europe/London,q
\'digits/at\' IMp)
exten = s,n,Playback(info-about-last-call&telephone-number)
exten = s,n,Set(lastcaller=${DB(CALLTRACE/204)})
exten = s,n,GotoIf($[ $[ "${lastcaller}" = "" ] | $[ "${lastcaller}" =
"unknown" ] ]?noinfo)
exten = s,n,SayDigits(${lastcaller})
exten = s,n,Set(TIMEOUT(digit)=3)
exten = s,n,Set(TIMEOUT(response)=7)
exten = s,n,Background(to-call-this-number&press-1)
exten = s,n,Goto(fin)
exten = s,n(noinfo),Playback(from-unknown-caller)
exten = s,n,Macro(hangupcall,)
exten = s,n(fin),Noop(Waiting for input)
exten = s,n,WaitExten(60,)
exten = s,n,Playback(sorry-youre-having-problems&goodbye)
exten = 1,1,Goto(from-internal,${lastcaller},1)
exten = i,1,Playback(vm-goodbye)
exten = i,n,Macro(hangupcall,)
exten = t,1,Playback(vm-goodbye)
exten = t,n,Macro(hangupcall,)


  #9  
Old March 15th 09, 12:12 PM posted to uk.telecom.voip
Phil Reynolds
external usenet poster
 
Posts: 21
Default Asterisk v 1.4 Call Trace

On Sun, 15 Mar 2009 11:39:20 +0000, Jono wrote:

Jono wrote :
Phil Reynolds explained :
On Sun, 15 Mar 2009 04:00:11 +0000, Jono wrote:

....where do I specify ext 204...? somewhere here?


So, I've modified the original with your /204 suggestion and it is doing
what I need....except the time stamp - always reads the current time and
not the time of the call...


That would imply that you do not have a lastcalltime/204 entry in your
database - you need to add it when the call comes in, like this:

Set(DB(lastcalltime/204)=${EPOCH})

If not set, the SayUnixTime treats it as "empty" which reads the current
time.

--
Phil Reynolds
mail:
PLEASE followup news posts in news
- that's what it's here for
  #10  
Old March 15th 09, 12:20 PM posted to uk.telecom.voip
Jono
external usenet poster
 
Posts: 1,539
Default Asterisk v 1.4 Call Trace

After serious thinking Phil Reynolds wrote :
On Sun, 15 Mar 2009 11:39:20 +0000, Jono wrote:

Jono wrote :
Phil Reynolds explained :
On Sun, 15 Mar 2009 04:00:11 +0000, Jono wrote:

....where do I specify ext 204...? somewhere here?


So, I've modified the original with your /204 suggestion and it is doing
what I need....except the time stamp - always reads the current time and
not the time of the call...


That would imply that you do not have a lastcalltime/204 entry in your
database - you need to add it when the call comes in, like this:

Set(DB(lastcalltime/204)=${EPOCH})


Whoosh......not sure if you noticed....I'm not using vanilla Asterisk
:-)

Where does the CDR get date and time of calls?


 




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Asterisk Call Transfer Query Matt uk.telecom.voip (UK VOIP) 3 May 16th 07 05:19 PM
Sipura/Asterisk 3-way call not working? PeterW uk.telecom.voip (UK VOIP) 1 October 28th 06 07:56 AM
call recording in asterisk Shabbir uk.telecom.voip (UK VOIP) 21 September 2nd 06 05:00 PM
make sipdiscount - skype call with asterisk Ben Fitzgerald uk.telecom.voip (UK VOIP) 2 February 28th 06 09:00 PM
Asterisk more than one call [email protected] uk.telecom.voip (UK VOIP) 4 October 20th 05 02:52 PM


All times are GMT +1. The time now is 10:35 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.Content Relevant URLs by vBSEO 2.4.0
Copyright 2004-2019 BroadbanterBanter.
The comments are property of their posters.