Thanks a lot for the explanation Richard - I was able to get things working by patching q931.c to my needs based on your answer. <div><br></div><div>Abhinav<br><br><div class="gmail_quote">On Tue, Nov 23, 2010 at 10:29 PM, Richard Mudgett <span dir="ltr"><<a href="mailto:rmudgett@digium.com">rmudgett@digium.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5"><br>
<br>
----- Original Message -----<br>
> Richard,<br>
><br>
><br>
> Thanks your reply - it clarified things. However, now I have a bigger<br>
> problem with libpri, the following :<br>
><br>
><br>
> Normally, with most providers, I get a q931 RESTART message when I<br>
> restart my application ( here FreeSWITCH ) - this RESTART message<br>
> contains the message to reset a single DS1 facility. Things work fine<br>
> here.<br>
><br>
><br>
> However, with this one provider, ,I get a q931 RESTART message<br>
> containing the following :<br>
><br>
><br>
><br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Informational<br>
> frame:<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < SAPI: 00 C/R:<br>
> 1 EA: 0<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < TEI: 000 EA: 1<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < N(S): 000 0: 0<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < N(R): 000 P: 0<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < 42 bytes of<br>
> data<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Protocol<br>
> Discriminator: Q.931 (8) len=42<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < TEI=0 Call<br>
> Ref: len= 2 (reference 0/0x0) (Sent from originator)<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Message Type:<br>
> RESTART (70)<br>
> 2010-11-23 02:18:12.161997 [ERR] ftmod_libpri.c:131 len: 37 ie->ie :<br>
> 24<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < [18 20 a9 83<br>
> 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 11 12 13 14 15 16 17 18<br>
> 19 1a 1b 1c 1d 1e 9f]<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Channel ID<br>
> (len=34) [ Ext: 1 IntID: Implicit Other(PRI) Spare: 0 Exclusive Dchan:<br>
> 0<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < ChanSel: As<br>
> indicated in following octets<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 1 Coding:<br>
> 0 Number Specified Channel Type: 3<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 1 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 2 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 3 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 4 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 5 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 6 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 7 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 8 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 9 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 10 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 11 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 12 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 13 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 14 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 15 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 17 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 18 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 19 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 20 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 21 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 22 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 23 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 24 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 25 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 26 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 27 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 28 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 29 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 0<br>
> Channel: 30 Type: CPE<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Ext: 1<br>
> Channel: 31 Type: CPE]<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < [79 01 80]<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 < Restart<br>
> Indentifier (len= 3) [ Ext: 1 Spare: 0 Resetting Indicated Channel (0)<br>
> ]<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 -- Making new<br>
> call for cref 0<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 Received message<br>
> for call 0xddcb80 on 0xdb25b0 TEI/SAPI 0/0, call->pri is 0xdb25b0<br>
> TEI/SAPI 0/0<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 -- Processing<br>
> Q.931 Restart<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 XXXX Beginning<br>
> IE handling: len = 37, step = 34<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 XXX Processing<br>
> IEs: cur_codeset = 0, IE 24. Switchtype: 5<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 -- Processing IE<br>
> 24 (cs0, Channel Identification)<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 XXX Processing<br>
> IEs: cur_codeset = 0, IE 121. Switchtype: 5<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 -- Processing IE<br>
> 121 (cs0, Restart Indicator)<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 q931.c:6863<br>
> post_handle_q931_message: Call 0 enters state 62 (Restart). Hold<br>
> state: Idle<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 q931.c:4363<br>
> restart_ack: Call 0 enters state 0 (Null). Hold state: Idle<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 > DL-DATA<br>
> request<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 > Protocol<br>
> Discriminator: Q.931 (8) len=13<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 > TEI=0 Call<br>
> Ref: len= 2 (reference 0/0x0) (Sent to originator)<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 > Message Type:<br>
> RESTART ACKNOWLEDGE (78)<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 TEI=0<br>
> Transmitting N(S)=0, window is open V(A)=0 K=7<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 > TEI: 0 State<br>
> 7(Multi-frame established)<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 > V(A)=0,<br>
> V(S)=0, V(R)=1<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 > K=7, RC=0,<br>
> l3initiated=0, reject_except=0, ack_pend=0<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 > T200_id=0,<br>
> N200=3, T203_id=1<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 > [ 00 01 00 02<br>
> 08 02 80 00 4e 18 03 a9 83 81 79 01 80 ]<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 > Informational<br>
> frame:<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 > SAPI: 00 C/R:<br>
> 0 EA: 0<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 > TEI: 000 EA: 1<br>
> 2010-11-23 02:18:12.161997 [DEBUG] ftmod_libpri.c:149 > N(S): 000 0: 0<br>
> 2010-11-23 02:18:12.163006 [DEBUG] ftmod_libpri.c:149 > N(R): 001 P: 0<br>
> 2010-11-23 02:18:12.163006 [DEBUG] ftmod_libpri.c:149 > 13 bytes of<br>
> data<br>
> 2010-11-23 02:18:12.163006 [DEBUG] ftmod_libpri.c:149 > Protocol<br>
> Discriminator: Q.931 (8) len=13<br>
> 2010-11-23 02:18:12.163006 [DEBUG] ftmod_libpri.c:149 > TEI=0 Call<br>
> Ref: len= 2 (reference 0/0x0) (Sent to originator)<br>
> 2010-11-23 02:18:12.163006 [DEBUG] ftmod_libpri.c:149 > Message Type:<br>
> RESTART ACKNOWLEDGE (78)<br>
> 2010-11-23 02:18:12.163006 [ERR] ftmod_libpri.c:131 len: 8 ie->ie : 24<br>
> 2010-11-23 02:18:12.163006 [DEBUG] ftmod_libpri.c:149 > [18 03 a9 83<br>
> 81]<br>
> 2010-11-23 02:18:12.163006 [DEBUG] ftmod_libpri.c:149 > Channel ID<br>
> (len= 5) [ Ext: 1 IntID: Implicit Other(PRI) Spare: 0 Exclusive Dchan:<br>
> 0<br>
> 2010-11-23 02:18:12.163006 [DEBUG] ftmod_libpri.c:149 > ChanSel: As<br>
> indicated in following octets<br>
> 2010-11-23 02:18:12.163006 [DEBUG] ftmod_libpri.c:149 > Ext: 1 Coding:<br>
> 0 Number Specified Channel Type: 3<br>
> 2010-11-23 02:18:12.163006 [DEBUG] ftmod_libpri.c:149 > Ext: 1<br>
> Channel: 1 Type: CPE]<br>
><br>
><br>
><br>
><br>
><br>
><br>
> As can be seen above, the RESTART message contains a message with all<br>
> the channels Number Specified ( as opposed to slot map specified, I<br>
> think ? ). However, the RESTART ACKNOWLEDGE for this message only<br>
> shows one channel being restarted.<br>
><br>
><br>
> Shouldn't all the channels specified by the RESTART message be<br>
> RESTARTED ?<br>
><br>
><br>
> If I'm not mistaken, this is causing the rest of my channels to not<br>
> accept calls at all, and post an application restart, only the first<br>
> channel of every span(line) takes calls - the rest just hangup and get<br>
> a RELEASE ACKNOWLEDGE.<br>
><br>
><br>
> How to fix this ?<br>
><br>
</div></div>Libpri simply does not handle repeated ies very well. In this case libpri is only setup to handle one channel at a time or the entire span (i.e., no channel specified). The upper layer is only notified to restart a single channel or the entire span.<br>
<div><div></div><div class="h5"><br>
Richard<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br>
</div></div></blockquote></div><br></div>