Changeset 728

Update libpri with latest changes.

Comitted by:  brian
Date:  Oct 28 2005 * 20:59 (over 6 years ago)

Affected files:

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)