man2015 / red5phone

Automatically exported from code.google.com/p/red5phone
0 stars 0 forks source link

possible - allow calling without login form? (auto-login) #48

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
first, thanks for the great project!

I installed Ubuntu 9.04 and red5phone on it.
everything works fine, I can login and make calls through my own Asterisk.

i want my clients to make calls through my Asterisk server, but they dont 
have to know sirver-ip, login/password etc.is it possible? i need do allow 
calls without entering login and pass, but every client should have his 
own asterisk account. 
thank you.

Original issue reported on code.google.com by ruslan.l...@gmail.com on 9 Jul 2009 at 2:43

GoogleCodeExporter commented 9 years ago
Hi ruslan,
You can include SIP proxy IP and login info on config.xml
---------------sample-----------start
<?xml version="1.0"?>
<config>
    <username>110</username>
    <password>110</password>
    <phone>110</phone>
    <mailbox>110</mailbox>
    <red5Url>rtmp:/sip</red5Url>
    <sipRealm>asterisk</sipRealm>
    <sipServer>123.456.789.111</sipServer>
</config>
---------------sample-----------end

create a SIP account on sip.conf in this case sip user is 110 and password is 
110(123.456.789.111 replace 
with the IP of your asterisk server)

after that you can recompile RED5Phone to collect these SIP info from 
"config.xml" then users can auto 
login :)

open red5phone.mxml find 
---------------
            private function onComplete(event:Event):void {
                configXML   = new XML(event.target.data);
                red5Url     = configXML.red5Url[0];
                sipRealm    = configXML.sipRealm[0];
                sipServer   = configXML.sipServer[0];

                        phone    = externalConfig.phone;
                username = externalConfig.username;
                password = externalConfig.password;
                mailbox = externalConfig.mailbox;

                loginCanvas.setParameters(sipRealm, sipServer, red5Url, 
externalConfig.phone, externalConfig.username, externalConfig.password, 
externalConfig.mailbox, 
externalConfig.autologin);                                  

            }
-----------------

and replace with 
-----------------
            private function onComplete(event:Event):void {
                configXML   = new XML(event.target.data);
                red5Url     = configXML.red5Url[0];
                sipRealm    = configXML.sipRealm[0];
                sipServer   = configXML.sipServer[0];
                username = configXML.username[0];
                password = configXML.password[0];
                phone    = configXML.phone[0];
                mailbox = configXML.mailbox[0];

                loginCanvas.setParameters(sipRealm, sipServer, red5Url, phone, username, 
password, mailbox, externalConfig.autologin);                                   

            }
-----------------

then recompile.

Cheers,
Madhawa

Original comment by madhawa1...@gmail.com on 10 Jul 2009 at 5:52

GoogleCodeExporter commented 9 years ago
wow, thanks for this! great, I'll try it (but I think it works;))
and what about if my sip-users are in postgres database? is it possible? 

Original comment by ruslan.l...@gmail.com on 10 Jul 2009 at 6:59

GoogleCodeExporter commented 9 years ago
i get an error when compiling.

Original comment by ruslan.l...@gmail.com on 10 Jul 2009 at 7:53

Attachments:

GoogleCodeExporter commented 9 years ago
okay, I added obProxy parametr and it compiled. but now I can see only 
sipRealm, 
red5url, and sipServer filled. username, pass etc = empty.

Original comment by ruslan.l...@gmail.com on 10 Jul 2009 at 8:16

GoogleCodeExporter commented 9 years ago
okay, fields username/pass are filled now ) but i dont want users to do see it. 
just 
click *.*.*.*:5080/sip/flex/index.html and see phone interface, not the login 
one. i 
mean this. not only "autofilling" :)

Original comment by ruslan.l...@gmail.com on 10 Jul 2009 at 8:24

GoogleCodeExporter commented 9 years ago
Hi ruslan,
You have received errors because you were using a new version :) my version is 
bit old. by the way you can hide those fields by a 
little dirty Hack.
open "LoginCanvas.mxml" and find the section
---------
    <mx:Text x="10" y="0" text="Phone#" width="85" height="20" fontSize="13" color="#E98F02" fontWeight="bold"/>
    <mx:TextInput x="107" y="1" width="137" id="phoneTxt"/>

    <mx:Text x="10" y="30" text="Username" width="85" height="20" fontSize="13" color="#E98F02" fontWeight="bold"/>
    <mx:TextInput x="107" y="31" width="137" id="usernameTxt"/>

    <mx:Text x="10" y="55" text="Password" width="85" height="20" fontSize="13" color="#E98F02" fontWeight="bold"/>
    <mx:TextInput x="107" y="56" width="137" displayAsPassword="true" id="passwordTxt"/>

    <mx:Text x="10" y="80" text="Mail Box" width="85" height="20" fontSize="13" color="#E98F02" fontWeight="bold" visible="true"/>
    <mx:TextInput x="108" y="81" width="137" id="mailboxTxt" visible="true" />

    <mx:Text x="10" y="105" text="SIP Realm" width="85" height="20" fontSize="13" color="#E98F02" fontWeight="bold" 
visible="true"/>
    <mx:TextInput x="107" y="106" width="137" id="realmTxt" visible="true" />

    <mx:Text x="10" y="130" text="SIP Server" width="85" height="20" fontSize="13" color="#E98F02" fontWeight="bold" 
visible="true"/>
    <mx:TextInput x="107" y="131" width="137" id="serverTxt" visible="true"/>

    <mx:Text x="10" y="184" text="Red5 URL" width="85" height="20" fontSize="13" color="#E98F02" fontWeight="bold" 
visible="true"/>
    <mx:TextInput x="107" y="185" width="137" id="urlTxt" visible="true"/>

    <mx:Button x="188" y="224" label="Login" click="login()" fillAlphas="[1.0, 1.0]" fillColors="[#FF0000, #DD0000]" 
color="#FFFFFF" themeColor="#DD0000"/>
    <mx:Text x="10" y="226"  color="#FD0202" fontSize="9" id="alertMessage" width="106"/>
    <mx:Text x="10" y="158" text="OB Proxy" width="89" height="23" fontSize="13" color="#E98F02" fontWeight="bold" 
visible="true"/>
    <mx:TextInput x="107" y="159" width="137" id="obproxyTxt" visible="true"/>

---------
and modify to 

---------
    <mx:Text x="10" y="0" text="Phone#" width="85" height="20" fontSize="13" color="#E98F02" fontWeight="bold" visible="false"/>
    <mx:TextInput x="107" y="1" width="137" id="phoneTxt" visible="false"/>

    <mx:Text x="10" y="30" text="Username" width="85" height="20" fontSize="13" color="#E98F02" fontWeight="bold" 
visible="false"/>
    <mx:TextInput x="107" y="31" width="137" id="usernameTxt" visible="false"/>

    <mx:Text x="10" y="55" text="Password" width="85" height="20" fontSize="13" color="#E98F02" fontWeight="bold" 
visible="false"/>
    <mx:TextInput x="107" y="56" width="137" displayAsPassword="true" id="passwordTxt" visible="false"/>

    <mx:Text x="10" y="80" text="Mail Box" width="85" height="20" fontSize="13" color="#E98F02" fontWeight="bold" 
visible="false"/>
    <mx:TextInput x="108" y="81" width="137" id="mailboxTxt" visible="false" />

    <mx:Text x="10" y="105" text="SIP Realm" width="85" height="20" fontSize="13" color="#E98F02" fontWeight="bold" 
visible="false"/>
    <mx:TextInput x="107" y="106" width="137" id="realmTxt" visible="false" />

    <mx:Text x="10" y="130" text="SIP Server" width="85" height="20" fontSize="13" color="#E98F02" fontWeight="bold" 
visible="false"/>
    <mx:TextInput x="107" y="131" width="137" id="serverTxt" visible="false"/>

    <mx:Text x="10" y="184" text="Red5 URL" width="85" height="20" fontSize="13" color="#E98F02" fontWeight="bold" 
visible="false"/>
    <mx:TextInput x="107" y="185" width="137" id="urlTxt" visible="false"/>

    <mx:Button x="188" y="224" label="Login" click="login()" fillAlphas="[1.0, 1.0]" fillColors="[#FF0000, #DD0000]" 
color="#FFFFFF" themeColor="#DD0000"/>
    <mx:Text x="10" y="226"  color="#FD0202" fontSize="9" id="alertMessage" width="106"/>
    <mx:Text x="10" y="158" text="OB Proxy" width="89" height="23" fontSize="13" color="#E98F02" fontWeight="bold" 
visible="false"/>
    <mx:TextInput x="107" y="159" width="137" id="obproxyTxt" visible="false"/>
---------

I hope this works for you.

Cheers,
Madhawa

Original comment by madhawa1...@gmail.com on 13 Jul 2009 at 7:12

GoogleCodeExporter commented 9 years ago
yea, it works great, thanks again! :)
what about working with postgres?

Original comment by ruslan.l...@gmail.com on 13 Jul 2009 at 9:14

GoogleCodeExporter commented 9 years ago
Hi ruslan,

open red5phone.mxml find 

<local:LoginCanvas id="loginCanvas" x="0" y="0" width="100%" height="100%"
borderStyle="none" />

and modify to

<local:LoginCanvas id="loginCanvas" x="0" y="0" width="100%" height="100%"
borderStyle="none" visible="false"/>

then recompile.

Original comment by liweisp...@gmail.com on 18 Nov 2009 at 8:26

GoogleCodeExporter commented 9 years ago
Hi Roslan 
there is other way to do auto login.
i added to the code long time ago external function name login1.
login1(obProxy1, myuid, phone1, username1, password1, 
realm1,server1,url1,conference1);

add to your page a test button in the end of the html page
<form name="demo">
<button onclick="red5phone.login(obProxy1, myuid, phone1, username1, password1, 
realm1,server1,url1,conference1);">Login</button>
</form>

it should work unless someone change it.

Lior

Original comment by lior.her...@gmail.com on 24 Nov 2009 at 7:58

GoogleCodeExporter commented 9 years ago
The code is still there ;-)

Original comment by olajide....@gmail.com on 24 Nov 2009 at 8:14

GoogleCodeExporter commented 9 years ago
hi,

I also wanted to be able to have the red5phone to autologin and not show the 
form,
showing the phone as soon as you enter the webpage.

I've tried the changes in "red5phone.mxml" and "LoginCanvas.mxml" and still get 
the
form before the phone. I also tried changing 'autologin: true' in the js of 
"index.html".

Anyone has a clue why it might not be working?

PS: login/registration/calls work fine

Original comment by antonio....@gmail.com on 17 Feb 2010 at 1:06

GoogleCodeExporter commented 9 years ago
hi antonio.h.ferreira,
It is really what I want to do too.
Please help me, if there is a way.

Original comment by kuru...@gmail.com on 16 Apr 2010 at 9:14

GoogleCodeExporter commented 9 years ago
Hi, after doing some steps above, on LoginCanvas.mxml change:

   private function login():void {

to:

   public function login():void { 

and then in red5phone.mxml add:

   loginCanvas.login();

at the end of the onComplete function.

Original comment by chu...@gmail.com on 10 Sep 2010 at 7:41

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
What about storing sip auth data at server side? :) Actually, if we put that 
data in config.xml, some smart guys could download and extract it :) Is there 
any way (without changing java sources) to store this data in module config? :)

Original comment by Vladimir...@gmail.com on 18 Nov 2010 at 7:27

GoogleCodeExporter commented 9 years ago
I am using windows XP and red5 0.8
I installed red5 latest version sip_r53. And I got an error in my red5 console 
given below.
RegisterAgent: Registration failure: 403 Forbidden (Bad auth)
[SIPUser] SIP Registration failure 403 Forbidden (Bad auth)
RegisterAgent: Failed Registration stop try.
And it's not log in to the system.
I am using asterisk as a relam.
my sip server is also running and I used my own id in red5 url 
rtmp://192.168.0.35/sip.

Anyone have any idea regarding this error so please help me to make it out.

Original comment by wasim.ka...@gmail.com on 18 Apr 2011 at 7:36

GoogleCodeExporter commented 9 years ago
How can I compile red5phone? Could please tell me step by stem instructions?

Original comment by nur...@muldashev.kz on 12 Aug 2011 at 4:41

GoogleCodeExporter commented 9 years ago
I also would like to see some detailed info about this in the wiki or so.

It's very worthfull to have there.

Original comment by matthijs...@gmail.com on 30 Sep 2011 at 11:03