Skip to content
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

Can't set the caller id? #1152

Closed
babawarrior opened this issue Jul 27, 2024 · 10 comments
Closed

Can't set the caller id? #1152

babawarrior opened this issue Jul 27, 2024 · 10 comments

Comments

@babawarrior
Copy link

Hello, I'm trying out sipsorcery but i can't manage to set the caller id, it always calls as "No Caller ID", my sip doesn't require caller id registration.

If anyone can help me set the caller id, I would be very happy.

This is my code:

using System;
using SIPSorcery.SIP.App;
using SIPSorcery.Media;
using SIPSorceryMedia.Abstractions;

const string DESTINATION = "sip:[email protected]";
Console.WriteLine("SIP Get Started");

var userAgent = new SIPUserAgent();

var voipMediaSession = new VoIPMediaSession();
voipMediaSession.AcceptRtpFromAny = true;
voipMediaSession.AudioExtrasSource.SetSource(AudioSourcesEnum.Silence);

// Place the call and wait for the result.
bool callResult = await userAgent.Call(DESTINATION, "8511", "25228", voipMediaSession);
Console.WriteLine($"Call result {(callResult ? "success" : "failure")}.");
//voipMediaSession.Close("idgaf");
if(callResult == true)
{
    voipMediaSession.AudioExtrasSource.StartAudio();
    voipMediaSession.AudioExtrasSource.SendAudioFromStream(new FileStream("hello.raw", FileMode.Open), AudioSamplingRatesEnum.Rate8KHz);

}


Thread.Sleep(10000);
userAgent.Hangup();

@babawarrior
Copy link
Author

still need help

@babawarrior
Copy link
Author

Still need help

@sipsorcery
Copy link
Member

Most SIP Providers use the From header to set the callerID. The From header can be tricky to customise as it's also often used for authentication.

Try switching to the SIPUserAgent.Call overload that takes a SIPCallDescriptor. Set the From header to something like:

"Your Desired Caller ID" <username@siprovider,com>

As mentioned you may have to iterate a bit to get it in the form reqd by your SIP Provider.

There are also lots of other similar issues in this repo. If you search for "callerid" you should get some useful suggestions.

@sipsorcery
Copy link
Member

Feel free to re-open if any further info.

@babawarrior
Copy link
Author

babawarrior commented Nov 2, 2024

Feel free to re-open if any further info.

I'm having a issue where I just receive "Call Result Failure" when using SIPCallDescriptor.
`
const string DESTINATION = "sip:[email protected]";
const string from = "46735000000<[email protected]>";
SIPCallDescriptor callDescriptor = new SIPCallDescriptor("314444", "438800000", DESTINATION, from, null, null, null, null,
SIPCallDirection.Out, "application/sdp", null, null);

`

@sipsorcery
Copy link
Member

Seems more like a SIP Provider issue than a library issue.

Only suggestion i have is to add a space between the From name and URI:

const string from = "46735000000 <[email protected]>";

@babawarrior
Copy link
Author

babawarrior commented Nov 3, 2024

Seems more like a SIP Provider issue than a library issue.

Only suggestion i have is to add a space between the From name and URI:

const string from = "46735000000 <[email protected]>";

I dont think its a SIP Provider issue because ozeki sdk worked but its expensive and I dont got that money.
Edit: forgot to mention that it still gets call result faliure.

@babawarrior
Copy link
Author

If i privre

Seems more like a SIP Provider issue than a library issue.

Only suggestion i have is to add a space between the From name and URI:

const string from = "46735000000 <[email protected]>";

If I privately give you my sip credentials from diamondcard.us, you think you can try debug it? I've had this issue for months.

@sipsorcery
Copy link
Member

I won't troubleshoot it for you but you hvae options. Use Wireshark to capture the SIP request with ozeki and compare it with the one you are sending with this library. It will most likely be something to with the From header or a P-Asserted header.

@babawarrior
Copy link
Author

I won't troubleshoot it for you but you hvae options. Use Wireshark to capture the SIP request with ozeki and compare it with the one you are sending with this library. It will most likely be something to with the From header or a P-Asserted header.

I didn't solve it, but i found a work around, different sip providers have so you can in the dest choose the callerid so i switched to a different sip. Btw I tried on like 5 different sip providers, it never worked with SIPCallDescriptor. But atleast I found a work around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants