[asterisk-commits] rmudgett: branch group/issue14292 r197334 - in /team/group/issue14292: ./ cha...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 27 17:03:28 CDT 2009


Author: rmudgett
Date: Wed May 27 17:03:23 2009
New Revision: 197334

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=197334
Log:
Merged revisions 197085,197103,197139,197207,197280 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/team/group/issue14068

................
  r197085 | rmudgett | 2009-05-27 10:24:45 -0500 (Wed, 27 May 2009) | 5 lines
  
  Changes to libpri API for COLP support.
  
  Made able to process PRI subcommands for more events.
  Moved the PRI subcommand processing to a common routine.
................
  r197103 | root | 2009-05-27 11:19:53 -0500 (Wed, 27 May 2009) | 13 lines
  
  Merged revisions 197089 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ........
    r197089 | seanbright | 2009-05-27 11:07:57 -0500 (Wed, 27 May 2009) | 6 lines
    
    Fix references to /etc/dahdi/system.conf and /etc/asterisk/chan_dahdi.conf in
    the sample configuration files.
    
    (closes issue #15207)
    Reported by: seandarcy
  ........
................
  r197139 | root | 2009-05-27 12:19:48 -0500 (Wed, 27 May 2009) | 24 lines
  
  Merged revisions 197125 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r197125 | jpeeler | 2009-05-27 11:52:26 -0500 (Wed, 27 May 2009) | 17 lines
    
    Blocked revisions 197124 via svnmerge
    
    ........
      r197124 | jpeeler | 2009-05-27 11:49:38 -0500 (Wed, 27 May 2009) | 12 lines
      
      Fix broken attended transfers
      
      The bridge was terminating immediately after the attended transfer was 
      completed. The problem was because upon reentering ast_channel_bridge
      nexteventts was checked to see if it was set and if so could possibly
      return AST_BRIDGE_COMPLETE.
      
      (closes issue #15183)
      Reported by: andrebarbosa
      Tested by: andrebarbosa, tootai, loloski
    ........
  ................
................
  r197207 | root | 2009-05-27 14:20:29 -0500 (Wed, 27 May 2009) | 9 lines
  
  Merged revisions 197189 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ........
    r197189 | seanbright | 2009-05-27 13:25:33 -0500 (Wed, 27 May 2009) | 2 lines
    
    Remove a file sample configuration file that is no longer used.
  ........
................
  r197280 | root | 2009-05-27 15:20:49 -0500 (Wed, 27 May 2009) | 51 lines
  
  Merged revisions 197209,197260,197265-197266 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r197209 | tilghman | 2009-05-27 14:20:56 -0500 (Wed, 27 May 2009) | 12 lines
    
    Recorded merge of revisions 197194 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r197194 | tilghman | 2009-05-27 14:09:42 -0500 (Wed, 27 May 2009) | 5 lines
      
      Use a different determinator on whether to print the delimiter, since leading fields may be blank.
      (closes issue #15208)
       Reported by: ramonpeek
       Patch by me, though inspired in part by a patch from ramonpeek
    ........
  ................
    r197260 | seanbright | 2009-05-27 15:08:16 -0500 (Wed, 27 May 2009) | 6 lines
    
    Since we use bashisms in build_tools/mkpkgconfig, we should call on bash
    explicitly when running from the Makefile.
    
    (closes issue #15209)
    Reported by: seandarcy
  ................
    r197265 | seanbright | 2009-05-27 15:13:12 -0500 (Wed, 27 May 2009) | 12 lines
    
    Blocked revisions 197264 via svnmerge
    
    ........
      r197264 | seanbright | 2009-05-27 16:12:06 -0400 (Wed, 27 May 2009) | 6 lines
      
      Since we use bashisms in build_tools/mkpkgconfig, we should call on bash
      explicitly when running from the Makefile.
      
      (closes issue #15209)
      Reported by: seandarcy
    ........
  ................
    r197266 | oej | 2009-05-27 15:14:00 -0500 (Wed, 27 May 2009) | 8 lines
    
    Adding some generic handling of error codes sent to us in replys to requests.
    
    Previously they always set hangupcause 0, which is generally wrong. With this
    change, we're setting some generic hangup causes. For 5xx errors, which indicate
    some sort of problem with the remote server, we're now setting CONGESTION.
    
    EDVX002
  ................
................

Removed:
    team/group/issue14292/configs/adtranvofr.conf.sample
Modified:
    team/group/issue14292/   (props changed)
    team/group/issue14292/Makefile
    team/group/issue14292/channels/chan_dahdi.c
    team/group/issue14292/channels/chan_sip.c
    team/group/issue14292/configs/chan_dahdi.conf.sample
    team/group/issue14292/configs/extensions.conf.sample
    team/group/issue14292/configs/sla.conf.sample
    team/group/issue14292/configs/smdi.conf.sample
    team/group/issue14292/configs/vpb.conf.sample
    team/group/issue14292/funcs/func_cut.c

Propchange: team/group/issue14292/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/group/issue14292/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/group/issue14292/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/group/issue14292/
------------------------------------------------------------------------------
--- issue14292-integrated (original)
+++ issue14292-integrated Wed May 27 17:03:23 2009
@@ -1,1 +1,1 @@
-/team/group/issue14068:1-197037
+/team/group/issue14068:1-197333

Propchange: team/group/issue14292/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed May 27 17:03:23 2009
@@ -1,1 +1,1 @@
-/trunk:1-197036
+/trunk:1-197279

Modified: team/group/issue14292/Makefile
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/issue14292/Makefile?view=diff&rev=197334&r1=197333&r2=197334
==============================================================================
--- team/group/issue14292/Makefile (original)
+++ team/group/issue14292/Makefile Wed May 27 17:03:23 2009
@@ -472,7 +472,7 @@
 	rm -f build_tools/menuselect-deps
 
 datafiles: _all
-	if [ x`$(ID) -un` = xroot ]; then CFLAGS="$(ASTCFLAGS)" sh build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
+	if [ x`$(ID) -un` = xroot ]; then CFLAGS="$(ASTCFLAGS)" bash build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
 # Should static HTTP be installed during make samples or even with its own target ala
 # webvoicemail?  There are portions here that *could* be customized but might also be
 # improved a lot.  I'll put it here for now.

Modified: team/group/issue14292/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/issue14292/channels/chan_dahdi.c?view=diff&rev=197334&r1=197333&r2=197334
==============================================================================
--- team/group/issue14292/channels/chan_dahdi.c (original)
+++ team/group/issue14292/channels/chan_dahdi.c Wed May 27 17:03:23 2009
@@ -3839,7 +3839,7 @@
 	default:
 		ast_reason = AST_REDIRECTING_REASON_UNKNOWN;
 		break;
-	}	/* end switch */
+	}
 
 	return ast_reason;
 }
@@ -3867,7 +3867,7 @@
 	default:
 		pri_reason = PRI_REDIR_UNKNOWN;
 		break;
-	}	/* end switch */
+	}
 
 	return pri_reason;
 }
@@ -3907,9 +3907,9 @@
 		ast_presentation = AST_PRES_NUMBER_NOT_AVAILABLE;
 		break;
 	default:
-		ast_presentation = AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED;	/* ?? */
+		ast_presentation = AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED;
 		break;
-	}	/* end switch */
+	}
 
 	return ast_presentation;
 }
@@ -3949,9 +3949,9 @@
 		pri_presentation = PRES_NUMBER_NOT_AVAILABLE;
 		break;
 	default:
-		pri_presentation = PRES_PROHIB_USER_NUMBER_NOT_SCREENED;	/* ?? */
+		pri_presentation = PRES_PROHIB_USER_NUMBER_NOT_SCREENED;
 		break;
-	}	/* end switch */
+	}
 
 	return pri_presentation;
 }
@@ -3976,7 +3976,7 @@
 	default:
 		ast_source = AST_CONNECTED_LINE_UPDATE_SOURCE_UNKNOWN;
 		break;
-	}	/* end switch */
+	}
 
 	return ast_source;
 }
@@ -4001,7 +4001,7 @@
 	default:
 		pri_source = PRI_CONNECTED_LINE_UPDATE_SOURCE_UNKNOWN;
 		break;
-	}	/* end switch */
+	}
 
 	return pri_source;
 }
@@ -14051,6 +14051,96 @@
 #endif	/* defined(HAVE_PRI) */
 
 #if defined(HAVE_PRI)
+/*!
+ * \internal
+ * \brief Handle the PRI subcommand events.
+ * \since 1.6.3
+ *
+ * \param pri DAHDI PRI private structure.
+ * \param chanpos Channel position in the span.
+ * \param event_id PRI event id
+ * \param channel PRI encoded span/channel
+ * \param subcmds Subcommands to process if any. (Could be NULL).
+ *
+ * \note Assumes the pri->pvts[chanpos]->lock is already obtained.
+ *
+ * \return Nothing
+ */
+static void dahdi_pri_handle_subcmds(struct dahdi_pri *pri, int chanpos, int event_id, int channel, const struct pri_subcommands *subcmds)
+{
+	int index;
+
+	if (!subcmds) {
+		return;
+	}
+	//ast_mutex_lock(&pri->pvts[chanpos]->lock);
+	for (index = 0; index < subcmds->counter_subcmd; ++index) {
+		const struct pri_subcommand *subcmd = &subcmds->subcmd[index];
+		struct ast_channel *owner;
+
+		switch (subcmd->cmd) {
+		case PRI_SUBCMD_CONNECTED_LINE:
+			owner = pri->pvts[chanpos]->owner;
+			if (owner) {
+				struct ast_party_connected_line connected;
+				const struct pri_subcmd_connected_line *cmdcl;
+
+				/* Update the connected line information on the other channel */
+				ast_party_connected_line_init(&connected);
+				cmdcl = &subcmd->connected_line;
+				connected.id.number = (char *) cmdcl->party.id.number;
+				connected.id.name = (char *) cmdcl->party.id.name;
+				connected.id.number_type = cmdcl->party.id.number_type;
+				connected.id.number_presentation =
+					pri_to_ast_presentation(cmdcl->party.id.number_presentation);
+				connected.source =
+					pri_to_ast_connected_line_update_source(cmdcl->party.source);
+				ast_channel_queue_connected_line_update(owner, &connected);
+
+				ast_copy_string(pri->pvts[chanpos]->lastcid_num, cmdcl->party.id.number,
+					sizeof(pri->pvts[chanpos]->lastcid_num));
+				ast_copy_string(pri->pvts[chanpos]->lastcid_name, cmdcl->party.id.name,
+					sizeof(pri->pvts[chanpos]->lastcid_name));
+
+				pri->pvts[chanpos]->subs[SUB_REAL].needcallerid = 1;
+				//dahdi_enable_ec(pri->pvts[chanpos]);
+			}
+			break;
+		case PRI_SUBCMD_REDIRECTING:
+			owner = pri->pvts[chanpos]->owner;
+			if (owner) {
+				struct ast_party_redirecting redirecting = {{0,},};
+				const struct pri_subcmd_redirecting *cmdr;
+
+				cmdr = &subcmd->redirecting;
+				redirecting.from.number = (char *) cmdr->party.from.number;
+				redirecting.from.name = (char *) cmdr->party.from.name;
+				redirecting.from.number_type = cmdr->party.from.number_type;
+				redirecting.from.number_presentation =
+					pri_to_ast_presentation(cmdr->party.from.number_presentation);
+				redirecting.to.number = (char *) cmdr->party.to.number;
+				redirecting.to.name = (char *) cmdr->party.to.name;
+				redirecting.to.number_type = cmdr->party.to.number_type;
+				redirecting.to.number_presentation =
+					pri_to_ast_presentation(cmdr->party.to.number_presentation);
+				redirecting.count = cmdr->party.count;
+				redirecting.reason = pri_to_ast_reason(cmdr->party.reason);
+				ast_channel_queue_redirecting_update(owner, &redirecting);
+			}
+			break;
+		default:
+			ast_log(LOG_WARNING,
+				"Unknown subcommand %d in %s event on channel %d/%d on span %d.\n",
+				subcmd->cmd, pri_event2str(event_id), PRI_SPAN(channel),
+				PRI_CHANNEL(channel), pri->span);
+			break;
+		}
+	}
+	//ast_mutex_unlock(&pri->pvts[chanpos]->lock);
+}
+#endif	/* defined(HAVE_PRI) */
+
+#if defined(HAVE_PRI)
 static void *pri_dchannel(void *vpri)
 {
 	struct dahdi_pri *pri = vpri;
@@ -14407,6 +14497,8 @@
 					chanpos = pri_fixup_principle(pri, chanpos, e->digit.call);
 					if (chanpos > -1) {
 						ast_mutex_lock(&pri->pvts[chanpos]->lock);
+						dahdi_pri_handle_subcmds(pri, chanpos, e->e, e->digit.channel,
+							e->digit.subcmds);
 						/* queue DTMF frame if the PBX for this call was already started (we're forwarding KEYPAD_DIGITs further on */
 						if ((pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING)
 							&& pri->pvts[chanpos]->call == e->digit.call
@@ -14435,6 +14527,8 @@
 					chanpos = pri_fixup_principle(pri, chanpos, e->ring.call);
 					if (chanpos > -1) {
 						ast_mutex_lock(&pri->pvts[chanpos]->lock);
+						dahdi_pri_handle_subcmds(pri, chanpos, e->e, e->ring.channel,
+							e->ring.subcmds);
 						/* queue DTMF frame if the PBX for this call was already started (we're forwarding INFORMATION further on */
 						if ((pri->overlapdial & DAHDI_OVERLAPDIAL_INCOMING)
 							&& pri->pvts[chanpos]->call == e->ring.call
@@ -14565,7 +14659,10 @@
 					chanpos = pri_find_empty_chan(pri, 1);
 				if (chanpos > -1) {
 					struct ast_party_redirecting redirecting = {{0,},};
+
 					ast_mutex_lock(&pri->pvts[chanpos]->lock);
+					dahdi_pri_handle_subcmds(pri, chanpos, e->e, e->ring.channel,
+						e->ring.subcmds);
 					if (pri->switchtype == PRI_SWITCH_GR303_TMC) {
 						/* Should be safe to lock CRV AFAIK while bearer is still locked */
 						crv = pri_find_crv(pri, pri_get_crv(pri->pri, e->ring.call, NULL));
@@ -14820,6 +14917,8 @@
 							PRI_SPAN(e->ringing.channel), PRI_CHANNEL(e->ringing.channel), pri->span);
 					} else {
 						ast_mutex_lock(&pri->pvts[chanpos]->lock);
+						dahdi_pri_handle_subcmds(pri, chanpos, e->e, e->ringing.channel,
+							e->ringing.subcmds);
 						if (ast_strlen_zero(pri->pvts[chanpos]->dop.dialstr)) {
 							dahdi_enable_ec(pri->pvts[chanpos]);
 							pri->pvts[chanpos]->subs[SUB_REAL].needringing = 1;
@@ -14872,6 +14971,9 @@
 				/* Get chan value if e->e is not PRI_EVNT_RINGING */
 				chanpos = pri_find_principle(pri, e->proceeding.channel);
 				if (chanpos > -1) {
+					ast_mutex_lock(&pri->pvts[chanpos]->lock);
+					dahdi_pri_handle_subcmds(pri, chanpos, e->e, e->proceeding.channel,
+						e->proceeding.subcmds);
 					if ((!pri->pvts[chanpos]->progress)
 #ifdef PRI_PROGRESS_MASK
 						|| (e->proceeding.progressmask & PRI_PROG_INBAND_AVAILABLE)
@@ -14895,7 +14997,6 @@
 							}
 						}
 
-						ast_mutex_lock(&pri->pvts[chanpos]->lock);
 						ast_debug(1, "Queuing frame from PRI_EVENT_PROGRESS on channel %d/%d span %d\n",
 							pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset,pri->span);
 						dahdi_queue_frame(pri->pvts[chanpos], &f, pri);
@@ -14917,17 +15018,19 @@
 						}
 						pri->pvts[chanpos]->progress = 1;
 						pri->pvts[chanpos]->dialing = 0;
-						ast_mutex_unlock(&pri->pvts[chanpos]->lock);
 					}
+					ast_mutex_unlock(&pri->pvts[chanpos]->lock);
 				}
 				break;
 			case PRI_EVENT_PROCEEDING:
 				chanpos = pri_find_principle(pri, e->proceeding.channel);
 				if (chanpos > -1) {
+					ast_mutex_lock(&pri->pvts[chanpos]->lock);
+					dahdi_pri_handle_subcmds(pri, chanpos, e->e, e->proceeding.channel,
+						e->proceeding.subcmds);
 					if (!pri->pvts[chanpos]->proceeding) {
 						struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_PROCEEDING, };
 
-						ast_mutex_lock(&pri->pvts[chanpos]->lock);
 						ast_debug(1, "Queuing frame from PRI_EVENT_PROCEEDING on channel %d/%d span %d\n",
 							pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset,pri->span);
 						dahdi_queue_frame(pri->pvts[chanpos], &f, pri);
@@ -14949,8 +15052,8 @@
 						}
 						pri->pvts[chanpos]->proceeding = 1;
 						pri->pvts[chanpos]->dialing = 0;
-						ast_mutex_unlock(&pri->pvts[chanpos]->lock);
 					}
+					ast_mutex_unlock(&pri->pvts[chanpos]->lock);
 				}
 				break;
 #ifndef PRI_EVENT_FACILITY
@@ -14966,8 +15069,8 @@
 					unsigned int handle;
 					int i;
 
-					for (i = 0; i < e->facility.subcmds.counter_subcmd; i++) {
-						struct pri_subcommand *subcmd = &e->facility.subcmds.subcmd[i];
+					for (i = 0; i < e->facility.subcmds->counter_subcmd; i++) {
+						struct pri_subcommand *subcmd = &e->facility.subcmds->subcmd[i];
 
 						switch (subcmd->cmd) {
 						case PRI_SUBCMD_CC_EXECPOSIBLE_INV:
@@ -15017,64 +15120,9 @@
 						ast_log(LOG_WARNING, "Facility requested on channel %d/%d not in use on span %d\n",
 							PRI_SPAN(e->facility.channel), PRI_CHANNEL(e->facility.channel), pri->span);
 					} else {
-						int i;
-
 						ast_mutex_lock(&pri->pvts[chanpos]->lock);
-						for (i = 0; i < e->facility.subcmds.counter_subcmd; i++) {
-							struct pri_subcommand *subcmd = &e->facility.subcmds.subcmd[i];
-							struct ast_channel *owner;
-
-							switch (subcmd->cmd) {
-							case PRI_SUBCMD_CONNECTED_LINE:
-								owner = pri->pvts[chanpos]->owner;
-								if (owner) {
-									struct ast_party_connected_line connected;
-									struct pri_subcmd_connected_line *cmdcl;
-
-									/* Update the connected line information on the other channel */
-									ast_party_connected_line_init(&connected);
-									cmdcl = &subcmd->connected_line;
-									connected.id.number = cmdcl->party.id.number;
-									connected.id.name = cmdcl->party.id.name;
-									connected.id.number_type = cmdcl->party.id.number_type;
-									connected.id.number_presentation = pri_to_ast_presentation(cmdcl->party.id.number_presentation);
-									connected.source = pri_to_ast_connected_line_update_source(cmdcl->party.source);
-									ast_channel_queue_connected_line_update(owner, &connected);
-
-									ast_copy_string(pri->pvts[chanpos]->lastcid_num, cmdcl->party.id.number, sizeof(pri->pvts[chanpos]->lastcid_num));
-									ast_copy_string(pri->pvts[chanpos]->lastcid_name, cmdcl->party.id.name, sizeof(pri->pvts[chanpos]->lastcid_name));
-
-									pri->pvts[chanpos]->subs[SUB_REAL].needcallerid = 1;
-									//dahdi_enable_ec(pri->pvts[chanpos]);
-								}
-								break;
-							case PRI_SUBCMD_REDIRECTING:
-								owner = pri->pvts[chanpos]->owner;
-								if (owner) {
-									struct ast_party_redirecting redirecting = {{0,},};
-									struct pri_subcmd_redirecting *cmdr;
-
-									cmdr = &subcmd->redirecting;
-									redirecting.from.number = cmdr->party.from.number;
-									redirecting.from.name = cmdr->party.from.name;
-									redirecting.from.number_type = cmdr->party.from.number_type;
-									redirecting.from.number_presentation = pri_to_ast_presentation(cmdr->party.from.number_presentation);
-									redirecting.to.number = cmdr->party.to.number;
-									redirecting.to.name = cmdr->party.to.name;
-									redirecting.to.number_type = cmdr->party.to.number_type;
-									redirecting.to.number_presentation = pri_to_ast_presentation(cmdr->party.to.number_presentation);
-									redirecting.count = 0;
-									redirecting.reason = pri_to_ast_reason(cmdr->party.reason);
-									ast_channel_queue_redirecting_update(owner, &redirecting);
-								}
-								break;
-							default:
-								ast_log(LOG_WARNING,
-									"Illegal subcommand %d in facility request on channel %d/%d not in use on span %d\n",
-									subcmd->cmd, PRI_SPAN(e->facility.channel), PRI_CHANNEL(e->facility.channel), pri->span);
-								break;
-							}
-						}
+						dahdi_pri_handle_subcmds(pri, chanpos, e->e, e->facility.channel,
+							e->facility.subcmds);
 						ast_mutex_unlock(&pri->pvts[chanpos]->lock);
 					}
 				}
@@ -15088,11 +15136,11 @@
 					/* No channel Connection */
 					int i;
 
-					for (i = 0; i < e->answer.subcmds.counter_subcmd; i++) {
+					for (i = 0; i < e->answer.subcmds->counter_subcmd; i++) {
 						struct ccbsnr_link *cclink;
 						unsigned int handle;
 						int cr = e->answer.cref;
-						struct pri_subcommand *subcmd = &e->answer.subcmds.subcmd[i];
+						struct pri_subcommand *subcmd = &e->answer.subcmds->subcmd[i];
 
 						switch (subcmd->cmd) {
 						case PRI_SUBCMD_CC_CCBSREQUEST_RR:
@@ -15189,6 +15237,8 @@
 						struct ast_channel *owner;
 
 						ast_mutex_lock(&pri->pvts[chanpos]->lock);
+						dahdi_pri_handle_subcmds(pri, chanpos, e->e, e->answer.channel,
+							e->answer.subcmds);
 						/* Now we can do call progress detection */
 
 						/* We changed this so it turns on the DSP no matter what... progress or no progress.
@@ -15263,8 +15313,8 @@
 					unsigned int state;
 					int i;
 
-					for (i = 0; i < e->hangup.subcmds.counter_subcmd; i++) {
-						struct pri_subcommand *subcmd = &e->hangup.subcmds.subcmd[i];
+					for (i = 0; i < e->hangup.subcmds->counter_subcmd; i++) {
+						struct pri_subcommand *subcmd = &e->hangup.subcmds->subcmd[i];
 
 						switch (subcmd->cmd) {
 						case PRI_SUBCMD_CC_ERROR:
@@ -15328,6 +15378,8 @@
 						int i;
 
 						ast_mutex_lock(&pri->pvts[chanpos]->lock);
+						dahdi_pri_handle_subcmds(pri, chanpos, e->e, e->hangup.channel,
+							e->hangup.subcmds);
 						if (!pri->pvts[chanpos]->alreadyhungup) {
 							/* we're calling here dahdi_hangup so once we get there we need to clear p->call after calling pri_hangup */
 							pri->pvts[chanpos]->alreadyhungup = 1;
@@ -15381,8 +15433,8 @@
 							ast_mutex_lock(&pri->pvts[chanpos]->lock);
 						}
 #endif
-						for (i = 0; i < e->hangup.subcmds.counter_subcmd; i++) {
-							struct pri_subcommand *subcmd = &e->hangup.subcmds.subcmd[i];
+						for (i = 0; i < e->hangup.subcmds->counter_subcmd; i++) {
+							struct pri_subcommand *subcmd = &e->hangup.subcmds->subcmd[i];
 
 							switch (subcmd->cmd) {
 							case PRI_SUBCMD_CC_RINGOUT_INV:
@@ -15416,6 +15468,8 @@
 					chanpos = pri_fixup_principle(pri, chanpos, e->hangup.call);
 					if (chanpos > -1) {
 						ast_mutex_lock(&pri->pvts[chanpos]->lock);
+						dahdi_pri_handle_subcmds(pri, chanpos, e->e, e->hangup.channel,
+							e->hangup.subcmds);
 						if (pri->pvts[chanpos]->realcall)
 							pri_hangup_all(pri->pvts[chanpos]->realcall, pri);
 						else if (pri->pvts[chanpos]->owner) {
@@ -15590,6 +15644,8 @@
 					chanpos = pri_fixup_principle(pri, chanpos, e->setup_ack.call);
 					if (chanpos > -1) {
 						ast_mutex_lock(&pri->pvts[chanpos]->lock);
+						dahdi_pri_handle_subcmds(pri, chanpos, e->e, e->setup_ack.channel,
+							e->setup_ack.subcmds);
 						pri->pvts[chanpos]->setup_ack = 1;
 						/* Send any queued digits */
 						for (x = 0;x < strlen(pri->pvts[chanpos]->dialdest); x++) {
@@ -15609,7 +15665,10 @@
 						PRI_SPAN(e->notify.channel), PRI_CHANNEL(e->notify.channel), pri->span);
 				} else if (!pri->discardremoteholdretrieval) {
 					struct ast_frame f = { AST_FRAME_CONTROL, };
+
 					ast_mutex_lock(&pri->pvts[chanpos]->lock);
+					dahdi_pri_handle_subcmds(pri, chanpos, e->e, e->notify.channel,
+						e->notify.subcmds);
 					switch (e->notify.info) {
 					case PRI_NOTIFY_REMOTE_HOLD:
 						f.subclass = AST_CONTROL_HOLD;

Modified: team/group/issue14292/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/issue14292/channels/chan_sip.c?view=diff&rev=197334&r1=197333&r2=197334
==============================================================================
--- team/group/issue14292/channels/chan_sip.c (original)
+++ team/group/issue14292/channels/chan_sip.c Wed May 27 17:03:23 2009
@@ -5698,6 +5698,16 @@
 		case 606:	/* Not acceptable */
 			return AST_CAUSE_BEARERCAPABILITY_NOTAVAIL;
 		default:
+			if (cause < 500 && cause >= 400) {
+				/* 4xx class error that is unknown - someting wrong with our request */
+				return AST_CAUSE_INTERWORKING;
+			} else if (cause < 600 && cause >= 500) {
+				/* 5xx class error - problem in the remote end */
+				return AST_CAUSE_CONGESTION;
+			} else if (cause < 700 && cause >= 600) {
+				/* 6xx - global errors in the 4xx class */
+				return AST_CAUSE_INTERWORKING;
+			}
 			return AST_CAUSE_NORMAL;
 	}
 	/* Never reached */

Modified: team/group/issue14292/configs/chan_dahdi.conf.sample
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/issue14292/configs/chan_dahdi.conf.sample?view=diff&rev=197334&r1=197333&r2=197334
==============================================================================
--- team/group/issue14292/configs/chan_dahdi.conf.sample (original)
+++ team/group/issue14292/configs/chan_dahdi.conf.sample Wed May 27 17:03:23 2009
@@ -713,8 +713,9 @@
 ;progzone=uk
 ;
 ; Set the tonezone. Equivalent of the defaultzone settings in
-; /etc/dahdi.conf . This sets the tone zone by number.
-; Note that you'd still need to load tonezones (loadzone in dahdi.conf).
+; /etc/dahdi/system.conf. This sets the tone zone by number.
+; Note that you'd still need to load tonezones (loadzone in
+; /etc/dahdi/system.conf).
 ; The default is -1: not to set anything.
 ;tonezone = 0 ; 0 is US
 ;
@@ -1147,7 +1148,7 @@
 
 ; Configuration Sections
 ; ~~~~~~~~~~~~~~~~~~~~~~
-; You can also configure channels in a separate dahdi.conf section. In
+; You can also configure channels in a separate chan_dahdi.conf section. In
 ; this case the keyword 'channel' is not used. Instead the keyword
 ; 'dahdichan' is used (as in users.conf) - configuration is only processed
 ; in a section where the keyword dahdichan is used. It will only be
@@ -1167,7 +1168,7 @@
 ;
 ; When starting a new section almost all of the configuration values are
 ; copied from their values at the end of the section [channels] in
-; dahdi.conf and [general] in users.conf - one section's configuration
+; chan_dahdi.conf and [general] in users.conf - one section's configuration
 ; does not affect another one's.
 ;
 ; Instead of letting common configuration values "slide through" you can 

Modified: team/group/issue14292/configs/extensions.conf.sample
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/issue14292/configs/extensions.conf.sample?view=diff&rev=197334&r1=197333&r2=197334
==============================================================================
--- team/group/issue14292/configs/extensions.conf.sample (original)
+++ team/group/issue14292/configs/extensions.conf.sample Wed May 27 17:03:23 2009
@@ -131,8 +131,8 @@
 TRUNK=DAHDI/G2					; Trunk interface
 ;
 ; Note the 'G2' in the TRUNK variable above. It specifies which group (defined
-; in dahdi.conf) to dial, i.e. group 2, and how to choose a channel to use in
-; the specified group. The four possible options are:
+; in chan_dahdi.conf) to dial, i.e. group 2, and how to choose a channel to use
+; in the specified group. The four possible options are:
 ;
 ; g: select the lowest-numbered non-busy DAHDI channel
 ;    (aka. ascending sequential hunt group).

Modified: team/group/issue14292/configs/sla.conf.sample
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/issue14292/configs/sla.conf.sample?view=diff&rev=197334&r1=197333&r2=197334
==============================================================================
--- team/group/issue14292/configs/sla.conf.sample (original)
+++ team/group/issue14292/configs/sla.conf.sample Wed May 27 17:03:23 2009
@@ -29,7 +29,7 @@
 
 ;autocontext=line1          ; This supports automatic generation of the dialplan entries 
                             ; if the autocontext option is used.  Each trunk should have 
-                            ; a unique context name.  Then, in dahdi.conf, this device 
+                            ; a unique context name.  Then, in chan_dahdi.conf, this device
                             ; should be configured to have incoming calls go to this context.
 
 ;ringtimeout=30             ; Set how long to allow this trunk to ring on an inbound call before hanging 

Modified: team/group/issue14292/configs/smdi.conf.sample
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/issue14292/configs/smdi.conf.sample?view=diff&rev=197334&r1=197333&r2=197334
==============================================================================
--- team/group/issue14292/configs/smdi.conf.sample (original)
+++ team/group/issue14292/configs/smdi.conf.sample Wed May 27 17:03:23 2009
@@ -2,8 +2,8 @@
 
 [interfaces]
 ; Specify serial ports to listen for SMDI messages on below.  These will be
-; referenced later in dahdi.conf.  If you do not specify any interfaces then
-; SMDI will be disabled.  Interfaces can have several different attributes
+; referenced later in chan_dahdi.conf.  If you do not specify any interfaces
+; then SMDI will be disabled.  Interfaces can have several different attributes
 ; associated with them.
 
 ; Set the number of stop bits to use per character here.  The default is no,

Modified: team/group/issue14292/configs/vpb.conf.sample
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/issue14292/configs/vpb.conf.sample?view=diff&rev=197334&r1=197333&r2=197334
==============================================================================
--- team/group/issue14292/configs/vpb.conf.sample (original)
+++ team/group/issue14292/configs/vpb.conf.sample Wed May 27 17:03:23 2009
@@ -97,8 +97,8 @@
 ;
 ; NOTE that other caller ID standards are supported in Asterisk, but are
 ; not yet active in chan_vpb.  It should be reasonably trivial to add
-; support for the other standards (see the default dahdi.conf for a list
-; of them) that Asterisk already handles.
+; support for the other standards (see the default chan_dahdi.conf for a
+; list of them) that Asterisk already handles.
 ;
 callerid=bell
 

Modified: team/group/issue14292/funcs/func_cut.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/issue14292/funcs/func_cut.c?view=diff&rev=197334&r1=197333&r2=197334
==============================================================================
--- team/group/issue14292/funcs/func_cut.c (original)
+++ team/group/issue14292/funcs/func_cut.c Wed May 27 17:03:23 2009
@@ -186,6 +186,7 @@
 		if (ast_str_strlen(str)) {
 			int curfieldnum = 1;
 			char *tmp2 = ast_str_buffer(str);
+			int firstfield = 1;
 			while (tmp2 != NULL && args.field != NULL) {
 				char *nextgroup = strsep(&(args.field), "&");
 				int num1 = 0, num2 = INT_MAX;
@@ -222,7 +223,8 @@
 				/* Output fields until we either run out of fields or num2 is reached */
 				while (tmp2 != NULL && curfieldnum <= num2) {
 					char *tmp3 = strsep(&tmp2, ds);
-					ast_str_append(buf, buflen, "%s%s", ast_str_strlen(*buf) ? ds : "", tmp3);
+					ast_str_append(buf, buflen, "%s%s", firstfield ? "" : ds, tmp3);
+					firstfield = 0;
 					curfieldnum++;
 				}
 			}




More information about the asterisk-commits mailing list