Execute javascript in curl and Post datas to another URL

Asterisk 15.6.0

Dialplan:

  • exten => _X.,1,MixMonitor(/var/www/html/monitor/from-internal/${CDR(uniqueid)}.wav,)

  • exten => _X.,2,Dial(SIP/${EXTEN})

  • exten => h,1,Set(__SourceNumber=${CDR(src)})

  • exten => h,n,Set(__CallerSource=ExampleSource)

  • exten => h,n,Set(__DestinationNumber=${CDR(dst)})

  • exten => h,n,Set(__DisplayNumber=${CDR(dst)})

  • exten => h,n,Set(__StartTime=2019-11-19-10:38:10)

  • exten => h,n,Set(__EndTime=2019-11-19-10:58:16)

  • exten => h,n,Set(__CallDuration=${CDR(duration)})

  • exten => h,n,Set(__Status=${CDR(disposition)})

  • exten => h,n,Set(__ResourceURL=google.com)

  • exten => h,n,Set(__Direction=outbound)

  • exten => h,n,Set(__CallSessionId=${CDR(uniqueid)})

  • exten => h,n,Set(__LeadId=318c3348-f106-11e9-b443-06c7f51a917e)

  • exten => h,n,Set(__Tag=Tag-Lead)

  • exten => h,n,Set(__UserId=49d43b18-05e8-11ea-a73d-06c7f51a917e)

  • exten => h,n,Set(CURL_RESULT={CURL(http://somedomain.com/api.php?SourceNumber={SourceNumber}&CallerSource={CallerSource}&DestinationNumber={DestinationNumber}&DisplayNumber={DisplayNumber}&StartTime={StartTime}&EndTime={EndTime}&CallDuration={CallDuration}&Status={Status}&ResourceURL={ResourceURL}&Direction={Direction}&CallSessionId={CallSessionId}&LeadId={LeadId}&Tag={Tag}&UserId=${UserId})})

  • exten => h,n,NoOp(CURL-RESPONSE: ${result})

when I execute the above the above dialplan and POST datas to php file using CURL .It is executing but when i use javascript function inside the file it is not posting datas to another URL in JSON format.

Can anyone help me with this issue?

Asterisk knows nothing about javascript (or Ecmascript); you will need to look at the other side.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.