The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: Re: axc v0.6



...apologies in advance... this "simple" reply is somewhat
long.

Quoting James Traynor (2/21/07 4:48 PM):
> All sounds great!

... not so great :(  I introduced an error into v0.7 that I didn't catch
until answering this.  So, now there's v0.7a.  Hopefully, that's the
last of the oops.

> Could you give an example messenger.event message that would dial a
> number and say hello? and what does it need targeting to?

Just like xAP Four, there is no targeting as axc (currently) listens to
all messenger.event messages and ignores the ones that don't start w/
"axc-" in the body.  Unlike four, it won't respond (yet) and
never will
if it doesn't understand the grammar.  This means that I currently have
four set to not echo the "I don't understand messages".  So, back
to
your question.  Here is an example message:

xap-header
{
v=12
hop=1
uid=FF111300
class=messenger.event
source=mi4.jabber.Jabber
}
Message.Receive
{
from=g.liming@xxxxxxx
body=axc-notify 18005551212 main alarm is tripped
}

Note that this is a slightly modified message directly from using xAP
Jabber to test.  The notable part that axc cares about is in the body
attribute.  It uses a syntax along the following:

body=<asterisk context> <numbertodial> <message>

Note that <asterisk context> must begin with "axc-".  You
can make
<message> be as long as you want (subject to not overflowing the xAP
packet) and w/ whatever characters you want (that are allowed by xAP).
Do realize that some text, numbers, dates, etc. do occasionally have
problems w/ TTS conversion.  That's where the latest mods to axc for
pronunciation come into play (more on that later).  Eventually, number
lists for multiple number tries and/or "fancier" multi-dial
capability
will be integrated.

Next, you'll have to mod the axc.conf so that axc knows the additional
required info.  For example, from the latest axc.conf.sample:

[axc-notify]
# optional; context will match the section title if not overriden
context=axc-notify
# optional; callerid that will be added to the line
cidnum=1234567890
# channel is required; it specifies the channel to be dialed
channel=IAX2/voicepulse01
# optional; timeout is time in seconds that the dial will be attempted
#    before hangup unless answered; default is 20
timeout=20


Note that the only entry that you absolutely must have is channel.
However, if you use a VoIP provider, then you probably want to define a
(proper and legal) cidnum so that the callee thinks that it's coming
from you (unless you're using this for some other purposes that I don't
want to know about).  If it's a "normal" PSTN line, then you
probably
can't change/fake your cidnum anyway and this won't matter.  Likewise,
timeout will guard against continuous ringing.  Eventually, I'll add
more support to possibly guard against no answers and allow rings to
other numbers or feedback to the sender that the call could not be
completed, etc. since I do intend to build this into a semi-emergency
"out-of-band" alert notification capability for my own uses.

Lastly, you'll have to mod your asterisk dial plan to do something w/
the message that axc parses out and "hands to it".  Note that the
speak
macro below and the globals is identical to the example for IVR (in the
wiki).  So, if you already have it, then you only care about defining
the context that is labeled "axc-notify".  Note that you can
change it
and then only have to change your axc.conf to match it up--allowing a
difference between the messenger.event body's "context" and the
real one
.  My suggestion is to keep things simple at first.

I will probably suggest changes later to the "sample" axc-notify
context
to allow for things like pressing the * button to force it to repeat.
Also, it could be modified to allow the callee (which might be you) to
enter a PIN and switch into the IVR attendant (in case you need to
remedy whatever the notice/alert is about).

Add the following lines (after the dashed line) to your
/etc/asterisk/extensions.ael or modify your dial plan in a comparable
way.  If you use TrixBox and rely on flite for tts, then change the TTS
global property to flite (not cepstral).

---------------------------
globals {
TTS=cepstral;
};

macro speak(text,escapedigits) {
NoOp(TTS=${TTS});
if ("${TTS}" == "cepstral") {
agi(cepstral.agi,${text},${escapedigits});
} else if ("${TTS}" == "festival") {
Festival(${text},${escapedigits});
} else if ("${TTS}" == "swift") {
Swift("${text});
};
};

context axc-notify {
s => {
if ("${xapresponse}" != "") {
&speak(${xapresponse},"");
set(xapresponse="");
};
Hangup();
};
};




xAP_Automation Main Index | xAP_Automation Thread Index | xAP_Automation Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.