[asterisk-users] Multiple user registration ...
Faheem
faheem_imt at yahoo.com
Mon Aug 31 00:36:15 CDT 2009
The purpose of Perl script is to store user registrations records only and nothing else regarding call dialing.
The script will main records like this.
User1:
IP1: 192.168.0.100 Por1: 5060
IP2: 69.30.21.10 Port2: 5060
User2:
IP1: 192.168.10.1 Por1: 5060
IP2: 192.168.10.1 Por2: 5061
User3:
IP1: 192.168.10.121 Por1: 5060
IP2: 192.168.10.123 Por2: 5061
and so on....
No it all depends on you to store these information on files or database.
Assume you have stored IP/Ports in the database.
Database=cloneline
Table = users(username,ip1,port1,ip2,port2)
For dialing:
Assume username=user1 and extension =123456
exten=> 123456,1,NoOp()
exten=> 123456,n,MYSQL(Connect connid 'localhost' cdr dbpass cloneline)
exten=> 123456,n,NoOP(Connection ID:${connid})
exten=> 123456,n,MYSQL(Query resultid ${connid} SELECT\ ip1\, port1\, ip2\, port2\, status\ from\ users\ where\ username="user1" )
exten=> 123456,n,MYSQL(Fetch fetchid ${resultid} ip1 port1 ip2 port2)
exten=> 123456,n,Dial(SIP/user1@${ip1}:${port1}&SIP/user1@${ip2}:${port2})
for dialing user3
username=user3 and extension =112233
exten=> 112233,1,NoOp()
exten=> 112233,n,MYSQL(Connect connid 'localhost' cdr dbpass cloneline)
exten=> 112233,n,NoOP(Connection ID:${connid})
exten=> 112233,n,MYSQL(Query resultid ${connid} SELECT\ ip1\,
port1\, ip2\, port2\, status\ from\ users\ where\ username="user3" )
exten=> 112233,n,MYSQL(Fetch fetchid ${resultid} ip1 port1 ip2 port2)
exten=> 112233,n,Dial(SIP/user3@${ip1}:${port1}&SIP/user3@${ip2}:${port2})
Hope every thing would be clear...
Muhammad Faheem
Software Engineer
AxVoice Inc.
307,Y Commercial,
DHA Lahore, Pakistan
+92-333-4793314
http://www.axvoice.com
--- On Fri, 8/28/09, Mauro Sergio Ferreira Brasil <mauro.brasil at tqi.com.br> wrote:
From: Mauro Sergio Ferreira Brasil <mauro.brasil at tqi.com.br>
Subject: Re: [asterisk-users] Multiple user registration ...
To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users at lists.digium.com>
Date: Friday, August 28, 2009, 5:38 PM
Thank you very much for all your help, Muhammad! (please let me know if
I should call you Faheem, instead).
I'll make some tests with this script on my premises as soon as possible.
Having a look on it, I couldn't realize how it really works in
conjunction with Asterisk.
I mean, it seems that the line cloning is acchieved by the
creation/update of a file (with a name that matches the SIP user name)
inside folder "/var/lib/asterisk/users".
The point is that I couldn't find any similar folder on my test server,
and a search on Google by this folder didn't returned any usefull results.
Am I missing something here ?
Suppose I want to acchieve this feature by database update.
I've noticed here that it will be a problem considering that field
"name" at "sip_buddies", that is my Realtime table for SIP users, have a
UNIQUE_KEY constraint.
Moreover, I don't know what will happen on Realtime (probably an error
or undesired behavior) that seems to be expecting just one record user
record information.
Have you tried database approach ?
Thanks again and best regards,
Mauro.
Faheem escreveu:
> Mauro,
>
> Yes, you will receive simultaneous ring on all devices which are
> registered with the same SIP User Account.
>
> If a SIP user is registered on multiple devices i.e. only one SIP
> account is used and only one extension is used here in my
> implementation, then he will ring on all registered SIP enabled
> devices/softphones.
>
> Also I've tested it with following combinations of SIP enabled
> devices/Softphones.
>
> 1) Both ports of SPA2100 are registered with one SIP account(Same IP
> address but different ports)
> 2) The same SIP user is registered with one port of SAP2100 and the
> same user is registered with Xten (multiple IP addresses)
> 3) The same SIP User is registered with two different SIP Dialers.
>
> Here in these three cases I've sucessfully able to receive concurrent
> ring on the registered devices/softphones. Also CDR are working correctly.
>
> The perl script works perfectly with my customization, you need to
> modify it according to your requirements.
>
>
> Muhammad Faheem
> Software Engineer
> AxVoice Inc.
> 307,Y Commercial,
> DHA Lahore, Pakistan
> +92-333-4793314
> http://www.axvoice.com
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> AstriCon 2009 - October 13 - 15 Phoenix, Arizona
> Register Now: http://www.astricon.net
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
--
__At.,
_
*Technology and Quality on Information*
Mauro Sérgio Ferreira Brasil
Coordenador de Projetos e Analista de Sistemas
+ mauro.brasil at tqi.com.br <mailto:@tqi.com.br>
: www.tqi.com.br <http://www.tqi.com.br>
( + 55 (34)3291-1700
( + 55 (34)9971-2572
_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090830/ee6ae69f/attachment-0001.htm
More information about the asterisk-users
mailing list