-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ringback sound #91
Comments
Hi, if I get you right, you want to stream a sound to a speaker device on a calling side before the call has been answered. For that you just have to create a sound player that will stream your audiofile to the speaker device and interconnect them via a ConferenceBridge. I'll stress that once again, you have to interconnect player and a speaker device, a call has nothing to do with the ringtone playback. A CallManager provides necessary callbacks for you to properly start and stop the playback at the right moments. |
@Lanista12 did it help? Did you figure this stuff out? |
@siniypin, no. Still trying figure that out. |
So what's the problem? Did you understand the suggestion? |
Yeah, I understood, but I realised that my approach was wrong from the begining. I found out that you don't need to send ringback tone at all. it seems like this is the issue. |
Check out this comment: #62 (comment) |
It didn't help. |
Can you post your code here? |
This is how I initialize UserAgent: var cfg = Configure.Pjsip4Net().With(x => x.Config.Require100Rel = true);
_ua = cfg.Build().Start();//build and start
_ua.ImManager.IncomingMessage += IncomingMessage;
_ua.CallManager.CallRedirected += CallRedirected;
_ua.CallManager.IncomingDtmfDigit += IncomingDtmfDigit;
_ua.ImManager.NatDetected += OnNatDetected;
_ua.CallManager.IncomingCall += CallManager_IncomingCall;
_ua.CallManager.Ring += CallManager_Ring;
_ua.CallManager.CallStateChanged += CallManager_CallStateChanged; |
I assume a |
Can you post a |
Here is my implementation of private void CallManager_Ring(object sender, RingEventArgs e)
{
// start ringtones
if (e.RingOn)
{
if (e.IsRingback)
{
MediaHandlers.StartRingback();
}
else
{
MediaHandlers.StartRingtone();
}
}
else
{
MediaHandlers.DetachAudio();
RechangeCurrentSpeaker();
}
} StartRingBack and StartRingTone is methods to play ringtones localy. |
So it is never executed, am I right? |
OK, I think I understand your problem a bit better now. Whenever you call a pjsip4net based app, the callee (basically any SIP-client) doesn't hear any ringback, because the app just never replies with 180. |
Ok. Roughly speaking, how long will it take for you to add this changes? |
I won't promise you anything. You have to understand that I voluntarily maintain this library and support you guys in my spare time. |
Ok. Not trying to compel you or something like that. Just trying to understand if you find it an easy task, so you can fix it super fast, or should I try to do that. Nothing else. |
@Lanista12 please do a favor, fix it and send me a pull request back. I'm currently overloaded. My idea was to track if the ring event has been handled by the app code and call a downstream API with proper params (http://www.pjsip.org/docs/latest-1/pjsip/docs/html/group__PJSUA__LIB__CALL.htm#ga6dd4a80bd96c319398e218bbffda5153) to tell pjsip to send 180 back . |
Ok. I'll do my best. |
Hello, Siniypin.
I have the same problem as in issue #39.
I used pjsip4net in my c# project and it works just fine. Quality is good, no interference or noise(other libraries had some problems with that), but there is one major problem: if someone calls me, the one does not hear any ringback sounds.
In issue #39 you gave an example how to solve this problem using conference bridge and WavPlayer.
https://gist.github.com/siniypin/47326a9fd78af95a3ff7
I tried to do that and I worked well, the caller heard every sound it played, but it worked only after I answered the call, and I need it to be played before I pick up the phone.
If I execute this code on
CallManager_Ring
event_ua.CallManager.Calls.First().ConferenceSlotId
return -1(I assume it is because I din't aswer the call yet, so connection is not established and ther is no media stream and sound port binded to it).If I execute the code anythere after
_call.Answer()
it return 1 and it works properly.P.S: Sorry for bad grammar. English is not my native language.
The text was updated successfully, but these errors were encountered: