Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] AGI Record File / what does randomerror mean? res_agi.c / line 2377


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
tg at ovm-group.com
Guest





PostPosted: Thu Jul 31, 2014 4:24 am    Post subject: [asterisk-users] AGI Record File / what does randomerror mea Reply with quote

Hi,

I have a question about this here:

Asterisk-Version: 11.10.2
File: res/res_agi.c
Line: 2377

[...]
static int handle_recordfile(struct ast_channel *chan, AGI *agi, int
argc, const char * const argv[])
2304 {
2305 struct ast_filestream *fs;
2306 struct ast_frame *f;
2307 struct timeval start;
2308 long sample_offset = 0;
2309 int res = 0;
2310 int ms;
[...]
2365 /* backward compatibility, if no offset given, arg[6] would
have been
2366 * caught below and taken to be a beep, else if it is a
digit then it is a
2367 * offset */
2368 if ((argc >6) && (sscanf(argv[6], "%30ld", &sample_offset)
!= 1) && (!strchr(argv[6], '=')))
2369 res = ast_streamfile(chan, "beep",
ast_channel_language(chan));
2370
2371 if ((argc > 7) && (!strchr(argv[7], '=')))
2372 res = ast_streamfile(chan, "beep",
ast_channel_language(chan));
2373
2374 if (!res)
2375 res = ast_waitstream(chan, argv[4]);
2376 if (res) {
2377 ast_agi_send(agi->fd, chan, "200 result=%d
(randomerror) endpos=%ld\n", res, sample_offset);
2378 } else {
2379 fs = ast_writefile(argv[2], argv[3], NULL, O_CREAT
| O_WRONLY | (sample_offset ? O_APPEND : 0), 0, AST_FILE_MODE);
2380 if (!fs) {
2381 res = -1;
2382 ast_agi_send(agi->fd, chan, "200 result=%d
(writefile)\n", res);
2383 if (sildet)
2384 ast_dsp_free(sildet);
2385 return RESULT_FAILURE;
2386 }

In line 2377 I find "randomerror". And in fact I get this "error"
sometimes in my AGI-Scripts but can not reproduce them by my own.

Can anybody tell me please, when this message will be fired? I do not
really understand this source at this point. The message will be sent,
when "res" is true (or larger 0). "res" should be set in the lines
before. MAYBE "res" is 0 in line 2377 when the call hangs up at this point?

Best regards
-Thorsten-

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services