[libpri-commits] mattf: branch mattf/bug13454 r633 - /team/mattf/bug13454/
SVN commits to the libpri project
libpri-commits at lists.digium.com
Mon Sep 22 14:44:22 CDT 2008
Author: mattf
Date: Mon Sep 22 14:44:21 2008
New Revision: 633
URL: http://svn.digium.com/view/libpri?view=rev&rev=633
Log:
Add additional support for call rerouting reason to CF[U,B,NA]
Modified:
team/mattf/bug13454/libpri.h
team/mattf/bug13454/pri.c
team/mattf/bug13454/pri_facility.c
team/mattf/bug13454/pri_facility.h
Modified: team/mattf/bug13454/libpri.h
URL: http://svn.digium.com/view/libpri/team/mattf/bug13454/libpri.h?view=diff&rev=633&r1=632&r2=633
==============================================================================
--- team/mattf/bug13454/libpri.h (original)
+++ team/mattf/bug13454/libpri.h Mon Sep 22 14:44:21 2008
@@ -654,7 +654,7 @@
/* Send notification */
int pri_notify(struct pri *pri, q931_call *c, int channel, int info);
-int pri_callrerouting_facility(struct pri *pri, q931_call *call, const char *dest);
+int pri_callrerouting_facility(struct pri *pri, q931_call *call, const char *dest, const char* original, const char* reason);
/* Get/Set PRI Timers */
#define PRI_GETSET_TIMERS
Modified: team/mattf/bug13454/pri.c
URL: http://svn.digium.com/view/libpri/team/mattf/bug13454/pri.c?view=diff&rev=633&r1=632&r2=633
==============================================================================
--- team/mattf/bug13454/pri.c (original)
+++ team/mattf/bug13454/pri.c Mon Sep 22 14:44:21 2008
@@ -515,12 +515,12 @@
}
-int pri_callrerouting_facility(struct pri *pri, q931_call *call, const char *dest)
-{
- if (!pri || !call)
- return -1;
-
- return qsig_cf_callrerouting(pri, call, dest);
+int pri_callrerouting_facility(struct pri *pri, q931_call *call, const char *dest, const char* original, const char* reason)
+{
+ if (!pri || !call)
+ return -1;
+
+ return qsig_cf_callrerouting(pri, call, dest, original, reason);
}
int pri_notify(struct pri *pri, q931_call *call, int channel, int info)
Modified: team/mattf/bug13454/pri_facility.c
URL: http://svn.digium.com/view/libpri/team/mattf/bug13454/pri_facility.c?view=diff&rev=633&r1=632&r2=633
==============================================================================
--- team/mattf/bug13454/pri_facility.c (original)
+++ team/mattf/bug13454/pri_facility.c Mon Sep 22 14:44:21 2008
@@ -1187,7 +1187,7 @@
/* End EECT */
/* QSIG CF CallRerouting */
-int qsig_cf_callrerouting(struct pri *pri, q931_call *c, const char* dest)
+int qsig_cf_callrerouting(struct pri *pri, q931_call *c, const char* dest, const char* original, const char* reason)
{
/*CallRerouting ::= OPERATION
-- Sent from the Served User PINX to the Rerouting PINX
@@ -1252,7 +1252,19 @@
ASN1_PUSH(compstk, compsp, comp);
/* reroutingReason DiversionReason */
- ASN1_ADD_BYTECOMP(comp, ASN1_ENUMERATED, buffer, i, 1); /* cfu */
+
+ if (reason) {
+ if (!strcasecmp(reason, "cfu"))
+ ASN1_ADD_BYTECOMP(comp, ASN1_ENUMERATED, buffer, i, 1); /* cfu */
+ else if (!strcasecmp(reason, "cfb"))
+ ASN1_ADD_BYTECOMP(comp, ASN1_ENUMERATED, buffer, i, 2); /* cfb */
+ else if (!strcasecmp(reason, "cfnr"))
+ ASN1_ADD_BYTECOMP(comp, ASN1_ENUMERATED, buffer, i, 3); /* cfnr */
+ }
+ else {
+ ASN1_ADD_BYTECOMP(comp, ASN1_ENUMERATED, buffer, i, 0); /* unknown */
+ }
+
/* calledAddress Address */
/* explicit sequence tag for Address */
@@ -1303,7 +1315,7 @@
ASN1_PUSH(compstk, compsp, comp);
/* type of public party number = unknown */
ASN1_ADD_BYTECOMP(comp, ASN1_ENUMERATED, buffer, i, 0);
- j = asn1_string_encode(ASN1_NUMERICSTRING, &buffer[i], len - i, 20, c->callednum, strlen(c->callednum));
+ j = asn1_string_encode(ASN1_NUMERICSTRING, &buffer[i], len - i, 20, original?(char*)original:c->callednum, original?strlen(original):strlen(c->callednum));
if (j < 0)
return -1;
Modified: team/mattf/bug13454/pri_facility.h
URL: http://svn.digium.com/view/libpri/team/mattf/bug13454/pri_facility.h?view=diff&rev=633&r1=632&r2=633
==============================================================================
--- team/mattf/bug13454/pri_facility.h (original)
+++ team/mattf/bug13454/pri_facility.h Mon Sep 22 14:44:21 2008
@@ -309,7 +309,7 @@
int rlt_initiate_transfer(struct pri *pri, q931_call *c1, q931_call *c2);
-int qsig_cf_callrerouting(struct pri *pri, q931_call *c, const char* dest);
+int qsig_cf_callrerouting(struct pri *pri, q931_call *c, const char* dest, const char* original, const char* reason);
/* starts a QSIG Path Replacement */
int anfpr_initiate_transfer(struct pri *pri, q931_call *c1, q931_call *c2);
More information about the libpri-commits
mailing list