The Dummies Guide to Direct Sound Card Overhead Paging with Optional Ring Tone Generation- Don't Try This as at Home


Preface:

Ok this is my first go at creating a wiki. So, let me preface everything by stating that I am very new to this environment and there is probably a better way to do almost all of this. I welcome comments and suggestions.

Description of Paging:

Good background information on Paging and Intercom can be found here. http://www.voip-info.org/wiki/index.php?page=Asterisk+Paging+and+Intercom

Specific setup for OverHead Paging via the Sound Card can be found here. http://www.voip-info.org/wiki/view/Setting+up+paging+with+a+sound+card

In the end I found all of this to be way too much work and now use SIP based VOIP paging products from a here http://www.cyberdata.net http://www.cyberdata.net/products/voip/voip-pager.html

So what’s different about this method?

In the past Overhead Paging via the chan_oss channel to the Sound Card could only be set to answer or not answer via the oss.conf file created from the documentation located here under Step 5. http://www.voip-info.org/wiki/view/Setting+up+paging+with+a+sound+card
It was an either or proposition.

With the solution described below one can now dial an extension with one of two optional switches specified in an extension’s Dial string giving us the optional ability to send a generated ring tone across the speakers as well. This is good in noisy environments such as warehouses or shop floors where someone needs to be alerted of incoming calls. Thus ring tone AND paging can use the same amplified sound system.





OLD WAY

Dialing:
console/dsp calls the oss.conf file located here /etc/asterisk and looks at the line
autoanswer=yes or no. If set to answer it will open a chan_oss and transmit the page.



NEW WAY

Optionally once the patch is installed, Dialing:
console/dsp/answer will pick of the channel same as the string console/dsp
console/dsp/noanswer will not pick up any line but will send a ring tone across the channel until a grouped extension is picked up.


Follow the instructions in this wiki to download Asterisk. Stop before making Asterisk though. It was at 1.2.14 at the time these instructions were written. http://www.aussievoip.com/wiki/How+to+upgrade+Asterisk

Next create a file called 20070113__chan_oss.diff with the below code. If it is still available download you may be able to download it from here: http://asterisk.drunkcoder.com/patches/20070113chan_oss.diff.txt

This code was provided by Corydon from the #Asterisk Channel in IRC.

Copy this file to the /usr/src/asterisk-x.x.x/channels directory.


Index: channels/chan_oss.c
===================================================================

+++ channels/chan_oss.c (working copy)@@ -692,10 +692,21 @@
{
struct chan_oss_pvt *o = c->tech_pvt;
struct ast_frame f = { 0, };
+ char *flags = ast_strdupa(dest), *destcopy;+ destcopy = strsep(&flags, "/");
ast_verbose(" << Call to '%s' on console from <%s><%s><%s> >>\n",
dest, c->cid.cid_dnid, c->cid.cid_num, c->cid.cid_name);
- if (o->autoanswer) {
+ if (flags && strcasecmp(flags, "answer") == 0) {+ f.frametype = AST_FRAME_CONTROL;+ f.sub+ ast_queue_frame(c, &f);+ } else if (flags && strcasecmp(flags, "noanswer") == 0) {+ f.frametype = AST_FRAME_CONTROL;+ f.sub+ ast_queue_frame(c, &f);+ ring(o, AST_CONTROL_RING);+ } else if (o->autoanswer) {ast_verbose( " << Auto-answered >> \n" );
f.frametype = AST_FRAME_CONTROL;
f.sub
@@ -915,12 +926,17 @@
int format, void *data, int *cause)
{
struct ast_channel *c;
- struct chan_oss_pvt *o = find_desc(data);
+ struct chan_oss_pvt *o;+ char *data2 = ast_strdupa(data), *slash;
+ if slash = strchr(data2, '/')+ *slash = '\0';+ o = find_desc(data2);+ast_log(LOG_WARNING, "oss_request ty <%s> data 0x%p <%s>\n",
type, data, (char *)data);
if (o == NULL) {
- ast_log(LOG_NOTICE, "Device %s not found\n", (char *)data);
+ ast_log(LOG_NOTICE, "Device %s not found\n", (char *)data2);/* XXX we could default to 'dsp' perhaps ? */
return NULL;
}


Place this file into /usr/src/asterisk-x.x.x/channels where x.x.x is your current version of the Asterisk Channel drivers. Then edit the Makefile and add chan_oss.so if it is not already at the end of the line containing:
CHANNEL_LIBS=chan_sip.so chan_agent.so chan_mgcp.so chan_iax2.so chan_local.so chan_skinny.so

So it looks like this:
CHANNEL_LIBS=chan_sip.so chan_agent.so chan_mgcp.so chan_iax2.so chan_local.so chan_skinny.so chan_oss.so

If you downloaded the patch from the above website then you’ll need to change it’s name and drop the .txt

mv 20070113__chan_oss.diff.txt 20070113__chan_oss.diff

Now run patch -p0 <20070113__chan_oss.diff

I am told that this feature patch may be added to an Asterisk build after 1.4.
From Corydon in #asterisk "It's also now been committed to trunk, rev 50847"

Now continue with making the Asterisk in the instructions above.

Modify /etc/asterisk/modules.conf to load chan_oss.conf if it isn’t already.

It used to read:
noload => chan_oss.so

But should now read:
load => chan_oss.so

Note: This solution only works w/ oss and not chan_asla at this time. Only chan_oss should be loaded as I was lead to believe that conflicts would arise if both were loaded.

Plug your speakers in.

Remember to run genzaptelconf if you are using a zaptel device.

Reboot if necessary.

Create a Paging extension by creating a custom extention from the FreePBX GUI and place “console/dsp/answer” in the Dial field with out the quotes.

Apply your changes.

Test by dialing that extension number.

If you don’t hear anything pull up alsamixer and unmute your Master and PCM selections and turn up your volume. If your sound card is different than mine than check which jacks you have plugged into and unmute and turn up all the channels until you hear something. If after doing all this and you still don’t have sound you might try changing out your soundcard. My first experiments were with a Crystal Audio onboard integrated sound card and it did make sound but it was very distorted. Swapping out to a Turtle Beach PCI Card helped alleviate this issue.
Next, setup the Ringing Extension.

Create another generic extension with console/dsp/noanswer in the Dial field. Submit and Apply your changes.

Create a Ring Group and include the Rining Extension you just created along with other actual extensions. I used a Ring Group that was supposed to ring all lines for incoming Sales calls via IRV. I just added this Ringer extension to that group. When the lines in this group rang so did the amplified speakers. When an extension picked up the incoming call it stopped ringing.

Test the Ringing extension by calling it’s number.



Environment I started from:

I started with TrixBox 2.0 build cd found here. http://www.trixbox.org/modules/smartsection/item.php?itemid=2/
ISO at the time of writing this is found here. http://sourceforge.net/project/showfiles.php?group_id=123387&package_id=192286


Special thanks to everyone at #asterisk and #freepbx for your support. Notable support came from Corydom and Qwell at #asterisk and groogs, wiseoldowl, BSDTech, Bananaskin, X-Rob



Preface:

Ok this is my first go at creating a wiki. So, let me preface everything by stating that I am very new to this environment and there is probably a better way to do almost all of this. I welcome comments and suggestions.

Description of Paging:

Good background information on Paging and Intercom can be found here. http://www.voip-info.org/wiki/index.php?page=Asterisk+Paging+and+Intercom

Specific setup for OverHead Paging via the Sound Card can be found here. http://www.voip-info.org/wiki/view/Setting+up+paging+with+a+sound+card

In the end I found all of this to be way too much work and now use SIP based VOIP paging products from a here http://www.cyberdata.net http://www.cyberdata.net/products/voip/voip-pager.html

So what’s different about this method?

In the past Overhead Paging via the chan_oss channel to the Sound Card could only be set to answer or not answer via the oss.conf file created from the documentation located here under Step 5. http://www.voip-info.org/wiki/view/Setting+up+paging+with+a+sound+card
It was an either or proposition.

With the solution described below one can now dial an extension with one of two optional switches specified in an extension’s Dial string giving us the optional ability to send a generated ring tone across the speakers as well. This is good in noisy environments such as warehouses or shop floors where someone needs to be alerted of incoming calls. Thus ring tone AND paging can use the same amplified sound system.





OLD WAY

Dialing:
console/dsp calls the oss.conf file located here /etc/asterisk and looks at the line
autoanswer=yes or no. If set to answer it will open a chan_oss and transmit the page.



NEW WAY

Optionally once the patch is installed, Dialing:
console/dsp/answer will pick of the channel same as the string console/dsp
console/dsp/noanswer will not pick up any line but will send a ring tone across the channel until a grouped extension is picked up.


Follow the instructions in this wiki to download Asterisk. Stop before making Asterisk though. It was at 1.2.14 at the time these instructions were written. http://www.aussievoip.com/wiki/How+to+upgrade+Asterisk

Next create a file called 20070113__chan_oss.diff with the below code. If it is still available download you may be able to download it from here: http://asterisk.drunkcoder.com/patches/20070113chan_oss.diff.txt

This code was provided by Corydon from the #Asterisk Channel in IRC.

Copy this file to the /usr/src/asterisk-x.x.x/channels directory.


Index: channels/chan_oss.c
===================================================================

+++ channels/chan_oss.c (working copy)@@ -692,10 +692,21 @@
{
struct chan_oss_pvt *o = c->tech_pvt;
struct ast_frame f = { 0, };
+ char *flags = ast_strdupa(dest), *destcopy;+ destcopy = strsep(&flags, "/");
ast_verbose(" << Call to '%s' on console from <%s><%s><%s> >>\n",
dest, c->cid.cid_dnid, c->cid.cid_num, c->cid.cid_name);
- if (o->autoanswer) {
+ if (flags && strcasecmp(flags, "answer") == 0) {+ f.frametype = AST_FRAME_CONTROL;+ f.sub+ ast_queue_frame(c, &f);+ } else if (flags && strcasecmp(flags, "noanswer") == 0) {+ f.frametype = AST_FRAME_CONTROL;+ f.sub+ ast_queue_frame(c, &f);+ ring(o, AST_CONTROL_RING);+ } else if (o->autoanswer) {ast_verbose( " << Auto-answered >> \n" );
f.frametype = AST_FRAME_CONTROL;
f.sub
@@ -915,12 +926,17 @@
int format, void *data, int *cause)
{
struct ast_channel *c;
- struct chan_oss_pvt *o = find_desc(data);
+ struct chan_oss_pvt *o;+ char *data2 = ast_strdupa(data), *slash;
+ if slash = strchr(data2, '/')+ *slash = '\0';+ o = find_desc(data2);+ast_log(LOG_WARNING, "oss_request ty <%s> data 0x%p <%s>\n",
type, data, (char *)data);
if (o == NULL) {
- ast_log(LOG_NOTICE, "Device %s not found\n", (char *)data);
+ ast_log(LOG_NOTICE, "Device %s not found\n", (char *)data2);/* XXX we could default to 'dsp' perhaps ? */
return NULL;
}


Place this file into /usr/src/asterisk-x.x.x/channels where x.x.x is your current version of the Asterisk Channel drivers. Then edit the Makefile and add chan_oss.so if it is not already at the end of the line containing:
CHANNEL_LIBS=chan_sip.so chan_agent.so chan_mgcp.so chan_iax2.so chan_local.so chan_skinny.so

So it looks like this:
CHANNEL_LIBS=chan_sip.so chan_agent.so chan_mgcp.so chan_iax2.so chan_local.so chan_skinny.so chan_oss.so

If you downloaded the patch from the above website then you’ll need to change it’s name and drop the .txt

mv 20070113__chan_oss.diff.txt 20070113__chan_oss.diff

Now run patch -p0 <20070113__chan_oss.diff

I am told that this feature patch may be added to an Asterisk build after 1.4.
From Corydon in #asterisk "It's also now been committed to trunk, rev 50847"

Now continue with making the Asterisk in the instructions above.

Modify /etc/asterisk/modules.conf to load chan_oss.conf if it isn’t already.

It used to read:
noload => chan_oss.so

But should now read:
load => chan_oss.so

Note: This solution only works w/ oss and not chan_asla at this time. Only chan_oss should be loaded as I was lead to believe that conflicts would arise if both were loaded.

Plug your speakers in.

Remember to run genzaptelconf if you are using a zaptel device.

Reboot if necessary.

Create a Paging extension by creating a custom extention from the FreePBX GUI and place “console/dsp/answer” in the Dial field with out the quotes.

Apply your changes.

Test by dialing that extension number.

If you don’t hear anything pull up alsamixer and unmute your Master and PCM selections and turn up your volume. If your sound card is different than mine than check which jacks you have plugged into and unmute and turn up all the channels until you hear something. If after doing all this and you still don’t have sound you might try changing out your soundcard. My first experiments were with a Crystal Audio onboard integrated sound card and it did make sound but it was very distorted. Swapping out to a Turtle Beach PCI Card helped alleviate this issue.
Next, setup the Ringing Extension.

Create another generic extension with console/dsp/noanswer in the Dial field. Submit and Apply your changes.

Create a Ring Group and include the Rining Extension you just created along with other actual extensions. I used a Ring Group that was supposed to ring all lines for incoming Sales calls via IRV. I just added this Ringer extension to that group. When the lines in this group rang so did the amplified speakers. When an extension picked up the incoming call it stopped ringing.

Test the Ringing extension by calling it’s number.



Environment I started from:

I started with TrixBox 2.0 build cd found here. http://www.trixbox.org/modules/smartsection/item.php?itemid=2/
ISO at the time of writing this is found here. http://sourceforge.net/project/showfiles.php?group_id=123387&package_id=192286


Special thanks to everyone at #asterisk and #freepbx for your support. Notable support came from Corydom and Qwell at #asterisk and groogs, wiseoldowl, BSDTech, Bananaskin, X-Rob


Created by: WAudette, Last modification: Wed 06 of May, 2009 (18:37 UTC)
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+