sipsorcery-org / sipsorcery

A WebRTC, SIP and VoIP library for C# and .NET. Designed for real-time communications apps.
https://sipsorcery-org.github.io/sipsorcery
Other
1.42k stars 432 forks source link

Can't set the caller id? #1152

Open babawarrior opened 1 month ago

babawarrior commented 1 month ago

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:4670000000@sip.9sip.net";
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 commented 1 month ago

still need help