[Asterisk-Users] How to restrict simultaneous phone registrations
Bryan Mahin
bryanm at uneta.com
Thu Apr 6 09:25:00 MST 2006
If I lock the account down to one simultaneous call, this will resolve
one problem but create another. The user will only be able to place or
receive one call and not be able to conference call two or three people
at a time. Correct? I really need to be able to lock the account down so
multiple calls can be placed from an account at Location A but not the
same account at Location B at the same time.
Kind of like the old version of AOL instant messenger. If you logon in a
second location, it'll bump off the first location. You couldn't use it
in two places at once. An even better scenario would be that both
locations can be logged in but only the second location to login can
place calls. This would cause someone to have to close their phone and
re-open it to place calls (bumping off the other phone).
-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Darren
Wiebe
Sent: Thursday, April 06, 2006 11:07 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [Asterisk-Users] How to restrict simultaneous phone
registrations
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jonathan k. Creasy wrote:
>> I apologize if this information is posted elsewhere. Unfortunately I
>> haven't found it yet if it is. I'm not familiar with the channel
>> counting features could you please explain? Also, how are you tagging
>> the phones to account codes?
>>
>
> You can limit calls using the set/check group commands.
>
> http://www.voip-info.org/wiki/index.php?page=Asterisk+cmd+SetGroup
>
> Account codes are set either by using the Set function or the
> accountcode= property in the SIP/IAX conf files.
>
> -Jonathan
Exactly, I'll post a sample dialplan. This dialplan is for ASTPP but
should give you the idea.
# exten => _1XXXXXXXXXX,1,Set(GROUP()=${ACCOUNTCODE})
# exten =>
_1XXXXXXXXXX,2,AGI(astpp-authorize.agi,${ACCOUNTCODE},${EXTEN})
# exten => _1XXXXXXXXXX,3,GotoIf($["${CALLSTATUS}" = "0"]?60) ; Checks
if account has sufficient funds
# exten => _1XXXXXXXXXX,4,GotoIf($["${CALLSTATUS}" = "1"]?70) ; Checks
if the phone number exists
# exten => _1XXXXXXXXXX,5,GotoIf($["${CALLSTATUS}" = "2"]?80) ; Check
if account exists
# exten => _1XXXXXXXXXX,6,GotoIf($["${GROUP_COUNT()}" >
"${MAXCHANNELS}"]?90) ; Verify number of outgoing channels
#
; assigned to account.
# exten => _1XXXXXXXXXX,7,Set(GROUP(${TRUNK1}-OUTBOUND)=OUTBOUND)
# exten =>
_1XXXXXXXXXX,8,GotoIf($["${GROUP_COUNT(OUTBOUND@${TRUNK1}-OUTBOUND)}" >
"${TRUNK1_MAXCHANNELS}"]?10)
# exten => _1XXXXXXXXXX,9,Dial(${LCRSTRING1}||${TIMELIMIT}|${OPTIONS})
# exten => _1XXXXXXXXXX,110,Busy
# exten => _1XXXXXXXXXX,10,Set(GROUP(${TRUNK2}-OUTBOUND)=OUTBOUND)
# exten =>
_1XXXXXXXXXX,11,GotoIf($["${GROUP_COUNT(OUTBOUND@${TRUNK2}-OUTBOUND)}" >
"${TRUNK2_MAXCHANNELS}"]?13)
# exten => _1XXXXXXXXXX,12,Dial(${LCRSTRING2}||${TIMELIMIT}|${OPTIONS})
# exten => _1XXXXXXXXXX,113,Busy
# exten => _1XXXXXXXXXX,13,Set(GROUP(${TRUNK2}-OUTBOUND)=OUTBOUND)
# exten =>
_1XXXXXXXXXX,14,GotoIf($["${GROUP_COUNT(OUTBOUND@${TRUNK3}-OUTBOUND)}" >
"${TRUNK3_MAXCHANNELS}"]?16)
# exten => _1XXXXXXXXXX,15,Dial(${LCRSTRING3}||${TIMELIMIT}|${OPTIONS})
# exten => _1XXXXXXXXXX,116,Busy
# exten => _1XXXXXXXXXX,16,Set(GROUP(${TRUNK4}-OUTBOUND)=OUTBOUND)
# exten =>
_1XXXXXXXXXX,17,GotoIf($["${GROUP_COUNT(OUTBOUND@${TRUNK4}-OUTBOUND)}" >
"${TRUNK4_MAXCHANNELS}"]?19)
# exten => _1XXXXXXXXXX,18,Dial(${LCRSTRING4}||${TIMELIMIT}|${OPTIONS})
# exten => _1XXXXXXXXXX,119,Busy
# exten => _1XXXXXXXXXX,19,Set(GROUP(${TRUNK5}-OUTBOUND)=OUTBOUND)
# exten =>
_1XXXXXXXXXX,20,GotoIf($["${GROUP_COUNT(OUTBOUND@${TRUNK5})-OUTBOUND}" >
"${TRUNK5_MAXCHANNELS}"]?22)
# exten => _1XXXXXXXXXX,21,Dial(${LCRSTRING5}||${TIMELIMIT}|${OPTIONS})
# exten => _1XXXXXXXXXX,122,Busy
# exten => _1XXXXXXXXXX,22,Goto(100)
# exten => _1XXXXXXXXXX,60,Congestion ; '0' Tells them they do not have
enough money
# exten => _1XXXXXXXXXX,61,Hangup
# exten => _1XXXXXXXXXX,70,Congestion '1' Bad Phone Number
# exten => _1XXXXXXXXXX,71,Hangup
# exten => _1XXXXXXXXXX,80,Congestion
# exten => _1XXXXXXXXXX,81,Hangup
# exten => _1XXXXXXXXXX,90,Congestion ; Their outgoing channel limit
is full already
# exten => _1XXXXXXXXXX,91,Hangup
# exten => _1XXXXXXXXXX,100,Congestion ; No Route Available
# exten => _1XXXXXXXXXX,101,Hangup
Some of the group counts are for outgoing trunks. It's just the first
one that you need.
- --
Darren Wiebe
darren at aleph-com.net
Aleph Communications
ASTPP - Open Source Voip Billing & Calling Cards
www.aleph-com.net/astpp
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFENS6w4DADnh+tnOQRAlTmAKCI8x7xV2nUlfhT4n325iqApMmecACcCATV
cpS+R+PdpYV6Rc6Sk7BIrGM=
=hZRr
-----END PGP SIGNATURE-----
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Please visit us @ www.uneta.com
More information about the asterisk-users
mailing list