sipdotnet icon indicating copy to clipboard operation
sipdotnet copied to clipboard

Success create call but no sound when it picked up.

Open cheanizer opened this issue 7 years ago • 10 comments

Account account = new Account("1001","mypassword", "192.168.100.1");
 phone = new Phone(account);
 phone.PhoneConnectedEvent += delegate ()
 {
     phone.MakeCall("1002");
 }

this scripts are work. but when the call picked up from other party. the sound is not transfered. is it related your experimental feature "PlaybackDevices, CaptureDevices"? and can you give us an example how to use it?

cheanizer avatar Feb 13 '18 08:02 cheanizer

Could you please check (or put here full log) for any errors or warnings from linphone?

phone.LogEvent += delegate (string message)
{
	Console.WriteLine("[DEBUG] " + message);
};

By default, audio streams are managed by the linphone itself. Experimental features may affect only if you use them.

bedefaced avatar Feb 13 '18 19:02 bedefaced

got this warning

2018-02-14 03:06:47:624 ortp-message-Audio bandwidth for this call is 80

2018-02-14 03:06:47:625 ortp-warning-No card defined for playback !

2018-02-14 03:06:47:625 ortp-warning-No card defined for capture !

2018-02-14 03:06:47:626 ortp-warning-LinphoneCall[07065850] - advanced adaptive rate control requested but avpf is not activated in this stream. Reverting to basic rate control instead.

I am using win32 library here, windows 7 and dotnet 4.6.1, I am also trying to use library in lib folder and got same result. .

the script work well with your master branch. with dll library that included in lib folder of this project.

cheanizer avatar Feb 13 '18 20:02 cheanizer

Firstly, I recommend to try use libraries not from SDK, but from Linphone build (I've already collected them here).

Secondly, try to set manually devices for playback and capture. Available devices in system can be obtained by phone.PlaybackDevices and phone.CaptureDevices. When you identify desired devices for playback/capture, set their names to PlaybackDevice and CaptureDevice properties.

bedefaced avatar Feb 13 '18 20:02 bedefaced

  1. try with your zip library and got same result
  2. set manual devices for playback
List<string> list = phone.PlaybackDevices();
Console.WriteLine(value : string.Join("\t", list.Cast<string>().ToArray()));

got empty result. so i decide to debug, and it stop at LinphoneWrapper.cs line 230

IntPtr ptr = Marshal.ReadIntPtr(listPtr);

this line return zero but when

IntPtr listPtr = linphone_core_get_sound_devices(linphoneCore);

the result is not zero (I do console.write to string the result)

cheanizer avatar Feb 13 '18 20:02 cheanizer

After the last Windows 10 system update, I can't hear anything. Tried the dev-branch with no luck. I have also, the same problem with CaptureDevices and PlaybackDevices always 0.

Any ideas?

EDIT:

It seems that somehow VS2017 is doing weird stuff with /bin/Debug/ output folder, locking some files. In fact, if I create a new project and use your snippet, everything just works fine. The only difference I can tell in my code, is that you do Phone.Disconnect() almost immediately after Phone.MakeCallAndRecord();

Are there any restrictions with this wrapper? I was thinking about implement a Single Instance approach for my WPF program.

Maybe VS2017 did create multiple instances, causing troubles for linphone?

panagiac avatar Feb 14 '18 16:02 panagiac

Could you please test Linphone client itself? Does sound devices detecting work?

bedefaced avatar Feb 14 '18 18:02 bedefaced

@bedefaced I edited my post, please check it out! Thanks.

panagiac avatar Feb 14 '18 18:02 panagiac

@panagiac So, after creating new project audio works? (By the way, multiple instances should not be a problem, I tested calls between Phone instances in one program.)

bedefaced avatar Feb 14 '18 19:02 bedefaced

@bedefaced Only on the new one. Tomorrow I'll do more specific tests. Can I contact you elsewhere?? Thank you in advance!

panagiac avatar Feb 14 '18 20:02 panagiac

Back to master and use library from master and all work fine. The problem maybe on new lib linphone version.

cheanizer avatar Feb 15 '18 05:02 cheanizer