]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip: Emit a second ringing event to ensure channel is found.
authorJoshua Colp <jcolp@digium.com>
Tue, 20 Feb 2018 16:33:43 +0000 (12:33 -0400)
committerJoshua Colp <jcolp@digium.com>
Tue, 20 Feb 2018 16:43:25 +0000 (12:43 -0400)
When constructing a dialog-info+xml NOTIFY message a ringing channel
is found if the state is ringing and further information is placed into
the message. Due to the migration to the Stasis message bus this did
not always work as expected.

This change raises a second ringing event in such a way to guarantee
that the event is received by chan_sip and another lookup is done to
find the ringing channel.

ASTERISK-24488

Change-Id: I547a458fc59721c918cb48be060cbfc3c88bcf9c

channels/chan_sip.c

index 563cea886bc4fcf7723fb7543d43fbfd2e359329..0a5caecb96111ed4263f58b4f8509a52152e73de 100644 (file)
@@ -23755,6 +23755,9 @@ static void handle_response_invite(struct sip_pvt *p, int resp, const char *rest
                        ast_queue_control(p->owner, AST_CONTROL_RINGING);
                        if (ast_channel_state(p->owner) != AST_STATE_UP) {
                                ast_setstate(p->owner, AST_STATE_RINGING);
+                               if (p->relatedpeer) {
+                                       ast_devstate_changed(AST_DEVICE_UNKNOWN, AST_DEVSTATE_NOT_CACHABLE, "SIP/%s", p->relatedpeer->name);
+                               }
                        }
                }
                if (find_sdp(req)) {