Busy Tone (SOLVED!)

Hello People,

I hope really somebody can give me a solution because i’m going beserk on it

I Really like to generate a busy tone when a user is on the phone.
I can get this to work partially.

When a user gets een incoming call and somebody else tries to phone him at the same time I get busy tone with the help of ‘incominglimit=1’

Works perfect!!!

But when a user dials out, ‘incominglimit’ doesn’t funtion of course. Because it is an outgoing call.
So when somebody else calls, the phone still rings while he is having an outgoing call.
Obviously I cannot limit to one connection for both in- and out calling because then I won’t be able to transfer a phonecall

I’'ve tried al kinds of combinations.

outgoinglimit
incominglimit
call-limit
busylevel
Set(GROUP) functions

Who can give me the solution. And get in the Hall of Fame!!! :smiley:

Best regards,

Hendrik van der Ploeg
Linux Administrator
The Netherlands

Well, “busy” is a very special condition.

It means that:

  1. The phone is in use.
  2. The phone has no other means to accept a call. (No second phone number appearance, no call waiting, etc…)
  3. The phone has no means to accept a message. (No voicemail, no alternate routing to another phone, etc… )

In today’s systems, (such as Asterisk) this is a generally an artificial condition, as you have the ability to give a phone call waiting, or voicemail, even if you don’t choose to do so.

My first thought is to investigate the client. The client may accept calls when there is a call in progress, and if that’s true Asterisk will route the call. If there’s some way to set Do Not Disturb when a call is in progress, you could use the response to route to a busy signal. (Even if it’s just a playback of the sound of a busy signal.)

Alternatively, you might set a variable when a call is placed, and have any incoming calls check to see if a global variable specific to the extension (ISBUSY301) is set. However, that would require that all outgoing calls, incoming calls, and extension to extension calls go through the Asterisk system, as an outgoing call won’t be able to set the variable and, more importantly, unset the variable when the call is ended if the Asterisk system isn’t aware of when the call began and ended. If you’re using re-invites to send the RTP data from peer to peer directly, this method wouldn’t work.

Anybody else some suggestions or examples maybe?

Thanks in advance

Hendrik vd Ploeg
The Netherlands

Hello People,

After thinking a bit and 1000 sleepless nights I solved the issue.
Finally I can force a busy tone!!!
Maybe the scripting code I use is a bit dirty, but remember I’m not a programmer :smiley:

At priority 2 I call a script where it sends the command ‘core show hints’ to the Asterisk console.
Doing some ‘grep’ commands and if the ‘result = yes’ then it should go to priority 5, if it’s ‘result = no’, then go to priority 4.

Voilaaaa,

[context]
exten => _18XX,1,Ringing
exten => _18XX,2,AGI(busydetect.sh|${EXTEN})
exten => _18XX,3,GotoIf($["${result}" = “yes”]?5) ;If result = yes go to 5 else 4
exten => _18XX,4,Dial(SIP/${EXTEN})
exten => _18XX,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

Regards,

Hendrik van der Ploeg
The Netherlands

Hi

One added step would be to action the script if a database key was set to call waiting = no

That looks good.

Ian

Hi Ian,

Thanks for the reply.
I don’t really understand what extra’s ‘waiting = no’ will do.
Could you please explain a bit?

Hendrik

Ok

The user can then choose to have multiple calls to their handset.

The set the variable tp CW=no in the astdb then when a call comes in and the user has set “call waiting” to no then the call passes through the agi if its said to yes then its skipped.

Ian

Ok I understand,

I’ll give it a go then! :smiley:

Regards,

Hendrik