Re: [asterisk-users] Expanding my answering-machine system

2023-06-18 Thread Joshua C. Colp
On Sun, Jun 18, 2023 at 9:28 AM Steve Matzura  wrote:

> Sorry, Joshua, I don't understand. One's a filename, one's an extension
> number. How are they the same? In other words, why would
> 'enter-ext-of-person' be considered a filename? I would think
> 'enter-ext-of-person' would be an extension number.
>
No. One is not an extension number. One is a Background instructed to play
a sound file with the filename "enter-ext-of-person". It is not a
placeholder where you replace it with an extension number. It's meant to be
used as-is, and play back a sound file named "enter-ext-of-person".

-- 
Joshua C. Colp
Asterisk Project Lead
Sangoma Technologies
Check us out at www.sangoma.com and www.asterisk.org
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Expanding my answering-machine system

2023-06-18 Thread Steve Matzura
Sorry, Joshua, I don't understand. One's a filename, one's an extension 
number. How are they the same? In other words, why would 
'enter-ext-of-person' be considered a filename? I would think 
'enter-ext-of-person' would be an extension number.



On 6/17/2023 7:27 PM, Joshua C. Colp wrote:

On Sat, Jun 17, 2023 at 7:48 PM Steve Matzura  wrote:

OK, this is how I thought it's supposed to work. It just
confounded me why the book would say the Playback() and
Background() syntax were the same, then in the very next paragraph
give an example that belied that claim.


The syntax is the same. They both take a filename. The example gave a 
filename of "enter-ext-of-person". You could pass that to Playback, 
though you would be unable to enter an extension.


--
Joshua C. Colp
Asterisk Project Lead
Sangoma Technologies
Check us out at www.sangoma.com  and 
www.asterisk.org 
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Expanding my answering-machine system

2023-06-17 Thread Joshua C. Colp
On Sat, Jun 17, 2023 at 7:48 PM Steve Matzura  wrote:

> OK, this is how I thought it's supposed to work. It just confounded me why
> the book would say the Playback() and Background() syntax were the same,
> then in the very next paragraph give an example that belied that claim.
>

The syntax is the same. They both take a filename. The example gave a
filename of "enter-ext-of-person". You could pass that to Playback, though
you would be unable to enter an extension.

-- 
Joshua C. Colp
Asterisk Project Lead
Sangoma Technologies
Check us out at www.sangoma.com and www.asterisk.org
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Expanding my answering-machine system

2023-06-17 Thread Steve Matzura
OK, this is how I thought it's supposed to work. It just confounded me 
why the book would say the Playback() and Background() syntax were the 
same, then in the very next paragraph give an example that belied that 
claim.



On 6/17/2023 1:46 PM, Doug Lytle wrote:

On 6/17/23 08:47, Steve Matzura wrote:


Both Background()  and WaitExten()  allow the caller to enter DTMF 
digits. Asterisk then attempts to find an extension in the current 
context that matches the digits that the caller entered. If Asterisk 
finds a match, it will send the call to that extension.



My question then is, is "*" a valid exension, as in:



I'd have to assume yes.  I don't use WaitExten() and I set 
autofallthrough=no in the /etc/asterisk.conf, since that is the way 
I've always expected Asterisk to work; my dialplan examples are based 
on that.


The below example shows a call coming into a DID, playing background 
prompts and excepting input during play.



;
;* Auto attendant
;

exten => 5175551212,1,Gosub(check-blacklist,s,1)
 same => n,Gosub(check-hours,s,1)
 same => n,Gosub(holiday-check,s,1)
 same => n,Gosub(get-callerid,s,1)
 same => n,Goto(auto-attend,s,1)

[auto-attend]

include => dial-by-extension

;*
;* Set timeouts
;*

exten => s,1,Set(TIMEOUT(response)=8)
 same => n,Set(TIMEOUT(digit)=2)
 same => n,Set(LOOPCOUNT=0)

 same => n,GotoIf($["${Holiday}" = "YES"]?HOLIDAY:BEGIN)
 same => n(BEGIN),Answer()
 same => n,Wait(1)

;
;* Play the 'Welcome message' and office hours message
;

 same => n,Background(${voice}/welcome)
 same => n,Background(${voice}/business_hours)
 same => n,Background(${voice}/8am_5pm)
 same => n(HOLIDAY),Background(${voice}/dial_anytime)
 same => n(DIRECTORY),Background(${voice}/directory_assist)
 same => n,Background(${voice}/press_1)
 same => n,Background(${voice}/to_ring_after_hours)
 same => n,Background(${voice}/press_2)
 same => n,Background(${voice}/absence_delay)
 same => n,Background(${voice}/press_3)

;
;* If 1 is pressed, go to Dial by name
;

exten => 1,1,Goto(directory,s,1)

;***
;* If 2 is pressed, dial the Foyer phone
;***

exten => 2,1,Goto(dial-by-extension,4255,1)

;***
;* If 3 is pressed, dial absence/delay extension
;***

exten => 3,1,Gosub(cellphone-callerid,s,1)
exten => 3,n,Voicemail(3888@sip,us)
exten => 3,n,Hangup()

;
;* If 8# is pressed, go to Voicemail Main menu
;

exten => 8#,1,VoiceMailMain(@sip)
exten => 8#,2,Hangup()

This is not the complete dialplan; I also have error checking and a 
loop counter.


Doug

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Expanding my answering-machine system

2023-06-17 Thread Doug Lytle

On 6/17/23 08:47, Steve Matzura wrote:


Both Background() and WaitExten()  allow the caller to enter DTMF 
digits. Asterisk then attempts to find an extension in the current 
context that matches the digits that the caller entered. If Asterisk 
finds a match, it will send the call to that extension.



My question then is, is "*" a valid exension, as in:



I'd have to assume yes.  I don't use WaitExten() and I set 
autofallthrough=no in the /etc/asterisk.conf, since that is the way I've 
always expected Asterisk to work; my dialplan examples are based on that.


The below example shows a call coming into a DID, playing background 
prompts and excepting input during play.



;
;* Auto attendant
;

exten => 5175551212,1,Gosub(check-blacklist,s,1)
 same => n,Gosub(check-hours,s,1)
 same => n,Gosub(holiday-check,s,1)
 same => n,Gosub(get-callerid,s,1)
 same => n,Goto(auto-attend,s,1)

[auto-attend]

include => dial-by-extension

;*
;* Set timeouts
;*

exten => s,1,Set(TIMEOUT(response)=8)
 same => n,Set(TIMEOUT(digit)=2)
 same => n,Set(LOOPCOUNT=0)

 same => n,GotoIf($["${Holiday}" = "YES"]?HOLIDAY:BEGIN)
 same => n(BEGIN),Answer()
 same => n,Wait(1)

;
;* Play the 'Welcome message' and office hours message
;

 same => n,Background(${voice}/welcome)
 same => n,Background(${voice}/business_hours)
 same => n,Background(${voice}/8am_5pm)
 same => n(HOLIDAY),Background(${voice}/dial_anytime)
 same => n(DIRECTORY),Background(${voice}/directory_assist)
 same => n,Background(${voice}/press_1)
 same => n,Background(${voice}/to_ring_after_hours)
 same => n,Background(${voice}/press_2)
 same => n,Background(${voice}/absence_delay)
 same => n,Background(${voice}/press_3)

;
;* If 1 is pressed, go to Dial by name
;

exten => 1,1,Goto(directory,s,1)

;***
;* If 2 is pressed, dial the Foyer phone
;***

exten => 2,1,Goto(dial-by-extension,4255,1)

;***
;* If 3 is pressed, dial absence/delay extension
;***

exten => 3,1,Gosub(cellphone-callerid,s,1)
exten => 3,n,Voicemail(3888@sip,us)
exten => 3,n,Hangup()

;
;* If 8# is pressed, go to Voicemail Main menu
;

exten => 8#,1,VoiceMailMain(@sip)
exten => 8#,2,Hangup()

This is not the complete dialplan; I also have error checking and a loop 
counter.


Doug
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Expanding my answering-machine system

2023-06-17 Thread Steve Matzura

Doug,


This is where the weeds start growing.


On 6/17/2023 4:55 AM, Doug Lytle wrote:


For both capabilities, you can use Background() instead of Playback() 
for audio prompts.  Background() allows for interrupting the prompts 
and continue on with your dialplan.


Understood. From the book:



The most common use of the Background() application is to create basic 
voice menus (often called auto attendants, IVRs ,  9 or phone trees ).



But now, the confusion:


Background() has the same syntax as Playback()  :

  [TestMenu]
exten => start,1,Answer()
  same => n,Background(enter-ext-of-person)


Stop right there. The syntax of Playback() is Playback(filename), 
there's no extension number.



More book:

Both Background() and WaitExten()  allow the caller to enter DTMF 
digits. Asterisk then attempts to find an extension in the current 
context that matches the digits that the caller entered. If Asterisk 
finds a match, it will send the call to that extension.



My question then is, is "*" a valid exension, as in:


exten => *,VoicemailMain()


-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Expanding my answering-machine system

2023-06-17 Thread Doug Lytle

On 6/16/23 20:29, Steve Matzura wrote:
As always, thanks in advance for a kick in the right direction. 


For both capabilities, you can use Background() instead of Playback() 
for audio prompts.  Background() allows for interrupting the prompts and 
continue on with your dialplan.


Doug-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Expanding my answering-machine system

2023-06-16 Thread Steve Matzura
You all know the story--give the customer/client what they ask for, and 
if they like it, they'll be back for more. Such is just so with my 
one-trick-pony answering-machine project. Now the other two musicians in 
my virtual band want the following capabilities:



1. The ability to dial the main number from outside our three-party 
network and hit a button, like 1, 2 or 3, while the outgoing message is 
playing which will ring one of the parties now in the system. 
Alternatively, press a button and have everybody's phone ring and 
someone will eventually pick up in their studio.



2. Check voicemail remotely when not on the local network with a phone 
connected to the system. This is emminently doable and well described on 
how to do it in my book, but I have a question about how to invoke the 
VoicemailMain() function while the outgoing message is playing. Is it as 
easy as creating an extension whose number is "#" and send that to 
VoicemailMain()?



As always, thanks in advance for a kick in the right direction.


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users