pjsip | PJSIP is Open Source SIP , Media , and NAT Traversal Library | TCP library
kandi X-RAY | pjsip Summary
kandi X-RAY | pjsip Summary
PJSIP is a free and open source multimedia communication library written in C language implementing standard based protocols such as SIP, SDP, RTP, STUN, TURN, and ICE.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pjsip
pjsip Key Features
pjsip Examples and Code Snippets
Community Discussions
Trending Discussions on pjsip
QUESTION
I want to receive call from IVR to asterisk, pass it to python who processors it and response it back to ivr. Can anyone guide me how to set it up This is what I have done My os is CentOs 8 I am using python 3.6 I am using asterisk vs 17
I have created sip.config
...ANSWER
Answered 2021-Mar-28 at 19:15There are plenty methods to do that.
The most advanced is to write dialplan using func_ODBC and func_curl(may work without python at all, depend on what you need).
Also you can check AGI and AMI interfaces.
https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=32375589
https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=29395573
QUESTION
I am looking to replace my older Asterisk 15 VoIP Server with Asterisk 17. Currently I have an application that works with Asterisk over ARI (i.e. Asterisk Rest Interface) + WS (for events). On my current version everything works fine, but after conncting my app to Asterisk 17 it did not receive ChannelHangupRequest
event and the following events in time (i.e. only after ~30 seconds). So I've decided to take a look on the Asterisk logs and I've found out that:
- The problem is not caused by my app
- The
ChannelHangupRequest
event is send, as I said before, after about 30-50 seconds. The interesting part is that it'scause
is equal to1
and there is a fieldsoft
equal totrue
. You can see below the event in JSON format. Official Asterisk 17 documentation does not give an obvious description for it or at least it is not obvious to me:From soft: boolean (optional) - Whether the hangup request was a soft hangup request
. Also, official hangup cause mappings indicate that1
is mapped toAST_CAUSE_UNALLOCATED
. On my older version (i.e. Asterisk 15), where the event fires immediately,case
is equal to16
=AST_CAUSE_NORMAL_CLEARING
.
<{"cause":1,"soft":true,"type":"ChannelHangupRequest","timestamp":"2021-03-23T17:10:19.817+0000","channel":{"id":"1616519370.38","name":"PJSIP/1000-00000026","state":"Up","caller":{"name":"Cristi","number":"1000"},"connected":{"name":"","number":""},"accountcode":"","dialplan":{"context":"from-internal","exten":"s","priority":1,"app_name":"Stasis","app_data":"my-app"},"creationtime":"2021-03-23T17:09:30.364+0000","language":"en"},"asterisk_id":"02:42:ac:13:00:03","application":"my-app"} < {"type":"StasisEnd","timestamp":"2021-03-23T17:10:19.817+0000","channel":{"id":"1616519370.38","name":"PJSIP/1000-00000026","state":"Up","caller":{"name":"Cristi","number":"1000"},"connected":{"name":"","number":""},"accountcode":"","dialplan":{"context":"from-internal","exten":"s","priority":1,"app_name":"Stasis","app_data":"my-app"},"creationtime":"2021-03-23T17:09:30.364+0000","language":"en"},"asterisk_id":"02:42:ac:13:00:03","application":"my-app"}
- Asterisk log shows that channel was disconnected
for lack of audio RTP activity in 49 seconds
. It explains the behaviour to some extent, specifically, it explains where theChannelHangupRequest
event comes from (after ~50 seconds), but it does not explain why isn't it sent properly immediately after user hangups.
13373[2021-03-23 17:09:28] VERBOSE[6273] stasis/app.c: Creating Stasis app 'my-app' 13374[2021-03-23 17:09:28] VERBOSE[6273] res_http_websocket.c: WebSocket connection from '172.19.0.1:54308' for protocol '' accepted using version '13' 13375[2021-03-23 17:09:29] VERBOSE[6276] stasis/app.c: Replacing Stasis app 'my-app' 13376[2021-03-23 17:09:29] VERBOSE[6276] res_http_websocket.c: WebSocket connection from '172.19.0.1:54312' for protocol '' accepted using version '13' 13377[2021-03-23 17:09:30] VERBOSE[6278] stasis/app.c: Replacing Stasis app 'my-app' 13378[2021-03-23 17:09:30] VERBOSE[6278] res_http_websocket.c: WebSocket connection from '172.19.0.1:54322' for protocol '' accepted using version '13' 13379[2021-03-23 17:09:30] VERBOSE[6280] dial.c: Called 1000 13380[2021-03-23 17:09:30] VERBOSE[1601] netsock2.c: Using SIP RTP Audio TOS bits 184 13381[2021-03-23 17:09:30] VERBOSE[1601] netsock2.c: Using SIP RTP Audio TOS bits 184 in TCLASS field. 13382[2021-03-23 17:09:30] VERBOSE[1601] netsock2.c: Using SIP RTP Audio CoS mark 5 13383[2021-03-23 17:09:30] VERBOSE[6280] dial.c: PJSIP/1000-00000026 is ringing 13384[2021-03-23 17:09:30] VERBOSE[6280] dial.c: PJSIP/1000-00000026 is ringing 13385[2021-03-23 17:09:44] VERBOSE[6276] res_http_websocket.c: WebSocket connection from '172.19.0.1:54312' closed 13386[2021-03-23 17:09:45] VERBOSE[6282] stasis/app.c: Replacing Stasis app 'my-app' 13387[2021-03-23 17:09:45] VERBOSE[6282] res_http_websocket.c: WebSocket connection from '172.19.0.1:54334' for protocol '' accepted using version '13' 13388[2021-03-23 17:09:49] VERBOSE[1601] res_rtp_asterisk.c: 0x7f8c1c02bf90 -- Strict RTP learning after remote address set to: 192.168.10.172:10096 13389[2021-03-23 17:09:49] VERBOSE[6280] dial.c: PJSIP/1000-00000026 answered 13390[2021-03-23 17:09:49] WARNING[1601] channel.c: Unable to find a codec translation path: (ulaw) -> (g723) 13391[2021-03-23 17:09:49] WARNING[1601] channel.c: Unable to find a codec translation path: (g723) -> (ulaw) 13392[2021-03-23 17:09:49] VERBOSE[6280] ari/resource_channels.c: Launching Stasis(my-app) on PJSIP/1000-00000026 13393[2021-03-23 17:10:19] NOTICE[1108] res_pjsip_sdp_rtp.c: Disconnecting channel 'PJSIP/1000-00000026' for lack of audio RTP activity in 49 seconds
- The above described behaviour applies only when user answers and, then, drops. If the user rejects call without answering, everything works fine.
One solution would be to reduce the RTP inactivity timeout as a workaround, but this wouldn't be preferable. Do you have any suggestions?
...ANSWER
Answered 2021-Mar-24 at 08:07Solved. The problem was in my firewall configuration. The testing environment was not properly configured, thus some packets were dropped before reaching to Asterisk. So, there wasn't a problem with Asterisk itself.
QUESTION
Asterisk 16.13.0
...ANSWER
Answered 2021-Mar-18 at 12:03205|206 result will be 1
QUESTION
I have built the FFmpeg with libx264 into static libs, here is my directory tree.
...ANSWER
Answered 2021-Feb-22 at 07:15I made a mistake in the build script:
QUESTION
PJSIP - 2.9
I am trying to enable ALAW and ULAW code into my iOS app. I passed list of codec for account add with G711A/8000/1 and G711U/8000/1 but when I make call and check the INVTE I did not see anyone of codec there.
Whereas if I add another codec I can see that enabled in INVITE. I tried to check whether these codecs has some other dependency or it has be enabled like G729.
Please help me if someone can. Thank you
...ANSWER
Answered 2021-Jan-21 at 12:21Basically G711a refers to PCMA and G711u refer as PCMU. So if you want to enable G711A or ALAW that means you need to use PCMA/8000/1 and for G711U or ULAW you need to have PCMU/8000/1
It is a bit confusing initially for me but now it's pretty clear.
QUESTION
I am trying to make a simple SIP user agent using https://github.com/pjsip/pjproject. I can succesfully connect to a sip server (Twilio) and place calls to PSTN numbers using the pjsua_* interface. This works fine.
What I would like now is to get a notification (through a callback or such) from pjsip when the user that I am calling answers the call.
I am using on_call_state() to get updates on the invite, but this goes through the same states
CALLING -> CONNECTING -> CONFIRMED -> DISCONNCTD
even if the user rejects the call. So I guess I am not looking at the right callback for this.
How can I definitely tell if the user has answered or rejected the call?
...ANSWER
Answered 2021-Jan-21 at 10:36for me it is working this way. in on_call_state callback:
QUESTION
I have been going through Android Pjsip
pjsua2
sample app. It works but they didn't implemented registration listener. And couldn't find any good enough documentation as well. Eg for android native sip stack, they have registration listener for registration failure, registration success as well. Please help me with a sample code as well if its possible.
ANSWER
Answered 2020-Sep-16 at 14:12I guess you're talking about empty brackets beside notifyRegState at files sample.java and sample2.java in pjsip-apps sources. You can easily implement your own registration listener there.
QUESTION
I have two different set of json object as follows.
...ANSWER
Answered 2020-Dec-10 at 15:58For example, to show each ActionID
;
QUESTION
I am struggling with this : when entering a queue, I'd like to play a welcome message to the caller.
The caller enters first a short queue (initQ
) without announce, then enters the mynewQ
where I'd like to play a custom welcome message.
So far, I was able to play only the default queue-youarenext.alaw
with :
Files queues.conf
:
ANSWER
Answered 2020-Nov-21 at 21:31You can do like this
QUESTION
I am trying to wrap my head around ARI and Asterisk, my goal is to dial from an extension to another. I dialed 5001 from extension 5002. Now in the stasisStart function, I want to create a new channel, and used the dialed number (5001) and pass 'PJSIP/5001' to the endpoint. How do I get the dialed number?
Dialplan:
...ANSWER
Answered 2020-Oct-27 at 21:24I found this example that works. I guess I was confused about the endpoint, I thought I had to specify it in the dialplan, but not.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pjsip
See also Getting Started: Building for Apple iPhone, iPad and iPod Touch.
Run build.sh.
Drag the generated libraries and headers files into your Xcode project.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page