Skip to content

Don't Require httpSettings in createSmsSettings/editSmsSettings #35

@amiller-gh

Description

@amiller-gh
await sipPeer.editSmsSettingsAsync({
      sipPeerSmsFeatureSettings: {
        tollFree: true,
        protocol: 'HTTP',
        a2pLongCode: 'ON',
        zone1: true,
        zone2: false,
        zone3: false,
        zone4: false,
        zone5: false,
      },
    });

Fails with

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <SipPeerSmsFeatureResponse>
    <ResponseStatus>
      <ErrorCode>1003</ErrorCode>
      <Description>httpSettings is required</Description>
    </ResponseStatus>
</SipPeerSmsFeatureResponse>

If I look up the proxy peer ID and set it in the call like so:

await sipPeer.editSmsSettingsAsync({
      sipPeerSmsFeatureSettings: {
        tollFree: true,
        protocol: 'HTTP',
        a2pLongCode: 'ON',
        zone1: true,
        zone2: false,
        zone3: false,
        zone4: false,
        zone5: false,
      },
      httpSettings: { proxyPeerId: 569238 }
    });

The call fails with:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <SipPeerSmsFeatureResponse>
    <ResponseStatus>
      <ErrorCode>1001</ErrorCode>
      <Description>Only admin users are allowed to set peer id</Description>
    </ResponseStatus>
</SipPeerSmsFeatureResponse>

Instead, I have to explicitly send an empty object for the API server to be happy with me:

await sipPeer.editSmsSettingsAsync({
      sipPeerSmsFeatureSettings: {
        tollFree: true,
        protocol: 'HTTP',
        a2pLongCode: 'ON',
        zone1: true,
        zone2: false,
        zone3: false,
        zone4: false,
        zone5: false,
      },
      httpSettings: {}
    });

This is a strange behavior and should either be documented, or gracefully accept an undefined value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions