Get rid of some duplicated code and correct a connected line error.
authorMark Michelson <mmichelson@digium.com>
Wed, 20 May 2009 20:45:05 +0000 (20:45 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 20 May 2009 20:45:05 +0000 (20:45 +0000)
When receiving a 200 OK response to an INVITE, it was possible to transmit two
connected line updates instead of a single one. Furthermore, the second did not
have the proper information present.

Now the two have been combined into a single update and the correct information
is presented.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195798 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index b2ad586..1f3f155 100644 (file)
@@ -17466,7 +17466,7 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru
                                        ast_set_flag(&p->flags[0], SIP_PENDINGBYE);
                }
 
-               if (!req->ignore && p->owner && get_rpid(p, req)) {
+               if (!req->ignore && p->owner && (get_rpid(p, req) || !reinvite)) {
                        /* Queue a connected line update */
                        ast_party_connected_line_init(&connected);
                        connected.id.number = (char *) p->cid_num;
@@ -17497,9 +17497,6 @@ static void handle_response_invite(struct sip_pvt *p, int resp, char *rest, stru
 
                if (!req->ignore && p->owner) {
                        if (!reinvite) {
-                               struct ast_party_connected_line connected;
-                               ast_party_connected_line_collect_caller(&connected, &p->owner->cid);
-                               ast_channel_queue_connected_line_update(p->owner, &connected);
                                ast_queue_control(p->owner, AST_CONTROL_ANSWER);
                                if (sip_cfg.callevents)
                                        manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",