SearchSearch  Log in to check your private messagesLog in to check your private messages  recent posts Recent Posts
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
deepenmOffline



Joined: May 13, 2008
Posts: 8

Status: Offline
Posted: May 15, 2008 - 09:27 AM Reply with quote Back to top
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()



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



In above extensions.conf file you see that on second line I used DIALSTATUS Varaible but ianplain told me that, variable DIALSTATUS is define when call ended. So, I think above idea that I used is wrong or missing something in that.

So, Please Share your valuable knowledge.

Regards,
Deepen
View user's profile Send private message
ianplainOffline
Site Admin


Joined: Jul 05, 2004
Posts: 2909
Location: Bath UK
Status: Offline
Posted: May 15, 2008 - 09:49 AM Reply with quote Back to top
Hi

The way to do it, Is as I pointed out before is with the script , This works well and is reliable.

Ian
View user's profile Send private message
deepenmOffline



Joined: May 13, 2008
Posts: 8

Status: Offline
Posted: May 15, 2008 - 11:02 AM Reply with quote Back to top
Hi ian,

Thanks for reply. But I don't get how that script identify InUse or not, because when I execute "core show hints" command on asterisk console, it's told me you doesn't registerd any hints after that I set one hint in my extensions.conf file.

exten => s,hint,MyHint
exten => s,2,AGI(busydetect.sh|${EXTEN})
exten => s,3,GotoIf($["${result}" = "yes"]?5) ;If result = yes go to 5 else 4
exten => s,4,Dial(SIP/${EXTEN})
exten => s,5,Busy


busydetect.sh:

#!/bin/sh
#
#
if [ "`/usr/sbin/asterisk -r -x "core show hints" |grep "$1" |grep -o InUse`" == "InUse" ]; then
echo SET VARIABLE result yes
else
echo SET VARIABLE result no
fi


so, now look at that script line,
/usr/sbin/asterisk -r -x "core show hints" |grep "$1" |grep -o InUse`" == "InUse"

Now, here the grep command don't Identify that InUse. So, please tell me is there is modification required in extensions.conf or zaptel-channels.conf

once again thanks to ian.

Regards,
deepen
View user's profile Send private message
ianplainOffline
Site Admin


Joined: Jul 05, 2004
Posts: 2909
Location: Bath UK
Status: Offline
Posted: May 15, 2008 - 11:31 AM Reply with quote Back to top
Hi have a read of http://www.voip-info.org/wiki/index.php ... extensions it will explain about setting up hints.

Ian
View user's profile Send private message
deepenmOffline



Joined: May 13, 2008
Posts: 8

Status: Offline
Posted: May 16, 2008 - 10:24 AM Reply with quote Back to top
Hi to all,

Many thanks for your reply. I saw your link for "core show hint". and according to change my extensions.conf.

Quote:
[MyContext]
exten => s,hint,Zap/6-1
exten => s,1,AGI(busydetect.sh|${EXTEN})
exten => s,2,GotoIf($["${result}" = "yes"]?5)

exten => s,3,Set(MYEXT=${EXTEN})
exten => s,4,AGI(somefile.php)
exten => s,5,Hangup


but problem is that core show hints every time gives me state idle and not InUse. And when one call establish and I try to call again on same number it's simply gives me an engage tone.

Can you please tell me is I required some more settings in extensions.conf or zaptel-channels.conf file.

thanks and regards,
Deepen
View user's profile Send private message
ianplainOffline
Site Admin


Joined: Jul 05, 2004
Posts: 2909
Location: Bath UK
Status: Offline
Posted: May 16, 2008 - 10:42 AM Reply with quote Back to top
Hi

exten => s,1,AGI(busydetect.sh|${EXTEN})

This is not correct as the ${EXTEN} in this case will be s

Lets go right back to the begining.

What are you trying to achieve ? as if you try to put a call to a busy zap channel it will report busy in the dialsatus variable AFTER trying it. Im not sure but I think you may be looking to solve a problem that doesn't exist.
View user's profile Send private message
deepenmOffline



Joined: May 13, 2008
Posts: 8

Status: Offline
Posted: May 16, 2008 - 11:01 AM Reply with quote Back to top
Hi Ian,

Thanks for reply. when I write ${Exten} it's internally pass "s" only.

And yes about My problem is as follows,
suppose I am now calling on one number(to Zap channel 6) and after call establish the callflow is running(which I wrote). Now
another User call on same number(to Zap channel 6) then it's receive engage tone. So, here I don't want engage tone, I want Busy tone or some message which tells the caller, call after some time.
View user's profile Send private message
deepenmOffline



Joined: May 13, 2008
Posts: 8

Status: Offline
Posted: May 16, 2008 - 02:14 PM Reply with quote Back to top
Hi Ian,

SO, it is possible that I mentioned or not. If it not possible then please let me know.

Regards,
Deepen
View user's profile Send private message
ianplainOffline
Site Admin


Joined: Jul 05, 2004
Posts: 2909
Location: Bath UK
Status: Offline
Posted: May 16, 2008 - 07:44 PM Reply with quote Back to top
Hi yes

thats what dialstatus is for its just that you need to call it after trying the extension not before, or you get hints working

Ian
View user's profile Send private message
deepenmOffline



Joined: May 13, 2008
Posts: 8

Status: Offline
Posted: May 16, 2008 - 09:12 PM Reply with quote Back to top
Hi Ian,

Many thanks for reply. Is some other changes are required in zaptel-channels.conf file like busydetect=1 or something because I was not changed anything in that file.

If you saw an extensions.conf file and it's looks ok, right?. So, If extensions.conf file is ok then there may be some other problem.

Smile once again thanks Ian. Smile

I will try to find problem and If you have some idea then please let me know.

Thanks,
Deepen
View user's profile Send private message
ianplainOffline
Site Admin


Joined: Jul 05, 2004
Posts: 2909
Location: Bath UK
Status: Offline
Posted: May 16, 2008 - 09:53 PM Reply with quote Back to top
Hi

Quote:
If you saw an extensions.conf file and it's looks ok, right?. So, If extensions.conf file is ok then there may be some other problem.


Not sure what you mean here, but none of yours have looked correct.

have a look at http://www.voip-info.org/wiki/view/Stdexten+macro

and have a readup on dialstatus http://www.voip-info.org/wiki-Asterisk+ ... DIALSTATUS

Ian
View user's profile Send private message


View previous topic Printable version Log in to check your private messages View next topic

Post new topic   Reply to topic
Forum Rules and Guidelines | About VoIP User | Privacy Policy


All logos and trademarks in this site are property of their respective owner.
Comments and posts are property of the poster, all the rest (c) 2003-2008 VoIP User Limited.

VoIP User Limited is incorporated in England and Wales under Company Number 6694577.

No part of this site may be reproduced without our prior consent.