Changeset 728

Update libpri with latest changes.

Committed by:  brian
Date:  Oct 28 2005 * 20:59 (over 2 years ago)

Affected files:

libpri/trunk/Makefile.in (unified diff)

r234r728
1515 @SET_MAKE@
1616
1717
18
1918 srcdir = @srcdir@
2019 top_srcdir = @top_srcdir@
2120 VPATH = @srcdir@
------
5857 *) f=$$p;; \
5958 esac;
6059 am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
61 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libdir)" \
60 am__installdirs = "$(DESTDIR)$(libdir)" \
6261 "$(DESTDIR)$(library_includedir)"
63 libLIBRARIES_INSTALL = $(INSTALL_DATA)
64 LIBRARIES = $(lib_LIBRARIES)
65 ARFLAGS = cru
66 libpri_a_AR = $(AR) $(ARFLAGS)
67 libpri_a_LIBADD =
68 am_libpri_a_OBJECTS =
69 libpri_a_OBJECTS = $(am_libpri_a_OBJECTS)
7062 libLTLIBRARIES_INSTALL = $(INSTALL)
7163 LTLIBRARIES = $(lib_LTLIBRARIES)
7264 libpri_la_LIBADD =
73 am__objects_1 = libpri_la-copy_string.lo libpri_la-pri.lo \
65 am_libpri_la_OBJECTS = libpri_la-copy_string.lo libpri_la-pri.lo \
7466 libpri_la-pri_facility.lo libpri_la-prisched.lo \
7567 libpri_la-q921.lo libpri_la-q931.lo
76 am_libpri_la_OBJECTS = $(am__objects_1)
7768 libpri_la_OBJECTS = $(am_libpri_la_OBJECTS)
7869 DEFAULT_INCLUDES = -I. -I$(srcdir)
7970 depcomp = $(SHELL) $(top_srcdir)/depcomp
------
8677 CCLD = $(CC)
8778 LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
8879 $(AM_LDFLAGS) $(LDFLAGS) -o $@
89 SOURCES = $(libpri_a_SOURCES) $(libpri_la_SOURCES)
90 DIST_SOURCES = $(libpri_a_SOURCES) $(libpri_la_SOURCES)
80 SOURCES = $(libpri_la_SOURCES)
81 DIST_SOURCES = $(libpri_la_SOURCES)
9182 library_includeHEADERS_INSTALL = $(INSTALL_HEADER)
9283 HEADERS = $(library_include_HEADERS)
9384 ETAGS = etags
------
199190 sharedstatedir = @sharedstatedir@
200191 sysconfdir = @sysconfdir@
201192 target_alias = @target_alias@
202 AM_CFLAGS = -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g
203 LIB_SOURCES = copy_string.c pri.c pri_facility.c prisched.c q921.c q931.c \
193 AUTOMAKE_OPTS = gnu
194 libpri_la_SOURCES = copy_string.c pri.c pri_facility.c prisched.c q921.c q931.c \
204195 compat.h compiler.h libpri.h pri_facility.h pri_internal.h pri_q921.h pri_q931.h pri_timers.h
205196
206197 library_includedir = $(includedir)
207198 library_include_HEADERS = libpri.h pri_internal.h
208199 lib_LTLIBRARIES = libpri.la
209 libpri_la_CFLAGS = $(AM_CFLAGS)
200 libpri_la_CFLAGS = $(AM_CFLAGS) -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g
210201 libpri_la_LDFLAGS = -version-info 1:0:0
211 libpri_la_SOURCES = $(LIB_SOURCES)
212 lib_LIBRARIES = libpri.a
213 libpri_a_CFLAGS = $(AM_CFLAGS)
214 libpri_a_SOURCES = $(LIB_SOUCES)
215202 all: all-am
216203
217204 .SUFFIXES:
------
249236 cd $(srcdir) && $(AUTOCONF)
250237 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
251238 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
252 install-libLIBRARIES: $(lib_LIBRARIES)
253 @$(NORMAL_INSTALL)
254 test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
255 @list='$(lib_LIBRARIES)'; for p in $$list; do \
256 if test -f $$p; then \
257 f=$(am__strip_dir) \
258 echo " $(libLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
259 $(libLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
260 else :; fi; \
261 done
262 @$(POST_INSTALL)
263 @list='$(lib_LIBRARIES)'; for p in $$list; do \
264 if test -f $$p; then \
265 p=$(am__strip_dir) \
266 echo " $(RANLIB) '$(DESTDIR)$(libdir)/$$p'"; \
267 $(RANLIB) "$(DESTDIR)$(libdir)/$$p"; \
268 else :; fi; \
269 done
270
271 uninstall-libLIBRARIES:
272 @$(NORMAL_UNINSTALL)
273 @list='$(lib_LIBRARIES)'; for p in $$list; do \
274 p=$(am__strip_dir) \
275 echo " rm -f '$(DESTDIR)$(libdir)/$$p'"; \
276 rm -f "$(DESTDIR)$(libdir)/$$p"; \
277 done
278
279 clean-libLIBRARIES:
280 -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
281 libpri.a: $(libpri_a_OBJECTS) $(libpri_a_DEPENDENCIES)
282 -rm -f libpri.a
283 $(libpri_a_AR) libpri.a $(libpri_a_OBJECTS) $(libpri_a_LIBADD)
284 $(RANLIB) libpri.a
285239 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
286240 @$(NORMAL_INSTALL)
287241 test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
------
591545 exit 1; } >&2
592546 check-am: all-am
593547 check: check-am
594 all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(HEADERS)
548 all-am: Makefile $(LTLIBRARIES) $(HEADERS)
595549 installdirs:
596 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libdir)" "$(DESTDIR)$(library_includedir)"; do \
550 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(library_includedir)"; do \
597551 test -z "$$dir" || $(mkdir_p) "$$dir"; \
598552 done
599553 install: install-am
------
622576 @echo "it deletes files that may require special tools to rebuild."
623577 clean: clean-am
624578
625 clean-am: clean-generic clean-libLIBRARIES clean-libLTLIBRARIES \
626 clean-libtool mostlyclean-am
579 clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
580 mostlyclean-am
627581
628582 distclean: distclean-am
629583 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
------
644598
645599 install-data-am: install-library_includeHEADERS
646600
647 install-exec-am: install-libLIBRARIES install-libLTLIBRARIES
601 install-exec-am: install-libLTLIBRARIES
648602
649603 install-info: install-info-am
650604
------
672626
673627 ps-am:
674628
675 uninstall-am: uninstall-info-am uninstall-libLIBRARIES \
676 uninstall-libLTLIBRARIES uninstall-library_includeHEADERS
629 uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \
630 uninstall-library_includeHEADERS
677631
678632 .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
679 clean-generic clean-libLIBRARIES clean-libLTLIBRARIES \
680 clean-libtool ctags dist dist-all dist-bzip2 dist-gzip \
681 dist-shar dist-tarZ dist-zip distcheck distclean \
682 distclean-compile distclean-generic distclean-libtool \
683 distclean-tags distcleancheck distdir distuninstallcheck dvi \
684 dvi-am html html-am info info-am install install-am \
685 install-data install-data-am install-exec install-exec-am \
686 install-info install-info-am install-libLIBRARIES \
633 clean-generic clean-libLTLIBRARIES clean-libtool ctags dist \
634 dist-all dist-bzip2 dist-gzip dist-shar dist-tarZ dist-zip \
635 distcheck distclean distclean-compile distclean-generic \
636 distclean-libtool distclean-tags distcleancheck distdir \
637 distuninstallcheck dvi dvi-am html html-am info info-am \
638 install install-am install-data install-data-am install-exec \
639 install-exec-am install-info install-info-am \
687640 install-libLTLIBRARIES install-library_includeHEADERS \
688641 install-man install-strip installcheck installcheck-am \
689642 installdirs maintainer-clean maintainer-clean-generic \
690643 mostlyclean mostlyclean-compile mostlyclean-generic \
691644 mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
692 uninstall-am uninstall-info-am uninstall-libLIBRARIES \
693 uninstall-libLTLIBRARIES uninstall-library_includeHEADERS
645 uninstall-am uninstall-info-am uninstall-libLTLIBRARIES \
646 uninstall-library_includeHEADERS
694647
695648 # Tell versions [3.59,3.63) of GNU make to not export all variables.
696649 # Otherwise a system limit (for SysV at least) may be exceeded.

libpri/trunk/libpri.h (unified diff)

r196r728
274274 int progress;
275275 int progressmask;
276276 q931_call *call;
277 char useruserinfo[260]; /* User->User info */
277278 } pri_event_ringing;
278279
279280 typedef struct pri_event_answer {
------
283284 int progress;
284285 int progressmask;
285286 q931_call *call;
287 char useruserinfo[260]; /* User->User info */
286288 } pri_event_answer;
287289
288290 typedef struct pri_event_facname {
------
312314 char redirectingname[256]; /* Redirecting name */
313315 int redirectingreason; /* Reason for redirect */
314316 int callingplanrdnis; /* Dialing plan of Redirecting Number */
315 char useruserinfo[256]; /* User->User info */
317 char useruserinfo[260]; /* User->User info */
316318 int flexible; /* Are we flexible with our channel selection? */
317319 int cref; /* Call Reference Number */
318320 int ctype; /* Call type (see PRI_TRANS_CAP_* */
------
335337 int cref;
336338 q931_call *call; /* Opaque call pointer */
337339 long aoc_units; /* Advise of Charge number of charged units */
340 char useruserinfo[260]; /* User->User info */
338341 } pri_event_hangup;
339342
340343 typedef struct pri_event_restart_ack {
------
519522 extern int pri_sr_set_called(struct pri_sr *sr, char *called, int calledplan, int complete);
520523 extern int pri_sr_set_caller(struct pri_sr *sr, char *caller, char *callername, int callerplan, int callerpres);
521524 extern int pri_sr_set_redirecting(struct pri_sr *sr, char *num, int plan, int pres, int reason);
525 #define PRI_USER_USER_TX
526 /* Set the user user field. Warning! don't send binary data accross this field */
527 extern void pri_sr_set_useruser(struct pri_sr *sr, char *userchars);
522528
529 extern void pri_call_set_useruser(q931_call *sr, char *userchars);
530
523531 extern int pri_setup(struct pri *pri, q931_call *call, struct pri_sr *req);
524532
525533 /* Set a call has a call indpendent signalling connection (i.e. no bchan) */

libpri/trunk/pri.c (unified diff)

r196r728
247247 return p;
248248 }
249249
250 void pri_call_set_useruser(q931_call *c, char *userchars)
251 {
252 if (userchars)
253 libpri_copy_string(c->useruserinfo, userchars, sizeof(c->useruserinfo));
254 }
255
256 void pri_sr_set_useruser(struct pri_sr *sr, char *userchars)
257 {
258 sr->useruserinfo = userchars;
259 }
260
250261 int pri_restart(struct pri *pri)
251262 {
252263 /* Restart Q.921 layer */

libpri/trunk/pri_internal.h (unified diff)

r196r728
129129 int redirectingpres;
130130 int redirectingreason;
131131 int justsignalling;
132 char *useruserinfo;
132133 };
133134
134135 /* Internal switch types */

libpri/trunk/q931.c (unified diff)

r196r728
969969 return 0;
970970 }
971971
972 static FUNC_SEND(transmit_user_user)
973 {
974 int datalen = strlen(call->useruserinfo);
975 if (datalen > 0) {
976 /* Restricted to 35 characters */
977 if (msgtype == Q931_USER_INFORMATION) {
978 if (datalen > 260)
979 datalen = 260;
980 } else {
981 if (datalen > 35)
982 datalen = 35;
983 }
984 ie->data[0] = 4; /* IA5 characters */
985 memcpy(&ie->data[1], call->useruserinfo, datalen);
986 call->useruserinfo[0] = '\0';
987 return datalen + 3;
988 }
989
990 return 0;
991 }
992
972993 static char *prog2str(int prog)
973994 {
974995 static struct msgtype progs[] = {
------
19271948 { 1, Q931_IE_KEYPAD_FACILITY, "Keypad Facility", dump_keypad_facility, receive_keypad_facility },
19281949 { 0, Q931_IE_SIGNAL, "Signal", dump_signal },
19291950 { 1, Q931_IE_SWITCHHOOK, "Switch-hook" },
1930 { 1, Q931_IE_USER_USER, "User-User", dump_user_user, receive_user_user },
1951 { 1, Q931_IE_USER_USER, "User-User", dump_user_user, receive_user_user, transmit_user_user },
19311952 { 1, Q931_IE_ESCAPE_FOR_EXT, "Escape for Extension" },
19321953 { 1, Q931_IE_CALL_STATUS, "Call Status" },
19331954 { 1, Q931_IE_CHANGE_STATUS, "Change Status" },
------
25042525 return send_message(pri, c, Q931_CALL_PROCEEDING, call_proceeding_ies);
25052526 }
25062527 #ifndef ALERTING_NO_PROGRESS
2507 static int alerting_ies[] = { Q931_PROGRESS_INDICATOR, -1 };
2528 static int alerting_ies[] = { Q931_PROGRESS_INDICATOR, Q931_IE_USER_USER, -1 };
25082529 #else
25092530 static int alerting_ies[] = { -1 };
25102531 #endif
------
26272648 return send_message(pri, c, Q931_CONNECT, connect_ies);
26282649 }
26292650
2630 static int release_ies[] = { Q931_CAUSE, -1 };
2651 static int release_ies[] = { Q931_CAUSE, Q931_IE_USER_USER, -1 };
26312652
26322653 int q931_release(struct pri *pri, q931_call *c, int cause)
26332654 {
------
26752696 return send_message(pri, c, Q931_RESTART, restart_ies);
26762697 }
26772698
2678 static int disconnect_ies[] = { Q931_CAUSE, -1 };
2699 static int disconnect_ies[] = { Q931_CAUSE, Q931_IE_USER_USER, -1 };
26792700
26802701 int q931_disconnect(struct pri *pri, q931_call *c, int cause)
26812702 {
------
26952716 return 0;
26962717 }
26972718
2698 static int setup_ies[] = { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT, Q931_IE_FACILITY, Q931_PROGRESS_INDICATOR, Q931_NETWORK_SPEC_FAC, Q931_DISPLAY,
2719 static int setup_ies[] = { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT, Q931_IE_FACILITY, Q931_PROGRESS_INDICATOR, Q931_NETWORK_SPEC_FAC, Q931_DISPLAY, Q931_IE_USER_USER,
26992720 Q931_CALLING_PARTY_NUMBER, Q931_CALLED_PARTY_NUMBER, Q931_REDIRECTING_NUMBER, Q931_SENDING_COMPLETE, Q931_IE_ORIGINATING_LINE_INFO, Q931_IE_GENERIC_DIGITS, -1 };
27002721
27012722 static int gr303_setup_ies[] = { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT, -1 };
------
27732794 } else
27742795 return -1;
27752796
2797 if (req->useruserinfo)
2798 libpri_copy_string(c->useruserinfo, req->useruserinfo, sizeof(c->useruserinfo));
2799
27762800 if (req->nonisdn && (pri->switchtype == PRI_SWITCH_NI2))
27772801 c->progressmask = PRI_PROG_CALLER_NOT_ISDN;
27782802 else
------
27972821
27982822 }
27992823
2800 static int release_complete_ies[] = { -1 };
2824 static int release_complete_ies[] = { Q931_IE_USER_USER, -1 };
28012825
28022826 static int q931_release_complete(struct pri *pri, q931_call *c, int cause)
28032827 {
------
30183042 case Q931_CONNECT:
30193043 case Q931_ALERTING:
30203044 case Q931_PROGRESS:
3045 c->useruserinfo[0] = '\0';
30213046 c->cause = -1;
30223047 case Q931_CALL_PROCEEDING:
30233048 c->progress = -1;
------
30373062 if (c->retranstimer)
30383063 pri_schedule_del(pri, c->retranstimer);
30393064 c->retranstimer = 0;
3065 c->useruserinfo[0] = '\0';
30403066 break;
30413067 case Q931_RELEASE_COMPLETE:
30423068 if (c->retranstimer)
30433069 pri_schedule_del(pri, c->retranstimer);
30443070 c->retranstimer = 0;
3071 c->useruserinfo[0] = '\0';
30453072 case Q931_STATUS:
30463073 c->cause = -1;
30473074 c->causecode = -1;
------
32253252 libpri_copy_string(pri->ev.ring.redirectingnum, c->redirectingnum, sizeof(pri->ev.ring.redirectingnum));
32263253 libpri_copy_string(pri->ev.ring.redirectingname, c->redirectingname, sizeof(pri->ev.ring.redirectingname));
32273254 libpri_copy_string(pri->ev.ring.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
3255 c->useruserinfo[0] = '\0';
32283256 pri->ev.ring.redirectingreason = c->redirectingreason;
32293257 pri->ev.ring.origredirectingreason = c->origredirectingreason;
32303258 pri->ev.ring.flexible = ! (c->chanflags & FLAG_EXCLUSIVE);
------
32503278 pri->ev.ringing.call = c;
32513279 pri->ev.ringing.progress = c->progress;
32523280 pri->ev.ringing.progressmask = c->progressmask;
3281 libpri_copy_string(pri->ev.ringing.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
3282 c->useruserinfo[0] = '\0';
32533283 return Q931_RES_HAVEEVENT;
32543284 case Q931_CONNECT:
32553285 if (c->newcall) {
------
32683298 pri->ev.answer.call = c;
32693299 pri->ev.answer.progress = c->progress;
32703300 pri->ev.answer.progressmask = c->progressmask;
3301 libpri_copy_string(pri->ev.answer.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
3302 c->useruserinfo[0] = '\0';
32713303 q931_connect_acknowledge(pri, c);
32723304 if (c->justsignalling) { /* Make sure WE release when we initiatie a signalling only connection */
32733305 q931_release(pri, c, PRI_CAUSE_NORMAL_CLEARING);
------
33813413 pri->ev.hangup.cref = c->cr;
33823414 pri->ev.hangup.cause = c->cause;
33833415 pri->ev.hangup.call = c;
3416 libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
3417 c->useruserinfo[0] = '\0';
33843418 /* Free resources */
33853419 if (c->alive) {
33863420 pri->ev.e = PRI_EVENT_HANGUP;
------
34143448 pri->ev.hangup.cause = c->cause;
34153449 pri->ev.hangup.call = c;
34163450 pri->ev.hangup.aoc_units = c->aoc_units;
3451 libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.ring.useruserinfo));
3452 c->useruserinfo[0] = '\0';
34173453 /* Don't send release complete if they send us release
34183454 while we sent it, assume a NULL state */
34193455 if (c->newcall)