sipsorcery
sipsorcery copied to clipboard
Can't set the caller id?
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();
still need help
Still need help
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.
Feel free to re-open if any further info.
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);
`
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]>";
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.
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.
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 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.