?

Log in

No account? Create an account
Phone Post: - brad's life — LiveJournal [entries|archive|friends|userinfo]
Brad Fitzpatrick

[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Phone Post: [Mar. 12th, 2004|03:06 pm]
Brad Fitzpatrick
[Tags|]

VoicePost
137K 0:36
“So, Michael and I have rewritten phonepostd, and this is a test. And indeed, my little file is growing. Go, little file! And it hasn't been deleted so far, so that's good. Ummm, yeah.

Say "Hi," Michael.

"Hello!"

Um, should we go get Mark Smith to sing us a song?

Yeah, I think we should.

Oh, but he's not here. Oh, Jesse wants to talk. Hey Jesse, can you sing us a song?

How can I sing you a song, get you phone away from me, bastard.

Yeah, that's the kind sort of kind fellows we have working here. Okay, bye.”

Transcribed by: multiple users
LinkReply

Comments:
[User Picture]From: lisa
2004-03-12 03:08 pm (UTC)
you guys need to get some women in there fast.
(Reply) (Thread)
[User Picture]From: deveiant
2004-03-12 03:16 pm (UTC)
Yeah, what were we thinking? Who would have sung suprano? =;)
(Reply) (Parent) (Thread)
[User Picture]From: lisa
2004-03-12 03:17 pm (UTC)
i can smell the testosterone from here!!
(Reply) (Parent) (Thread)
[User Picture]From: taral
2004-03-12 04:00 pm (UTC)
Why was the file getting deleted?
(Reply) (Thread)
[User Picture]From: brad
2004-03-12 04:34 pm (UTC)
So as you're recording, a file named

$userid-$time.wav

gets appended... file size keeps getting bigger, mtime updated, etc.

When you hang up or choose a posting option, the Asterisk AGI script drops a "queue info" file beside it, with info on where/how to post it:

$userid-$time.qinfo

Now, phonepostd comes along and looks at all the files in this spool directory.

If a qinfo file is there, and the wav is there, it needs to be encoded to:

$userid-$time.ogg

Once that's done, the ogg needs to be uploaded to the user's blob cluster, and a blobid returned.

Once that's done, the LJ post is made.

But keep in mind that any step can fail:

-- encoding the ogg
-- posting to blob server
-- posting to LJ

So it writes up a diagnostic at:

$userid-$posttime.err

If any part fails. But it never looks at that text. It just uses the mtime of the *.err file to know how long ago it last failed and delay retrying too quick.

It adds state info to the *.qinfo file... like storing the blobid and seconds of the file (from the encoding and upload steps) once those files are deleted, before the LJ post is made.

Before this was all very hokey, and some error cases weren't handled. Finally cleaned it all up and made it robust.

The deletion reference was that we have a rule "If $userid-$posttime.* exists, but not the corresponding *.qinfo file, delete all those files, since we can't do anything." That's useful both to clean up historic crud, and used to clean up itself.

But the rewrite initially contained a bug where we'd delete a recording in progress (*.wav) because it existed and there was no correspoding *.qinfo. Added in a check for that.

All's clean and happy now.
(Reply) (Parent) (Thread)