Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 147884 Details for
Bug 215593
asterisk-1.6 (and related) ebuilds
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), 7.94 KB, created by
Natanael Copa
on 2008-03-31 18:13:57 UTC
(
hide
)
Description:
libpri-1.6.0-connectedname.diff
Filename:
MIME Type:
Creator:
Natanael Copa
Created:
2008-03-31 18:13:57 UTC
Size:
7.94 KB
patch
obsolete
>Index: libpri-1.6.0-beta1/libpri.h >=================================================================== >--- libpri-1.6.0-beta1.orig/libpri.h 2008-03-27 13:48:31.000000000 +0200 >+++ libpri-1.6.0-beta1/libpri.h 2008-03-27 14:09:12.000000000 +0200 >@@ -281,6 +281,7 @@ > int progressmask; > q931_call *call; > char useruserinfo[260]; /* User->User info */ >+ char calledname[256]; > } pri_event_ringing; > > typedef struct pri_event_answer { >@@ -292,6 +293,7 @@ > int progressmask; > q931_call *call; > char useruserinfo[260]; /* User->User info */ >+ char calledname[256]; > } pri_event_answer; > > typedef struct pri_event_facname { >@@ -551,6 +553,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-03-27 13:48:31.000000000 +0200 >+++ libpri-1.6.0-beta1/pri.c 2008-03-27 14:08:53.000000000 +0200 >@@ -261,6 +261,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-03-27 13:48:31.000000000 +0200 >+++ libpri-1.6.0-beta1/pri_facility.c 2008-03-27 14:03:41.000000000 +0200 >@@ -1070,6 +1070,58 @@ > } > /* End Callername */ > >+/* Sending calledname information functions */ >+static int add_calledname_facility_ies(struct pri *pri, q931_call *c) >+{ >+ 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, SS_CNID_CALLEDNAME); >+ >+ 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, Q931_ALERTING, 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 +2269,22 @@ > return -1; > } > break; >+ case SS_CNID_CALLEDNAME: >+ 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 +2499,14 @@ > 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); >+ >+ return 0; >+} >+ >Index: libpri-1.6.0-beta1/pri_facility.h >=================================================================== >--- libpri-1.6.0-beta1.orig/pri_facility.h 2008-03-27 13:48:31.000000000 +0200 >+++ libpri-1.6.0-beta1/pri_facility.h 2008-03-27 14:04:11.000000000 +0200 >@@ -58,6 +58,7 @@ > #define ROSE_AOC_IDENTIFICATION_OF_CHARGE 37 > /* Q.SIG operations */ > #define SS_CNID_CALLINGNAME 0 >+#define SS_CNID_CALLEDNAME 1 > #define SS_ANFPR_PATHREPLACEMENT 4 > #define SS_DIVERTING_LEG_INFORMATION2 21 > #define SS_MWI_ACTIVATE 80 >@@ -300,6 +301,9 @@ > /* 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); >+ > 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-03-27 13:48:31.000000000 +0200 >+++ libpri-1.6.0-beta1/pri_internal.h 2008-03-27 14:01:07.000000000 +0200 >@@ -222,6 +222,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-03-27 13:48:31.000000000 +0200 >+++ libpri-1.6.0-beta1/q931.c 2008-03-27 14:08:16.000000000 +0200 >@@ -2630,9 +2630,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) >@@ -2648,6 +2649,7 @@ > 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); > } > >@@ -3141,6 +3143,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; >@@ -3403,6 +3406,7 @@ > pri->ev.ringing.call = c; > pri->ev.ringing.progress = c->progress; > pri->ev.ringing.progressmask = c->progressmask; >+ libpri_copy_string(pri->ev.ringing.calledname, c->calledname, sizeof(pri->ev.ringing.calledname)); > libpri_copy_string(pri->ev.ringing.useruserinfo, c->useruserinfo, sizeof(pri->ev.ringing.useruserinfo)); > c->useruserinfo[0] = '\0'; > >@@ -3433,6 +3437,7 @@ > pri->ev.answer.call = c; > pri->ev.answer.progress = c->progress; > pri->ev.answer.progressmask = c->progressmask; >+ libpri_copy_string(pri->ev.answer.calledname, c->calledname, sizeof(pri->ev.answer.calledname)); > libpri_copy_string(pri->ev.answer.useruserinfo, c->useruserinfo, sizeof(pri->ev.answer.useruserinfo)); > c->useruserinfo[0] = '\0'; > q931_connect_acknowledge(pri, c);
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 215593
:
147852
|
147873
|
147877
|
147879
|
147880
|
147881
|
147882
|
147883
|
147884
|
147887
|
148586
|
148591
|
148592
|
148594
|
148595
|
148596
|
148597
|
148598
|
148600