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
The phone has no other means to accept a call. (No second phone number appearance, no call waiting, etc…)
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.
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
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
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
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.