${ANSWEREDTIME} Returning Null

Home » Asterisk Users » ${ANSWEREDTIME} Returning Null
Asterisk Users 6 Comments

Hi,

I am initiating a call using call files. In ‘h’ extension I am trying to collect the value of ANSWEREDTIME variable but it is returning null.

While It works fine when call is not generated using call files instead is generated from softphone.

any idea what might be wrong?

thanks Anurag Rana http://newbie42.blogspot.in/

6 thoughts on - ${ANSWEREDTIME} Returning Null

  • Call file syntax:

    Channel: SIP/1111
    MaxRetries: 2
    Context: demo1
    Extension: s Priority: 1
    WaitTime: 30
    RetryTime:
    60

    in dialplan:
    exten=>h,n,NoOp(${DIALLEDPEERNUMBER)

    variable ${DIALLEDPEERNUMBER} is returning null.

    Suggestions please?

    Thanks

    Anurag Rana http://newbie42.blogspot.in/

  • Hmm. I’ve looked a bit further. According to the documentation,
    ${DIALEDPEERNUMBER} is set by a Dial() command. If you are using a call file to generate the call, then there will not be an explicit Dial() command and the variable will not get assigned.

    Could you set a variable in the call file instead? Use a line like Set: varname=value in the call file. Then, later in the dialplan, you can retrieve ${varname} .
    If the call was -not- made by a call file, then that variable won’t be set; in which case, you can pick up on ${DIALEDPEERNUMBER} instead.