From: Mark Michelson Date: Wed, 20 May 2009 20:45:05 +0000 (+0000) Subject: Get rid of some duplicated code and correct a connected line error. X-Git-Tag: 11.0.0-beta1~4852 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=56903a748528db95c5ef22fbc1a0ee0b94bab090;p=thirdparty%2Fasterisk.git Get rid of some duplicated code and correct a connected line error. 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 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index b2ad586dd0..1f3f1554b3 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -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",