Recent Posts

Pages: [1] 2 3 ... 10
1
Yate users hangout place / How handling ISUP message
« Last post by SIPEx on January 23, 2020, 09:44:39 AM »
Hello,

Imagine you have 3 mtp3 links on 1 linkset. We are using link number 3 for outgoing calls. Can we ignore other ISUP messages from other MTP3 links on one linkset??

and How?
2
Windows / Calling issue under Telephony in Yate client
« Last post by manohar.bhat on January 22, 2020, 10:32:21 PM »
Installed yate-5.0.0-1-setup and configured SIP account. SIP account is provided by Grandstream device.
While installing the Yate client, we selected VOIP Installation.
Issue is, saved contacts are unable to make call. Which means, i saved few contacts and tried calling selected contact but Call doesn't initiate. Help me to solve it.
3
Other Yate server issues / Re: register instead of regfile
« Last post by cc08 on January 20, 2020, 03:01:15 PM »
Hi Monica!

Unfortunately, in your example, there is no routing, and especially the functionality of "alternatives".
Over the weekend, I made a working function in postgres, but it turned out so ugly!

Iíll leave this function here, maybe a professional will see it, will be horrified and advise how to ennoble it.

Code: [Select]
CREATE FUNCTION public.get_route(_caller text, _called text, _addres text) RETURNS SETOF record
    LANGUAGE plpgsql
    AS $$DECLARE
  _location text :='-';
  _tmp text;
  _sum int;
  _sumAlt int;
  _sumCld int;
  _result RECORD;
  _record RECORD;
/* max count of calls is 5*/
  _callto1 text;
  _callto2 text;
  _callto3 text;
  _callto4 text;
  _callto5 text;

BEGIN

  SELECT COUNT(id)
  FROM ( SELECT id
         FROM users
         WHERE username=_called
         AND location IS NOT NULL)
  AS sub
  INTO _sumCld;
  IF _sumCld IS NULL THEN
    _sumCld = 0;
  END IF;

  SELECT COUNT(id)
  FROM ( SELECT id
         FROM users
         WHERE alternatives ~ _called
         AND location IS NOT NULL)
  AS sub
  INTO _sumAlt;
  IF _sumAlt IS NULL THEN
    _sumCld = 0;
  END IF;

  _sum = _sumAlt + _sumCld;
  IF _sum > 1 THEN
    _location ='fork';
    IF _sumAlt > 1 THEN
      FOR _record IN
        SELECT location
        FROM users
        WHERE alternatives ~ _called
        AND location IS NOT NULL
      LOOP
        CASE _sumAlt
          WHEN 1 THEN _callto1 = _record.location;
          WHEN 2 THEN _callto2 = _record.location;
          WHEN 3 THEN _callto3 = _record.location;
          WHEN 4 THEN _callto4 = _record.location;
          WHEN 5 THEN _callto5 = _record.location;
        END CASE;
        _sumAlt = _sumAlt -1;
        EXIT WHEN _sumAlt = 0;
      END LOOP;

      IF _sumCld = 1 THEN
        SELECT location
        FROM users
        WHERE username=_called
        AND location IS NOT NULL
        INTO _tmp;
        CASE _sum
          WHEN 1 THEN _callto1 = _tmp;
          WHEN 2 THEN _callto2 = _tmp;
          WHEN 3 THEN _callto3 = _tmp;
          WHEN 4 THEN _callto4 = _tmp;
          WHEN 5 THEN _callto5 = _tmp;
        END CASE;       
      END IF;
    ELSE
      SELECT location
      FROM users
      WHERE username=_called
      AND location IS NOT NULL
      INTO _callto1;
      SELECT location
      FROM users
      WHERE alternatives ~ _called
      AND location IS NOT NULL
      INTO _callto2;
    END IF;
  ELSE
    IF _sumCld = 1 THEN
      SELECT location
      FROM users
      WHERE username=_called
      AND location IS NOT NULL
      INTO _location;
    ELSEIF _sumAlt = 1 THEN
      SELECT location
      FROM users
      WHERE alternatives ~ _called
      AND location IS NOT NULL
      INTO _location;
    ELSE
      RETURN;
    END IF;   
  END IF;

  SELECT _location,_callto1,_callto2,_callto3,_callto4,_callto5
  INTO _result;

  RETURN NEXT _result;
  RETURN;

END;
$$;


Table `users` based on your examples, but slightly modified.

Code: [Select]
CREATE TABLE public.users (
    username text NOT NULL,
    password text,
    vcard text,
    first_name text,
    last_name text,
    address text,
    inuse integer,
    location text,
    expires timestamp without time zone,
    alternatives text,
    realm text,
    reginterval integer DEFAULT 300,
    lnr boolean DEFAULT false,
    context text,
    id bigint DEFAULT nextval('public.user_id_seq'::regclass) NOT NULL,
    record text,
    skype text,
    mobile text,
    groupe text
);


And part of register.conf:

Code: [Select]
[call.route]
query=SELECT * FROM get_route('${caller}','${called}','${address}') AS t(location text,"callto.1" text,"callto.2" text,"callto.3" text,"callto.4" text,"callto.5" text)
result=location
priority=110

4
Other Yate server issues / Re: Digit manipulation in Yate
« Last post by Monica Tepelus on January 20, 2020, 04:18:30 AM »
Hi,

Digit manipulation can be done from any module handing call.route, not just regexroute. You can even make a custom script in javascript / php and do this.
https://docs.yate.ro/wiki/How_to_do_routing_using_javascript
You also have various example in yate's sources in share/scripts/ directory.
5
Other Yate server issues / Re: register instead of regfile
« Last post by Monica Tepelus on January 20, 2020, 03:56:56 AM »
Hi,

You can use both MySQL or PostgreSQL. Below is an example with mysql. With postgresql it's the same concept. Call stored procedure that must return record type with all the columns you need in your answer, so you can return parameters to be added, not just the call.route answer.

https://docs.yate.ro/wiki/Register_Database_Schema
6
Other Yate server issues / register instead of regfile
« Last post by cc08 on January 16, 2020, 08:29:53 AM »
Hi!

I'm trying to move to the register module, but I canít implement the functionality of "alternatives".

It is necessary to use the stored procedure of postgres, but my knowledge is not enough.

Tell me an example, please.
8
Not enough information.
9
I'm trying to build yatesbts, but fails with two errors:
(Full log and env details attached and at https://pastebin.com/LRg3UVbH)

Code: [Select]
g++ -Wall   -I../.. -I../.. -I. -I./../CommonLibs -I./../A53 -I./../Connection -I./../GSM -I./../Globals -I./../sqlite3 -I./../Control -I./../CLI -I./../GPRS -I./../Peering -I./../SGSNGGSN -I./../TRXManager -O2 -DLITTLE_ENDIAN -Wno-overloaded-virtual -fPIC -DHAVE_GCC_FORMAT_CHECK -DHAVE_BLOCK_RETURN -I/usr/local/include/yate -DHAVE_CONFIG_H -c  MSInfo.cpp
MSInfo.cpp: In member function ‘bool GPRS::MSInfo::msAssignChannels()’:
MSInfo.cpp:641:86: error: no match for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream<char>}’ and ‘std::ostringstream {aka std::__cxx11::basic_ostringstream<char>}’)
             GPRSLOG(INFO,GPRS_MSG|GPRS_CHECK_OK) << "Multislot assignment for "<<this<<os;
MSInfo.cpp:641:86: note: candidate: operator<<(int, int) <built-in>
MSInfo.cpp:641:86: note:   no known conversion for argument 2 from ‘std::ostringstream {aka std::__cxx11::basic_ostringstream<char>}’ to ‘int’

and

Code: [Select]
/usr/include/c++/7/iomanip:79:5: note:   template argument deduction/substitution failed:
MSInfo.cpp:641:88: note:   cannot convert ‘os’ (type ‘std::ostringstream {aka std::__cxx11::basic_ostringstream<char>}’) to type ‘std::_Resetiosflags’
             GPRSLOG(INFO,GPRS_MSG|GPRS_CHECK_OK) << "Multislot assignment for "<<this<<os;
                                                                                        ^~
In file included from /usr/include/c++/7/iostream:39:0,
                 from ./../CommonLibs/Timeval.h:31,
                 from ./../CommonLibs/Interthread.h:29,
                 from MSInfo.h:19,
                 from MSInfo.cpp:17:
/usr/include/c++/7/ostream:682:5: note: candidate: template<class _Ostream, class _Tp> typename std::enable_if<std::__and_<std::__not_<std::is_lvalue_reference<_Tp> >, std::__is_convertible_to_basic_ostream<_Ostream>, std::__is_insertable<typename std::__is_convertible_to_basic_ostream<_Tp>::__ostream_type, const _Tp&, void> >::value, typename std::__is_convertible_to_basic_ostream<_Tp>::__ostream_type>::type std::operator<<(_Ostream&&, const _Tp&)
     operator<<(_Ostream&& __os, const _Tp& __x)
     ^~~~~~~~
/usr/include/c++/7/ostream:682:5: note:   template argument deduction/substitution failed:
/usr/include/c++/7/ostream: In substitution of ‘template<class _Ostream, class _Tp> typename std::enable_if<std::__and_<std::__not_<std::is_lvalue_reference<_Tp> >, std::__is_convertible_to_basic_ostream<_Ostream>, std::__is_insertable<typename std::__is_convertible_to_basic_ostream<_Tp>::__ostream_type, const _Tp&, void> >::value, typename std::__is_convertible_to_basic_ostream<_Tp>::__ostream_type>::type std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_ostream<char>&; _Tp = std::__cxx11::basic_ostringstream<char>]’:
MSInfo.cpp:641:88:   required from here
/usr/include/c++/7/ostream:682:5: error: no type named ‘type’ in ‘struct std::enable_if<false, std::basic_ostream<char>&>’
/usr/include/c++/7/ostream:574:5: note: candidate: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const unsigned char*)
     operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
     ^~~~~~~~

In the exact same environment, doing the same steps, succeeds for http://yate.null.ro/svn/yate revision 6376 so I'm thinking that yatesbts has some different requirements, perhaps for glibc version?

Any help available on this?


Thanks!
10
OK, quick update. Now out twinkle on a linux box and it appears that I am actually having issues with my Softphones on my Windows 10 PC. Anyone know of a good one that works or of any issues with Windows 10 hosting a softphone?

Thanks.
Pages: [1] 2 3 ... 10