The recordingFilterSave method creates or replaces the existing recording filter.
bool recordingFilterSave( string section, RecordingFilter filter );
Name of parameter | Type | Description |
section | string | Section, from where to load filter. It can be one of following values:
|
filter | RecordingFilter | Recording filter object, which will be created/edited. |
If the function succeds, the return boolean TRUE value.
If the function fails, then one of folloiwng SOAP Exceptions is thrown.
NotFoundException | Invalid section parameter |
InvalidSyntaxException | Syntax of condition is not valid |
InvalidParameterException | One of filter options is invalid. For example, name is empty or contains invalid character. |
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.
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) }