Extensions with Dashes in them

Help
KenLee
2011-03-29
2013-05-30
  • KenLee
    KenLee
    2011-03-29

    I am using extensions of the form:
    XXX-abc

    Example:
    101-mtt

    Activa seems to not support this style of extension.  I have tested incoming and outgoing calls with extensions of the form SIP/XXX and of the form SIP/XXX-abc.  Only the SIP/XXX have worked for me.  The SIP protocol and Asterisk both allow dashes in an extension name.

    I am reviewing the code to confirm this.  Any assistance would be appreicated.

     
  • KenLee
    KenLee
    2011-03-29

    The code here in astcall.cpp looks dash friendly.  Specifically the channel name is being chopped at the last dash when the channel is type sip:

      else if ((extPos = channel.find(sip)) != -1) {  // sip channel type
        address = channel.substr(extPos+sip.size(), channel.size());
        if ((extPos=address.find_last_of("-")) != -1) { // '-' found
          address = address.substr(0, extPos);
        }
      }
    
     
  • KenLee
    KenLee
    2011-03-30

    Probably what is happening is that this works when the channel name is:
    SIP/283-ABC-asdf23slkdfj39

    But when the channel name is simply:
    SIP/283-ABC

    The ABC is being chopped.

     
  • activatsp
    activatsp
    2011-04-04

    Hi!

    When a call is procesed Asterisk adds an slash an a string to make the channel unique, activatsp probably do not know if the channel is produced by asterisk.

    We can study the problem but the workaround is to not use slashes.

    Activa Team.

     
  • RJ2011
    RJ2011
    2011-04-05

    To make it work with "-" in the channel name, we added a new method called RemoveTechnologyPrefix
    std::string AsteriskCall::RemoveTechnologyPrefix(std::string channel)

    what this method does is basically removing the string up to "/" in the front of the channel.

    Here is the list of files that contains the modifications.
    astcall.cpp:            std::string AsteriskCall::RemoveTechnologyPrefix(std::string channel)
    astcstaprovider.cpp:    const std::string address = AsteriskCall::RemoveTechnologyPrefix(channel);
    astinterface.h:         static std::string  RemoveTechnologyPrefix(std::string channel);