This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

how to split the particular datas from group of datas  RSS feed

 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am getting an output below when i run my java code:


Channel Location State Application(Data)
SIP/5104-09a08098 5104@from-internal:1 Ringing AppDial((Outgoing Line))
SIP/5102-099f9700 s@macro-dial:7 Ring Dial(SIP/5104||tr)
2 active channels
1 active call


Here i need to store the channel name and state in the database in separate field.

How can i split the channel separately and state to the partcular channel.please guide me to do this.

Thanks

 
Marshal
Posts: 59745
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain more details about the problem.

[This might be a database-specific problem, which we usually discuss on a different forum.]
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can make use of StringTokeniser Class see java docs for more details
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your replies.Sorry for the delayed reply.Actually i need to find how many active channels in asterisk using java.I can able to get the active channels like the following:


Channel Location State Application(Data)
SIP/5104-0a0bb988 (None) Up Bridged Call(SIP/5102-0a0a9cf8
SIP/5102-0a0a9cf8 s@macro-dial:7 Up Dial(SIP/5104||tr)
2 active channels
1 active call


But I need to match the state and the channel like "SIP/5104-0a0bb988=Up " and i have to store it in database in the field channel "SIP/5104-0a0bb988" and in state "Up".How can I link the channel and the state?

I have looked at string tokeniser.But if i get any sample code it will be very useful.

Thanks
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
By doing like the following ,I can able to take the datas below the channel from


Channel Location State Application(Data)
SIP/5104-0a0bb988 (None) Up Bridged Call(SIP/5102-0a0a9cf8
SIP/5102-0a0a9cf8 s@macro-dial:7 Up Dial(SIP/5104||tr)
2 active channels
1 active call


like


for (String line : response.getResult())
{
String channel=line.substring(0,line.indexOf(" "));
System.out.print(channel);
}


gave me the result


Channel
SIP/5104-0a0bb988
SIP/5102-0a0a9cf8
2 active channels
1 active call



But Now i need to take the datas below the Application(Data) .How can i take those datas.please assist me to do this.

Thanks.
 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
By doing like the following ,I can able to take the datas below the channel from


Channel Location State Application(Data)
SIP/5104-0a0bb988 (None) Up Bridged Call(SIP/5102-0a0a9cf8
SIP/5102-0a0a9cf8 s@macro-dial:7 Up Dial(SIP/5104||tr)
2 active channels
1 active call


like


for (String line : response.getResult())
{
String channel=line.substring(0,line.indexOf(" "));
System.out.print(channel);
}


gave me the result


Channel
SIP/5104-0a0bb988
SIP/5102-0a0a9cf8
2 active channels
1 active call



But Now i need to take the datas below the Application(Data) .How can i take those datas.please assist me to do this.

Thanks.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!