Ejemplo n.º 1
0
// Play a series of tones
bool playTones(char* szPlayTones, SIPX_CALL hCall)
{
    bool bRC = true ;

    while (*szPlayTones)
    {
        int toneId = *szPlayTones++ ;

        if (    (toneId >= '0' && toneId <= '9') ||
            (toneId == '#') || (toneId == '*') || toneId == ',' || toneId == '!')
        {
            if (toneId == ',')
            {
                printf("<-> Playtone: Sleeping for 2 seconds\n") ;
                SLEEP(2000) ;
            }
            else
            {
                printf("<-> Playtone: %c\n", toneId) ;
                sipxCallStartTone(hCall, (SIPX_TONE_ID) toneId, true, false) ;
                SLEEP(250) ;
            }
        }
        else
        {
            bRC = false ;
            break ;
        }
    }

    return bRC ;
}
Ejemplo n.º 2
0
void DialPadButton::OnMouseDown(wxMouseEvent& event)
{
    if (sipXmgr::getInstance().getCurrentCall() > 0)
    {
        sipxCallStartTone(sipXmgr::getInstance().getCurrentCall(), mToneId, true, true);
    }
    event.Skip();
}
Ejemplo n.º 3
0
// Play a series of tones
bool playTones(char* szPlayTones)
{
    bool bRC = true ;

    while (*szPlayTones)
    {
        int toneId = *szPlayTones++ ;

        if (    (toneId >= '0' && toneId <= '9') ||
                (toneId == '#') || (toneId == '*') || toneId == ',' || toneId == '!')
        {
            if (toneId == ',')
            {
                printf("<-> Playtone: Sleeping for 2 seconds\n") ;
                SLEEP(2000) ;
            }
            else
            {
                printf("<-> Playtone: %c\n", toneId) ;
                SLEEP(250) ;
                if (sipxCallStartTone(g_hCall, (SIPX_TONE_ID) toneId, true, true) != SIPX_RESULT_SUCCESS)
                {
                    printf("Playtone returned error\n");
                }
                SLEEP(500) ;
                sipxCallStopTone(g_hCall) ;
            }
        }
        else
        {
            bRC = false ;
            break ;
        }

    }

    return bRC ;
}
Ejemplo n.º 4
0
int CallStartToneCommand::execute(int argc, char* argv[])
{
	int commandStatus = CommandProcessor::COMMAND_FAILED;
	if(argc == 4)
	{
		if(sipxCallStartTone(atoi(argv[1]), ID_TONE_BUSY,
			atoi(argv[2]), atoi(argv[3])) == SIPX_RESULT_SUCCESS)
		{
			printf("Tone is being played.\n");
		}
		else
		{
			printf("Tone was unable to be played.\n");
		}
	}
	else
	{
		UtlString usage;
        getUsage(argv[0], &usage);
        printf("%s", usage.data());
        commandStatus = CommandProcessor::COMMAND_BAD_SYNTAX;
	}
	return commandStatus;
}