Bug#297977: libpri1: Keypad facility received during setup should be used as called number

Mikael Magnusson Mikael Magnusson <mikma@users.sourceforge.net>, 297977@bugs.debian.org
Thu, 3 Mar 2005 20:25:07 +0100


--x+6KMIRAuhnl3hBn
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: libpri1
Version: 1.0.4-2
Severity: normal
Tags: patch

Some ISDN phones sends numbers that begins with * or # as "keypad facility"
instead of "called party number" during call setup. Those are also copied 
to callednum with my patch.

Regards,
Mikael


-- System Information:
Debian Release: 3.1
Architecture: i386 (i586)
Kernel: Linux 2.6.8-2-386
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages libpri1 depends on:
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an

-- no debconf information

--x+6KMIRAuhnl3hBn
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

diff -ur libpri-1.0.4/q931.c libpri-1.0.4.new/q931.c
--- libpri-1.0.4/q931.c	2005-03-03 20:07:19.000000000 +0100
+++ libpri-1.0.4.new/q931.c	2005-03-03 20:08:26.000000000 +0100
@@ -1403,8 +1403,10 @@
 static FUNC_RECV(receive_keypad_facility)
 {
 	/* copy digits to call->callednum or call->digits */
-	if (msgtype == Q931_SETUP) {
+	if (msgtype == Q931_INFORMATION) {
  	    q931_get_number(call->digits, sizeof(call->digits), ie->data , len - 2);
+	} else if (msgtype == Q931_SETUP) {
+ 	    q931_get_number(call->callednum, sizeof(call->callednum), ie->data, len - 2);
 	} else {
 	    // XXX we assume 1 byte keypad
 	    call->digits[0] = ie->data[0] & 0x7f;

--x+6KMIRAuhnl3hBn--