public void sofia_contact()
{
Client client = new Client();
try
{
client.connect( host, port, password, 2 );
}
catch ( InboundConnectionFailure e )
{
log.error( "Connect failed", e );
return;
}
// EslMessage response = client.sendSyncApiCommand( "sofia_contact", "internal/102@192.168.100.201" );
//回拨两方通话 {origination_caller_id_number=95126,hangup_after_bridge=true,continue_on_fail=true,originate_timeout=60}
// EslMessage response = client.sendSyncApiCommand( "originate", " {origination_caller_id_number=95126,hangup_after_bridge=true,continue_on_fail=true,originate_timeout=60}sofia/gateway/pstn/1118601323147 1003 XML default" );
EslMessage response = client.sendSyncApiCommand("sofia xmlstatus", "profile internal reg 1002");
// client.
// 会议回拨
// originate user/18601323147 conference:conf_uuid-TEST_CON inline
log.info( "Response to 'sofia_contact': [{}]", response );
for ( Entry<Name, String> header : response.getHeaders().entrySet() )
{
log.info( " * header [{}]", header );
}
for ( String bodyLine : response.getBodyLines() )
{
log.info( " * body [{}]", bodyLine );
}
client.close();
{
Client client = new Client();
try
{
client.connect( host, port, password, 2 );
}
catch ( InboundConnectionFailure e )
{
log.error( "Connect failed", e );
return;
}
// EslMessage response = client.sendSyncApiCommand( "sofia_contact", "internal/102@192.168.100.201" );
//回拨两方通话 {origination_caller_id_number=95126,hangup_after_bridge=true,continue_on_fail=true,originate_timeout=60}
// EslMessage response = client.sendSyncApiCommand( "originate", " {origination_caller_id_number=95126,hangup_after_bridge=true,continue_on_fail=true,originate_timeout=60}sofia/gateway/pstn/1118601323147 1003 XML default" );
EslMessage response = client.sendSyncApiCommand("sofia xmlstatus", "profile internal reg 1002");
// client.
// 会议回拨
// originate user/18601323147 conference:conf_uuid-TEST_CON inline
log.info( "Response to 'sofia_contact': [{}]", response );
for ( Entry<Name, String> header : response.getHeaders().entrySet() )
{
log.info( " * header [{}]", header );
}
for ( String bodyLine : response.getBodyLines() )
{
log.info( " * body [{}]", bodyLine );
}
client.close();
}
查询用户在线状态
sofia xmlstatus profile internal reg 1001
sofia xmlstatus profile internal reg
sofia status profile internal reg 1001
sofia status profile internal reg
sofia status profile internal reg
sofia status profile internal
http://iiiiiiii.com/freeswitch/onlineall?type=txt
http://iiiiiiii.com/freeswitch/onlineall?type=xml
http://iiiiiiii.com/freeswitch/online?account=1040&type=txt
http://iiiiiiii.com/freeswitch/online?account=1040&type=xml
http://iiiiiiii.com/freeswitch/online?account=10ddddddd40&type=xml 不在线或者不存在