[asterisk-dev] Q931_IE_TIME_DATE in libpri - only dump of IE available

Wolfgang Pichler wpichler at yosd.at
Fri Sep 24 07:58:40 CDT 2010


Hi all,

i have now tested my patch - and it does work as expected...

here is the bug report
https://issues.asterisk.org/view.php?id=18047

<https://issues.asterisk.org/view.php?id=18047>best regards,
Wolfgang

2010/9/24 Wolfgang Pichler <wpichler at yosd.at>

> Hi all,
>
> i have done the following quick patch to libpri...
>
>
> root at wolfgang-desktop:/usr/local/src/asterisk-1.8/libpri# diff q931.c
> ../../libpri/q931.c
> 36a37
> > #include <time.h>
> 2825a2827,2844
> > static int receive_time_date(int full_ie, struct pri *ctrl, q931_call
> *call, int msgtype, q931_ie *ie, int len)
> > {
> > return 0;
> > }
> >
> > static int transmit_time_date(int full_ie, struct pri *ctrl, q931_call
> *call, int msgtype, q931_ie *ie, int len, int order) {
> > time_t now;
> > struct tm *timedate;
> > time(&now);
> > timedate = localtime(&now);
> > ie->data[0] = timedate->tm_year - 100; // 1900+
> > ie->data[1] = timedate->tm_mon + 1;
> > ie->data[2] = timedate->tm_mday;
> > ie->data[3] = timedate->tm_hour;
> > ie->data[4] = timedate->tm_min;
> > return 7;
> > }
> >
> 3474c3493
> < { 1, Q931_IE_TIME_DATE, "Date/Time", dump_time_date },
> ---
> > { 1, Q931_IE_TIME_DATE, "Date/Time", dump_time_date, receive_time_date,
> transmit_time_date },
> 4955a4975,4985
> > static int connect_NET_ies[] = {
> > Q931_CHANNEL_IDENT,
> > Q931_IE_FACILITY,
> > Q931_PROGRESS_INDICATOR,
> > Q931_DISPLAY,
> > Q931_IE_CONNECTED_NUM,
> > Q931_IE_CONNECTED_SUBADDR,
> > Q931_IE_TIME_DATE,
> > -1
> > };
> >
> 5009c5039,5045
> < return send_message(ctrl, c, Q931_CONNECT, connect_ies);
> ---
> > int network = ctrl->localtype == PRI_NETWORK;
> > if (network) {
> >     /* networks may send datetime */
> >     return send_message(ctrl, c, Q931_CONNECT, connect_NET_ies);
> > } else {
> >     return send_message(ctrl, c, Q931_CONNECT, connect_ies);
> > }
>
>
> Does compile fine - but i was not able to try it out until yet....
>
> Maybe someone takes a look on it - to acknowledge if it could work as i'd
> like it to work.
>
>
> What i have done - i have ported the bristuff datetime handling to the
> current libpri svn
>
> On the receive side - the IE does get ignored.
>
> On CONNECT messages - when pri localtype == NETWORK it will include the
> DATETIME IE in the CONNECT message with the current time.
>
> I think it should work as i expect it to work.
>
> Can anyone see a possible problem within the code ?
>
> I will open a bug report for it
>
> best regards,
> Wolfgang
>
>
> 2010/9/24 Wolfgang Pichler <wpichler at yosd.at>
>
> Hi all,
>>
>> i have a box in the middle setup - where asterisk is accting as a gateway.
>> Box is using asterisk 1.8 - and latest libpri. Protocol is q.931
>>
>> I now got a complaint that the time on the isdn phones is going to be
>> wrong - so i have taken a look into the q.931 protocol - and found out that
>> there is the Q931_IE_TIME_DATE element which does carry out the current time
>> from the network to the user.
>>
>> I have taken a look into q931.c - and as far as i can see - it does only
>> dump the received IE.
>>
>> I have searched bugs.digium.com - but can't find anything related to
>> this.
>>
>> I have seen that the bristuff patches have implemented something related
>> to this.
>>
>> Does anyone know if there are current patches out there for the current
>> libpri to be able to forward such IE's when received - or to instruct
>> asterisk to generate such an IE for a call ?
>>
>> I will look at the bristuff code - maybe this functions can get ported to
>> the current libpri...
>>
>> best regards,
>> Wolfgang
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20100924/2971d44a/attachment-0001.htm 


More information about the asterisk-dev mailing list