--- libpri-1.4-2009-01-29/q931.c 2009-09-08 18:23:33.000000000 +0200 +++ libpri-1.4-2009-01-29.new/q931.c 2009-09-09 13:49:43.000000000 +0200 @@ -2782,7 +2782,7 @@ #ifdef ALERTING_NO_PROGRESS static int call_progress_ies[] = { -1 }; #else -static int call_progress_with_cause_ies[] = { Q931_PROGRESS_INDICATOR, Q931_CAUSE, -1 }; +static int call_progress_with_cause_ies[] = { Q931_CAUSE, Q931_PROGRESS_INDICATOR, -1 }; static int call_progress_ies[] = { Q931_PROGRESS_INDICATOR, -1 }; #endif @@ -2866,7 +2866,7 @@ return send_message(pri, c, Q931_CALL_PROCEEDING, call_proceeding_ies); } #ifndef ALERTING_NO_PROGRESS -static int alerting_ies[] = { Q931_PROGRESS_INDICATOR, Q931_IE_USER_USER, Q931_IE_FACILITY, -1 }; +static int alerting_ies[] = { Q931_IE_FACILITY, Q931_PROGRESS_INDICATOR, Q931_IE_USER_USER, -1 }; #else static int alerting_ies[] = { Q931_IE_FACILITY, -1 }; #endif @@ -2887,7 +2887,7 @@ return send_message(pri, c, Q931_ALERTING, alerting_ies); } -static int connect_ies[] = { Q931_CHANNEL_IDENT, Q931_PROGRESS_INDICATOR, Q931_IE_CONNECTED_NUM, Q931_IE_FACILITY, -1 }; +static int connect_ies[] = { Q931_CHANNEL_IDENT, Q931_IE_FACILITY, Q931_PROGRESS_INDICATOR, Q931_IE_CONNECTED_NUM, -1 }; int q931_setup_ack(struct pri *pri, q931_call *c, int channel, int nonisdn) { @@ -3012,7 +3012,7 @@ return send_message(pri, c, Q931_CONNECT, connect_ies); } -static int release_ies[] = { Q931_CAUSE, Q931_IE_USER_USER, Q931_IE_FACILITY, -1 }; +static int release_ies[] = { Q931_CAUSE, Q931_IE_FACILITY, Q931_IE_USER_USER, -1 }; int q931_release(struct pri *pri, q931_call *c, int cause) { @@ -3060,7 +3060,7 @@ return send_message(pri, c, Q931_RESTART, restart_ies); } -static int disconnect_ies[] = { Q931_CAUSE, Q931_IE_USER_USER, Q931_IE_FACILITY, -1 }; +static int disconnect_ies[] = { Q931_CAUSE, Q931_IE_FACILITY, Q931_IE_USER_USER, -1 }; int q931_disconnect(struct pri *pri, q931_call *c, int cause) { @@ -3205,7 +3205,7 @@ } -static int release_complete_ies[] = { Q931_IE_USER_USER, Q931_IE_FACILITY, -1 }; +static int release_complete_ies[] = { Q931_IE_FACILITY, Q931_IE_USER_USER, -1 }; static int q931_release_complete(struct pri *pri, q931_call *c, int cause) { @@ -4046,6 +4046,10 @@ cmdr->redirecting.count = c->divertedtocount; cmdr->redirecting.reason = c->divertedtoreason; haveevent = 1; + /* copy diverted to number to connected number to adjust display on partner channel when no connectd number in Q931 Connect*/ + libpri_copy_string(c->connectednum, c->divertedtonum, sizeof(c->connectednum)); + c->connectedpres = c->divertedtopres; + c->connectedplan = c->divertedtoplan; pri_message(pri, "DivertingLegInformation1, sending facility/CMD_REDIRECTING (%s/%s)\n", cmdr->redirecting.to.name, cmdr->redirecting.to.number); } }