Hi Ike and thanks for all of your help!
To start with I changed tip ring and got this when I called in.
Called in number is: 0123456789
== Starting post polarity CID detection on channel 4
[Apr 7 20:48:49] DEBUG[29893]: dsp.c:1682 ast_dsp_set_busy_pattern: dsp busy pattern set to 0,0
– Starting simple switch on ‘Zap/4-1’
[Apr 7 20:48:49] DEBUG[30014]: chan_zap.c:6109 ss_thread: Receiving DTMF cid on channel Zap/4-1
[Apr 7 20:48:50] DEBUG[30014]: chan_zap.c:6127 ss_thread: CID got digit ‘D’
[Apr 7 20:48:50] DEBUG[30014]: chan_zap.c:6127 ss_thread: CID got digit ‘0’
[Apr 7 20:48:50] DEBUG[30014]: chan_zap.c:6127 ss_thread: CID got digit ‘1’
[Apr 7 20:48:50] DEBUG[30014]: chan_zap.c:6127 ss_thread: CID got digit ‘2’
[Apr 7 20:48:51] DEBUG[30014]: chan_zap.c:6127 ss_thread: CID got digit ‘3’
[Apr 7 20:48:51] DEBUG[30014]: chan_zap.c:6127 ss_thread: CID got digit ‘4’
[Apr 7 20:48:51] DEBUG[30014]: chan_zap.c:6127 ss_thread: CID got digit ‘6’
[Apr 7 20:48:51] DEBUG[30014]: chan_zap.c:6127 ss_thread: CID got digit ‘5’
[Apr 7 20:48:51] DEBUG[30014]: chan_zap.c:6127 ss_thread: CID got digit ‘7’
[Apr 7 20:48:51] DEBUG[30014]: chan_zap.c:6127 ss_thread: CID got digit ‘8’
[Apr 7 20:48:52] DEBUG[30014]: chan_zap.c:4489 zt_handle_event: Ignoring Polarity switch to IDLE on channel 4, state 9
[Apr 7 20:48:52] DEBUG[30014]: chan_zap.c:4492 zt_handle_event: Polarity Reversal event occured - DEBUG 2: channel 4, state 9, pol= 0, aonp= 1, honp= 0, pdelay= 600, tv= 708321912
[Apr 7 20:48:52] DEBUG[30014]: chan_zap.c:6127 ss_thread: CID got digit ‘9’
[Apr 7 20:48:52] DEBUG[30014]: chan_zap.c:6127 ss_thread: CID got digit ‘C’
[Apr 7 20:48:53] DEBUG[30014]: chan_zap.c:6138 ss_thread: CID got string ‘D0123465789C’
[Apr 7 20:48:53] DEBUG[30014]: chan_zap.c:6140 ss_thread: CID is ‘0123465789’, flags -1209907406
– Executing [s@pts_incoming:1] Set(“Zap/4-1”, “CALLERID(all)=”" <0123465789>") in new stack
As you can see, it could not get digit 5 and 6 in correct order!
Next in <zapata.conf> file I added:
answeronpolarityswitch=yes ; Default = no
hanguponpolarityswitch=yes ; with only this it ended the call when the called answered the phone (SIP=>ZAP)!
I restarted * and called in again.
Connected to Asterisk 1.4.17 currently running on asterisk (pid = 3048)
Verbosity was 3 and is now 10
== Starting post polarity CID detection on channel 4
[Apr 7 20:50:47] DEBUG[30117]: dsp.c:1682 ast_dsp_set_busy_pattern: dsp busy pattern set to 0,0
– Starting simple switch on ‘Zap/4-1’
[Apr 7 20:50:47] DEBUG[30151]: chan_zap.c:6109 ss_thread: Receiving DTMF cid on channel Zap/4-1
[Apr 7 20:50:47] DEBUG[30151]: chan_zap.c:6127 ss_thread: CID got digit ‘D’
[Apr 7 20:50:48] DEBUG[30151]: chan_zap.c:6127 ss_thread: CID got digit ‘0’
[Apr 7 20:50:48] DEBUG[30151]: chan_zap.c:6127 ss_thread: CID got digit ‘1’
[Apr 7 20:50:48] DEBUG[30151]: chan_zap.c:6127 ss_thread: CID got digit ‘2’
[Apr 7 20:50:48] DEBUG[30151]: chan_zap.c:6127 ss_thread: CID got digit ‘3’
[Apr 7 20:50:48] DEBUG[30151]: chan_zap.c:6127 ss_thread: CID got digit ‘4’
[Apr 7 20:50:48] DEBUG[30151]: chan_zap.c:6127 ss_thread: CID got digit ‘5’
[Apr 7 20:50:49] DEBUG[30151]: chan_zap.c:6127 ss_thread: CID got digit ‘6’
[Apr 7 20:50:49] DEBUG[30151]: chan_zap.c:6127 ss_thread: CID got digit ‘7’
[Apr 7 20:50:49] DEBUG[30151]: chan_zap.c:6127 ss_thread: CID got digit ‘8’
[Apr 7 20:50:49] DEBUG[30151]: chan_zap.c:4489 zt_handle_event: Ignoring Polarity switch to IDLE on channel 4, state 9
[Apr 7 20:50:49] DEBUG[30151]: chan_zap.c:4492 zt_handle_event: Polarity Reversal event occured - DEBUG 2: channel 4, state 9, pol= 0, aonp= 1, honp= 1, pdelay= 600, tv= 708439410
[Apr 7 20:50:49] DEBUG[30151]: chan_zap.c:6127 ss_thread: CID got digit ‘9’
[Apr 7 20:50:49] DEBUG[30151]: chan_zap.c:6127 ss_thread: CID got digit ‘C’
[Apr 7 20:50:51] DEBUG[30151]: chan_zap.c:6138 ss_thread: CID got string ‘D0123456789C’
[Apr 7 20:50:51] DEBUG[30151]: chan_zap.c:6140 ss_thread: CID is ‘0123456789’, flags -1210017998
– Executing [s@pts_incoming:1] Set(“Zap/4-1”, “CALLERID(all)=”" <0123456789>") in new stack
Now it looks like it gives me the correct number of digits and in correct order.
But stil the “Polarity Reversal event” is there!
When I called out I could see this:
-- Executing [0123456789@internal-call-profile-pre:1] NoOp("SIP/5507-082157d8", "AccountCode:call-in-house - HostIP:192.168.0.10 - Exten:0123456789 - SipDomain:192.168.0.10") in new stack
-- Executing [0123456789@internal-call-profile-pre:2] GotoIf("SIP/5507-082157d8", "0?call-in-house-call-profile|0123456789|1") in new stack
-- Executing [0123456789@internal-call-profile-pre:3] GotoIf("SIP/5507-082157d8", "1?call-in-house-call-profile|0123456789|1") in new stack
-- Goto (call-in-house-call-profile,0123456789,1)
-- Executing [0123456789@call-in-house-call-profile:1] NoOp("SIP/5507-082157d8", "Out Ovrigtid kvallar natter - PTS!") in new stack
-- Executing [0123456789@call-in-house-call-profile:2] Macro("SIP/5507-082157d8", "zapout") in new stack
-- Executing [s@macro-zapout:1] NoOp("SIP/5507-082157d8", "zapout - ZAP/4/0123456789") in new stack
[Apr 7 20:51:31] DEBUG[30192]: app_macro.c:337 _macro_exec: Executed application: NoOp
– Executing [s@macro-zapout:2] Festival(“SIP/5507-082157d8”, “Normal Phone Line”) in new stack
== Parsing ‘/etc/asterisk/festival.conf’: Found
[Apr 7 20:51:31] DEBUG[30192]: app_festival.c:378 festival_exec: Text passed to festival server : Normal Phone Line
[Apr 7 20:51:31] DEBUG[30192]: app_festival.c:462 festival_exec: Passing text to festival…
[Apr 7 20:51:31] DEBUG[30192]: app_festival.c:481 festival_exec: Passing data to channel…
[Apr 7 20:51:31] DEBUG[30192]: app_festival.c:506 festival_exec: Festival WV command
[Apr 7 20:51:33] DEBUG[30192]: app_festival.c:252 send_waveform_to_channel: Last frame
[Apr 7 20:51:33] DEBUG[30192]: app_macro.c:337 _macro_exec: Executed application: Festival
– Executing [s@macro-zapout:3] Dial(“SIP/5507-082157d8”, “ZAP/4/0123456789|20|tTr”) in new stack
[Apr 7 20:51:33] DEBUG[30192]: dsp.c:1682 ast_dsp_set_busy_pattern: dsp busy pattern set to 0,0
[Apr 7 20:51:33] DEBUG[30192]: chan_zap.c:1954 zt_call: Dialing ‘0123456789’
[Apr 7 20:51:33] DEBUG[30192]: chan_zap.c:2030 zt_call: Deferring dialing…
– Called 4/0123456789
[Apr 7 20:51:36] DEBUG[30192]: chan_zap.c:1457 zt_train_ec: Engaged echo training on channel 4
[Apr 7 20:51:38] DEBUG[30192]: chan_zap.c:1420 zt_enable_ec: Echo cancellation already on
and when I answered the call this comes up:
[Apr 7 20:51:44] DEBUG[30192]: chan_zap.c:4463 zt_handle_event: Answering on polarity switch!
[Apr 7 20:51:44] DEBUG[30192]: chan_zap.c:4478 zt_handle_event: Polarity Reversal event occured - DEBUG 1: channel 4, state 6, pol= 1, aonp= 1, honp= 1, pdelay= 600, tv= 0
[Apr 7 20:51:44] DEBUG[30192]: chan_zap.c:4485 zt_handle_event: Polarity Reversal detected but NOT hanging up (too close to answer event) on channel 4, state 6
[Apr 7 20:51:44] DEBUG[30192]: chan_zap.c:4492 zt_handle_event: Polarity Reversal event occured - DEBUG 2: channel 4, state 6, pol= 1, aonp= 1, honp= 1, pdelay= 600, tv= 0
– Zap/4-1 answered SIP/5507-082157d8
[Apr 7 20:51:53] DEBUG[30192]: chan_zap.c:4478 zt_handle_event: Polarity Reversal event occured - DEBUG 1: channel 4, state 6, pol= 1, aonp= 1, honp= 1, pdelay= 600, tv= 9408
[Apr 7 20:51:53] DEBUG[30192]: chan_zap.c:4481 zt_handle_event: Polarity Reversal detected and now Hanging up on channel 4
[Apr 7 20:51:53] DEBUG[30192]: chan_zap.c:4492 zt_handle_event: Polarity Reversal event occured - DEBUG 2: channel 4, state 6, pol= 0, aonp= 1, honp= 1, pdelay= 600, tv= 9408
– Hungup ‘Zap/4-1’
== Spawn extension (macro-zapout, s, 3) exited non-zero on ‘SIP/5507-0821e008’ in macro ‘zapout’
== Spawn extension (macro-zapout, s, 3) exited non-zero on ‘SIP/5507-0821e008’
== Starting post polarity CID detection on channel 4
[Apr 7 21:30:04] DEBUG[30307]: dsp.c:1682 ast_dsp_set_busy_pattern: dsp busy pattern set to 0,0
– Starting simple switch on ‘Zap/4-1’
[Apr 7 21:30:04] DEBUG[32298]: chan_zap.c:6109 ss_thread: Receiving DTMF cid on channel Zap/4-1
[Apr 7 21:30:07] WARNING[32298]: chan_zap.c:6117 ss_thread: DTMFCID timed out waiting for ring. Exiting simple switch
– Hungup ‘Zap/4-1’
Several “Polarity Reversal” lines!!!
I change the tip and ring back, but with the same result!
// Nypon