[asterisk-commits] mmichelson: branch group/CCSS r230214 - /team/group/CCSS/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Nov 13 17:01:14 CST 2009


Author: mmichelson
Date: Fri Nov 13 17:01:10 2009
New Revision: 230214

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=230214
Log:
Fix compile errors and add a call to sip_alloc.

More care will need to be taken to make the call to sip_alloc
more correct, but what's there will work somewhat.


Modified:
    team/group/CCSS/channels/chan_sip.c

Modified: team/group/CCSS/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/channels/chan_sip.c?view=diff&rev=230214&r1=230213&r2=230214
==============================================================================
--- team/group/CCSS/channels/chan_sip.c (original)
+++ team/group/CCSS/channels/chan_sip.c Fri Nov 13 17:01:10 2009
@@ -2868,7 +2868,7 @@
 static void transmit_fake_auth_response(struct sip_pvt *p, int sipmethod, struct sip_request *req, enum xmittype reliable);
 static int transmit_request(struct sip_pvt *p, int sipmethod, int inc, enum xmittype reliable, int newbranch);
 static int transmit_request_with_auth(struct sip_pvt *p, int sipmethod, int seqno, enum xmittype reliable, int newbranch);
-static int transmit_publish(struct sip_epa_entry *epa_entry, enum sip_publish_type publish_type);
+static int transmit_publish(struct sip_epa_entry *epa_entry, enum sip_publish_type publish_type, const char * body);
 static int transmit_invite(struct sip_pvt *p, int sipmethod, int sdp, int init);
 static int transmit_reinvite_with_sdp(struct sip_pvt *p, int t38version, int oldsdp);
 static int transmit_info_with_digit(struct sip_pvt *p, const char digit, unsigned int duration);
@@ -11717,30 +11717,30 @@
 	struct sip_request req;
 	char expires_str[10];
 
-	/* XXX Use sip_alloc and create_addr here */
+	sip_alloc(NULL, NULL, 0, SIP_PUBLISH, NULL);
 
 	req.method = SIP_PUBLISH;
 
 	pvt->branch = ast_random();
-	build_via(p);
-
-	initreqprep(&req, p, SIP_PUBLISH);
-
-	if (p->options && p->options->auth) {
-		add_header(&req, p->options->authheader, p->options->auth);
-	}
-
-	add_header("Event", epa_entry->event);
+	build_via(pvt);
+
+	initreqprep(&req, pvt, SIP_PUBLISH);
+
+	if (pvt->options && pvt->options->auth) {
+		add_header(&req, pvt->options->authheader, pvt->options->auth);
+	}
+
+	add_header(&req, "Event", epa_entry->event);
 
 	snprintf(expires_str, sizeof(expires_str), "%d", publish_type == SIP_PUBLISH_REMOVE ? 0 : DEFAULT_PUBLISH_EXPIRES);
-	add_header("Expires", expires_str);
+	add_header(&req, "Expires", expires_str);
 
 	if (publish_type != SIP_PUBLISH_INITIAL) {
-		add_header("SIP-If-Match", epa_entry->entity_tag);
+		add_header(&req, "SIP-If-Match", epa_entry->entity_tag);
 	}
 
 	add_line(&req, body);
-	send_request(p, &req, XMIT_RELIABLE, INITIAL_CSEQ);
+	send_request(pvt, &req, XMIT_RELIABLE, INITIAL_CSEQ);
 
 	return 0;
 }




More information about the asterisk-commits mailing list