Hi there dear users and dear developers of Asterisk!
I've got a maybe strange idea, let's see if you laugh or think it's reasonable J
I'm using Asterisk with Digium TDM800P cards with 24 lines (as an answering
machine).
Each analog line can be reached through a phonenumber, since they are each
connected to my telephone provider. Yes expensive I know J
The challenge:
I'd like to somehow verify that my 1) TDM800P cards and 2) the analog lines,
and 3) my operator is alive and working, and I have an Idea which I wonder if
will/could work.
My first idea was to ask the zap-driver if it could detect if the line was ok,
but no function existed to do that, what I could find. Anyone knows about one?
My second idea, was to try calling simply, to know if things were ok. But, I
couldn't just call any number, I had to know the number was in use, and not
disturbing anyone.
So, I called myself, or I called another of my phonelines.
So,
I'd like to use the asterisk manager interface in java to originate a call from
one ZAP-channel, calling out to my telephone provider,
And then they will direct the call back to my, but into another ZAP-channel
(since I'm calling that channel's number).
So: I'm making ZAP/1 calling out to no 323121321 - telephone company, Ok:
323121321 belongs to this guy - redirecting me to my ZAP/2 channel, which
answers the call.
Then I have a connection, and ZAP/2 will answer and do some DTMF.
My first ZAP/1 is run through my java program, and I'd like to listen for
certain DTMF-tones, to know I have a working circuit.
The goal for all of this, is to verify things are working, so my provider is
not down, or one of my ZAP-lines are dead.
So far, I've tried calling and got some half-success, but not sure what is
going on doing all the right way.
For ex: why am I calling with Zap1, to Zap 3, and then Zap 7 is answering? 3
channels used for one outgoing and one incoming call? Something must be very
wrong J
Please educate me, dear experts.
Input?
Sincerely,
Johan Sandgren
www.svep.sehttp://www.svep.se, [EMAIL PROTECTED]
Frosty Sweden but with some sunshine today !! J
My code and settings below, for information.
=JAVA CODE (extract)
OriginateAction originateAction = new OriginateAction();
ManagerResponse originateResponse = null;
originateAction.setChannel(ZAP/1);
originateAction.setContext(Outgoing);
originateAction.setExten(201); // maps to
ZAP/7 through external phonecompany PBX
originateAction.setPriority(new Integer(1));
originateAction.setTimeout(new Long(15*1000));
// xml-milliseconds
originateAction.setAsync(false);
== extensions.conf (extract)
[Incoming]
exten = s,1,Set(DYNAMIC_FEATURES=hangup)
exten = s,2,Agi(agi://localhost/answer.agi)
[Outgoing]
exten = _X.,1,Set(DYNAMIC_FEATURES=hangupfeature)
exten = _X.,n,Dial(Zap/3/${EXTEN}
== Asterisk response:
AGI Debugging Enabled
== Parsing '/etc/asterisk/manager.conf': Found
== Manager 'stt' logged on from 127.0.0.1
Channel Zap/1-1 was answered.
-- Executing [EMAIL PROTECTED]:1] Set(Zap/1-1,
DYNAMIC_FEATURES=hangupfeature) in new stack
-- Executing [EMAIL PROTECTED]:2] Dial(Zap/1-1, Zap/3/201) in new stack
-- Called 3/201
-- Starting simple switch on 'Zap/7-1'
-- Zap/3-1 answered Zap/1-1
[Feb 14 13:02:33] WARNING[26260]: chan_zap.c:6499 ss_thread: CallerID returned
with error on channel 'Zap/7-1'
-- Executing [EMAIL PROTECTED]:1] Set(Zap/7-1, DYNAMIC_FEATURES=hangup)
in new stack
-- Executing [EMAIL PROTECTED]:2] AGI(Zap/7-1,
agi://localhost/answer.agi) in new stack
AGI Tx agi_network: yes
AGI Tx agi_network_script: answer.agi
AGI Tx agi_request: agi://localhost/answer.agi
AGI Tx agi_channel: Zap/7-1
AGI Tx agi_language: en
AGI Tx agi_type: Zap
AGI Tx agi_uniqueid: 1202990552.2
AGI Tx agi_callerid: unknown
AGI Tx agi_calleridname: unknown
AGI Tx agi_callingpres: 0
AGI Tx agi_callingani2: 0
AGI Tx agi_callington: 0
AGI Tx agi_callingtns: 0
AGI Tx agi_dnid: unknown
AGI Tx agi_rdnis: unknown
AGI Tx agi_context: Incoming
AGI Tx agi_extension: s
AGI Tx agi_priority: 2
AGI Tx agi_enhanced: 0.0
AGI Tx agi_accountcode:
AGI Tx
AGI Rx ANSWER
AGI Tx 200 result=0
AGI Rx CHANNEL STATUS
AGI Tx 200 result=6
AGI Rx WAIT FOR DIGIT 1
== Manager 'testmanager' logged off from 127.0.0.1
AGI Tx 200 result=0
AGI Rx CHANNEL STATUS
AGI Tx 200 result=6
AGI Rx WAIT FOR DIGIT 1
AGI Tx 200 result=0
== Spawn extension (Incoming, s, 2) exited non-zero on 'Zap/7-1'
-- Hungup 'Zap/7-1'
= Asterisk log
__
Johan Sandgren
Svep Design Center AB (www.svep.sehttp://www.svep.se)
St. Lars väg 42A, SE-222 70 Lund
Phone: 046-19 27 22
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
asterisk-users