Zap Channel Problem

Hi to all,

Is any body knows how to find whether zap channel is busy or not. I tried out many things. But I don’t get success.

If any body know or previously done that then please tell me in details i.e. about extensions.conf or other files.

My current extensions.conf file is as follows,

[quote][MyContext]
exten => s,1,GotoIf($["${DIALSTATUS}" = “BUSY”]?4:2)
exten => s,2,AGI(Somefile.php)
exten => s,3,Hangup()
exten => s,4,AGI(OnBusy.php)
exten => s,5,Hangup()[/quote]

My current zaptel-channel.conf file as follows,

[quote];;; line="6 WCTDM/0/5 FXSKS"
signalling=fxs_ks
callerid=asreceived
group=0
channel => 5
context=MyContext[/quote]

In above extensions.conf file you see that on second line I used DIALSTATUS Variable but ianplain told me that in past post, variable DIALSTATUS is define when call ended. So, I think above idea that I used is wrong or missing something in that. So, Please suggest me nice solution for how to detect channel busy or not.

Please Share your valuable knowledge.

Regards,
Deepen

you can use dialstatus variable like this

exten => s,1,Dial(${ZAP/1/123456,,T) exten => s,n,Goto(s-${DIALSTATUS},1) exten => s-NOANSWER,1,Hangup exten => s-CONGESTION,1,Congestion exten => s-CANCEL,1,Hangup exten => s-BUSY,1,Busy exten => s-CHANUNAVAIL,1,Hangup

Hi ehsan310,

Many thanks for reply.  I used your given detail.  My extensions.conf file now look like this.

[quote] [MyContext]
exten => s,1,Dial(${ZAP/6,T)
exten => s,2,AGI(Somefile1.php)
exten => s,3,AGI(Somefile2.php)
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,Hangup
exten => s-CONGESTION,1,Congestion
exten => s-CANCEL,1,Hangup
exten => s-BUSY,1,Busy
exten => s-CHANUNAVAIL,1,Hangup[/quote]

[color=red]But the following problem occur on console it’s said that “unable to create channel type Zap”. And also not detect busy line. problem as it is.[/color]

[quote]*CLI> – Starting simple switch on ‘Zap/6-1’
[May 16 03:48:04] NOTICE[13791]: chan_zap.c:6376 ss_thread: Got event 18 (Ring Begin)…
– Executing [s@from-pstn:1] Dial(“Zap/6-1”, “Zap/6||T”) in new stack
[May 16 03:48:04] WARNING[13791]: app_dial.c:1191 dial_exec_full: Unable to create channel of type ‘Zap’ (cause 0 - Unknown)

Executing [s@MyContext:2] AGI(“Zap/6-1”, “somefile1.php”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/somefile1.php
==Spawn extension (MyContext, s,2) exited non-zero on ‘Zap/6-1’
– Hungup ‘Zap/6-1’
[May 16 03:48:23] WARNING[13404]: chan_zap.c:6685 handle_init_event: Detected alarm on channel 6: No Alarm
[May 16 03:48:24] NOTICE[13404]: chan_zap.c:6678 handle_init_event: Alarm cleared on channel 6
[/quote]

anybody welcome to give my problem’s solution.

Thanks and Regards,
Deepen

[code][MyContext]
exten => s,1,Dial(ZAP/6,T)
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s,n,AGI(Somefile1.php)
exten => s,n,AGI(Somefile2.php)

exten => s-NOANSWER,1,AGI(noanswer.php)
exten => s-CONGESTION,1,Congestion
exten => s-CANCEL,1,Hangup
exten => s-BUSY,1,AGI(busy.php)
exten => s-CHANUNAVAIL,1,Hangup[/code]

Hi eshan,

       Many thanks for reply. But I already does that before your reply come. Then that's error was gone but I still get engage tone when one call is going on channel 6 and I try to make another. It's not me busy tone.

Is there any Idea why its not happen.?

Regards,
Deepen

according to this error

your problem is in your zap channel and your zap channel not properly loaded