Index: channels/chan_sip.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v retrieving revision 1.831 diff -u -r1.831 chan_sip.c --- channels/chan_sip.c 30 Aug 2005 21:59:01 -0000 1.831 +++ channels/chan_sip.c 31 Aug 2005 00:19:50 -0000 @@ -442,6 +442,7 @@ char *distinctive_ring; char *osptoken; int addsipheaders; + char *uri_options; char *vxml_url; char *auth; char *authheader; @@ -1940,6 +1941,8 @@ /* Check whether there is a VXML_URL variable */ if (!p->options->vxml_url && !strcasecmp(ast_var_name(current), "VXML_URL")) { p->options->vxml_url = ast_var_value(current); + } else if (!p->options->uri_options && !strcasecmp(ast_var_name(current), "URI_OPTIONS")) { + p->options->uri_options = ast_var_value(current); } else if (!p->options->distinctive_ring && !strcasecmp(ast_var_name(current), "ALERT_INFO")) { /* Check whether there is a ALERT_INFO variable */ p->options->distinctive_ring = ast_var_value(current); @@ -4385,7 +4388,7 @@ } /*--- initreqprep: Initiate new SIP request to peer/user ---*/ -static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmethod, char *vxml_url) +static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmethod) { char invite[256] = ""; char from[256]; @@ -4484,9 +4487,13 @@ } ast_copy_string(p->uri, invite, sizeof(p->uri)); + /* If URI OPTIONS is set, append those options */ + if (p->options && p->options->uri_options) + snprintf(invite, sizeof(invite), "%s;%s", p->uri, p->options->uri_options); + /* If there is a VXML URL append it to the SIP URL */ - if (vxml_url) { - snprintf(to, sizeof(to), "<%s>;%s", invite, vxml_url); + if (p->options && p->options->vxml_url) { + snprintf(to, sizeof(to), "<%s>;%s", invite, p->options->vxml_url); } else { snprintf(to, sizeof(to), "<%s>", invite); } @@ -4517,7 +4524,7 @@ /* Bump branch even on initial requests */ p->branch ^= rand(); build_via(p, p->via, sizeof(p->via)); - initreqprep(&req, p, sipmethod, p->options ? p->options->vxml_url : (char *) NULL); + initreqprep(&req, p, sipmethod); } else reqprep(&req, p, sipmethod, 0, 1); @@ -4780,7 +4787,7 @@ char *t = tmp; size_t maxbytes = sizeof(tmp); - initreqprep(&req, p, SIP_NOTIFY, NULL); + initreqprep(&req, p, SIP_NOTIFY); add_header(&req, "Event", "message-summary"); add_header(&req, "Content-Type", default_notifymime); @@ -8269,7 +8276,7 @@ continue; } - initreqprep(&req, p, SIP_NOTIFY, NULL); + initreqprep(&req, p, SIP_NOTIFY); for (var = varlist; var; var = var->next) add_header(&req, var->name, var->value);