js/supportchat.js

changeset 16
ebc14a22a0c1
parent 15
071c513502d1
child 21
b691536ed125
equal deleted inserted replaced
15:071c513502d1 16:ebc14a22a0c1
1 /* Config */ 1 /* Config */
2 var LOGIN_DOMAIN = "anon.localhost";
3 var BOSH_URL = "/http-bind";
4 2
5 /*** Helper functions */ 3 var support_config = {
4 login_domain: "anon.localhost",
5 bosh_url: "/http-bind",
6 team_rooms: {
7 "Sales": "sales@support.localhost",
8 "Technical": "technical@support.localhost"
9 }
10 };
6 11
7 /*** XMPP handling */ 12 /*** XMPP handling */
8 var conn = null; 13 var conn = null;
9 14
10 /* Called by Strophe when status of connection changes 15 /* Called by Strophe when status of connection changes
22 } 27 }
23 28
24 /* Initiate the connection to the XMPP server */ 29 /* Initiate the connection to the XMPP server */
25 function start_connection() 30 function start_connection()
26 { 31 {
27 conn = new Strophe.Connection(BOSH_URL); 32 conn = new Strophe.Connection(support_config.bosh_url);
28 var ret = true; 33 var ret = true;
29 try 34 try
30 { 35 {
31 conn.connect(LOGIN_DOMAIN, null, handle_connection_status, 50); 36 conn.connect(support_config.login_domain, null, handle_connection_status, 50);
32 } 37 }
33 catch(e) 38 catch(e)
34 { 39 {
35 ret = false; 40 ret = false;
36 } 41 }

mercurial