[asterisk-dev] Real-time call control for Dial app

Grey Man greymanvoip at gmail.com
Thu Mar 27 21:48:39 CDT 2008


On Thu, Mar 27, 2008 at 10:10 AM, Charles Wang <lazy.charles at gmail.com> wrote:
> Hi all,
>
> I tried to using rtcc-curl-1.4.13.patch in bug id 6335
> http://bugs.digium.com/view.php?id=6335 reported by KNK. I patch it to
> asterisk 1.4.18.1 and it seems work.
>
> My extensions.conf lists below:
>
> exten =>
> _X.,1,Set(TimeLimit=${CURL(http://127.0.0.1/test.php?app=rtcc&accountcode=${ACCOUNTCODE}&dst=${EXTEN}&channelid=${UNIQUEID}&seqnum=1)})
>  exten => _X.,n,Set(TimeLimit=${MATH(${TimeLimit}+5,int)})
> exten => _X.,n,Set(TimeLimit=${MATH(${TimeLimit}*1000,int)})
> exten => _X.,n,Set(dst=${EXTEN})
> exten => _X.,n,NoOp(Initial time limit for ${ACCOUNTCODE} and ${EXTEN} set
> at ${TimeLimit})
>  exten => _X.,n,Set(RTCC_START_SEQNUM=2)
> exten => _X.,n,Set(RTCC_INTERVAL=60000)
> exten => _X.,n,Dial(SIP/1025,,L(${TimeLimit}:::http://127.0.0.1/test.php))
> exten => _X.,n,Hangup
>
> My URL test.php always reponses interger 120. It is pure text format without
> any symbol before/after it.
>
> My test.php: ( one row only )
> 120
>
>     -- Accepting AUTHENTICATED call from XXX.XXX.XXX.XXX:
>        > requested format = ilbc,
>        > requested prefs = (),
>        > actual format = ilbc,
>        > host prefs = (ilbc),
>        > priority = mine
>      -- Executing [_X. at default:1] Set("SIP/2922-10", "TimeLimit=120") in new
> stack
>     -- Executing [_X. at default:2] Set("SIP/2922-10", "TimeLimit=125") in new
> stack
>     -- Executing [_X. at default:3] Set("SIP/2922-10", "TimeLimit=125000") in
> new stack
>      -- Executing [_X. at default:4] Set("SIP/2922-10", "dst=295") in new stack
>     -- Executing [_X. at default:5] NoOp("SIP/2922-10", "Initial time limit for
> and 295 set at 45000") in new stack
>      -- Executing [_X. at default:6] Set("SIP/2922-10", "RTCC_START_SEQNUM=2")
> in new stack
>     -- Executing [_X. at default:7] Set("SIP/2922-10", "RTCC_INTERVAL=60000")
> in new stack
>      -- Executing [_X. at default:8] Dial("SIP/2922-10",
> "SIP/1025||L(125000::http://127.0.0.1/test.php)") in new stack
>     -- Limit Data for this call:
>        > timelimit      = 125000
>         > play_warning   = 0
>        > play_to_caller = yes
>        > play_to_callee = no
>        > warning_freq   = 0
>        > rtcc url       = //127.0.0.1/test.php
>        > rtcc interval  = 60000
>         > rtcc exp intvl = 0
>        > rtcc seqnum     = 2
>        > start_sound    = (null)
>        > warning_sound  = timeleft
>        > end_sound      = (null)
>
> During the period, I trace the /var/log/httpd/access_log. I can't find any
> request to test.php. Should it be visited each 6 sec ?

You've got the interval set at 60s. If you want the rtcc call to be
made every 6s change to:

exten => _X.,n,Set(RTCC_INTERVAL=6000)

> (Only this line)
> 127.0.0.1 - - [27/Mar/2008:17:51:54 +0800] "GET
> /test.php?app=rtcc&accountcode=&dst=295&channelid=1206611514.2&seqnum=1
> HTTP/1.1" 200 3 "-" "asterisk-libcurl-agent/1.0"
>
> Then, I tried to reduce the integer number 120 to 80. I wish it can be hunup
> when 80 seconds reached. But the answer was NO. It made my asterisk crashed.
> I got this message in debug mode.
>
> [Mar 27 17:52:58] DEBUG[32053]: app_dial.c:877 rtcccallback: call control
> accountcode=2922, dst=295.
> asterisk: symbol lookup error: /usr/lib/asterisk/modules/app_dial.so:
> undefined symbol: curl_easy_init
>
> Can anyone kindly give me any idea?

It's bad if the patch crashed Asterisk. The latest patch I did was for
1.14.17 and it should have a better chance of working properly. I've
attached the 1.4.17 patch since I can't upload files to the bug
tracker anymore since it was decided by someone somewhere that rtcc is
of no interest to Asterisk users even though it's regularly requested
and there are two patch options available.

Regards,

Greyman.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtcc-curl-1.4.17.patch
Type: application/octet-stream
Size: 20729 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20080328/dede32c6/attachment-0001.obj 


More information about the asterisk-dev mailing list