Hi all,<div><br></div><div>i have now tested my patch - and it does work as expected...</div><div><br></div><div>here is the bug report</div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="https://issues.asterisk.org/view.php?id=18047">https://issues.asterisk.org/view.php?id=18047</a></div>
<div><br></div><div><a href="https://issues.asterisk.org/view.php?id=18047"></a>best regards,</div><div>Wolfgang<br><br><div class="gmail_quote">2010/9/24 Wolfgang Pichler <span dir="ltr"><<a href="mailto:wpichler@yosd.at">wpichler@yosd.at</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi all,<div><br></div><div>i have done the following quick patch to libpri...</div><div><br></div><div><br></div><div>
<div>root@wolfgang-desktop:/usr/local/src/asterisk-1.8/libpri# diff q931.c ../../libpri/q931.c</div><div>
36a37</div><div>> #include <time.h></div><div>2825a2827,2844</div><div>> static int receive_time_date(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)</div><div>> {</div><div>
> <span style="white-space:pre-wrap">        </span>return 0;</div><div>> }</div><div>> </div><div>> static int transmit_time_date(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len, int order) {</div>
<div>> <span style="white-space:pre-wrap">        </span>time_t now;</div><div>> <span style="white-space:pre-wrap">        </span>struct tm *timedate;</div><div>> <span style="white-space:pre-wrap">        </span>time(&now);</div>
<div>> <span style="white-space:pre-wrap">        </span>timedate = localtime(&now);</div><div>> <span style="white-space:pre-wrap">        </span>ie->data[0] = timedate->tm_year - 100; // 1900+</div>
<div>> <span style="white-space:pre-wrap">        </span>ie->data[1] = timedate->tm_mon + 1;</div><div>> <span style="white-space:pre-wrap">        </span>ie->data[2] = timedate->tm_mday;</div>
<div>> <span style="white-space:pre-wrap">        </span>ie->data[3] = timedate->tm_hour;</div><div>> <span style="white-space:pre-wrap">        </span>ie->data[4] = timedate->tm_min;</div>
<div>> <span style="white-space:pre-wrap">        </span>return 7;</div><div>> }</div><div>> </div><div>3474c3493</div><div>< <span style="white-space:pre-wrap">        </span>{ 1, Q931_IE_TIME_DATE, "Date/Time", dump_time_date },</div>
<div>---</div><div>> <span style="white-space:pre-wrap">        </span>{ 1, Q931_IE_TIME_DATE, "Date/Time", dump_time_date, receive_time_date, transmit_time_date },</div><div>4955a4975,4985</div><div>
> static int connect_NET_ies[] = {</div><div>> <span style="white-space:pre-wrap">        </span>Q931_CHANNEL_IDENT,</div><div>> <span style="white-space:pre-wrap">        </span>Q931_IE_FACILITY,</div>
<div>> <span style="white-space:pre-wrap">        </span>Q931_PROGRESS_INDICATOR,</div><div>> <span style="white-space:pre-wrap">        </span>Q931_DISPLAY,</div><div>> <span style="white-space:pre-wrap">        </span>Q931_IE_CONNECTED_NUM,</div>
<div>> <span style="white-space:pre-wrap">        </span>Q931_IE_CONNECTED_SUBADDR,</div><div>> <span style="white-space:pre-wrap">        </span>Q931_IE_TIME_DATE,</div><div>> <span style="white-space:pre-wrap">        </span>-1</div>
<div>> };</div><div>> </div><div>5009c5039,5045</div><div>< <span style="white-space:pre-wrap">        </span>return send_message(ctrl, c, Q931_CONNECT, connect_ies);</div><div>---</div><div>> <span style="white-space:pre-wrap">        </span>int network = ctrl->localtype == PRI_NETWORK;</div>
<div>> <span style="white-space:pre-wrap">        </span>if (network) {</div><div>> <span style="white-space:pre-wrap">        </span> /* networks may send datetime */</div><div>> <span style="white-space:pre-wrap">        </span> return send_message(ctrl, c, Q931_CONNECT, connect_NET_ies);</div>
<div>> <span style="white-space:pre-wrap">        </span>} else {</div><div>> <span style="white-space:pre-wrap">        </span> return send_message(ctrl, c, Q931_CONNECT, connect_ies);</div>
<div>> <span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><br></div><div>Does compile fine - but i was not able to try it out until yet....</div><div><br></div><div>Maybe someone takes a look on it - to acknowledge if it could work as i'd like it to work.</div>
<div><br></div><div><br></div><div>What i have done - i have ported the bristuff datetime handling to the current libpri svn</div><div><br></div><div>On the receive side - the IE does get ignored.</div><div><br></div><div>
On CONNECT messages - when pri localtype == NETWORK it will include the DATETIME IE in the CONNECT message with the current time.</div><div><br></div><div>I think it should work as i expect it to work.</div><div><br></div>
<div>Can anyone see a possible problem within the code ?</div><div><br></div><div>I will open a bug report for it</div><div><br></div><div>best regards,</div><div>Wolfgang</div><div><br></div><br><div class="gmail_quote">
2010/9/24 Wolfgang Pichler <span dir="ltr"><<a href="mailto:wpichler@yosd.at" target="_blank">wpichler@yosd.at</a>></span><div><div></div><div class="h5"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<div>
<br></div><div>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</div><div><br></div><div>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.</div>
<div><br></div><div>I have taken a look into q931.c - and as far as i can see - it does only dump the received IE.</div><div><br></div><div>I have searched <a href="http://bugs.digium.com" target="_blank">bugs.digium.com</a> - but can't find anything related to this.</div>
<div><br></div><div>I have seen that the bristuff patches have implemented something related to this.</div><div><br></div><div>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 ?</div>
<div><br></div><div>I will look at the bristuff code - maybe this functions can get ported to the current libpri...</div><div><br></div><div>best regards,</div><div>Wolfgang</div><font color="#888888"><div><br></div>
</font></blockquote></div></div></div><br></div>
</blockquote></div><br></div>