Methods

getVersion

The getVersion method returns version of MiaRec application.

 

Syntax (in C#)

string getVersion();

 

 

Return Value

If the function succeds, the return boolean TRUE value.

If the function fails, SOAP Exceptions is thrown.

 

 

Example (in C#)

try
{
    string version service.getVersion();
    Console.WriteLine(version)
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message)
}

 

Sample output:

MiaRec(Duxoft) Version(3.0.557) Build(Jul 14 2010, 16:03:09)

 

 

reloadConfig

The reloadConfig method forces MiaRec application to re-read configuration from MiaRec.ini configuration file.

 

Syntax (in C#)

void reloadConfig();

 

 

Return Value

The method doesn't return any value. But may throw SOAP Exception, if execution fails.

 

 

Example (in C#)

try
{
    service.reloadConfig();
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message)
}

 

 

recordingFilterLoad

The recordingFilterLoad method returns recording filter object with specified name.

 

Syntax (in C#)

RecordingFilter recordingFilterLoad(
    string section, 
    string name
);

 

 

Parameters

Name of parameterTypeDescription
sectionstring

Section, from where to load filter. It can be one of following values:

  • OnCallStart
  • OnCallStop
namestring

Unique name of filter inside that section.

Special name "default_" is used for a default filter.

 

 

Return Value

If the function succeds, the return value is the filter objec of type RecordingFilter.

If the function fails, then one of folloiwng SOAP Exceptions is thrown.

 

NotFoundExceptionInvalid section parameter or filter with such name doesn't exist
InvalidParameterExceptionName parameter is empty

 

 

Example (in C#)

try
{
    MiaRec::RecordingFilter filter = service.recordingFilterLoad("OnCallStart", "filter1-");

    Console.WriteLine("name:      " + filter.name);
    Console.WriteLine("filename:  " + filter.filename);
    Console.WriteLine("condition: " + filter.condition);
    Console.WriteLine("action:    " + filter.action);

     MiaRec::RecordingFilterCustomParameter[] parameters = filter.customParameters;
     if (parameters != null)
     {
         for (int j = 0; j < parameters.Length; j++)
         {
             Console.WriteLine(parameters[j].name + ": " + parameters[j].value);
         }
     }
}
catch (FaultException<MiaRec::InvalidParameterException> ex)
{
    Console.WriteLine("Failed: " + ex.Detail.Description);
}
catch (FaultException<MiaRec::NotFoundException> ex)
{
    Console.WriteLine("Failed: " + ex.Detail.Description);
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message)
}

 

Sample output:

name:      filter1-
filename:  C:\Recordings\call.mp3
condition: caller-number = '123' OR callee-number = '123'
action:     record 
custom1: value1
custom2: value2

 

 

See Also

 

recordingFilterLoadAll

The recordingFilterLoadAll method returns all filters from specified section.

 

Syntax (in C#)

RecordingFilter[] recordingFilterLoadAll(
    string section
);

 

 

Parameters

Name of parameterTypeDescription
sectionstring

Section, from where to load filter. It can be one of following values:

  • OnCallStart
  • OnCallStop

 

 

Return Value

If the function succeds, the return value is an array of RecordingFilter objects.

If the function fails, then one of folloiwng SOAP Exceptions is thrown.

 

NotFoundExceptionInvalid section parameter

 

 

Example (in C#)

try
{
    MiaRec::RecordingFilter[] filters = service.recordingFilterLoadAll("OnCallStart");

    for (int i = 0; i < filters.Length; i++)
    {
       MiaRec::RecordingFilter filter = filters[i];

       Console.WriteLine("Filter #" + i + ":");
       Console.WriteLine("    name:      " + filter.name);
       Console.WriteLine("    filename:  " + filter.filename);
       Console.WriteLine("    condition: " + filter.condition);
       Console.WriteLine("    action:    " + filter.action);

       MiaRec::RecordingFilterCustomParameter[] parameters = filter.customParameters;
       if (parameters != null)
       {
           for (int j = 0; j < parameters.Length; j++)
           {
               Console.WriteLine("    " + parameters[j].name + ": " + parameters[j].value);
           }
       }
    }
}
catch (FaultException<MiaRec::NotFoundException> ex)
{
    Console.WriteLine("Failed: " + ex.Detail.Description);
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message)
}

 

Sample output:

Filter #0:
    name:      filter1-
    filename:  
    condition: caller-number = '123' OR callee-number = '123'
    action:    record
Filter #2:
    name:      filter2-
    filename:  
    condition: caller-number = '555' OR callee-number = '555'
    action:    record
Filter #3:
    name:      default_
    filename:  
    condition: 
    action:    ignore

 

 

See Also

 

recordingFilterSave

The recordingFilterSave method creates or replaces the existing recording filter.

 

Syntax (in C#)

bool recordingFilterSave(
    string section, 
    RecordingFilter filter
);

 

 

Parameters

Name of parameterTypeDescription
sectionstring

Section, from where to load filter. It can be one of following values:

  • OnCallStart
  • OnCallStop
filterRecordingFilterRecording filter object, which will be created/edited.

 

 

Return Value

If the function succeds, the return boolean TRUE value.

If the function fails, then one of folloiwng SOAP Exceptions is thrown.

 

NotFoundExceptionInvalid section parameter
InvalidSyntaxException
Syntax of condition is not valid
InvalidParameterExceptionOne of filter options is invalid. For example, name is empty or contains invalid character.

 

Remarks

This method creates/edits recording filter inside MiaRec.ini configuration file.

Method reloadConfig should be executed to apply changes to running MiaRec application.

Otherwise changes will be reloaded only when MiaRec is restarted.

 

Example (in C#)

try
{
    MiaRec::RecordingFilter filter = new MiaRec::RecordingFilter();

    filter.name = "filter2-";
    filter.priority = 0;
    filter.condition = "caller-number LIKE '200%' OR callee-number LIKE '200%'";
    filter.action = "record";

    filter.customParameters = new MiaRec::RecordingFilterCustomParameter[2];
    filter.customParameters[0].name =  "company-name";
    filter.customParameters[0].value = "Google";
    filter.customParameters[1].name =  "person-name";
    filter.customParameters[1].value = "John Smith";
    
    service.recordingFilterSave("OnCallStart", filter);
}
catch (FaultException<MiaRec::InvalidParameterException> ex)
{
    Console.WriteLine("Failed: " + ex.Detail.Description);
}
catch (FaultException<MiaRec::InvalidSyntaxException> ex)
{
    Console.WriteLine("Failed: " + ex.Detail.Description);
}
catch (FaultException<MiaRec::NotFoundException> ex)
{
    Console.WriteLine("Failed: " + ex.Detail.Description);
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message)
}

 

 

 

See Also

 

recordingFilterValidate

The recordingFilterValidate method checks if recording filter's options are valid (for example, if condition expression has valid syntax).

 

Syntax (in C#)

bool recordingFilterSave(
    RecordingFilter filter
);

 

 

Parameters

Name of parameterTypeDescription
filterRecordingFilterRecording filter object, which will be validated

 

 

Return Value

If the function succeds, the return boolean TRUE value.

If the function fails, then one of folloiwng SOAP Exceptions is thrown.

 

InvalidSyntaxException
Syntax of condition is not valid
InvalidParameterExceptionOne of filter options is invalid. For example, name is empty or contains invalid character.

 

 

Example (in C#)

try
{
    MiaRec::RecordingFilter filter = new MiaRec::RecordingFilter();

    filter.name = "filter2-";
    filter.priority = 0;
    filter.condition = "caller-number LIKE '200%' OR callee-number LIKE '200%'";
    filter.action = "record";

    filter.customParameters = new MiaRec::RecordingFilterCustomParameter[2];
    filter.customParameters[0].name =  "company-name";
    filter.customParameters[0].value = "Google";
    filter.customParameters[1].name =  "person-name";
    filter.customParameters[1].value = "John Smith";
    
    service.recordingFilterValidate(filter);
}
catch (FaultException<MiaRec::InvalidParameterException> ex)
{
    Console.WriteLine("Failed: " + ex.Detail.Description);
}
catch (FaultException<MiaRec::InvalidSyntaxException> ex)
{
    Console.WriteLine("Failed: " + ex.Detail.Description);
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message)
}

 

 

See Also

 

recordingFilterDelete

The recordingFilterDelete method removes filter from MiaRec.ini configuration file.

 

Syntax (in C#)

bool recordingFilterDelete(
    string section, 
    string name
);

 

 

Parameters

Name of parameterTypeDescription
sectionstring

Section, from where to load filter. It can be one of following values:

  • OnCallStart
  • OnCallStop
namestringUnique name of the filter

 

 

Return Value

If the function succeds, the return boolean TRUE value.

If the function fails, then one of folloiwng SOAP Exceptions is thrown.

 

NotFoundExceptionInvalid section parameter or filter with such name doesn't exist
InvalidParameterExceptionName is invalid (empty or contains invalid character)

 

Remarks

This method removes a recording filter from MiaRec.ini configuration file.

Method reloadConfig should be executed to apply changes to running MiaRec application.

Otherwise changes will be reloaded only when MiaRec is restarted.

 

Example (in C#)

try
{
    service.recordingFilterDelete("OnCallStart", "filter1-");
}
catch (FaultException<MiaRec::InvalidParameterException> ex)
{
    Console.WriteLine("Failed: " + ex.Detail.Description);
}
catch (FaultException<MiaRec::NotFoundException> ex)
{
    Console.WriteLine("Failed: " + ex.Detail.Description);
}
catch (Exception ex)
{
    Console.WriteLine(ex.Message)
}

 

 

See Also