diff -u -r1.806 chan_sip.c --- channels/chan_sip.c 9 Aug 2005 16:41:28 -0000 1.806 +++ channels/chan_sip.c 16 Aug 2005 15:10:16 -0000 @@ -412,6 +412,7 @@ char *osptoken; int addsipheaders; char *vxml_url; + char *uri_options; char *auth; char *authheader; }; @@ -1842,6 +1843,8 @@ /* Check whether there is a VXML_URL variable */ if (!options.vxml_url && !strcasecmp(ast_var_name(current),"VXML_URL")) { options.vxml_url = ast_var_value(current); + } else if (!options.uri_options && !strcasecmp(ast_var_name(current),"URI_OPTIONS")) { + options.uri_options = ast_var_value(current); } else if (!options.distinctive_ring && !strcasecmp(ast_var_name(current),"ALERT_INFO")) { /* Check whether there is a ALERT_INFO variable */ options.distinctive_ring = ast_var_value(current); @@ -4281,7 +4284,7 @@ } /*--- initreqprep: Initiate 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 *vxml_url, char *uri_options) { char invite[256]=""; char from[256]; @@ -4366,6 +4369,11 @@ snprintf(invite, sizeof(invite), "sip:%s%s", p->tohost, urioptions); } ast_copy_string(p->uri, invite, sizeof(p->uri)); + + /* If URI OPTIONS is set, append those options */ + if (uri_options) + snprintf(invite, sizeof(invite), "%s;%s", p->uri, uri_options); + /* If there is a VXML URL append it to the SIP URL */ if (vxml_url) { @@ -4400,7 +4408,8 @@ /* Bump branch even on initial requests */ p->branch ^= rand(); build_via(p, p->via, sizeof(p->via)); - initreqprep(&req, p, sipmethod, options ? options->vxml_url : (char *) NULL); + initreqprep(&req, p, sipmethod, options ? options->vxml_url : (char *) NULL, + options ? options->uri_options : (char *) NULL); } else reqprep(&req, p, sipmethod, 0, 1); @@ -4574,7 +4583,7 @@ char *t = tmp; size_t maxbytes = sizeof(tmp); - initreqprep(&req, p, SIP_NOTIFY, NULL); + initreqprep(&req, p, SIP_NOTIFY, NULL, NULL); add_header(&req, "Event", "message-summary"); add_header(&req, "Content-Type", default_notifymime); @@ -7835,7 +7844,7 @@ continue; } - initreqprep(&req, p, SIP_NOTIFY, NULL); + initreqprep(&req, p, SIP_NOTIFY, NULL, NULL); for (var = varlist; var; var = var->next) add_header(&req, var->name, var->value);