0

I have compiled the source with version 2.7.1 along with python 3.6. PJSIP works excellent as described. I have encountered an issue where when sending the DTMF,

What am i doing:

  • Registering the account
  • Making a call
  • Checking whether the Media state is active
  • Then calling the method self.call.dial_dtmf("4")

Thats when i am getting an error as:

self.call.dial_dtmf("4")
  File "C:\Python36-32\lib\site-packages\pjsua.py", line 1761, in dial_dtmf
    self._lib()._err_check("dial_dtmf()", self, err)
  File "C:\Python36-32\lib\site-packages\pjsua.py", line 2722, in _err_check
    raise Error(op_name, obj, err_code, err_msg)
pjsua.Error: Object: {Call sip:2002@192.168.100.127:5060}, 
operation=dial_dtmf(), error=b'Invalid value or argument (PJ_EINVAL)'

Also i have checked with SDP that there is 101 telephone-event is available. shown below :

    Session Description Protocol
        Session Description Protocol Version (v): 0
        Owner/Creator, Session Id (o): 3cxPS 496286826496 76722208769 IN IP4 192.168.100.127
        Session Name (s): 3cxPS Audio call
        Connection Information (c): IN IP4 192.168.100.122
        Time Description, active time (t): 0 0
        Media Description, name and address (m): audio 5004 RTP/AVP 0 8 9 109 101
        Media Attribute (a): sendrecv
        Media Attribute (a): rtpmap:0 PCMU/8000
        Media Attribute (a): ptime:20
        Media Attribute (a): rtpmap:8 PCMA/8000
        Media Attribute (a): rtpmap:9 G722/8000
        Media Attribute (a): rtpmap:109 iLBC/8000
        Media Attribute (a): fmtp:109 mode=30
        Media Attribute (a): rtpmap:101 telephone-event/8000
            Media Attribute Fieldname: rtpmap
            Media Format: 101
            MIME Type: telephone-event
            Sample Rate: 8000
        Media Attribute (a): fmtp:101 0-15
            Media Attribute Fieldname: fmtp
            Media Format: 101 [telephone-event]
            Media format specific parameters: 0-15

I have checked sending the DTMF from the console app generated when we compile the source, and it works flawless. Same console app pjsua_app.py has errors and i am unable to run that to test sending DTMF.

Can anybody let me where i am doing wrong or is there any other method to send DTMF with RFC 2833.

-- vrOom

vrOom
  • 23
  • 1
  • 5

1 Answers1

0

In my case i used wrong type of var (string)

current_call.dial_dtmf(int(code))

Changing to integer fixed this issue

Super
  • 1
  • 1