[svn-commits] rmudgett: branch group/issue14292 r913 - /team/group/issue14292/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jun 25 17:24:59 CDT 2009


Author: rmudgett
Date: Thu Jun 25 17:24:56 2009
New Revision: 913

URL: http://svn.asterisk.org/svn-view/libpri?view=rev&rev=913
Log:
Merged revisions 909 via svnmerge from 
https://origsvn.digium.com/svn/libpri/team/group/issue14068

................
  r909 | root | 2009-06-25 14:35:44 -0500 (Thu, 25 Jun 2009) | 24 lines
  
  Merged revisions 907 via svnmerge from 
  file:///srv/subversion/repos/libpri/branches/1.4
  
  ........
    r907 | seanbright | 2009-06-25 13:53:38 -0500 (Thu, 25 Jun 2009) | 17 lines
    
    Add support for sending Reverse Charging Indication IE on ISDN PRI.
    
    Add the ability to transmit a Reverse Charging Indication IE during a SETUP
    message.  In passing, re-work some of the receive logic to be forwards
    compatible with new RCI values that may be added in the future.  Also removed
    the PRI_REVERSECHARGE_SUPPORT define that I added on the last commit since we
    can just check for PRI_REVERSECHARGE_NONE or _REQUESTED on the Asterisk side to
    determine support for this.
    
    Special thanks to rmudgett who could have written this in half the time he spent
    reviewing it, but instead talked me through it.  Much appreciated!
    
    (issue #13760)
    Reported by: mrgabu
    
    Review: https://reviewboard.asterisk.org/r/292/
  ........
................

Modified:
    team/group/issue14292/   (props changed)
    team/group/issue14292/libpri.h
    team/group/issue14292/pri.c
    team/group/issue14292/pri_internal.h
    team/group/issue14292/q931.c

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

Propchange: team/group/issue14292/
------------------------------------------------------------------------------
--- issue14292-integrated (original)
+++ issue14292-integrated Thu Jun 25 17:24:56 2009
@@ -1,1 +1,1 @@
-/team/group/issue14068:1-903
+/team/group/issue14068:1-912

Propchange: team/group/issue14292/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jun 25 17:24:56 2009
@@ -1,1 +1,1 @@
-/branches/1.4:1-902
+/branches/1.4:1-908

Modified: team/group/issue14292/libpri.h
URL: http://svn.asterisk.org/svn-view/libpri/team/group/issue14292/libpri.h?view=diff&rev=913&r1=912&r2=913
==============================================================================
--- team/group/issue14292/libpri.h (original)
+++ team/group/issue14292/libpri.h Thu Jun 25 17:24:56 2009
@@ -183,6 +183,10 @@
 
 #define PRES_NUMBER_NOT_AVAILABLE \
 	(PRI_PRES_UNAVAILABLE | PRI_PRES_NETWORK_NUMBER)
+
+/* Reverse Charging Indication */
+#define PRI_REVERSECHARGE_NONE      -1
+#define PRI_REVERSECHARGE_REQUESTED  1
 
 /* Causes for disconnection */
 #define PRI_CAUSE_UNALLOCATED					1
@@ -873,6 +877,7 @@
 #define PRI_USER_USER_TX
 /* Set the user user field.  Warning!  don't send binary data accross this field */
 void pri_sr_set_useruser(struct pri_sr *sr, const char *userchars);
+void pri_sr_set_reversecharge(struct pri_sr *sr, int requested);
 
 void pri_call_set_useruser(q931_call *sr, const char *userchars);
 
@@ -942,7 +947,6 @@
 #define PRI_REDIRECTING_REASON
 #define PRI_AOC_UNITS
 #define PRI_ANI
-#define PRI_REVERSECHARGE_SUPPORT
 
 /* Send notification */
 int pri_notify(struct pri *pri, q931_call *c, int channel, int info);

Modified: team/group/issue14292/pri.c
URL: http://svn.asterisk.org/svn-view/libpri/team/group/issue14292/pri.c?view=diff&rev=913&r1=912&r2=913
==============================================================================
--- team/group/issue14292/pri.c (original)
+++ team/group/issue14292/pri.c Thu Jun 25 17:24:56 2009
@@ -911,7 +911,7 @@
 static void pri_sr_init(struct pri_sr *req)
 {
 	memset(req, 0, sizeof(struct pri_sr));
-	
+	req->reversecharge = PRI_REVERSECHARGE_NONE;
 }
 
 int pri_sr_set_connection_call_independent(struct pri_sr *req)
@@ -1241,6 +1241,11 @@
 	return 0;
 }
 
+void pri_sr_set_reversecharge(struct pri_sr *sr, int requested)
+{
+	sr->reversecharge = requested;
+}
+
 int pri_sr_set_ccringout(struct pri_sr *sr, int ccringout)
 {
 	sr->ccringout = ccringout;

Modified: team/group/issue14292/pri_internal.h
URL: http://svn.asterisk.org/svn-view/libpri/team/group/issue14292/pri_internal.h?view=diff&rev=913&r1=912&r2=913
==============================================================================
--- team/group/issue14292/pri_internal.h (original)
+++ team/group/issue14292/pri_internal.h Thu Jun 25 17:24:56 2009
@@ -160,6 +160,7 @@
 	int ccbsnr;
 	const char *useruserinfo;
 	int transferable;
+	int reversecharge;
 	int ccringout;
 };
 
@@ -431,7 +432,10 @@
 	q931_call *bridged_call;        /* Pointer to other leg of bridged call (Used by Q.SIG when eliminating tromboned calls) */
 
 	int changestatus;		/* SERVICE message changestatus */
-	int reversecharge;		/* Reverse charging indication */
+	int reversecharge;		/* Reverse charging indication:
+							   -1 - No reverse charging
+							    1 - Reverse charging
+							0,2-7 - Reserved for future use */
 };
 
 extern int pri_schedule_event(struct pri *pri, int ms, void (*function)(void *data), void *data);

Modified: team/group/issue14292/q931.c
URL: http://svn.asterisk.org/svn-view/libpri/team/group/issue14292/q931.c?view=diff&rev=913&r1=912&r2=913
==============================================================================
--- team/group/issue14292/q931.c (original)
+++ team/group/issue14292/q931.c Thu Jun 25 17:24:56 2009
@@ -2654,6 +2654,15 @@
 	return 0;
 }
 
+static int transmit_reverse_charging_indication(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len, int order)
+{
+	if (call->reversecharge != PRI_REVERSECHARGE_NONE) {
+		ie->data[0] = 0x80 | (call->reversecharge & 0x7);
+		return 3;
+	}
+	return 0;
+}
+
 static struct ie ies[] = {
 	/* Codeset 0 - Common */
 	{ 1, NATIONAL_CHANGE_STATUS, "Change Status", dump_change_status, receive_change_status, transmit_change_status },
@@ -2670,7 +2679,7 @@
 	{ 1, Q931_BINARY_PARAMETERS, "Packet-layer Binary Parameters" },
 	{ 1, Q931_WINDOW_SIZE, "Packet-layer Window Size" },
 	{ 1, Q931_CLOSED_USER_GROUP, "Closed User Group" },
-	{ 1, Q931_REVERSE_CHARGE_INDIC, "Reverse Charging Indication", dump_reverse_charging_indication, receive_reverse_charging_indication },
+	{ 1, Q931_REVERSE_CHARGE_INDIC, "Reverse Charging Indication", dump_reverse_charging_indication, receive_reverse_charging_indication, transmit_reverse_charging_indication },
 	{ 1, Q931_CALLING_PARTY_NUMBER, "Calling Party Number", dump_calling_party_number, receive_calling_party_number, transmit_calling_party_number },
 	{ 1, Q931_CALLING_PARTY_SUBADDR, "Calling Party Subaddress", dump_calling_party_subaddr, receive_calling_party_subaddr },
 	{ 1, Q931_CALLED_PARTY_NUMBER, "Called Party Number", dump_called_party_number, receive_called_party_number, transmit_called_party_number },
@@ -3720,8 +3729,8 @@
 }
 
 static int setup_ies[] = { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT, Q931_IE_FACILITY, Q931_PROGRESS_INDICATOR, Q931_NETWORK_SPEC_FAC, Q931_DISPLAY,
-	Q931_CALLING_PARTY_NUMBER, Q931_CALLED_PARTY_NUMBER, Q931_REDIRECTING_NUMBER, Q931_IE_USER_USER, Q931_SENDING_COMPLETE,
-	Q931_IE_ORIGINATING_LINE_INFO, Q931_IE_GENERIC_DIGITS, -1 };
+	Q931_REVERSE_CHARGE_INDIC, Q931_CALLING_PARTY_NUMBER, Q931_CALLED_PARTY_NUMBER, Q931_REDIRECTING_NUMBER, Q931_IE_USER_USER,
+	Q931_SENDING_COMPLETE, Q931_IE_ORIGINATING_LINE_INFO, Q931_IE_GENERIC_DIGITS, -1 };
 
 static int gr303_setup_ies[] =  { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT, -1 };
 
@@ -3827,6 +3836,8 @@
 		c->progressmask = PRI_PROG_CALLER_NOT_ISDN;
 	else
 		c->progressmask = 0;
+
+	c->reversecharge = req->reversecharge;
 
 	if (req->ccringout)
 		c->ccoperation = PRI_CC_RINGOUT;
@@ -4091,6 +4102,7 @@
 		c->complete = 0;
 		c->nonisdn = 0;
 		c->aoc_units = -1;
+		c->reversecharge = -1;
 		/* Fall through */
 	case Q931_CONNECT:
 		c->ccrequestresult = 0;




More information about the svn-commits mailing list