ESL에서 freeswitch 사용자 등록 상태 조회

1757 단어
직접 부호
핵심 코드
EslMessage response = client.sendSyncApiCommand("sofia xmlstatus", "profile internal reg 1002"); 
    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/[email protected]" );
// {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 header : response.getHeaders().entrySet() )
{
log.info( " * header [{}]", header );
}
for ( String bodyLine : response.getBodyLines() )
{
log.info( " * body [{}]", bodyLine );
}
client.close();
}

좋은 웹페이지 즐겨찾기