Skip to content

Commit

Permalink
cami: Increase max wait time.
Browse files Browse the repository at this point in the history
Increase max wait time from 500ms to 1s.

This is kind of a sloppy fix, so it can
really only be done to a point. However,
there seems to be at least one scenario
where, for some reason, AMI is (apparently)
legitimately blocking for longer than 500ms
but less than 1s.

Example debug:

1657483794:439 : 169 : DATA FROM AMI
1657483794:439 : 263 : Asterisk left us high and dry for the end of the response, polling again...
1657483794:489 : 158 : Response pending this loop (13180/1048576)!
1657483795:808 : 158 : Response pending this loop (13180/1048576)!
1657483795:808 : 169 : DATA FROM AMI
1657483795:808 : 229 : Unsolicited event
1657483795:808 : 719 : <== AMI Response: Response: Success

What's a bit strange is that even though it's blocked for
about 320 ms in this example, the size of the response doesn't
actually increase by the time the response finishes. However,
the existing code does successfully detect an EOM at that point
and dispatch the response.

So, to account for this, we increase the max wait time to 1000ms
which should at least address this kind of situation.
  • Loading branch information
InterLinked1 committed Jul 10, 2022
1 parent cd3fc98 commit 6d57c7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/cami.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

/* Max wait time in ms. Don't be tempted to make this too big, as this blocks all AMI traffic. Most of the time, it shouldn't really matter though. */
#define AMI_MAX_WAIT_TIME 500
#define AMI_MAX_WAIT_TIME 1000

/* Currently, it is expected that any single AMI response fit within a single buffer, so responses larger than this may be truncated and corrupted. */
#define AMI_BUFFER_SIZE 1048576
Expand Down

0 comments on commit 6d57c7c

Please sign in to comment.