Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Question about outband event use java


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
zhaoxxqq at 163.com
Guest





PostPosted: Mon Jun 29, 2009 9:43 pm    Post subject: [Freeswitch-users] Question about outband event use java Reply with quote

Hi folks, I'm really newbee to touch outband event. I write socket below <extension name="nb_conferences"> <condition field="destination_number" expression="^(30\d{2})$"> <action application="socket" data="127.0.0.1:8023 full"/> <action application="answer"/> <action application="conference" data="$1-${domain_name}@default"/> </condition> </extension> and I write java server code like below: import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.net.ServerSocket; import java.net.Socket; import java.util.regex.*; public class ServerCode { /** * @param args */ public static int portNo = 8023; public static void main(String[] args) throws IOException { // TODO code application logic here ServerSocket s= new ServerSocket(portNo); System.out.println("The Server is start:" + s); Socket socket=s.accept(); try{ System.out.println("Accept the Client:"+ socket); BufferedReader in =new BufferedReader(new InputStreamReader(socket.getInputStream())); PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())),true); while(true){ String str = in.readLine(); if(str.equals("byebye")){ break; } System.out.println("In Server recieved the info:" + str); out.println("connect\n\n"); } } finally { System.out.println("close the server socket and the io."); socket.close(); s.close(); } } } When I use extension 1001 to dial 3001, the cli display below: 2009-06-30 18:35:27 [NOTICE] switch_channel.c:567 switch_channel_set_name() New Channel sofia/internal/1001@61.55.140.138:5060 [b9c80e50-6561-11de-8972-f3830035270b] 2009-06-30 18:35:27 [INFO] mod_dialplan_xml.c:233 dialplan_hunt() Processing 1001->3001 in context default I have send "connect\n\n" to FS, but no response to outband server. Can anyone help me? 2009-06-30 zhaoxxqq
Back to top
jason at jasonjgw.net
Guest





PostPosted: Mon Jun 29, 2009 9:50 pm    Post subject: [Freeswitch-users] Question about outband event use java Reply with quote

zhaoxxqq <zhaoxxqq@163.com> wrote:

Quote:
and I write java server code like below:

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.regex.*;

Shouldn't you be using the Java event socket libraries that were discussed on
the list recently? There's also one in the FreeSWITCH source tree now.



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services