I wanted a simple solution for automatically call a number, play a wav then hangup.
I'm completely new to linphone.
I started to make a little perl wrapper over linphonec. It was working, but to make it better I wanted libphonec to notify me back when the wav file was all streamed to the client.
Looking around the C source code and found a way to be callbacked by using ms_filter_set_notify_callback
I've made a patch that exposes a new public function in linphonecore.h.
void linphone_core_set_play_file_with_cb(LinphoneCore *lc, const char *file, MSFilterNotifyFunc cb);
the original linphone_core_set_play_file calls linphone_core_set_play_file_with_cb with NULL for cb
so that all existing program will work as expected.
The new API user could register a callback with linphone_core_set_play_file_with_cb and
the callback will be triggered when the streaming of the file is completed.
I've also moved 2 variables declarations that were causing problem because they were unused when I compiled with --disable-video
Here's the patch that does that.
Regards,
-tony