CallerID not working using SIPSorcery .net 6 with Voip.ms #1181
Replies: 2 comments 2 replies
-
You'll need to dig into the voip.ms docs (or ask ChatGPT) what SIP header they use to set caller ID. It is normally the From header but not always. Other than that your example From header looks a bit weird, normally it would be:
|
Beta Was this translation helpful? Give feedback.
-
Finally I figure out!! Voip.ms has a rule that there is no documentation at all, but if you need to override caller_id you need to SETUP voip.ms like this: And in the code replace username with your callerId bool callResult = await userAgent.Call(DESTINATION, CALLER_ID, null, voipMediaSession); |
Beta Was this translation helpful? Give feedback.
-
Hi All!
When using SIPSorcery with .NET 6 to make SIP calls via VoIP.ms, the custom Caller ID is not being passed correctly, despite being set in the code.
We have setup in Voip.MS the setting ---> "I use a system capable of passing its own CallerID"
And the code that I'm using is this:
`
using ConsoleApp.Sipsorcery;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Serilog;
using Serilog.Extensions.Logging;
using SIPSorcery.Media;
using SIPSorcery.SIP;
using SIPSorcery.SIP.App;
public class Program
{
private static Microsoft.Extensions.Logging.ILogger _logger = NullLogger.Instance;
}
`
This the Serilog output:
[22:51:12 INF] SIP Get Started
[22:51:12 DBG] CreateRtpSocket attempting to create and bind RTP socket(s) on [::]:0.
[22:51:12 DBG] CreateBoundSocket attempting to create and bind socket(s) on [::]:0 using protocol Udp.
[22:51:12 DBG] CreateBoundSocket even port required, closing socket on [::]:49667 and retrying on 49668.
[22:51:12 DBG] CreateBoundSocket attempting to create and bind socket(s) on [::]:49669 using protocol Udp.
[22:51:12 DBG] CreateBoundSocket successfully bound on [::]:49669, dual mode True.
[22:51:12 DBG] Successfully bound RTP socket [::]:49668 (dual mode True) and control socket [::]:49669 (dual mode True).
[22:51:12 DBG] RTPChannel for [::]:49668 started.
[22:51:12 DBG] SIPClientUserAgent attempting to resolve atlanta2.voip.ms.
[22:51:13 DBG] SIPClientUserAgent resolved atlanta2.voip.ms to udp:MY_IP:5060 in 1074.87ms.
[22:51:13 DBG] UAC commencing call to sip:NUMBER_NUMBER@atlanta2.voip.ms:5060.
[22:51:14 DBG] CreateBoundSocket attempting to create and bind socket(s) on 0.0.0.0:0 using protocol Udp.
[22:51:14 DBG] CreateBoundSocket successfully bound on 0.0.0.0:57590.
[22:51:14 INF] SIP UDP Channel created for udp:0.0.0.0:57590.
[22:51:14 DBG] Information response 100 Trying for sip:NUMBER_NUMBER@atlanta2.voip.ms.
[22:51:14 INF] Call attempt to sip:NUMBER_NUMBER@atlanta2.voip.ms received a trying response INVITE 100 Trying.
[22:51:14 DBG] Response 603 Declined for sip:NUMBER_NUMBER@atlanta2.voip.ms.
[22:51:14 WRN] Call attempt was answered with failure response INVITE 603 Declined.
[22:51:14 WRN] Call failed. Retrying... (Attempt 1 of 5)
Beta Was this translation helpful? Give feedback.
All reactions