File tree 4 files changed +23
-9
lines changed
SIPExamples/UserAgentClient
4 files changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ static void Main(string[] args)
52
52
bool isCallHungup = false ;
53
53
bool hasCallFailed = false ;
54
54
55
- Log = AddConsoleLogger ( LogEventLevel . Verbose ) ;
55
+ Log = AddConsoleLogger ( LogEventLevel . Debug ) ;
56
56
57
57
SIPURI callUri = SIPURI . ParseSIPURI ( DEFAULT_DESTINATION_SIP_URI ) ;
58
58
if ( args ? . Length > 0 )
Original file line number Diff line number Diff line change 5
5
</PropertyGroup >
6
6
7
7
<ItemGroup >
8
- <PackageReference Include =" Microsoft.Extensions.Logging" Version =" 5.0.0" />
9
- <PackageReference Include =" Microsoft.VisualStudio.Web.CodeGeneration.Design" Version =" 5.0.2" />
10
- <PackageReference Include =" Serilog.Extensions.Logging" Version =" 3.0.1" />
11
- <PackageReference Include =" Serilog.Sinks.Console" Version =" 3.1.1" />
8
+ <PackageReference Include =" Microsoft.Extensions.Logging" Version =" 9.0.0" />
9
+ <PackageReference Include =" Microsoft.VisualStudio.Web.CodeGeneration.Design" Version =" 9.0.0" />
10
+ <PackageReference Include =" Newtonsoft.Json" Version =" 13.0.3" />
11
+ <PackageReference Include =" Serilog.Extensions.Logging" Version =" 8.0.0" />
12
+ <PackageReference Include =" Serilog.Sinks.Console" Version =" 6.0.0" />
12
13
</ItemGroup >
13
14
14
15
<ItemGroup >
Original file line number Diff line number Diff line change 23
23
<PackageReference Include =" Microsoft.Extensions.Hosting" Version =" 5.0.0" />
24
24
<PackageReference Include =" Microsoft.Extensions.Hosting.WindowsServices" Version =" 5.0.1" />
25
25
<PackageReference Include =" Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version =" 1.10.9" />
26
+ <PackageReference Include =" Newtonsoft.Json" Version =" 13.0.3" />
26
27
<PackageReference Include =" Serilog.Extensions.Hosting" Version =" 4.1.2" />
27
28
<PackageReference Include =" Serilog.Settings.Configuration" Version =" 3.1.0" />
28
29
<PackageReference Include =" Serilog.Sinks.Console" Version =" 3.1.1" />
Original file line number Diff line number Diff line change @@ -1007,19 +1007,31 @@ private async Task DialogRequestReceivedAsync(SIPRequest sipRequest)
1007
1007
1008
1008
try
1009
1009
{
1010
- SDP offer = SDP . ParseSDPDescription ( sipRequest . Body ) ;
1010
+ SDP offer = ! string . IsNullOrWhiteSpace ( sipRequest . Body ) ? SDP . ParseSDPDescription ( sipRequest . Body ) : null ;
1011
1011
1012
1012
if ( sipRequest . Header . CallId == _oldCallID )
1013
1013
{
1014
1014
// A transfer is in progress and this re-INVITE belongs to the original call. More than likely
1015
1015
// the purpose of the request is to place us on hold. We'll respond with OK but not update any local state.
1016
1016
var answerSdp = MediaSession . CreateAnswer ( null ) ;
1017
- var okResponse = reInviteTransaction . GetOkResponse ( SDP . SDP_MIME_CONTENTTYPE , answerSdp . ToString ( ) ) ;
1018
- reInviteTransaction . SendFinalResponse ( okResponse ) ;
1017
+
1018
+ if ( answerSdp != null )
1019
+ {
1020
+ var okResponse = reInviteTransaction . GetOkResponse ( SDP . SDP_MIME_CONTENTTYPE , answerSdp . ToString ( ) ) ;
1021
+ reInviteTransaction . SendFinalResponse ( okResponse ) ;
1022
+ }
1023
+ else
1024
+ {
1025
+ logger . LogWarning ( "Unable to create an answer for the re-INVITE request." ) ;
1026
+ var notAcceptableResponse = SIPResponse . GetResponse ( sipRequest , SIPResponseStatusCodesEnum . NotAcceptable , "Unable to create an answer." ) ;
1027
+ reInviteTransaction . SendFinalResponse ( notAcceptableResponse ) ;
1028
+ }
1019
1029
}
1020
1030
else
1021
1031
{
1022
- var setRemoteResult = MediaSession . SetRemoteDescription ( SdpType . offer , offer ) ;
1032
+ // TODO: We should accept an empty re-INVITE body and send a new offer in the response. The remote peer can then send
1033
+ // back teh SDP answer in the ACK.
1034
+ var setRemoteResult = offer != null ? MediaSession . SetRemoteDescription ( SdpType . offer , offer ) : SetDescriptionResultEnum . Error ;
1023
1035
1024
1036
if ( setRemoteResult != SetDescriptionResultEnum . OK )
1025
1037
{
You can’t perform that action at this time.
0 commit comments