Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
################################################################################
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
################################################################################

/.vs
/out
/temp
4 changes: 3 additions & 1 deletion src/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
#include <string>
#include <vector>
#include <sstream>
#include <thread>
#include <cstring>
#include <ctime>
#include <cassert>
#include <chrono>

#include "commands.h"
#include "state.h"
Expand Down Expand Up @@ -497,7 +499,7 @@ bool Wait::RunCommand(const std::string &loopsuffix) {
return true;
}
//cout << "Wait: usleep " << n << endl;
usleep(WAIT_SLEEP_ACCURACY * 1000);
std::this_thread::sleep_for(std::chrono::duration<int, std::milli>(WAIT_SLEEP_ACCURACY));
if(!closed
&& TPState::Instance().GetState() == TPState::TERMINATED) {
errorstring = "Wait: application terminated";
Expand Down
8 changes: 4 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#include <iostream>
#include <sstream>
#include <chrono>
#include <thread>
#include <signal.h>
#include "main.h"
#include "commands.h"
Expand Down Expand Up @@ -459,10 +461,8 @@ bool Manager::SendDTMF(const PString &dtmf)
// sleep a while
std::cout << "sent DTMF: [" << dtmf[i] << "]" << std::endl;

struct timespec tp;
tp.tv_sec = 0;
tp.tv_nsec = 500 * 1000 * 1000; // half a second
nanosleep (&tp, 0);
using namespace std::chrono_literals;
std::this_thread::sleep_for(500ms);
}
}
ok = (i == dtmf.GetSize() - 1 ? true : false);
Expand Down