Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - ganapathi

Pages: 1 [2]
16
Yate users hangout place / SIP Authentication Multi-Request
« on: August 05, 2018, 12:41:41 PM »
Hi ,

As i seen the sip log for user.auth message, everytime yate unauthorized for first SIP REGISTER message and then it's SIP Client re-sending request then it's accepting the authentication.

It's not possible to do the necessary configuration to do it on first attempt..?

Even when SIP client places a new call then also same. SIP Client doesn't sending along with username at first attempt eventhough SIP client configured with authname properly.

Is it the problem with SIP client or SIP server ?.

Due to this resource is used extra for double initiation for every authentication and call if system allowed only for authenticated call .

Database Queries are running two times as per register configuration. Is there any way to avoid multiple Queries execution by putting some condition to execute SQL queries on register conf or force SIP client to send along with username for every request.

Log :

2018-08-05_23:52:12.256689 <sip:INFO> 'udp:0.0.0.0:5060' received 526 bytes SIP message from 192.168.1.87:5799 [0x23c3b00]
------
REGISTER sip:192.168.1.254 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.87:5799;branch=z9hG4bK2234544112399619815;rport
From: 7020 <sip:7020@192.168.1.254:5060>;tag=1994220662
To: 7020 <sip:7020@192.168.1.254:5060>
Call-ID: 13640258646285-1436943169562@192.168.1.87
CSeq: 334 REGISTER
Contact: <sip:7020@192.168.1.87:5799>
Max-Forwards: 70
Expires: 3600
Supported: path
User-Agent: Fanvil X3S 2.4.0.5487 0c383e194a04
Allow: INVITE, ACK, OPTIONS, BYE, CANCEL, REFER, NOTIFY, INFO, PRACK, UPDATE, MESSAGE
Content-Length: 0

Returned true 'database' delay=0.000463
  thread=0x7f32b0002950 'YSIP Register'
  data=(nil)
  retval='(null)'
  param['account'] = 'technobureau_db'
  param['query'] = 'SELECT password FROM users WHERE username = '' AND state IS TRUE AND  password IS NOT NULL AND password<>'''
  param['results'] = 'true'
  param['handlers'] = 'pgsqldb:100'
  param['rows'] = '0'
  param['affected'] = '0'
  param['dbtype'] = 'pgsqldb'
2018-08-05_23:52:12.310487 <sip:INFO> 'udp:0.0.0.0:5060' sending code 401 0x7f32b400e380 to 192.168.1.87:5799 [0x23c3b00]
------
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.87:5799;branch=z9hG4bK2234544112399619815;rport=5799;received=192.168.1.87
From: 7020 <sip:7020@192.168.1.254:5060>;tag=1994220662
To: 7020 <sip:7020@192.168.1.254:5060>;tag=92709314
Call-ID: 13640258646285-1436943169562@192.168.1.87
CSeq: 334 REGISTER
WWW-Authenticate: Digest realm="Yate", nonce="ca2c0bc506831e31eafca851c019e1c7.1533493332", stale=FALSE, algorithm=MD5
Server: YATE/6.0.1
Allow: ACK, INVITE, BYE, CANCEL, MESSAGE, REGISTER, REFER, OPTIONS, INFO, SUBSCRIBE, SECRET, NOTIFY
Content-Length: 0

------
2018-08-05_23:52:12.316263 <sip:INFO> 'udp:0.0.0.0:5060' received 717 bytes SIP message from 192.168.1.87:5799 [0x23c3b00]
------
REGISTER sip:192.168.1.254 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.87:5799;branch=z9hG4bK9097321992589110910;rport
From: 7020 <sip:7020@192.168.1.254:5060>;tag=1994220662
To: 7020 <sip:7020@192.168.1.254:5060>
Call-ID: 13640258646285-1436943169562@192.168.1.87
CSeq: 335 REGISTER
Contact: <sip:7020@192.168.1.87:5799>
Authorization: Digest username="7020", realm="Yate", nonce="ca2c0bc506831e31eafca851c019e1c7.1533493332", uri="sip:192.168.1.254", response="166d4c0999c9b4bf93010709d998fe80", algorithm=MD5
Max-Forwards: 70
Expires: 3600
Supported: path
User-Agent: Fanvil X3S 2.4.0.5487 0c383e194a04
Allow: INVITE, ACK, OPTIONS, BYE, CANCEL, REFER, NOTIFY, INFO, PRACK, UPDATE, MESSAGE
Content-Length: 0

------
Returned true 'database' delay=0.000348
  thread=0x7f32b0002bc0 'YSIP Register'
  data=0x7f32b4010b80
  retval='(null)'
  param['account'] = 'technobureau_db'
  param['query'] = 'SELECT password FROM users WHERE username = '7020' AND state IS TRUE AND  password IS NOT NULL AND password<>'''
  param['results'] = 'true'
  param['handlers'] = 'pgsqldb:100'
  param['columns'] = '1'
  param['rows'] = '1'
  param['affected'] = '1'
  param['dbtype'] = 'pgsqldb'
------
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.87:5799;branch=z9hG4bK9097321992589110910;rport=5799;received=192.168.1.87
From: 7020 <sip:7020@192.168.1.254:5060>;tag=1994220662
To: 7020 <sip:7020@192.168.1.254:5060>;tag=757183696
Call-ID: 13640258646285-1436943169562@192.168.1.87
CSeq: 335 REGISTER
Expires: 3600
Contact: <sip:7020@192.168.1.87:5799>;expires=3600
Server: YATE/6.0.1
Allow: ACK, INVITE, BYE, CANCEL, MESSAGE, REGISTER, REFER, OPTIONS, INFO, SUBSCRIBE, SECRET, NOTIFY
Content-Length: 0


17
Yate users hangout place / Call.Route after call answered
« on: August 03, 2018, 01:30:02 AM »
Hi

As am initiating a outbound call through background system and i need to call sip user by using call.route method moment call got answered.

Is it possible.

Initiating Outbound :

Message* notify = new Message("call.execute");
      copyParams2(*notify, a, i);
      notify->addParam("copyparams", "cdrtrack,link");
      notify->addParam("cdrtrack", "false");
      Engine::enqueue(notify);

Call.cdr Message Handler :

if (msg.getParam(YSTRING("operation"))->c_str() == YSTRING("update") &&
         msg.getParam(YSTRING("status"))->c_str() == YSTRING("answered")) {
         Message* notify = new Message("call.route");
                        notify->copyParam(msg,"billid");
                        notify->copyParam(msg,"caller");
                        notify->copyParam(msg,"called");
      }

18
Hi

As i recently noticed as CDR module is initialized for Wave channel and keep available on cdrbuild status

Code: [Select]
name=cdrbuild,type=cdr,format=Status|Caller|Called|BillId|Duration;cdrs=8,hungup=0;wave/90=unknown||||462416,
And some original channel created by call doesn't finalizing and it's keep available until service restart and finalized once  service ended , due to that call end time shows inappropriately.

CDRBuild :

Code: [Select]
%%+status:cdrbuild
name=cdrbuild,type=cdr,format=Status|Caller|Called|BillId|Duration;cdrs=8,hungup=0;wave/90=unknown||||462416,sip/5951=answered|6027|7002|1530000462-5867|275148,sip/5952=answered|6027|7002|1530000462-5867|275148,sip/5956=answered|6034|6033|1530000462-5871|275135,sip/5957=answered|6034|6033|1530000462-5871|275135,wave/262=unknown||||191456,wave/267=unknown||||42145,wave/302=unknown||||27914
%%-status

CDRCombine :

Code: [Select]
%%+status:cdrcombine
name=cdrcombine,type=cdr,format=ChanId|Caller|Called|Address|OutLegs;cdrs=3;1530000462-5867=sip/5951|6027|7002|192.168.1.74:5060|1,1530000462-5871=sip/5956|6034|6033|192.168.1.93:5268|1,1530000462-6703=sip/6739|6033|6004|192.168.1.78:5629|1
%%-status


And yate keep throws chan.locate message with null value like mentioned below.

Code: [Select]
Sniffed 'chan.locate' time=1530551429.087579
  thread=0x7f4f9c02a4e0 'YSIP Register'
  data=(nil)
  retval='(null)'
  param['id'] = ''

Kindly help me to avoid this issue.

19
Yate users hangout place / CDRBuild - Holdtime Modification - 6.0.1
« on: June 10, 2018, 01:25:16 AM »
Hi

As I trying to add holdtime in core level instead of custom patch, but almost calculated the holdtime and debug console emitting the value properly but failed to add into emitting CDR message to get it stored in Database.

Due to clear show fully operational function are hidden with “..” value.

Appreciated if Anybody help me on this.

Yate Version : 6.0.1-dev

SIP Client/IP Phone : For Making Call.

Ysipchan.cpp:


bool YateSIPConnection::reInviteProxy(SIPTransaction* t, MimeSdpBody* sdp, int invite)

{

..

..

..

 

    msg->addParam("audio_changed",String::boolText(audioChg));

    msg->addParam("mute",String::boolText(MediaStarted != m_mediaStatus));

// Holdtime Patch START

   if( MediaStarted != m_mediaStatus)

      msg->addParam("status","hold");

   else

         msg->addParam("status","unhold");

// Holdtime Patch END

    putMedia(*msg);

    Engine::enqueue(msg);

..

..

..

}

 

 

Cdrbuild.cpp:

 

Variable Initialization :

 

class CdrHandler : public MessageHandler

{

public:

    CdrHandler(const char *name, int type, int prio = 50)

                                                          : MessageHandler(name,prio,__plugin.name()),

                                                            m_type(type)

                                                          { }

    virtual bool received(Message &msg);

private:

    int m_type;

    u_int64_t

      m_holdsec,

      m_hold,

      m_unhold;                                     

};

 

 

Variable Initialization 2 :

 

class CdrBuilder : public NamedList

{

public:

..

..

..

private:

    u_int64_t

     m_start,

     m_call,

     m_ringing,

     m_answer,

     m_holdsec,                                     

     m_hangup;

..

..

..

}

 

Variable Initializations 3 :

 

CdrBuilder::CdrBuilder(const char *name)

    : NamedList(name), m_dir("unknown"), m_status("unknown"),

      m_first(true), m_write(true)

{

    m_statusTime = m_start = m_call = m_ringing = m_answer = m_hangup = m_holdsec = 0;

    m_cdrId = ++s_seq;

}

 

Hold Time Calculation On cdrbuild function :

 

bool CdrHandler::received(Message &msg)

{

    Lock lock(s_mutex);

..

..

..

 

if (m_type == CdrUpdate) {

const String* oper = msg.getParam(YSTRING("operation"));

const String* TBmute = msg.getParam(YSTRING("mute"));

if (oper && (*oper != YSTRING("cdrbuild")) )

  track = false;

  if (oper && TBmute && (*TBmute == YSTRING("true")) ) {

   track = true;

   m_hold = Time::msecNow();

  }

  if (oper && TBmute && (*TBmute == YSTRING("false") ) && m_hold && ( m_hold > 0 ) ){

   track = true;

   m_unhold =                                       Time::msecNow();

   if(m_holdsec)

     m_holdsec = m_holdsec + m_unhold - m_hold;

   else

     m_holdsec = m_unhold - m_hold;

   if(m_holdsec)

    Debug("cdrbuild",DebugAll,"TBholdtime is '%lu'",m_holdsec);

  }

}

..

..

..

}

 

Holdtime Emit Function :

 

void CdrBuilder::emit(const char *operation)

{

..

..

..

 

    m->addParam("ringtime",printTime(buf,t_answer - t_ringing));

    m->addParam("holdtime",printTime(buf,m_holdsec));   // Holdtime Emit. This is where I need value to be emit.

    m->addParam("status",m_status);

..

..

..

}

20
Yate users hangout place / C++ Code Changes Help
« on: October 19, 2017, 10:27:12 AM »
Hi

Will you please give me a example to pass/Gather some variable along with value to/From other module in C++ source code.

For example if ysigchan module had error then need to pass m_error into cdrbuild module as well.

21
Hi

As i need to assign one value while listening one module(chan.disconnected) and need to assign the value on another module(call.cdr) by using external module.

Will you please guys help me for the same.


Yate::Install("chan.disconnected",80);

call_cdr->params["call_direction"]='xyz';

22
Features requests / ISDN Cause Code on PSTN Calling
« on: September 30, 2017, 07:36:03 AM »
Hi

As like asterisk ISDN Cause code with description is required in yate also to analyze the call status . And also if yate detects the called party number is switch off, User Busy, Network Busy, Disconnected on ISDN then it would more useful.

Also ring timeout while calling.

Pages: 1 [2]