sipsorcery icon indicating copy to clipboard operation
sipsorcery copied to clipboard

SIPUserAgent.Call can now be called with the addition AuthName optional parameter.

Open breeblebrax opened this issue 3 years ago • 2 comments

Added Optional Parameter to function Filename: SIPUserAgent.cs

public Task Call(string dst, string username, string password, IMediaSession mediaSession, int ringTimeout = 0, string optionalAuthUserName = null) {

Using is here.

        SIPCallDescriptor callDescriptor = new SIPCallDescriptor(
           username ?? SIPConstants.SIP_DEFAULT_USERNAME,
           password,
           dstUri.ToString(),
           fromHeader,
           dstUri.CanonicalAddress,
           null, null, optionalAuthUserName,
           SIPCallDirection.Out,
           SDP.SDP_MIME_CONTENTTYPE,
           null,
           null);

breeblebrax avatar Jan 20 '22 20:01 breeblebrax

I'm a bit reluctant to add the optionalAuthUserName as an additional optional parameter to the Call method. The intent with that method is to target ease of use for new developers. Once a dev has some familiarity with how things work it's hopefully not too big a leap to use the full SIPCallDescriptor method.

The AuthUsername is not that widely used a parameter and once one it gets added to Call it's likely they'll be requests to add more and then it will end up as complex as the SIPCallDescriptor.

sipsorcery avatar Jan 21 '22 21:01 sipsorcery

I see the concern, I will do it the other way. Thanks for your response! Cheers

breeblebrax avatar Jan 21 '22 23:01 breeblebrax