Misterhouse Voice Recognition

View: New views
17 Messages — Rating Filter:   Alert me  

Misterhouse Voice Recognition

by plasma2002 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What is everybody using to get MH to do VR?
Which route is the easiest?

I am currently using MH on Ubuntu. How difficult is a wine environment to set up for VR?
Depending on this much-needed feature, i may convert over to Windoze if needed.

Thoughts? Opinions?

-BrianG

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


Re: Misterhouse Voice Recognition

by Jim Duda :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Brian,

I'm currently using VR with the pocketsphinx code from CMU Sphinx.

If you are running misterhouse from the SVN distribution, you should
check out the pocketsphinx_control.pl code module (code/common).  You
should simply be able to follow the installation instructions.

It works, but dependent upon the quality of the microphone you have.

I also have it working through my Asterisk phone system.  I can dial
an extension and issue voice commands that way.  There is a post on
this list which desribes the detailed instructions for integration
with asterisk.

Jim


Brian Gaut wrote:

> What is everybody using to get MH to do VR?
> Which route is the easiest?
>
> I am currently using MH on Ubuntu. How difficult is a wine environment
> to set up for VR?
> Depending on this much-needed feature, i may convert over to Windoze if
> needed.
>
> Thoughts? Opinions?
>
> -BrianG
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
>
>
> ------------------------------------------------------------------------
>
> ________________________________________________________
> To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365
>
Br


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


Asterisk Integration

by Garry Doucette :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok. I've embarked on my next ambitious project. I've got Asterisk up and
running using FreePBX. That's working fine. Asterisk and MH are on the same
server.

I decided I would go the xAP route so I've been studying all things
Asterisk, MH and xAP. I've got axc-v0.7b installed. I've also got the files
from Gregg's mh_gregg_telephony.tar.gz on my system.

My first problem seems to be that axc can't connect to Asterisk (I planned
on changing other settings once I got the connection established). The
axc.log is giving me this...

15/07/08 20:47:05 [INFO] (xAP::Comm): Created xAP send socket on port 3639
15/07/08 20:47:05 [INFO] (xAP::Comm): Created xAP listen socket on port
49155
15/07/08 20:47:05 [DEBUG] (Extension::new) Created new extension,
gregg_desk, using channel, SIP/01
15/07/08 20:47:05 [DEBUG] Initializing extension: gregg_desk
15/07/08 20:47:05 [DEBUG] (Extension::add_carrier) Added incoming carrier:
nufone to extension: gregg_desk
15/07/08 20:47:05 [DEBUG] (Extension::add_number_formatter) Added formatter,
number_formatter1, to nufone as s/1?(\d{10})/$1/
15/07/08 20:47:05 [DEBUG] (Extension::add_carrier) Added incoming carrier:
tierone to extension: gregg_desk
15/07/08 20:47:05 [DEBUG] (Extension::add_carrier) Added outgoing carrier:
voipout to extension: gregg_desk
15/07/08 20:47:05 [DEBUG] (Extension::add_number_formatter) Added formatter,
number_formatter1, to voipout as s/1?(\d{10})/$1/
15/07/08 20:47:05 [DEBUG] (Extension::add_carrier) Added outgoing carrier:
house to extension: gregg_desk
15/07/08 20:47:05 [DEBUG] (Extension::add_number_formatter) Added formatter,
number_formatter1, to house as s/9?1?(\d{10})/$1/
15/07/08 20:47:05 [DEBUG] (Extension::add_carrier) Added outgoing carrier:
tierone to extension: gregg_desk
15/07/08 20:47:05 [DEBUG] (Extension::new) Created new extension, guest,
using channel, SIP/03
15/07/08 20:47:05 [DEBUG] Initializing extension: guest
15/07/08 20:47:05 [DEBUG] (Extension::add_carrier) Added incoming carrier:
jnctn to extension: guest
15/07/08 20:47:05 [DEBUG] (Extension::add_number_formatter) Added formatter,
number_formatter1, to jnctn as s/1?(\d{10})/$1/
15/07/08 20:47:05 [DEBUG] (Extension::add_carrier) Added outgoing carrier:
voipout to extension: guest
15/07/08 20:47:05 [DEBUG] (Extension::add_number_formatter) Added formatter,
number_formatter1, to voipout as s/1?(\d{10})/$1/
15/07/08 20:47:05 [DEBUG] (Extension::add_carrier) Added outgoing carrier:
house to extension: guest
15/07/08 20:47:05 [DEBUG] (Extension::add_number_formatter) Added formatter,
number_formatter1, to house as s/9?1?(\d{10})/$1/
15/07/08 20:47:05 [INFO] Completed initialization
15/07/08 20:47:05 [INFO] Read 6 entries from ./pronouncable_words.list
15/07/08 20:47:05 [DEBUG] (Extension::send_line_data) Sending line info for
gregg_desk.house; network_type: PSTN; country_code: 1; state: free
15/07/08 20:47:05 [DEBUG] (Extension::send_line_data) Sending line info for
gregg_desk.tierone; network_type: OFFICE; country_code: 1; state: free
15/07/08 20:47:05 [DEBUG] (Extension::send_line_data) Sending line info for
gregg_desk.voipout; network_type: VPSTN; country_code: 1; state: free
15/07/08 20:47:05 [DEBUG] (Extension::send_line_data) Sending line info for
gregg_desk.nufone; network_type: VPSTN; country_code: 1; state: free
15/07/08 20:47:05 [DEBUG] (Extension::send_line_data) Sending line info for
guest.house; network_type: PSTN; country_code: 1; state: free
15/07/08 20:47:05 [DEBUG] (Extension::send_line_data) Sending line info for
guest.voipout; network_type: VPSTN; country_code: 1; state: free
15/07/08 20:47:05 [DEBUG] (Extension::send_line_data) Sending line info for
guest.jnctn; network_type: VPSTN; country_code: 1; state: free
15/07/08 20:47:05 [DEBUG] (::main) Attempting astman connection
15/07/08 20:47:05 [ERROR] (::main) Could not connect to Asterisk!
15/07/08 20:47:06 [DEBUG] (::main) Attempting astman connection
15/07/08 20:47:06 [ERROR] (::main) Could not connect to Asterisk!
15/07/08 20:47:07 [DEBUG] (::main) Attempting astman connection
15/07/08 20:47:07 [ERROR] (::main) Could not connect to Asterisk!

Any ideas why I might be having this problem? I read somewhere that having
both MH and Asterisk on the same box may cause difficulties.

My config files:

My axc.conf file...

##
## G E N E R A L
##

[general]
log_file = /tmp/axc.log
# log_level 0 is least verbose; 5 is most
log_level = 4


##
## A S T E R I S K   C O N N E C T I O N
##

[astman_connect]
# This section holds the credentials and host to allow
# connection to the asterisk manager.  It is essential
# that manager.conf (in your asterisk config dir) be
# configured to match the corresponding entries
#
# The following is an example:
#
;
; Asterisk Call Management support
;
[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0

[doucga]
secret = Secret-42
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.255
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user

uid = doucga
pwd = Secret-42
# make sure that you update the permit line in
# manager.conf if you attempt to connect to
# anything other than localhost
host = 127.0.0.1


##
## x A P
##

[xap]
# heartbeat interval in minutes
hbeat_interval = 1
# ignore the xAP base uid unless it conflicts w/ other apps
base_uid = FFE8
# the source of xAP messages will be of the form:
# liming.axc.<instance_name>
instance_name = house
# set nohub = 1 if you don't have a hub operating; default is 0
nohub = 0

*******************

My manager.conf....

;
; Asterisk Call Management support
;
[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0

[doucga]
secret = Coffee-42
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user

#include manager_additional.conf
#include manager_custom.conf

Garry


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


Re: Asterisk Integration

by Gregg Liming :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Garry,

Garry Doucette wrote:

[... snip...]

> Any ideas why I might be having this problem?

It looks to me like you uncommented the astman example embedded in
axc.conf.  That is just an example of what you should expect to see in
manager.conf.  You definitely don't want to uncomment it as now, axc
will interpret the entries that you intended to be associated with
[astman_connect] w/ (instead) [dougca].  I'll wrap the section below
that either needs to be put back in comments or just deleted.

And.... most importantly... the pwd in axc.conf (which you have as
"Secret-42") must match the secret in manager.conf (which you have as
"Coffee-42").

BTW: The absence of any sections labeled [asterisk] and the dependent
voicemail, extensions, trunks is going to mean that your axc isn't going
to do anything.  Hopefully, you've just omitted them for the purpose of
this post.  If not, then you'll have to revisit this.

> I read somewhere that having
> both MH and Asterisk on the same box may cause difficulties.

I suspect it's less of a problem these days.  One of the problems that
can occur results from the fact that asterisk needs millsecond timing
accuracy if you do transcoding, meetme and possibly other stuff.  That
means either having an internal timing source or one of the "zap" cards
to provide very frequent interrupts.  Historically, this interrupt
frequency could eventually hit during a time when mh was doing a OS
select to determine if socket data existed.  If that happened, then the
socket would get trashed.  I'm pretty sure that the latest svn has
resolved these issues that have always existed.

However... I don't run mh and asterisk on the same system.

> My axc.conf file...
>
> ##
> ## G E N E R A L
> ##
>
> [general]
> log_file = /tmp/axc.log
> # log_level 0 is least verbose; 5 is most
> log_level = 4
>
>
> ##
> ## A S T E R I S K   C O N N E C T I O N
> ##
>
> [astman_connect]
> # This section holds the credentials and host to allow
> # connection to the asterisk manager.  It is essential
> # that manager.conf (in your asterisk config dir) be
> # configured to match the corresponding entries
> #
> # The following is an example:
> #

---------delete or comment the followin ---------

> ;
> ; Asterisk Call Management support
> ;
> [general]
> enabled = yes
> port = 5038
> bindaddr = 0.0.0.0
>
> [doucga]
> secret = Secret-42
> deny=0.0.0.0/0.0.0.0
> permit=127.0.0.1/255.255.255.255
> read = system,call,log,verbose,command,agent,user
> write = system,call,log,verbose,command,agent,user

--------------end section ------------------------

> uid = doucga
> pwd = Secret-42
> # make sure that you update the permit line in
> # manager.conf if you attempt to connect to
> # anything other than localhost
> host = 127.0.0.1
>
>
> ##
> ## x A P
> ##
>
> [xap]
> # heartbeat interval in minutes
> hbeat_interval = 1
> # ignore the xAP base uid unless it conflicts w/ other apps
> base_uid = FFE8
> # the source of xAP messages will be of the form:
> # liming.axc.<instance_name>
> instance_name = house
> # set nohub = 1 if you don't have a hub operating; default is 0
> nohub = 0
>
> *******************
>
> My manager.conf....
>
> ;
> ; Asterisk Call Management support
> ;
> [general]
> enabled = yes
> port = 5038
> bindaddr = 0.0.0.0
>
> [doucga]
> secret = Coffee-42
> deny=0.0.0.0/0.0.0.0
> permit=127.0.0.1/255.255.255.0
> read = system,call,log,verbose,command,agent,user
> write = system,call,log,verbose,command,agent,user
>
> #include manager_additional.conf
> #include manager_custom.conf
>
> Garry
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> ________________________________________________________
> To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365
>


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


Re: Misterhouse Voice Recognition

by Pete Flaherty :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Also based on Jims scripts I committed a linux installer, also in svn
it should be in the code/support/  folder.  It's a *nix bash script that
will get make etc all the sphinx components.

It's been a little while since I updated it, but should get you the
components needed ....


--
-Pete Flaherty
http://www.lpcomet.com
http://www.mraudrey.net
http://www.hauntedacrewoods.com

On Wed, July 9, 2008 8:37 pm, Jim Duda wrote:

> Brian,
>
> I'm currently using VR with the pocketsphinx code from CMU Sphinx.
>
> If you are running misterhouse from the SVN distribution, you should
> check out the pocketsphinx_control.pl code module (code/common).  You
> should simply be able to follow the installation instructions.
>
> It works, but dependent upon the quality of the microphone you have.
>
> I also have it working through my Asterisk phone system.  I can dial
> an extension and issue voice commands that way.  There is a post on
> this list which desribes the detailed instructions for integration
> with asterisk.
>
> Jim
>
>
> Brian Gaut wrote:
>> What is everybody using to get MH to do VR?
>> Which route is the easiest?
>>
>> I am currently using MH on Ubuntu. How difficult is a wine environment
>> to set up for VR?
>> Depending on this much-needed feature, i may convert over to Windoze if
>> needed.
>>
>> Thoughts? Opinions?
>>
>> -BrianG
>>
>>
>> ------------------------------------------------------------------------
>>
>> -------------------------------------------------------------------------
>> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
>> Studies have shown that voting for your favorite open source project,
>> along with a healthy diet, reduces your potential for chronic lameness
>> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
>>
>>
>> ------------------------------------------------------------------------
>>
>> ________________________________________________________
>> To unsubscribe from this list, go to:
>> http://sourceforge.net/mail/?group_id=1365
>>
> Br
>
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> ________________________________________________________
> To unsubscribe from this list, go to:
> http://sourceforge.net/mail/?group_id=1365
>
>



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


Re: Asterisk Integration

by Garry Doucette :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Gregg!

Success...

07/08 17:51:17 [INFO] (xAP::Comm): Created xAP send socket on port 3639
16/07/08 17:51:17 [INFO] (xAP::Comm): Created xAP listen socket on port
49155
16/07/08 17:51:17 [DEBUG] (Extension::new) Created new extension, 200, using
channel,
16/07/08 17:51:17 [DEBUG] Initializing extension: 200
16/07/08 17:51:17 [INFO] Completed initialization
16/07/08 17:51:17 [INFO] Read 6 entries from ./pronouncable_words.list
16/07/08 17:51:17 [DEBUG] (::main) Attempting astman connection
16/07/08 17:51:17 [INFO] (::main) Successfully connected to asterisk manager
16/07/08 17:51:17 [DEBUG] (::checkMailWaiting) Beginning mailbox status
check
16/07/08 17:51:17 [INFO] (::checkMailWaiting) Mailbox 200@default: new=5,
old=0
16/07/08 17:51:17 [DEBUG] Extension: 200 is hook

So I've got the connection sorted out (it was a matter of making sure all
the passwords and userids were synced including FreePBX). When I call into
Extension 200 I see the messages about the call and voicemail status in the
axc.log. The first thing I noticed is when I fire up my xap viewer I'm not
seeing any messages on the network from axc. Any suggestions for
troubleshooting would be appreciated.

Now I'm also working on getting Telephony.pl working in MH.

Here's my setup so far...

mh.ini
phone_line_names=home_phone.house => Home
phone_extension_names=home_phone => Home-Phone

***************************************************
Axc.conf
##
## G E N E R A L
##

[general]
log_file = /tmp/axc.log
# log_level 0 is least verbose; 5 is most
log_level = 4


##
## A S T E R I S K   C O N N E C T I O N
##

[astman_connect]
uid = admin
pwd = Coffee-42
host = 127.0.0.1


##
## x A P
##

[xap]
hbeat_interval = 1
base_uid = FFE8
instance_name = house
nohub = 0

##
## A S T E R I S K   M O N I T O R I N G
##
[asterisk]
monitored_extensions = 200
watched_mailboxes = 200@default
mbox_watch_interval = 300

##
## V O I C E M A I L B O X   S E T U P
##

[200@default]
display=ifnew
priority=5
duration=15
displaytext=Voicemail for Doucettes. New: $new_messages; Old: $old_messages


##
## U N A T T E N D E D   D I A L I N G
##

[axc-notify]
context=axc-notify
cidnum=2507233349
channel=SIP/200
timeout=20


##
## E X T E N S I O N S
##

[home_phone]
channel = SIP/200
incoming = Telus
outgoing = spa3000

##
## T R U N K S
##

[pstn]
incoming_channel = SIP/192.168.1.210
outgoing_channel = SIP/pstn
country_code = 1
network_type = VPSTN
dial_context = intern
dialler = None
number_formatter1 = s/1?(\d{10})/$1/

****************************************************
Telephony.pl
# Category=Phone

use Telephony_Interface;
use CID_Lookup;
use CID_Log;
use CID_Announce1;
use CID_Server;
use Telephony_xAP;
use xAP_Items;

#@ Intercepts and processes xap events: outgoing.callcomplete for DTMF
#@ and incoming callwithcid for CID

# Note: Telephony_xAP "maps" the extension and line info from the
originating
# xAP source message using the ini vars: phone_line_names and
phone_line_extensions.
# My entries are as follows:
# phone_line_names = gregg_desk\.* => Gregg-Business
## note the use of regex to allow all the lines that can connect to
gregg_desk
## extension to be mapped to Gregg-Business.  That's actually wrong since
## I do call out on the home line.  So, a better example would be
# phone_line_names = gregg_desk.nufone => Gregg-Business, gregg_desk.voipjet
=> Gregg-Business,
#      gregg_desk.home => Home
#
# phone_extension_names = home_phone => Home-Phone
#

# create the meteor xAP listener
# Background: CID.Meteor is the original xAP message schema designed around
the Meteor device
# Because telephony has evolved, a new schema, CTI, will eventually replace
it.
# Telephony xAP attempts to support both as well as does axc (Asterisk xAP
Connector)
# Note: the use of '>:>' as a xAP source filter says to listen for all
messages from all
# endpoints.  It is likely that this will need to change to something like
# '>:gregg_desk.*' to differentiate which extension is ringing. This will
definitely
# be the case once on-/off-hook state tracking is added to Telephony_xAP
$doucga_meteor_item = new xAP_Item('CID.Meteor','>:home_phone.*');

# create the CTI xAP listener
$doucga_cti_item = new xAP_Item('CTI.*','>:home_phone.*');

# create the CTI2 xAP listener
# sigh... CTI2 only exists because the CTI folks have not yet adopted the
# concept of voicemail message counts.  Hopefully, this will change
# and CTI2 can go away.
$vm_cti2_item = new xAP_Item('CTI2.*', '>:vm.default.*');

$extensions_item = new BSC_Item('liming.axc.house:extensions.home_phone');

# create the asterisk telephony item instance
# It is the "glue" that extracts useful info out of the xAP objects related
to
# telephony info.  Note the use of the pound noloop.  I probably ought to
# just support a constructor that handles an array of xAP objects rather
than
# the add_xap_item syntax.
$doucga_tel_item = new Telephony_xAP($doucga_cti_item);
$doucga_tel_item->add_xap_item($doucga_meteor_item); #noloop

# declare the call_type for $ast_tel_item statically since Telephony_xAP
doesn't (yet) support dynamic detection
# call_type is used by the outbound call logs
$doucga_tel_item->call_type('POTS');
$doucga_tel_item->call_type('POTS');

# create the asterisk MWI item instance
$vm_mwi_item = new MWI_xAP($vm_cti2_item);

# create the net callerid item instance - since we can use the call waiting
feature
# which * doesn't support for FXO lines
$ncid_tel_item = new Telephony_Interface($config_parms{callerid_name},
$config_parms{callerid_port}, $config_parms{callerid_type});

# add the hook that will send out the xAP callerid info for ncid
$ncid_tel_item->tie_event('ncid_hook($ncid_tel_item)');

# create the lookup object so that inbound and outbound numbers can be
converted
# add both telephony interface items to it
# Note: it will become important that I add event filters once I setup
multiple
# Telephony_xAP objects that might get the same intercepted inbound call.
Otherwise,
# we'd get multiple announcements and logged entries.  I'll probably
implement
# some mechanism of tracking those calls w/ a timer and just reset the
# object state to something that won't trigger downstream events
$cid_look = new CID_Lookup($doucga_tel_item);
$cid_look -> add($ncid_tel_item); #noloop

# create the logger to get both in and outbound info (note: outbound info
isn't available
#  from the ncid.  That's the reason that I use axc to monitor outbound
calls for the house (pstn)
#  but use ncid for pstn inbound
$cid_logger = new CID_Log($cid_look);


# create the line listener
$line_query_listener = new xAP_Item('CTI.Query');
$line_query_listener->tie_event('line_query_hook($line_query_listener)');
my $line_query_listener_uid;
if ($Reload) {
   $line_query_listener_uid = &xAP::get_xap_uid(xAP::XAP_REAL_DEVICE_NAME,
'housephone');
}

# create the announce object.  Note that I use a variant of the original.
# CID_Announce1 ISA CID_Announce and only includes an override of the parse
function
# that generates the $format1 string.  This is because I don't want to hear
# location info derived from area code.  Instead just speak the number if
not in
# my phone.callerid.list and/or if the callername includes the words "call"
in it
# (which is virtually call cell calls and many businesses)
$cid_announce = new CID_Announce1($cid_look, 'Call from $format1 on
$address');

# tie OSD logic to a cid lookup state change
# This is used to display CID info on my squeezebox.  Note that it uses
# a different format than is spoken--which is quite deliberate
$cid_look->tie_event('osd_hook($cid_look)'); #noloop

$vm_mwi_item->tie_event('mwi_hook($vm_mwi_item)'); #noloop
$extensions_item->tie_event('onoff_hook($extensions_item)'); #noloop

my $doucga_vm_new = $Save{'doucga_vm_new'} if $Reload;
$doucga_vm_new = 0 unless $doucga_vm_new;

sub ncid_hook {
   my ($tel_item) = @_;
   if ($tel_item) {
          my ($headerVars, $block, @data);
         $headerVars->{'class'} = 'CID.Incoming';
         $headerVars->{'source'} =
&xAP::get_xap_mh_source_info(xAP::XAP_REAL_DEVICE_NAME)
              . ':housephone';
         $headerVars->{'uid'} = $line_query_listener_uid;
         push @data, $headerVars;
         $block->{type} = 'Voice';
         if ($tel_item->cid_type eq 'N') {
            $block->{rnnumber} = 'Available';
            $block->{phone} = $tel_item->cid_number;
            if ($tel_item->cid_name) {
               $block->{name} = $tel_item->cid_name;
               $block->{rnname} = 'Available';
            }
         } elsif ($tel_item->cid_type eq 'U') {
            $block->{rnnumber} = 'Unavailable';
            $block->{phone} = '';
         } else {
            $block->{rnnumber} = 'Withheld';
            $block->{phone} = '';
         }
         $block->{linestate} = 'free';
         $block->{network} = 'PSTN';
         push @data, 'CID.Incoming', $block;
         &xAP::sendXapWithHeaderVars(@data);
     
   }
}


sub line_query_hook {
   my ($line_query_obj) = @_;
   if (defined($line_query_obj)) {
      if ($line_query_obj->{'xap-header'}{target} eq '*.*.>') {
         # send out the response
         my ($headerVars, $block, @data);
         $headerVars->{'class'} = 'CTI.Info';
         $headerVars->{'source'} =
&xAP::get_xap_mh_source_info(xAP::XAP_REAL_DEVICE_NAME)
              . ':housephone';
         $headerVars->{'uid'} = $line_query_listener_uid;
         push @data, $headerVars;
         $block->{country} = 1;
         $block->{dialler} = 'none';
         $block->{linestate} = 'free';
         $block->{network} = 'PSTN';
         push @data, 'Line', $block;
         &xAP::sendXapWithHeaderVars(@data);
      }
   }
}

sub mwi_hook {
        my ($mwi_item) = @_;
        if (defined($mwi_item)) {
                my $changed_mwi = $mwi_item->mwi_changed;
                if (defined($changed_mwi)) {
                        # mailbox names are consistent w/ asterisk's
<mailbox>@<vmcontext>
                        #   naming conventions
                        if ($$changed_mwi{mailbox} eq '01@default') {
                                $doucga_vm_new = $$changed_mwi{newmessages};
                                $Save{'doucga_vm_new'} = $doucga_vm_new;
                        }
                }
        }
}

# if new messages exist, display an OSD message every minute
if ($New_Minute && $doucga_vm_new) {
        &display_vm_info('Home');
}

sub display_vm_info {
        my ($username) = @_;
        my $vm_msg = "$username has $doucga_vm_new new vm message(s)";
        # display the message for 15 seconds
        &xAP::send('xPL','slimdev-slimserv.squeezebox',
                'osd.basic' => { command => 'write', delay => 15, text =>
$vm_msg });
}

sub onoff_hook {
        my ($extensions_item) = @_;
        if (defined($extensions_item)) {
                if (lc $extensions_item->state eq OFF) {
                  &xAP::send('xPL','xplmedia-client.basementdesk',
'media.basic' => { command => 'mute', state => 'OFF' });
                } elsif (lc $extensions_item->state eq ON) {
                  &xAP::send('xPL','xplmedia-client.basementdesk',
'media.basic' => { command => 'mute', state => 'ON' });
                }
        } else {
                print "Warning - no tel_item passed to onoff_hook hook";
        }
}

sub osd_hook {
        my ($cid_lookup) = @_;

        if (defined $cid_lookup && ($cid_lookup->state() =~ /^cid/i)) {
            my $osd_format;
            $osd_format = $cid_lookup->cid_name();
            my $display_time;
            # set the default display time to 30 secs (for callers that we
know)
            $display_time = 30;
            if (($osd_format =~ /CALL/i or lc $osd_format =~ /unknown/i) and
$cid_lookup->formated_number()) {
                # any callerid info that is unuseful like "unknown" or "ohio
call" or "cellular call"
                # we'll instead display their phone number--which is *much*
more useful
                $osd_format = $cid_lookup->formated_number();
                # and, display it longer since we may be dialing it back (or
attempting to recall)
                $display_time = 60;
            }
            my $line;
            $line = $cid_lookup->address();
            my $line2 = $osd_format . " on " . $line;
            $osd_format = $osd_format . " on " . $line;
            &display("app=cid priority=high duration=$display_time
$osd_format");
        }
}

Garry


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


Re: Asterisk Integration

by Gregg Liming :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Garry Doucette wrote:

> So I've got the connection sorted out (it was a matter of making sure all
> the passwords and userids were synced including FreePBX). When I call into
> Extension 200 I see the messages about the call and voicemail status in the
> axc.log. The first thing I noticed is when I fire up my xap viewer I'm not
> seeing any messages on the network from axc. Any suggestions for
> troubleshooting would be appreciated.

At a minimum, you should see heartbeats.  You didn't indicate what
"viewer" you are using and whether there is a hub running on the same
system as the viewer.

> Now I'm also working on getting Telephony.pl working in MH.

I would first focus on getting axc's config correct.  Then, move on.

> Here's my setup so far...


> ##
> ## A S T E R I S K   M O N I T O R I N G
> ##
> [asterisk]
> monitored_extensions = 200
> watched_mailboxes = 200@default
> mbox_watch_interval = 300

Your monitored_extensions is init'd to 200 and yet you don't have any
extension labeled as 200--just home_phone.  Stuff has to match.  I would
suggest you invest more time in studying the example config.

> ##
> ## E X T E N S I O N S
> ##
>
> [home_phone]
> channel = SIP/200
> incoming = Telus
> outgoing = spa3000
>
> ##
> ## T R U N K S
> ##

Same comment as above.  Please pay attention to the fact that you must
make things agree.  You specify both Telus and spa3000 as trunks, but
then fully fail to define these as trunks below--instead, just using "pstn".

> [pstn]
> incoming_channel = SIP/192.168.1.210
> outgoing_channel = SIP/pstn
> country_code = 1
> network_type = VPSTN
> dial_context = intern
> dialler = None
> number_formatter1 = s/1?(\d{10})/$1/
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


Parent Message unknown Re: Asterisk Integration

by Gregg Liming :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Garry Doucette wrote:

> Yes it does... 2 NICs
>
> I'm pretty sure, we had the same issue when I was setting up Zoneminder and
> xap. That's what made me think it was worth a shot...

Yep--that now does ring a bell.  So, yes, you will need to set
ipaddress_broadcast as you already did.  Next, you could try copying
lib/xAP/Comm.pm from your zmxap connector to the same location in your
new axc connector.  As it turns out, there are a few additions in the
axc copy (sans support for ipaddress_broadcast) that have now been
incorporated into the svn repo for each.  Since I've not yet created any
new tar balls for zmxap and axc, then you could also grab the latest using:

svn co
https://xapconnectors.svn.sourceforge.net/svnroot/xapconnectors/zmxap zmxap

and

svn co
https://xapconnectors.svn.sourceforge.net/svnroot/xapconnectors/axc axc


Sorry for the line wrap; but, am assuming you can figure that out.  Or,
if you would really prefer to get a new tar ball, then let me know and
I'll expedite posting them.

Let me know if the above does not solve your ability to see at least axc
heartbeat messages in message viewer.  You'll still have to fix your
axc.conf as noted in the previous email message as it has a number of
problems in defining extensions, etc.

Gregg

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


Re: Asterisk Integration

by Garry Doucette :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Gregg

Another success!

I'm seeing messages from axc over the network.

Now I'll work on my other configuration settings.

Thanks for your help!

Garry

-----Original Message-----
From: Gregg Liming [mailto:gregg@...]
Sent: Thursday, July 17, 2008 10:18 AM
To: garry.doucette@...; The main list for the MisterHouse home
automation program
Subject: Re: [mh] Asterisk Integration

Garry Doucette wrote:

> Yes it does... 2 NICs
>
> I'm pretty sure, we had the same issue when I was setting up
> Zoneminder and xap. That's what made me think it was worth a shot...

Yep--that now does ring a bell.  So, yes, you will need to set
ipaddress_broadcast as you already did.  Next, you could try copying
lib/xAP/Comm.pm from your zmxap connector to the same location in your new
axc connector.  As it turns out, there are a few additions in the axc copy
(sans support for ipaddress_broadcast) that have now been incorporated into
the svn repo for each.  Since I've not yet created any new tar balls for
zmxap and axc, then you could also grab the latest using:

svn co
https://xapconnectors.svn.sourceforge.net/svnroot/xapconnectors/zmxap zmxap

and

svn co
https://xapconnectors.svn.sourceforge.net/svnroot/xapconnectors/axc axc


Sorry for the line wrap; but, am assuming you can figure that out.  Or,
if you would really prefer to get a new tar ball, then let me know and
I'll expedite posting them.

Let me know if the above does not solve your ability to see at least axc
heartbeat messages in message viewer.  You'll still have to fix your
axc.conf as noted in the previous email message as it has a number of
problems in defining extensions, etc.

Gregg


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


Image1.png (41K) Download Attachment

Re: Asterisk Integration

by Gregg Liming :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Garry Doucette wrote:

> Another success!
>
> I'm seeing messages from axc over the network.
>
> Now I'll work on my other configuration settings.

Good to hear!  So, once you get axc.conf to a working condition (or at
least closer--as I'd be happy to help then), you should then know (by
looking at your xAP viewer) what the endpoint names are.  That will be
key in setting up telephony.pl or whatever code you want to intercept or
interact w/ axc.  To recap about possible functionality that you can
leverage, axc can be used to:

1) log outbound calls via mh
2) log inbound calls via mh
3) announce callerid via mh
4) use mh to initiate unattended dialout (e.g., some alarm alert causes
you to want to be notified by your cell phone via TTS message)
5) detect on/off hook conditions and using mh, control something in
response (e.g., auto-mute some adjacent music device)

A "not yet (6)" might be to use mh's contact list to initiate dialing.
Technically, there is a "hook" in axc to do this, but I've not
personally been all that excited to expend the effort.  Possibly--if
sufficient interest--then, some work here might occur.

Hope this helps your planning...

Gregg

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


"set_with_timer" not working with insteon

by Michael Easton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi gang,

Is there a new command for setting insteon devices with a timer? "set_with_timer" doesn't work with insteon and wondered if there was something I was missing?
set_with_timer $light ON, (2*60); ## Does work if light is an insteon
 device
 $light->set("ON"); ## Syntax works for Insteon

 The "set_with_timer" appears to reside in Generic_Item and wondered if that needs to be updated?

Thanks
Michael



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


Re: "set_with_timer" not working with insteon

by Gregg Liming :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Michael Easton wrote:

> Is there a new command for setting insteon devices with a timer?
> "set_with_timer" doesn't work with insteon and wondered if there was
> something I was missing?

I just added support as Generic_Item's implementation (relying on
setting setby equal to $self) fundamentally breaks Insteon_Device.

So, do a svn update and all should be well.

Gregg

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


Re: "set_with_timer" not working with insteon

by Dan Uribe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ah you just beat me to it, been questioning/checking everything before
posting. I'll second the issue in the current SVN.  
 
Here's the debug output from my test if it helps.  First a normal set on
off then a set_with_timer event.  The timer event seems to fire fine but
either the device or PLM are filtering(?) the command from sending.
 
07/17/08 07:52:10 PM [Insteon_Device] $Kitchen_Table::set(off,
Insteon_Link=HASH(0xc8223ac))
07/17/08 07:51:10 PM [Insteon_Device] $Kitchen_Table::set(on,
Insteon_Link=HASH(0xc8223ac))
07/17/08 07:51:10 PM Running: Test function B
07/17/08 07:51:06 PM [Insteon_Device] received command/state acknowledge
from $Kitchen_Table: off and data: 00
07/17/08 07:51:06 PM [Insteon_PLM] Processing message for $Kitchen_Table

07/17/08 07:51:06 PM [Insteon_PLM] Parsing serial data:
025003de860dff3a2b1300
07/17/08 07:51:05 PM [Insteon_PLM] Parsing serial data:
026203de860f130006
07/17/08 07:51:05 PM [Insteon_Device] $Kitchen_Table::set(off, )
07/17/08 07:51:05 PM Running: Test function A
07/17/08 07:51:02 PM [Insteon_Device] received command/state acknowledge
from $Kitchen_Table: on and data: ff
07/17/08 07:51:02 PM [Insteon_PLM] Processing message for $Kitchen_Table

07/17/08 07:51:02 PM [Insteon_PLM] Parsing serial data:
025003de860dff3a2b11ff
07/17/08 07:51:02 PM [Insteon_PLM] Parsing serial data:
026203de860f11ff06
07/17/08 07:51:02 PM [Insteon_Device] $Kitchen_Table::set(on, )
07/17/08 07:51:02 PM Running: Test function A

TIA,
Dan.

________________________________

From: misterhouse-users-bounces@...
[mailto:misterhouse-users-bounces@...] On Behalf Of
Michael Easton
Sent: Thursday, July 17, 2008 6:16 PM
To: The main list for the MisterHouse home automation program
Subject: [mh] "set_with_timer" not working with insteon


Hi gang,

Is there a new command for setting insteon devices with a timer?
"set_with_timer" doesn't work with insteon and wondered if there was
something I was missing?
set_with_timer $light ON, (2*60); ## Does work if light is an insteon
 device
 $light->set("ON"); ## Syntax works for Insteon

 The "set_with_timer" appears to reside in Generic_Item and wondered if
that needs to be updated?

Thanks
Michael

       


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


Re: "set_with_timer" not working with insteon

by Dan Uribe :: Rate this Message: