tmakkonen / sipcmd

sipcmd
327 stars 108 forks source link

URGENT - Segmentation fault #57

Open shamun opened 6 years ago

shamun commented 6 years ago

Following, dials on my phone, send/receives no DTMF on the receiver phone, call remain connected forever (does not disconnect after certain duration).


root@ubuntu-s-1vcpu-1gb-ams2-01:~/sipcmd# ./sipcmd -P sip -u xxx -c xxx -w sip1.nomado.eu -x "c003247171xxxx;ws3000;d**;w200;h"
Starting sipcmd
in debug mode
Manager
Init
initialising SIP endpoint...
TestChanAudio
TestChanAudio
Listening for SIP signalling on 0.0.0.0:5060
SIP listener up
registered as sip:xxxxx@sip1.nomado.eu
Created LocalEndPoint
Main
## Call ##
TestPhone::Main: calling "003247171xxxx" using gateway "sip1.nomado.eu" at Thu Feb 22 08:17:58 2018

Setting up a call to: sip:003247171xxxx@sip1.nomado.eu
LocalEndpoint::MakeConnection
LocalEndpointCreateConnection
LocalConnection
OnIncomingConnection: token=L513285842
connection set up to sip:003247171xxxx@sip1.nomado.eu
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 0
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 0
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 0
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 0
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 4
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 4
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 4
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 4
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 4
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 4
OnOpenMediaStream
recording media from sip
CreateMediaStream
TestChannel[ Call[Cbb3c0ddc1]-EP<local>[L513285842] - 0x7f96bc03dd30 ]
OnOpenMediaStream
streaming media to local
TestChannel::Write
TestChannel::Write
CreateMediaStream
TestChannel[ Call[Cbb3c0ddc1]-EP<local>[L513285842] - 0x7f96bc0572d0 ]
OnOpenMediaStream
recording media from local
OnOpenMediaStream
streaming media to sip
Segmentation fault (core dumped)
shamun commented 6 years ago

Fixed - the Segmentation fault.

429 bool RawMediaStream::WriteData(const BYTE *data,
430         PINDEX length, PINDEX &written)
431 {
432 //    cout << __func__ << endl;
433     if (!isOpen) {
434         cout << "channel not open!" << endl;
435         return false;
436     }
437 
438     if (IsSource()) {
439         cout << "tried to write to a source stream!" << endl;
440         return false;
441     }
442 
443     if (m_channel == NULL) {
444         cout << "no channel!" << endl;
445         return false;
446     }
447 
448     if (data != NULL && length != 0) {
449         if (!m_channel->Write(data, length)) {
450             cout << "data write failed!" << endl;
451             return false;
452             CollectAverage(data, written);
453         }
454     } else {
455         PBYTEArray silence(defaultDataSize);
456         if (!m_channel->Write(silence, defaultDataSize)) {
457             cout << "silence write failed!" << endl;
458             return false;
459         }
460         written = m_channel->GetLastWriteCount();
461         CollectAverage(silence, written);
462     }
463     //written = m_channel->GetLastWriteCount();
464     // cout << "wrote " << written << endl;
465     return true;
466     //return OpalRawMediaStream::WriteData(data, length, written);
467 }

BUT still DTMF is never received on the receiver and the call remain connected forever.

How to fix the DTMF and CALL disconnect ?

root@ubuntu-s-1vcpu-1gb-ams2-01:~/sipcmd# ./sipcmd -P sip -u xx -c xx -w sip1.nomado.eu -x "c003247171xxxx;ws3000;d**;w200;h"
Starting sipcmd
in debug mode
Manager
Init
initialising SIP endpoint...
TestChanAudio
TestChanAudio
Listening for SIP signalling on 0.0.0.0:5060
SIP listener up
registered as sip:xx@sip1.nomado.eu
Created LocalEndPoint
Main
## Call ##
TestPhone::Main: calling "003247171xxxx" using gateway "sip1.nomado.eu" at Thu Feb 22 08:31:32 2018

Setting up a call to: sip:003247171xxxx@sip1.nomado.eu
LocalEndpoint::MakeConnection
LocalEndpointCreateConnection
LocalConnection
OnIncomingConnection: token=L138c3d3d2
connection set up to sip:003247171xxxx@sip1.nomado.eu
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 0
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 1
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 2
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 3
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 4
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 4
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 4
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 4
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 4
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 4
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 4
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 4
OnOpenMediaStream
recording media from sip
CreateMediaStream
TestChannel[ Call[C6d2933191]-EP<local>[L138c3d3d2] - 0x7f386003dd30 ]
OnOpenMediaStream
streaming media to local
TestChannel::Write
TestChannel::Write
CreateMediaStream
TestChannel[ Call[C6d2933191]-EP<local>[L138c3d3d2] - 0x7f38600572d0 ]
OnOpenMediaStream
recording media from local
OnOpenMediaStream
streaming media to sip
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 4
TestChannel::Write
TestChannel::Write
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 4
TestChannel::Write
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 5
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 5
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 5
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 5
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 5
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 5
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 5
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 5
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 5
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 5
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 6
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 6
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 6
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 6
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 6
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 6
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 6
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 6
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 6
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 6
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 7
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 7
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 7
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 7
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 7
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 7
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 7
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 7
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 7
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 7
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 8
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 8
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 8
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 8
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 8
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 8
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 8
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 8
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 8
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 8
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 9
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 9
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 9
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 9
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 9
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 9
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 9
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 9
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 9
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 9
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 10
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 10
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 10
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 10
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 10
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 10
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 10
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 10
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 10
TestPhone::Main: calling "sip:003247171xxxx@sip1.nomado.eu" for 10
Problem running command sequence ("c003247171xxxx;ws3000;d**;w200;h"):
  Call: Dial timed out
TestPhone::Main: shutting down
     osutils.cxx(2294)  PTLib   Possible deadlock in read/write mutex 0x7f386003e8a0 :
  thread-id=139880709773056 (0x7f3884045700), readers=1, writers=0
  thread-id=139880710305536 (0x7f38840c7700), readers=0, writers=1

     osutils.cxx(2294)  PTLib   Possible deadlock in read/write mutex 0x7f3860005bb0 :
  thread-id=139880710305536 (0x7f38840c7700), readers=0, writers=1
  thread-id=139881144993536 (0x7f389df54700), readers=1, writers=0

     osutils.cxx(2294)  PTLib   Possible deadlock in read/write mutex 0x269f260 :
  thread-id=139880710305536 (0x7f38840c7700), readers=0, writers=1
  thread-id=139881145104576 (0x7f389df6f8c0), readers=0, writers=1

^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^X^X^X^X     osutils.cxx(2294)  PTLib   Possible deadlock in read/write mutex 0x7f3860005bb0 :
  thread-id=139880710305536 (0x7f38840c7700), readers=0, writers=1
  thread-id=139881144461056 (0x7f389ded2700), readers=0, writers=1
  thread-id=139881144993536 (0x7f389df54700), readers=1, writers=0

^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^Csignal caught!
^X^X^X^X^X^X^X^X^X