Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Members / jhb / Setting up a freeswitch conference server

Setting up a freeswitch conference server

by Jörg Baach last modified Apr 11, 2008 10:52 PM
I had problems running asterisk in an openvz setup, so I thought freeswitch might be an alternative.
cd /usr/share
ln -s automake-1.10/ automake-1.9
  • Compilation runs through. Cool. Make, make install
  • Now, what to do next?
  • First, I need the "register => user:pass@provider/user" equivalent in freeswitch.
  • Solution: put a little xml file into conf/sip_profiles/outbound/sipgate.xml:
     
<include>
  <gateway name="sipgate.de">-
  <!--/// account username *required* ///-->
  <param name="username" value="myuser"/>
  <!--/// account password *required* ///-->
  <param name="password" value="pass"/>
  </gateway>
</include>
  • I start /usr/local/freeswitch/bin/freeswitch, now what?
> sofia status profile outbound
  • does the trick. Btw, entering
>...

stops the server

  • Now next thing: I need to have the incoming call connected to a conference.
  • I put some xml into conf/dialplan/public.xml:
    <extension name="conferencing">
      <condition field="destination_number" expression=".*">
        <action application="conference" data="test" />
      </condition>        
    </extension>

 

  • Restart, next problem, I see the testcall coming in, but get a "conference_function() Memory Error Creating Audio Buffer!" on the freeswitch console ;-(
  • bkw_ in #freeswitch comes to the rescue: the problem is that I havn't assigned enough resources - I am running from a OpenVZ guest.
  • He recommends to tune up the setting in the host:
vzctl set $VE --privvmpages 65536:69632 

Now, restarting again, calling in, flamenco to be heard. Great!

 

----------------------------

 

Problem is that it has not multiple conferences.

So, to change that, conf/dialplan/public.xml gets a different action:

 

   <extension name="conferencing">
      <condition field="destination_number" expression=".*">
        <!--<action application="conference" data="test" /> -->
        <action application="javascript" data="/home/jhb/confroom.js"/>
      </condition>
    </extension>

with /home/jhb/confroom.js being:

/** 
confroom.js - Simple iIVR Menu using a database.
http://wiki.freeswitch.org/wiki/Examples_confcall_js
by Ken Rice (SwK @ #freeswitch) and Joerg Baach (jhb)

**/

var astsounds = '/var/lib/asterisk/sounds/en/'

var line = "====================================\n";

var dtmf = new Object();
dtmf.digits = "";
var replay = 1;
var lastdigit = "";

function mycb (session, type, data, arg) {

        lastdigit = data.digit;
		dtmf.digits += lastdigit;
        console_log("notice","got: " + lastdigit + "\n");
        return(false);
}

session.answer();

while(session.ready()) {
    console_log("notice","Collecting digits\n"); 
    console_log("notice", line);
    session.streamFile(astsounds + "conf-getconfno.wav", mycb);	
	
    while (lastdigit != "#" && session.ready()) {
		session.collectInput(mycb, dtmf, 5000);
	} 
	 
    var confroom = dtmf.digits + "@default";
    
    console_log("notice", "ConfRoom: [" + confroom  +"]\n");
    console_log("notice", line);
    
    session.flushDigits();
    session.execute("conference", confroom);
    
    session.flushDigits();
    lastdigit = "";
    dtmf.digits = ""; 

}

 

Filed under:
Add comment

You can add a comment by filling out the form below. Plain text formatting.

Question: What is 23 plus 19?
Your answer: