예제 #1
0
void MainWindow::dialButtonClicked()
{
    QPushButton *senderButton = (QPushButton *) sender();
    if(!senderButton)
        return;

    const QString dtxt = senderButton->text();
    const int cp = ui->uriComboBox->lineEdit()->cursorPosition();
    QString ct = ui->uriComboBox->currentText();
    ct.insert(cp, dtxt);
    ui->uriComboBox->setCurrentText(ct);
    ui->uriComboBox->lineEdit()->setCursorPosition(cp+1);

    const QString state = voipc.state();

    if (state.compare("CONNECTING") == 0 || state.compare("CONFIRMED") == 0) {
        sendDtmf(dtxt.at(0).toLatin1());
    }
}
예제 #2
0
SipperMediaDTMFCodec::SipperMediaDTMFCodec(const std::string &sendFile, const std::string &recvFile)
{
   _sendState = STATE_NONE;
   _listLen = 0;

   if(sendFile.length() > 0)
   {
      FILE *fp = fopen(sendFile.c_str(), "r");

      if(fp != NULL)
      {
         char data[201]; data[200] = '\0';
         while(fgets(data, 200, fp) != NULL)
         {
            sendDtmf(data);
         }

         fclose(fp);
      }
   }
}