<div>Hi Moy,</div>
<div> </div>
<div>¡Great, it works! Thanks ever so much.</div>
<div> </div>
<div>But, I don't understand anything. I mean: </div>
<div>The only difference I can see between this testasync.diff and your last asterisk-1.4.18-async-agi.patch is at the lines:</div>
<div> </div>
<div>returnstatus |= agi_handle_command(chan, &async_agi, cmd->cmd_buffer);<br>if ((returnstatus < 0) || (returnstatus == AST_PBX_KEEPALIVE)) {<br> free_agi_cmd(cmd);<br> ast_log(LOG_DEBUG, "agi_handle_command returned error or AST_PBX_KEEPALIVE on chan %s (0x%X)\n", chan->name, returnstatus);<br>
break;<br>}<br></div>
<div>where you have inserted an ast_log output among other things, however, the code isn't exiting by that point, as you can see:</div>
<div> </div>
<div>[Apr 16 15:35:41] DEBUG[22621]: manager.c:2108 process_message: Manager received command 'AGI'<br>[Apr 16 15:35:41] -- Playing 'es/demo-congrats' (escape_digits=1) (sample_offset 0)<br>[Apr 16 15:35:41] DEBUG[22662]: rtp.c:2753 ast_rtp_write: Ooh, format changed from unknown to alaw<br>
[Apr 16 15:35:41] DEBUG[22662]: rtp.c:2770 ast_rtp_write: Created smoother: format: 8 ms: 20 len: 160<br>[Apr 16 15:35:41] DEBUG[22662]: channel.c:1793 ast_settimeout: Scheduling timer at 160 sample intervals<br>[Apr 16 15:35:50] DEBUG[22621]: manager.c:2108 process_message: Manager received command 'Redirect'<br>
[Apr 16 15:35:50] DEBUG[22621]: channel.c:1378 ast_softhangup_nolock: Soft-Hanging up channel 'SIP/502-082901f0'<br>[Apr 16 15:35:50] DEBUG[22662]: channel.c:1793 ast_settimeout: Scheduling timer at 0 sample intervals<br>
[Apr 16 15:35:50] DEBUG[22662]: res_agi.c:430 launch_asyncagi: ast_check_hangup returned true on chan SIP/502-082901f0 (0x2)<br>[Apr 16 15:35:50] DEBUG[22662]: res_agi.c:489 launch_asyncagi: launch_asyncagi returned (0x4) for chan SIP/502-082901f0<br>
[Apr 16 15:35:50] DEBUG[22662]: pbx.c:2427 __ast_pbx_run: Spawn extension (sip_sercom,801,0) exited non-zero on 'SIP/502-082901f0'<br>[Apr 16 15:35:50] == Spawn extension (sip_sercom, 801, 0) exited non-zero on 'SIP/502-082901f0'<br>
[Apr 16 15:35:50] DEBUG[22662]: pbx.c:1831 pbx_extension_helper: Launching 'NoOp'<br>[Apr 16 15:35:50] -- Executing [801@sip_sercom:1] NoOp("SIP/502-082901f0", "entrada numeracion del 8 801") in new stack<br>
[Apr 16 15:35:50] DEBUG[22662]: pbx.c:1831 pbx_extension_helper: Launching 'AGI'<br>[Apr 16 15:35:50] -- Executing [801@sip_sercom:2] AGI("SIP/502-082901f0", "agi:async") in new stack<br><br>
<div>It's exiting by the if-else, above this last modification, already fixed in asterisk-1.4.18-async-agi.patch. If I go back to asterisk-1.4.18-async-agi.patch, then the execution doesn't exit overthere. As I already said, I don't understand anything :-(</div>
<div> </div>
<div>I would appreciate some kind of clarification about it if you can. I'm a senior programmer, both c and c++, and I have developed asyncronous voice applications for years, so don't hesitate to use all technical terms you want.<br>
</div>
<div>Nevertheless, thanks again for all and count with me for any help you could need</div>
<div> </div>
<div>Regards</div>
<div>Jose</div>
<div> </div></div>
<div class="gmail_quote">2009/4/15 Moises Silva <span dir="ltr"><<a href="mailto:moises.silva@gmail.com">moises.silva@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Ok, that makes more sense. Try this new patch and let me know how it<br>goes, once you confirm it works I will post it in my blog with a<br>
better name.<br><br><a href="http://moythreads.com/testasync.diff" target="_blank">http://moythreads.com/testasync.diff</a><br><br>Moy<br>
<div class="im"><br>On Wed, Apr 15, 2009 at 11:52 AM, <<a href="mailto:cyr2242@gmail.com">cyr2242@gmail.com</a>> wrote:<br>> Hi Moy,<br></div>> You are right. I failed applying the patch. In fact, I applied it but I didn't "make install" so I started a wrong asterisk. I apologize, it was my mistake. This time I made sure twice before getting the logs and this time the log message you said appears, but it doesn't work either as you can see:<br>
> I'm copying the whole log from the originate action to the hangup:<br>><br>> =====================================================================<br>> [Apr 15 13:01:22] DEBUG[25752]: manager.c:2108 process_message: Manager received command 'originate'<br>
> [Apr 15 13:01:22] DEBUG[26933]: chan_sip.c:15874 sip_request_call: Asked to create a SIP channel with formats: 0x40 (slin)<br>> [Apr 15 13:01:22] DEBUG[26933]: chan_sip.c:4508 sip_alloc: Allocating new SIP dialog for (No Call-ID) - INVITE (With RTP)<br>
> [Apr 15 13:01:22] DEBUG[26933]: chan_sip.c:2740 do_setnat: Setting NAT on RTP to Off<br>> [Apr 15 13:01:22] DEBUG[26933]: chan_sip.c:2745 do_setnat: Setting NAT on VRTP to Off<br>> [Apr 15 13:01:22] DEBUG[26933]: chan_sip.c:2998 sip_call: Outgoing Call for 501<br>
> [Apr 15 13:01:22] DEBUG[26933]: chan_sip.c:3013 sip_call: Our T38 capability (0), joint T38 capability (0)<br>> [Apr 15 13:01:22] DEBUG[26933]: chan_sip.c:6423 add_sdp: ** Our capability: 0x38000e (gsm|ulaw|alaw|h263|h263p|h264) Video flag: False<br>
> [Apr 15 13:01:22] DEBUG[26933]: chan_sip.c:6424 add_sdp: ** Our prefcodec: 0x40 (slin)<br>> [Apr 15 13:01:22] DEBUG[26933]: chan_sip.c:6439 add_sdp: This call needs video offers!<br>> [Apr 15 13:01:22] DEBUG[30207]: chan_sip.c:2215 __sip_semi_ack: (Provisional) Stopping retransmission (but retaining packet) on '<a href="mailto:5c2607ce7cda26537726b6a4323a3049@10.0.5.20">5c2607ce7cda26537726b6a4323a3049@10.0.5.20</a>' Request 102: Found<br>
> [Apr 15 13:01:22] DEBUG[30207]: chan_sip.c:2215 __sip_semi_ack: (Provisional) Stopping retransmission (but retaining packet) on '<a href="mailto:5c2607ce7cda26537726b6a4323a3049@10.0.5.20">5c2607ce7cda26537726b6a4323a3049@10.0.5.20</a>' Request 102: Found<br>
> [Apr 15 13:01:22] DEBUG[30207]: chan_sip.c:2157 __sip_ack: Acked pending invite 102<br>> [Apr 15 13:01:22] DEBUG[30207]: chan_sip.c:2174 __sip_ack: Stopping retransmission on '<a href="mailto:5c2607ce7cda26537726b6a4323a3049@10.0.5.20">5c2607ce7cda26537726b6a4323a3049@10.0.5.20</a>' of Request 102: Match Not Found<br>
> [Apr 15 13:01:22] DEBUG[30207]: chan_sip.c:5470 process_sdp: We're settling with these formats: 0x100008 (alaw|h263p)<br>> [Apr 15 13:01:22] DEBUG[30207]: chan_sip.c:8236 build_route: build_route: Contact hop: <sip:501@10.0.2.151:5060;user=phone><br>
> [Apr 15 13:01:22] > Channel SIP/501-0828df48 was answered.<br>> [Apr 15 13:01:22] DEBUG[26934]: pbx.c:1831 pbx_extension_helper: Launching 'NoOp'<br>> [Apr 15 13:01:22] -- Executing [801@sip_sercom:1] NoOp("SIP/501-0828df48", "entrada numeracion del 8 801") in new stack<br>
> [Apr 15 13:01:22] DEBUG[26934]: pbx.c:1831 pbx_extension_helper: Launching 'AGI'<br>> [Apr 15 13:01:22] -- Executing [801@sip_sercom:2] AGI("SIP/501-0828df48", "agi:async") in new stack<br>
> [Apr 15 13:01:51] DEBUG[25752]: manager.c:2108 process_message: Manager received command 'AGI'<br>> [Apr 15 13:01:51] -- Playing 'es/demo-congrats' (escape_digits=1) (sample_offset 0)<br>> [Apr 15 13:01:51] DEBUG[26934]: rtp.c:2753 ast_rtp_write: Ooh, format changed from unknown to alaw<br>
> [Apr 15 13:01:51] DEBUG[26934]: rtp.c:2770 ast_rtp_write: Created smoother: format: 8 ms: 20 len: 160<br>> [Apr 15 13:01:51] DEBUG[26934]: channel.c:1793 ast_settimeout: Scheduling timer at 160 sample intervals<br>
> [Apr 15 13:02:00] DEBUG[25752]: manager.c:2108 process_message: Manager received command 'Redirect'<br>> [Apr 15 13:02:00] DEBUG[25752]: channel.c:1378 ast_softhangup_nolock: Soft-Hanging up channel 'SIP/501-0828df48'<br>
> [Apr 15 13:02:00] DEBUG[26934]: channel.c:1793 ast_settimeout: Scheduling timer at 0 sample intervals<br>> [Apr 15 13:02:00] DEBUG[26934]: res_agi.c:488 launch_asyncagi: launch_asyncagi returned (0x2) for chan SIP/501-0828df48<br>
> [Apr 15 13:02:00] DEBUG[26934]: pbx.c:2448 __ast_pbx_run: Extension 801, priority 0 returned normally even though call was hung up<br>> [Apr 15 13:02:00] DEBUG[26934]: channel.c:1378 ast_softhangup_nolock: Soft-Hanging up channel 'SIP/501-0828df48'<br>
> [Apr 15 13:02:00] DEBUG[26934]: channel.c:1477 ast_hangup: Hanging up channel 'SIP/501-0828df48'<br>> [Apr 15 13:02:00] DEBUG[26934]: chan_sip.c:3485 sip_hangup: Hangup call SIP/501-0828df48, SIP callid <a href="mailto:5c2607ce7cda26537726b6a4323a3049@10.0.5.20">5c2607ce7cda26537726b6a4323a3049@10.0.5.20</a>)<br>
> =====================================================================<br>><br>> As it seemed the execution was exiting by a line of code without a log, I did a bit modification to res_agi.c (some additional log line) and I was able to find out the execution was exiting in the line 437 with the res variable containing a -1:<br>
><br>> if (cmd) {<br>> res = agi_handle_command(chan, &async_agi, cmd->cmd_buffer);<br>> if ((res < 0) || (res == AST_PBX_KEEPALIVE)) {<br>
> free_agi_cmd(cmd);<br>> break;<br>><br>> In order to discard any version issues, I installed a new one from scratch and then applied the async-agi patch only, getting the same results. By the way, I was also able to install an asterisk 1.6.0.9 with the same configuration and dial plan like the 1.4.18 one and it worked fine.<br>
><br>> I hope this can be useful.<br>><br>> Regards<br>> Jose<br>><br>><br>> -- Moises Silva wrote :<br>
<div class="im">><br>> I really think you did not recompile and reinstall after applying the<br>> new patch. I don't see any code path where the message<br>><br>> [Apr 13 12:03:57] DEBUG[2755]: res_agi.c:464 launch_asyncagi: No frame<br>
> read on channel SIP/501-08279028, going out ...<br>><br>> Is displayed but then<br>><br>> ast_log(LOG_DEBUG, "launch_asyncagi returned (0x%X) for chan %s\n",<br>> returnstatus, chan->name);<br>
><br>> is NOT displayed. In fact, there is no way you can get out of<br>> launch_asyncagi without displaying that message. I tested this with<br>> 1.4.18 version exactly.<br>><br>> The fact that works for some people and not for others may be due to<br>
> different asterisk versions and/or dial plan specific issues.<br>><br>> Please make sure the patch was correctly applied, once that is done we<br>> can try some other things.<br>><br>><br></div>
<div class="im">> --<br>> This message was sent on behalf of <a href="mailto:cyr2242@gmail.com">cyr2242@gmail.com</a> at openSubscriber.com<br></div>> <a href="http://www.opensubscriber.com/message/asterisk-users@lists.digium.com/11929418.html" target="_blank">http://www.opensubscriber.com/message/asterisk-users@lists.digium.com/11929418.html</a><br>
<div>
<div></div>
<div class="h5">><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-users mailing list<br>> To UNSUBSCRIBE or update options visit:<br>> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
><br><br><br><br>--<br>"I do not agree with what you have to say, but I’ll defend to the<br>death your right to say it." Voltaire<br></div></div></blockquote></div><br>