Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 148582 Details for
Bug 216171
net-libs/libpri-1.6 ebuilds (needed by asterisk 1.6)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
libpri-1.6.0-connectedname.diff
libpri-1.6.0-connectedname.diff (text/plain), 11.57 KB, created by
Natanael Copa
on 2008-04-04 11:22:01 UTC
(
hide
)
Description:
libpri-1.6.0-connectedname.diff
Filename:
MIME Type:
Creator:
Natanael Copa
Created:
2008-04-04 11:22:01 UTC
Size:
11.57 KB
patch
obsolete
>Index: libpri-1.6.0-beta1/libpri.h >=================================================================== >--- libpri-1.6.0-beta1.orig/libpri.h 2008-04-03 14:58:48.000000000 +0300 >+++ libpri-1.6.0-beta1/libpri.h 2008-04-03 14:58:55.000000000 +0300 >@@ -323,6 +323,7 @@ > int progressmask; > q931_call *call; > char useruserinfo[260]; /* User->User info */ >+ char calledname[256]; > } pri_event_ringing; > > typedef struct pri_event_answer { >@@ -333,6 +334,7 @@ > int progressmask; > q931_call *call; > char useruserinfo[260]; /* User->User info */ >+ char calledname[256]; > } pri_event_answer; > > typedef struct pri_event_facname { >@@ -388,6 +390,7 @@ > q931_call *call; /* Opaque call pointer */ > long aoc_units; /* Advise of Charge number of charged units */ > char useruserinfo[260]; /* User->User info */ >+ char calledname[256]; > } pri_event_hangup; > > typedef struct pri_event_restart_ack { >@@ -585,6 +588,9 @@ > > void pri_call_set_useruser(q931_call *sr, const char *userchars); > >+/* Set the line called number, name and presentation */ >+void pri_call_set_called_name(q931_call *c, char *number, char *name, int pres); >+ > int pri_setup(struct pri *pri, q931_call *call, struct pri_sr *req); > > /* Set a call has a call indpendent signalling connection (i.e. no bchan) */ >Index: libpri-1.6.0-beta1/pri.c >=================================================================== >--- libpri-1.6.0-beta1.orig/pri.c 2008-04-03 14:58:48.000000000 +0300 >+++ libpri-1.6.0-beta1/pri.c 2008-04-03 14:58:55.000000000 +0300 >@@ -267,6 +267,12 @@ > libpri_copy_string(c->useruserinfo, userchars, sizeof(c->useruserinfo)); > } > >+void pri_call_set_called_name(q931_call *c, char *number, char *name, int pres) >+{ >+ if (name) >+ libpri_copy_string(c->calledname, name, sizeof(c->calledname)); >+} >+ > void pri_sr_set_useruser(struct pri_sr *sr, const char *userchars) > { > sr->useruserinfo = userchars; >Index: libpri-1.6.0-beta1/pri_facility.c >=================================================================== >--- libpri-1.6.0-beta1.orig/pri_facility.c 2008-04-03 14:58:27.000000000 +0300 >+++ libpri-1.6.0-beta1/pri_facility.c 2008-04-03 14:58:55.000000000 +0300 >@@ -1070,6 +1070,59 @@ > } > /* End Callername */ > >+/* Sending calledname information functions */ >+static int add_calledname_facility_ies(struct pri *pri, q931_call *c, >+ int state, int oper_id) >+{ >+ int res = 0; >+ int i = 0; >+ unsigned char buffer[256]; >+ unsigned char namelen = 0; >+ struct rose_component *comp = NULL, *compstk[10]; >+ int compsp = 0; >+ >+ i = 0; >+ namelen = strlen(c->calledname); >+ if (namelen > 50) >+ namelen = 50; /* truncate the name */ >+ if (namelen <= 0) >+ return -1; >+ >+ buffer[i++] = (ASN1_CONTEXT_SPECIFIC | Q932_PROTOCOL_EXTENSIONS); >+ /* Interpretation component */ >+ >+ if (pri->switchtype == PRI_SWITCH_QSIG) { >+ ASN1_ADD_SIMPLE(comp, COMP_TYPE_NFE, buffer, i); >+ ASN1_PUSH(compstk, compsp, comp); >+ ASN1_ADD_BYTECOMP(comp, (ASN1_CONTEXT_SPECIFIC | ASN1_TAG_0), buffer, i, 0); >+ ASN1_ADD_BYTECOMP(comp, (ASN1_CONTEXT_SPECIFIC | ASN1_TAG_2), buffer, i, 0); >+ ASN1_FIXUP(compstk, compsp, buffer, i); >+ } >+ >+ ASN1_ADD_BYTECOMP(comp, COMP_TYPE_INTERPRETATION, buffer, i, 0); >+ >+ ASN1_ADD_SIMPLE(comp, COMP_TYPE_INVOKE, buffer, i); >+ ASN1_PUSH(compstk, compsp, comp); >+ >+ /* Invoke ID */ >+ ASN1_ADD_BYTECOMP(comp, ASN1_INTEGER, buffer, i, get_invokeid(pri)); >+ >+ /* Operation ID: Called name */ >+ ASN1_ADD_BYTECOMP(comp, ASN1_INTEGER, buffer, i, oper_id); >+ >+ res = asn1_string_encode((ASN1_CONTEXT_SPECIFIC | ASN1_TAG_0), &buffer[i], sizeof(buffer)-i, 50, c->calledname, namelen); >+ if (res < 0) >+ return -1; >+ i += res; >+ ASN1_FIXUP(compstk, compsp, buffer, i); >+ >+ if (pri_call_apdu_queue(c, state, buffer, i, NULL, NULL)) >+ return -1; >+ >+ return 0; >+} >+/* End Calledname */ >+ > /* MWI related encode and decode functions */ > static void mwi_activate_encode_cb(void *data) > { >@@ -2217,6 +2270,24 @@ > return -1; > } > break; >+ case SS_CNID_CALLEDNAME: >+ case SS_CNID_CONNECTEDNAME: >+ case SS_CNID_BUSYNAME: >+ if (pri->debug & PRI_DEBUG_APDU) >+ pri_message(pri, " Handle Called name display operation\n"); >+ switch (comp->type) { >+ case ROSE_NAME_PRESENTATION_ALLOWED_SIMPLE: >+ memcpy(call->calledname, comp->data, comp->len); >+ call->calledname[comp->len] = 0; >+ if (pri->debug & PRI_DEBUG_APDU) >+ pri_message(pri, " Received called name '%s'\n", call->calledname); >+ return 0; >+ default: >+ if (pri->debug & PRI_DEBUG_APDU) >+ pri_message(pri, "Do not handle argument of type 0x%X\n", comp->type); >+ return -1; >+ } >+ break; > case ROSE_CALL_TRANSFER_IDENTIFY: > if (pri->debug & PRI_DEBUG_APDU) > pri_message(pri, "ROSE %i: CallTransferIdentify - not handled!\n", operation_tag); >@@ -2431,3 +2502,39 @@ > return 0; > } > >+int pri_call_add_alerting_apdus(struct pri *pri, q931_call *call) >+{ >+ if (!pri->sendfacility) >+ return 0; >+ >+ if (pri->switchtype == PRI_SWITCH_QSIG) >+ add_calledname_facility_ies(pri, call, Q931_ALERTING, >+ SS_CNID_CALLEDNAME); >+ >+ return 0; >+} >+ >+int pri_call_add_connect_apdus(struct pri *pri, q931_call *call) >+{ >+ if (!pri->sendfacility) >+ return 0; >+ >+ if (pri->switchtype == PRI_SWITCH_QSIG) >+ add_calledname_facility_ies(pri, call, Q931_CONNECT, >+ SS_CNID_CONNECTEDNAME); >+ >+ return 0; >+} >+ >+int pri_call_add_busy_apdus(struct pri *pri, q931_call *call) >+{ >+ if (!pri->sendfacility) >+ return 0; >+ >+ if (pri->switchtype == PRI_SWITCH_QSIG) >+ add_calledname_facility_ies(pri, call, Q931_DISCONNECT, >+ SS_CNID_BUSYNAME); >+ >+ return 0; >+} >+ >Index: libpri-1.6.0-beta1/pri_facility.h >=================================================================== >--- libpri-1.6.0-beta1.orig/pri_facility.h 2008-04-03 14:58:27.000000000 +0300 >+++ libpri-1.6.0-beta1/pri_facility.h 2008-04-03 14:58:55.000000000 +0300 >@@ -58,7 +58,10 @@ > #define ROSE_AOC_IDENTIFICATION_OF_CHARGE 37 > /* Q.SIG operations */ > #define SS_CNID_CALLINGNAME 0 >-#define SS_ANFPR_PATHREPLACEMENT 4 >+#define SS_CNID_CALLEDNAME 1 >+#define SS_CNID_CONNECTEDNAME 2 >+#define SS_CNID_BUSYNAME 3 >+#define SS_ANFPR_PATHREPLACEMENT 4 > #define SS_DIVERTING_LEG_INFORMATION2 21 > #define SS_MWI_ACTIVATE 80 > #define SS_MWI_DEACTIVATE 81 >@@ -300,6 +303,15 @@ > /* Adds the "standard" APDUs to a call */ > int pri_call_add_standard_apdus(struct pri *pri, q931_call *call); > >+/* Adds the "alerting" state APDUs to a call */ >+int pri_call_add_alerting_apdus(struct pri *pri, q931_call *call); >+ >+/* Adds the "connected" state APDUs to a call */ >+int pri_call_add_connect_apdus(struct pri *pri, q931_call *call); >+ >+/* Adds the "busy" state APDUs to a call */ >+int pri_call_add_busy_apdus(struct pri *pri, q931_call *call); >+ > int asn1_dump(struct pri *pri, void *comp, int len); > > #endif /* _PRI_FACILITY_H */ >Index: libpri-1.6.0-beta1/pri_internal.h >=================================================================== >--- libpri-1.6.0-beta1.orig/pri_internal.h 2008-04-03 14:58:48.000000000 +0300 >+++ libpri-1.6.0-beta1/pri_internal.h 2008-04-03 14:58:55.000000000 +0300 >@@ -223,6 +223,7 @@ > int calledplan; > int nonisdn; > char callednum[256]; /* Called Number */ >+ char calledname[256]; /* Called Name */ > int complete; /* no more digits coming */ > int newcall; /* if the received message has a new call reference value */ > >Index: libpri-1.6.0-beta1/q931.c >=================================================================== >--- libpri-1.6.0-beta1.orig/q931.c 2008-04-03 14:58:48.000000000 +0300 >+++ libpri-1.6.0-beta1/q931.c 2008-04-03 16:16:43.000000000 +0300 >@@ -53,7 +53,7 @@ > { Q931_PROGRESS, "PROGRESS", { Q931_PROGRESS_INDICATOR } }, > { Q931_SETUP, "SETUP", { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT } }, > { Q931_SETUP_ACKNOWLEDGE, "SETUP ACKNOWLEDGE" }, >- >+ > /* Call disestablishment messages */ > { Q931_DISCONNECT, "DISCONNECT", { Q931_CAUSE } }, > { Q931_RELEASE, "RELEASE" }, >@@ -2779,9 +2779,10 @@ > return send_message(pri, c, Q931_CALL_PROCEEDING, call_proceeding_ies); > } > #ifndef ALERTING_NO_PROGRESS >-static int alerting_ies[] = { Q931_PROGRESS_INDICATOR, Q931_IE_USER_USER, -1 }; >+static int alerting_ies[] = { Q931_PROGRESS_INDICATOR, Q931_IE_FACILITY, >+ Q931_IE_USER_USER, -1 }; > #else >-static int alerting_ies[] = { -1 }; >+static int alerting_ies[] = { Q931_IE_FACILITY, -1 }; > #endif > > int q931_alerting(struct pri *pri, q931_call *c, int channel, int info) >@@ -2797,10 +2798,12 @@ > UPDATE_OURCALLSTATE(pri, c, Q931_CALL_STATE_CALL_RECEIVED); > c->peercallstate = Q931_CALL_STATE_CALL_DELIVERED; > c->alive = 1; >+ pri_call_add_alerting_apdus(pri, c); > return send_message(pri, c, Q931_ALERTING, alerting_ies); > } > >-static int connect_ies[] = { Q931_CHANNEL_IDENT, Q931_PROGRESS_INDICATOR, -1 }; >+static int connect_ies[] = { Q931_CHANNEL_IDENT, Q931_PROGRESS_INDICATOR, >+ Q931_IE_FACILITY, -1 }; > > int q931_setup_ack(struct pri *pri, q931_call *c, int channel, int nonisdn) > { >@@ -2910,6 +2913,7 @@ > c->retranstimer = 0; > if ((c->ourcallstate == Q931_CALL_STATE_CONNECT_REQUEST) && (pri->bri || (!pri->subchannel))) > c->retranstimer = pri_schedule_event(pri, pri->timers[PRI_TIMER_T313], pri_connect_timeout, c); >+ pri_call_add_connect_apdus(pri, c); > return send_message(pri, c, Q931_CONNECT, connect_ies); > } > >@@ -2961,7 +2965,7 @@ > return send_message(pri, c, Q931_RESTART, restart_ies); > } > >-static int disconnect_ies[] = { Q931_CAUSE, Q931_IE_USER_USER, -1 }; >+static int disconnect_ies[] = { Q931_CAUSE, Q931_IE_FACILITY, Q931_IE_USER_USER, -1 }; > > int q931_disconnect(struct pri *pri, q931_call *c, int cause) > { >@@ -2976,6 +2980,8 @@ > if (c->retranstimer) > pri_schedule_del(pri, c->retranstimer); > c->retranstimer = pri_schedule_event(pri, pri->timers[PRI_TIMER_T305], pri_disconnect_timeout, c); >+ if (cause == PRI_CAUSE_USER_BUSY) >+ pri_call_add_busy_apdus(pri, c); > return send_message(pri, c, Q931_DISCONNECT, disconnect_ies); > } else > return 0; >@@ -3292,6 +3298,7 @@ > c->callerpres = -1; > c->callernum[0] = '\0'; > c->callednum[0] = '\0'; >+ c->calledname[0] = '\0'; > c->callername[0] = '\0'; > c->callerani[0] = '\0'; > c->callerplanani = -1; >@@ -3556,6 +3563,8 @@ > pri->ev.ringing.progressmask = c->progressmask; > libpri_copy_string(pri->ev.ringing.useruserinfo, c->useruserinfo, sizeof(pri->ev.ringing.useruserinfo)); > c->useruserinfo[0] = '\0'; >+ libpri_copy_string(pri->ev.ringing.calledname, c->calledname, sizeof(pri->ev.ringing.calledname)); >+ c->calledname[0] = '\0'; > > cur = c->apdus; > while (cur) { >@@ -3586,6 +3595,8 @@ > pri->ev.answer.progressmask = c->progressmask; > libpri_copy_string(pri->ev.answer.useruserinfo, c->useruserinfo, sizeof(pri->ev.answer.useruserinfo)); > c->useruserinfo[0] = '\0'; >+ libpri_copy_string(pri->ev.answer.calledname, c->calledname, sizeof(pri->ev.answer.calledname)); >+ c->calledname[0] = '\0'; > q931_connect_acknowledge(pri, c); > if (c->justsignalling) { /* Make sure WE release when we initiatie a signalling only connection */ > q931_release(pri, c, PRI_CAUSE_NORMAL_CLEARING); >@@ -3752,6 +3763,7 @@ > pri->ev.hangup.aoc_units = c->aoc_units; > libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.hangup.useruserinfo)); > c->useruserinfo[0] = '\0'; >+ pri->ev.hangup.calledname[0] = '\0'; > /* Don't send release complete if they send us release > while we sent it, assume a NULL state */ > if (c->newcall) >@@ -3786,6 +3798,8 @@ > pri->ev.hangup.aoc_units = c->aoc_units; > libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.hangup.useruserinfo)); > c->useruserinfo[0] = '\0'; >+ libpri_copy_string(pri->ev.hangup.calledname, c->calledname, sizeof(pri->ev.hangup.calledname)); >+ c->calledname[0] = '\0'; > if (c->alive) > return Q931_RES_HAVEEVENT; > else
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 216171
:
148579
|
148580
|
148581
| 148582