Page 1 of 1 [ 16 posts ] 

anomie
Sea Gull
Sea Gull

User avatar

Joined: 22 Jan 2010
Age: 48
Gender: Female
Posts: 201

21 Apr 2010, 8:18 am

Just thought I'd put the feelers out ...

Struggling to talk to it in perl at the moment. Is indeed a struggle as am learning perl at same time. All on some silly 3-day deadline of course, how else will it ever be?



cyberscan
Veteran
Veteran

User avatar

Joined: 16 Apr 2008
Age: 58
Gender: Male
Posts: 1,296
Location: Near Panama, City Florida

21 Apr 2010, 8:28 am

I love Asterisk. If you are programming AGI, I use C to handle most of mine. Just stay away from Gizmo. It was bought by and screwed up by Google.


_________________
I am AUTISTIC - Always Unique, Totally Interesting, Straight Talking, Intelligently Conversational.
I am also the author of "Tech Tactics Money Saving Secrets" and "Tech Tactics Publishing and Production Secrets."


anomie
Sea Gull
Sea Gull

User avatar

Joined: 22 Jan 2010
Age: 48
Gender: Female
Posts: 201

21 Apr 2010, 8:54 am

Hey that was quick, I thought I'd be waiting ages for a reply.

My task is to capture Asterisk Manager Events, translate them into some weird proprietary codes and send the latter off down a serial cable (don't even ask).

I've got all the bits and pieces together apart from one, which sounds like it should be simple - I just need a script that will initiate an Asterisk Manager session (just a case of sending some login informaion) and then listen on the relevant port. Once the events are coming in I can parse them, send over the serial port, no problem.

I haven't learnt C yet, and besides my boss doesn't want me to use it.

I can't believe how stuck I am on this - I just want the damn thing to shake hands with the AMI and print out the responses to the console, then I can do the rest.

Probably I'm just missing something on the conceptual level, in which case all I can do is keep fiddling about till the lightning strikes.



cyberscan
Veteran
Veteran

User avatar

Joined: 16 Apr 2008
Age: 58
Gender: Male
Posts: 1,296
Location: Near Panama, City Florida

21 Apr 2010, 9:03 am

Are you tying to use this in order to log and bill calls like a SMDR (Station Messaging Detail Recorder)‎?


_________________
I am AUTISTIC - Always Unique, Totally Interesting, Straight Talking, Intelligently Conversational.
I am also the author of "Tech Tactics Money Saving Secrets" and "Tech Tactics Publishing and Production Secrets."


anomie
Sea Gull
Sea Gull

User avatar

Joined: 22 Jan 2010
Age: 48
Gender: Female
Posts: 201

21 Apr 2010, 9:11 am

That's the kind of thing, yes. The customer has a bespoke system that listens for these weird codes on the COM port (codes that their old PBX used to output) that tell it when someone has answered, hung up and so on. They want to replace their old PBX with Asterisk and instead of changing this other software, they've decided the mountain should come to Mohammed, so I have to make the Asterisk server send the same event codes as their old PBX did.

I'm relatively new to this malarkey (I was a database programmer before), so I might be barking up the wrong tree, but my boss said to use Asterisk Manager Events so that is what I am doing.



anomie
Sea Gull
Sea Gull

User avatar

Joined: 22 Jan 2010
Age: 48
Gender: Female
Posts: 201

21 Apr 2010, 9:26 am

Think I'll just do some sort of hideous kludge with Bash and Telnet



cyberscan
Veteran
Veteran

User avatar

Joined: 16 Apr 2008
Age: 58
Gender: Male
Posts: 1,296
Location: Near Panama, City Florida

21 Apr 2010, 9:36 am

Have you looked at the following?

http://www.voip-info.org/wiki/view/Asterisk+manager+API


_________________
I am AUTISTIC - Always Unique, Totally Interesting, Straight Talking, Intelligently Conversational.
I am also the author of "Tech Tactics Money Saving Secrets" and "Tech Tactics Publishing and Production Secrets."


cyberscan
Veteran
Veteran

User avatar

Joined: 16 Apr 2008
Age: 58
Gender: Male
Posts: 1,296
Location: Near Panama, City Florida

21 Apr 2010, 9:41 am

I wish I could help you with the PERL thingie, but PERL is not my area of expertise.


_________________
I am AUTISTIC - Always Unique, Totally Interesting, Straight Talking, Intelligently Conversational.
I am also the author of "Tech Tactics Money Saving Secrets" and "Tech Tactics Publishing and Production Secrets."


anomie
Sea Gull
Sea Gull

User avatar

Joined: 22 Jan 2010
Age: 48
Gender: Female
Posts: 201

21 Apr 2010, 10:13 am

I've found another possibility now, in php ... it looks so beautifully simple... hope it works ... maybe this will turn my day around ...

<?php

$socket = fsockopen("192.168.0.53","5038", $errno, $errstr, $timeout);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: admin\r\n");
fputs($socket, "Secret: blabla\r\n\r\n");

$wrets=fgets($socket,128);

?>



anomie
Sea Gull
Sea Gull

User avatar

Joined: 22 Jan 2010
Age: 48
Gender: Female
Posts: 201

21 Apr 2010, 10:25 am

HURRAH!! !! ! -- I got up, made a coffee, had a good moan on the phone to a mate... and the solution presented itself. It's often the way.

Thanks though - now I know there's another Asterisk guy on the forum, I'm sure I'll be posting in this section again.


anomie@testserver3:~$ ./trying_php

Asterisk Call Manager/1.1
Response: Success
Message: Authentication accepted



cyberscan
Veteran
Veteran

User avatar

Joined: 16 Apr 2008
Age: 58
Gender: Male
Posts: 1,296
Location: Near Panama, City Florida

21 Apr 2010, 10:25 am

Cool. I was going to get the SMDR software specs from you and hack up a program in C to do the job. I know your boss doesn't like C, but C is easily translatable into many other languages. I'm glad you found a better solution. PHP is a mixture of HTML and C basically.


_________________
I am AUTISTIC - Always Unique, Totally Interesting, Straight Talking, Intelligently Conversational.
I am also the author of "Tech Tactics Money Saving Secrets" and "Tech Tactics Publishing and Production Secrets."


anomie
Sea Gull
Sea Gull

User avatar

Joined: 22 Jan 2010
Age: 48
Gender: Female
Posts: 201

21 Apr 2010, 10:38 am

I'm glad you didn't 'cos it's not standard SMDR (as far as I can tell).

The codes are things like
C01000222

which means
Call on line 100 answered by extension 222

and
A0222

which means
Call on extension 222 is finished

Is that standard SMDR protocol? I've been googling for what it might be and figured it was just some weird bespoke thing they had. I'd be very pleased though if I was proved wrong!



cyberscan
Veteran
Veteran

User avatar

Joined: 16 Apr 2008
Age: 58
Gender: Male
Posts: 1,296
Location: Near Panama, City Florida

21 Apr 2010, 11:10 am

There are several different protocols used. Each one used to be a big secret for the vendor. The good thing about Asterisk and SIP in general is the fact that these are forcing vendors to open up :-)


_________________
I am AUTISTIC - Always Unique, Totally Interesting, Straight Talking, Intelligently Conversational.
I am also the author of "Tech Tactics Money Saving Secrets" and "Tech Tactics Publishing and Production Secrets."


anomie
Sea Gull
Sea Gull

User avatar

Joined: 22 Jan 2010
Age: 48
Gender: Female
Posts: 201

21 Apr 2010, 11:57 am

Yes - that's what I love about it. I've been working with open source software exclusively for a few months now and I'm already used to just expecting everything to be open. "Oh, such-and-such doesn't work, right, I'll just have a look at the code - What do you mean, I can't have it?" :roll:



pakled
Veteran
Veteran

User avatar

Joined: 12 Nov 2007
Age: 68
Gender: Male
Posts: 7,015

21 Apr 2010, 11:56 pm

I know a guy who used to do phone troubleshooting over the web; they did Linux scripts (no Gui)
the horror...;)


_________________
anahl nathrak, uth vas bethude, doth yel dyenvey...


anomie
Sea Gull
Sea Gull

User avatar

Joined: 22 Jan 2010
Age: 48
Gender: Female
Posts: 201

26 Apr 2010, 6:27 am

pakled wrote:
I know a guy who used to do phone troubleshooting over the web; they did Linux scripts (no Gui)
the horror...;)


That's pretty much exactly what I do, all day 4 days a week. I get paid a pittance, and I travel for nearly 2 hours each way, too.

Oh and did I mention ... I love it!?