[Home]

Summary:ASTERISK-24692: PJSIP: Provisional 181 response during a call forward is given an SDP, which cancels ringing on devices without Asterisk providing an inband indication
Reporter:Matt Jordan (mjordan)Labels:
Date Opened:2015-01-15 09:38:29.000-0600Date Closed:2015-01-21 06:09:42.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Resources/res_pjsip
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:During a call forward, Asterisk will generate a 181 provisional response:

{code}
case AST_CONTROL_REDIRECTING:
if (ast_channel_state(ast) != AST_STATE_UP) {
response_code = 181;
} else {
res = -1;
}
break;
{code}

This is a nice thing to do. Unfortunately, PJSIP adds an SDP to the 181 provisional response:

{noformat}
<--- Transmitting SIP response (954 bytes) to UDP:x.x.x.x:5060 --->
SIP/2.0 181 Call Is Being Forwarded
Via: SIP/2.0/UDP x.x.x.x:5060;rport=5060;received=y.y.y.y;branch=z9hG4bKPjIo3GpwdBfAvZOr3Ammsvn0cjRkI5q9RN
Call-ID: 8O.T2t9YnJ2FxgX.0EOU39LdzCG0Gr2E
From: "201" <sip:201@x.x.x.x>;tag=j5rsF30Mb05sMX0.PooGb60vyQJoCVHK
To: <sip:202@y.y.y.y>;tag=8d16b0c3-ef2d-4edf-b04d-aa0d4b15dd6f
CSeq: 12807 INVITE
Server: Asterisk PBX 13.1.0
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REGISTER, REFER
Contact: <sip:z.z.z.z:5060>
Diversion: <sip:202@z.z.z.z>;reason=unknown
Content-Type: application/sdp
Content-Length:   311

v=0
o=- 116652538 116652540 IN IP4 z.z.z.z
s=Asterisk
c=IN IP4 z.z.z.z
t=0 0
m=audio 19124 RTP/AVP 9 0 8 111 96
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
{noformat}

The SDP causes the device that receives the 181 to stop generating ringing, which is appropriate - it was informed that media may be flowing to it, so it stops generating the ringing tone.

Unfortunately, Asterisk didn't get the memo, and so no audio flows from Asterisk to the phone.

Alas, the notion of slapping an SDP on the 181 (which is allowed) is occurring down in PJSIP land:

{code}
    if (st_code/100==2 || (st_code/10==18 && st_code!=180)) {
{code}

So, we either have to fix this in PJSIP, or we have to buck up and generate some ringing for the device ourselves.
Comments:By: Joshua C. Colp (jcolp) 2015-01-21 06:09:35.603-0600

This has been fixed upstream in pjproject as of changeset 4975 and backported into our git in commit 86e700f4aebb2892d4257dcd5cef2ffb159bdb26.