Andrew Kohlsmith
2004-Jun-01 12:33 UTC
[Asterisk-Users] Zap and call pickup -- it don't work.
The problem: T100P connected to an Adit600. Channel 1-16 are FXS, 17-24 FXO. I have Zap/24 in callgroup 3 and Zap/1-16 in pickupgroup 3. When a call comes in on Zap/24 I cannot pick it up with *8 from Zap/1-16. *CLI> show version Asterisk CVS-04/27/04-23:48:08 built by root@tuck on a i686 running Linux The zapata.conf and extensions.conf are located here: http://lists.digium.com/pipermail/asterisk-users/2004-May/048527.html (I've since changed channel 1-16's pickupgroup to just 3, it didn't help.) What I see in *'s debug log: Jun 1 15:21:13 DEBUG[213006]: SIMPLE DIAL (NO URL) Jun 1 15:21:13 DEBUG[213006]: Received AST_CONTROL_PROGRESS on Zap/24-1 Jun 1 15:21:16 DEBUG[229391]: DTMF digit: * on Zap/2-1 Jun 1 15:21:16 DEBUG[229391]: DTMF digit: 8 on Zap/2-1 Jun 1 15:21:16 DEBUG[229391]: Enabled echo cancellation on channel 2 Jun 1 15:21:16 DEBUG[229391]: No call pickup possible... Jun 1 15:21:16 DEBUG[229391]: No call pickup possible... Jun 1 15:21:17 DEBUG[213006]: Exception on 35, channel 24 Jun 1 15:21:17 DEBUG[213006]: Got event Ring/Answered(2) on channel 24 (index 0) Jun 1 15:21:23 DEBUG[213006]: Exception on 35, channel 24 Jun 1 15:21:23 DEBUG[213006]: Got event Ring/Answered(2) on channel 24 (index 0) Jun 1 15:21:29 DEBUG[213006]: Exception on 35, channel 24 Jun 1 15:21:29 DEBUG[213006]: Got event Ring/Answered(2) on channel 24 (index 0) Jun 1 15:21:29 DEBUG[229391]: Hangup: channel: 2 index = 0, normal = 13, callwait = -1, thirdcall = -1 Jun 1 15:21:29 DEBUG[229391]: disabled echo cancellation on channel 2 Jun 1 15:21:29 DEBUG[229391]: Set option TDD MODE, value: OFF(0) on Zap/2-1 Jun 1 15:21:29 DEBUG[229391]: Updated conferencing on 2, with 0 conference users Jun 1 15:21:34 DEBUG[213006]: We're hanging up IAX2[ak_home]/4 now... Jun 1 15:21:37 DEBUG[213006]: Hangup: channel: 24 index = 0, normal = 35, callwait = -1, thirdcall = -1 Jun 1 15:21:37 DEBUG[213006]: disabled echo cancellation on channel 24 Jun 1 15:21:37 DEBUG[213006]: Set option TDD MODE, value: OFF(0) on Zap/24-1 Jun 1 15:21:37 DEBUG[213006]: Updated conferencing on 24, with 0 conference users Now you'll see the "No call pickup possible" -- that comes from both res_parking's ast_call_pickup() and also from chan_zap. Basically you get that if the channel you're trying to pick up is NOT in AST_STATE_RING or AST_STATE_RINGING. I modified chan_zap.c so that "zap show channels" gives me the state of the channel as well. On to the main event: the CLI log when run as "asterisk -vvvvgc": Asterisk Ready. -- Starting simple switch on 'Zap/24-1' -- Executing NoOp("Zap/24-1", "01062004-15:21:12 "BENSHAW CAN CON" <2915794>") in new stack -- Executing System("Zap/24-1", "/usr/bin/perl /usr/local/scripts/astbot.pl '"BENSHAW CAN CON" <2915794>'") in new stack -- Executing Dial("Zap/24-1", "IAX2/benshaw@ak_home/s|20|Ttr") in new stack -- Called benshaw@ak_home/s -- Call accepted by 209.47.196.34 (format ILBC) -- Format for call is ILBC -- IAX2[ak_home]/4 is ringing -- Starting simple switch on 'Zap/2-1' zap show channel 24 Channel: 24 State: 4 (AST_STATE_RING) File Descriptor: 35 Span: 1 Extension: Context: in_2914574 Caller ID string: Destroy: 0 Signalling Type: FXS Kewlstart Owner: Zap/24-1 Real: Zap/24-1 Callwait: <None> Threeway: <None> Confno: -1 Propagated Conference: -1 Real in conference: 0 DSP: yes Relax DTMF: no Dialing/CallwaitCAS: 0/0 Default law: ulaw Fax Handled: no Pulse phone: no Echo Cancellation: 128 taps, currently OFF Actual Confinfo: Num/0, Mode/0x0000 Actual Confmute: No Actual Hookstate: Offhook *CLI> zap show channel 2 Channel: 2 State: 1 (AST_STATE_RESERVED) File Descriptor: 13 Span: 1 Extension: Context: fxs Caller ID string: "Benshaw VOIP" <(519) 291-5112> Destroy: 0 Signalling Type: FXO Kewlstart Owner: Zap/2-1 Real: Zap/2-1 Callwait: <None> Threeway: <None> Confno: -1 Propagated Conference: -1 Real in conference: 0 DSP: yes Relax DTMF: no Dialing/CallwaitCAS: 0/0 Default law: ulaw Fax Handled: no Pulse phone: no Echo Cancellation: 32 taps unless TDM bridged, currently ON Actual Confinfo: Num/0, Mode/0x0000 Actual Confmute: No Actual Hookstate: Offhook -- Hungup 'Zap/2-1' -- Nobody picked up in 20000 ms -- Hungup 'IAX2[ak_home]/4' -- Executing Hangup("Zap/24-1", "") in new stack == Spawn extension (in_2914574, h, 1) exited non-zero on 'Zap/24-1' -- Hungup 'Zap/24-1' As you can see, Zap/24-1 is *clearly* in AST_STATE_RING. The only weirdness I see is that the hookstate is "off hook" -- I did NOT Answer() the call, and my * box at home did not answer the call. My extensions.conf file looks like this: [in_1234567] exten => s,1,NoOp(${DATETIME} ${CALLERID}) exten => s,2,System(/usr/bin/perl /usr/local/scripts/astbot.pl '${CALLERID}') exten => s,3,Dial(IAX2/benshaw@ak_home/s,20,Ttr) ;exten => s,4,Dial(${FXOTRUNK}/${CELL},,Ttr) exten => s,5,Hangup exten => h,1,Hangup exten => t,1,Hangup I Dial() my home box, and it rings the FXS interfaces connected to it. Since there's nobody home, there's nobody to answer. My cat isn't that well trained yet. :-) Can anyone *please* help? I'm tearing out my hair here, this *should* work! Regards, Andrew
Andrew Kohlsmith
2004-Jun-01 14:07 UTC
[Asterisk-Users] Zap and call pickup -- it don't work.
On Tuesday 01 June 2004 15:33, Andrew Kohlsmith wrote:> The problem: T100P connected to an Adit600. Channel 1-16 are FXS, 17-24 > FXO. I have Zap/24 in callgroup 3 and Zap/1-16 in pickupgroup 3. When a > call comes in on Zap/24 I cannot pick it up with *8 from Zap/1-16.Some more debugging info: - upgraded to CVS HEAD as of today around 4pm EDT - mangled res_parking to give some more debuggery, in which I found something interesting when working with James: (again, incoming call is ringing Zap/24-1, I pick up Zap/2-1 and dial *8) Jun 1 16:41:55 DEBUG[213006]: Exception on 35, channel 24 Jun 1 16:41:55 DEBUG[213006]: Got event Ring/Answered(2) on channel 24 (index 0) Jun 1 16:41:58 DEBUG[229391]: DTMF digit: * on Zap/2-1 Jun 1 16:41:58 DEBUG[229391]: DTMF digit: 8 on Zap/2-1 Jun 1 16:41:58 DEBUG[229391]: Enabled echo cancellation on channel 2 Jun 1 16:41:58 DEBUG[229391]: ast_pickup_call(Zap/2-1): Jun 1 16:41:58 DEBUG[229391]: cur->name: Zap/2-1 Jun 1 16:41:58 DEBUG[229391]: cur->pbx: false Jun 1 16:41:58 DEBUG[229391]: cur->callgroup: 2 Jun 1 16:41:58 DEBUG[229391]: chan->pickupgroup: 2 Jun 1 16:41:58 DEBUG[229391]: chan->pickupgroup & cur->callgroup: True Jun 1 16:41:58 DEBUG[229391]: cur->state: 1 Jun 1 16:41:58 DEBUG[229391]: ast_pickup_call(Zap/2-1): Jun 1 16:41:58 DEBUG[229391]: cur->name: IAX2[ak_home]/3 Jun 1 16:41:58 DEBUG[229391]: cur->pbx: false Jun 1 16:41:58 DEBUG[229391]: cur->callgroup: 0 Jun 1 16:41:58 DEBUG[229391]: chan->pickupgroup: 2 Jun 1 16:41:58 DEBUG[229391]: chan->pickupgroup & cur->callgroup: False Jun 1 16:41:58 DEBUG[229391]: cur->state: 5 Jun 1 16:41:58 DEBUG[229391]: ast_pickup_call(Zap/2-1): Jun 1 16:41:58 DEBUG[229391]: cur->name: Zap/24-1 Jun 1 16:41:58 DEBUG[229391]: cur->pbx: true Jun 1 16:41:58 DEBUG[229391]: cur->callgroup: 0 Jun 1 16:41:58 DEBUG[229391]: chan->pickupgroup: 2 Jun 1 16:41:58 DEBUG[229391]: chan->pickupgroup & cur->callgroup: False Jun 1 16:41:58 DEBUG[229391]: cur->state: 4 Jun 1 16:41:58 DEBUG[229391]: No call pickup possible... Jun 1 16:41:58 DEBUG[229391]: No call pickup possible... Now I see two immediate problems: Problem #1. The call groups and pickup groups are all wrong. My zapata.conf looks like this: [channels] context=fxs ;switchtype=national ;pridialplan=national ;overlapdial=no signalling=fxo_ks usecallerid=yes callwaiting=yes callwaitingcallerid=yes rxwink=300 ; Atlas seems to use long (250ms) winks hidecallerid=no threewaycalling=yes transfer=yes cancallforward=no callreturn=no ;mailbox=1234 echocancel=32 echocancelwhenbridged=no echotraining=yes relaxdtmf=no ;rxgain=1.0 ;txgain=0.75 group=1 callgroup=1 pickupgroup=1 immediate=no callerid="Benshaw VOIP" <(xxx) xxx-xxxx> channel => 1-16 context=fxo callerid=asreceived signalling=fxs_ks transfer=no group=2 callgroup=2 pickupgroup=2 echocancel=128 echocancelwhenbridged=yes echotraining=yes callprogress=no channel => 17-23 context=in_1234567 callerid=asreceived group=3 callgroup=1 callprogress=no channel => 24 So why the hell is Zap/24-1 in callgroup 0 and Zap/2-1 in pickupgroup 2? I realize they're bit fields but it doesn't make sense since in zapata.conf 24's callgroup == 1-16's pickupgroup... the bitmaps should be the same. Problem #2 is that Zap/24-1's pbx flag is set. I will never be able to pick it up, even if its callgroup matches the pickupgroup of the channel I'm using. Now in my extensions.conf, context in_1234567 has an 's' extension -- is this causing pbx to get set? If so, how do I work around this? I want to have Zap/24 ring my house but be able to pick it up at work without resorting to somehow logging in to asterisk. I don't want Zap/24 to ring at work, I want to pick it up if I see the call is something I want to take while at work. Any ideas? Regards, Andrew