importfsfrom"node:fs";importprocessfrom"node:process";importtype{RtpPacket}from"werift-rtp";importSoftphonefrom"../src/index.js";constsoftphone=newSoftphone({outboundProxy:process.env.SIP_INFO_OUTBOUND_PROXY!,username:process.env.SIP_INFO_USERNAME!,password:process.env.SIP_INFO_PASSWORD!,authorizationId:process.env.SIP_INFO_AUTHORIZATION_ID!,domain:process.env.SIP_INFO_DOMAIN!,});softphone.enableDebugMode();// print all SIP messagesconstmain=async()=>{awaitsoftphone.register();// detect inbound callsoftphone.on("invite",async(inviteMessage)=>{// decline the call// await waitFor({ interval: 1000 });// await softphone.decline(inviteMessage);// answer the callconstcallSession=awaitsoftphone.answer(inviteMessage);// do something with the call session});};main();