{"version":3,"file":"response.mjs","names":[],"sources":["../../../src/sip-message/outbound/response.ts"],"sourcesContent":["import type InboundMessage from \"../inbound.js\";\nimport responseCodes from \"../response-codes.js\";\nimport OutboundMessage from \"./index.js\";\n\nclass ResponseMessage extends OutboundMessage {\n  public constructor(\n    inboundMessage: InboundMessage,\n    {\n      responseCode,\n      headers = {},\n      body = \"\",\n    }: {\n      responseCode: number;\n      headers?: { [key: string]: string };\n      body?: string;\n    },\n  ) {\n    super(undefined, { ...headers }, body);\n    this.subject = `SIP/2.0 ${responseCode} ${responseCodes[responseCode]}`;\n    const keys = [\"Via\", \"From\", \"To\", \"Call-Id\", \"CSeq\"];\n    for (const key of keys) {\n      if (inboundMessage.headers[key]) {\n        this.headers[key] = inboundMessage.headers[key];\n      }\n    }\n  }\n}\n\nexport default ResponseMessage;\n"],"mappings":";;;AAIA,IAAM,kBAAN,cAA8B,gBAAgB;CAC5C,YACE,gBACA,EACE,cACA,UAAU,EAAE,EACZ,OAAO,MAMT;AACA,QAAM,KAAA,GAAW,EAAE,GAAG,SAAS,EAAE,KAAK;AACtC,OAAK,UAAU,WAAW,aAAa,GAAG,cAAc;AAExD,OAAK,MAAM,OAAO;GADJ;GAAO;GAAQ;GAAM;GAAW;GACxB,CACpB,KAAI,eAAe,QAAQ,KACzB,MAAK,QAAQ,OAAO,eAAe,QAAQ"}