jart / gosip Goto Github PK
View Code? Open in Web Editor NEWPublic Switched Telecommunications Network Unleashed
License: Apache License 2.0
Public Switched Telecommunications Network Unleashed
License: Apache License 2.0
The following usecase test failed. It same that Extension Header name cannot be substring of Stander Header name.
For example, Extension Header "Call", "Proxy", "User" parse failed.
var msgTests = []msgTest{
{
name: "Extension Headers",
s: "SIP/2.0 200 OK\r\n" +
"Call: omfg\r\n" +
"\r\n",
msg: sip.Msg{
VersionMajor: 2,
Status: 200,
Phrase: "OK",
XHeader: &sip.XHeader{Name: "Call", Value: []byte("omfg")},
},
}
我想使用这个gosip 有没有对应的文档?
Hello @Sean-Der, @1lann, @pion, @jaroszan, @StefanKopieczek.
I noticed you all published GitHub projects implementing telephony protocols in Go. I've worked on this library on and off for the past ten years. I no longer have a commercial interest in this code.
Would you be interested in working on this project instead of what you're currently doing? I can make you all admins right now. Here's why that's worth considering.
This codebase does a pretty good job solving exceedingly toilsome problems. The hardest was ragel parsing able to withstand most RFC torture tests. This project has zero dependencies other than go itself. It may not implement WebRTC but it does have the complete stack needed for PSTN interfacing. It uses assembly optimized codecs and comfort noise generation. It's written in such a way that grants maximal power to the library user. The fone example demonstrates in a concrete way how a CLI telephone can be implemented in a few hundred lines, which has full control over the event handling loop.
Alternatively, if you are not interested in maintaining this project and making it your own, please feel free to copy and paste whatever you need from this one into your own. I posted it here since I love sharing. What I'd love even more, is to make you all stars on Hacker News and similar sites, for all the unsung hero work you're currently doing. The best way to have more impact is to unite your efforts.
Reproduce like this:
func main() {
fmt.Println(util.GenerateCallID())
fmt.Println(util.GenerateCallID())
}
first run:
524f1d03-d1d8-41e9-a4a0-99042736d40b
d9681b86-7321-4443-aff5-8a4568e274db
second run (even on another machine):
524f1d03-d1d8-41e9-a4a0-99042736d40b
d9681b86-7321-4443-aff5-8a4568e274db
INVITE sip:[email protected]:9910 SIP/2.0
Via: SIP/2.0/UDP 125.34.208.105:61187;rport;branch=z9hG4bKPjfKaxrWpsvm-e7BLZRChpcNDLykxPJ4B1
Max-Forwards: 70
From: "8001" sip:[email protected];tag=qN-0Y9yR2bFZgG7i8OTYaOaFTKPWMMR7
To: sip:[email protected]
Contact: sip:[email protected]:61187;ob
Call-ID: tQiy-MRgE4.DucuID.j3evkm-4ykUC73
CSeq: 26213 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, norefersub
User-Agent: Telephone 1.5.2
Content-Type: application/sdp
Content-Length: 443
v=0
o=- 3832828136 3832828136 IN IP4 125.34.208.105
s=pjmedia
b=AS:117
t=0 0
a=X-nat:0
m=audio 4002 RTP/AVP 96 9 8 0 101 102
c=IN IP4 125.34.208.105
b=TIAS:96000
a=rtcp:4003 IN IP4 125.34.208.105
a=sendrecv
a=rtpmap:96 opus/48000/2
a=fmtp:96 useinbandfec=1
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/48000
a=fmtp:101 0-16
a=rtpmap:102 telephone-event/8000
a=fmtp:102 0-16
@jart do you think it makes sense to move out dialog handling into own package?
How do I parse DTMF from the RTP stream for RFC 2833?
I need play mp3 or wav file, do you know what lib can help me ?
Thanks!!!
It'd be nice to have something like Travis to help run tests quickly during the PR code review process.
I think it would make sense to decouple the SDP parser from the SIP parser. @moggle-mog already saw it here
#9 (comment)
@jart , @moggle-mog what do you think?
It'd be nice to determine the best way to handle the case where sdp.Addr
is empty string. To the best of my knowledge, that shouldn't happen during parsing, and is most likely indicative of an the calling function failing to supply the value. See also:
Line 302 in 5219113
I need to have all my outbound traffic go through a proxy (Kamailio) so that internal IPv6 servers can communicate with external IPv4 and so I can do media transcoding (RTPEngine).
As far as I can tell. there is no direct support in dialog.Dialog
(or dialog.Transport
) for setting an outbound proxy.
I was thinking that it looks like there are two ways I can implement this:
Dialog
to change the send method.msg.Route
of all outgoing messages with a Route
header that points to the outbound proxy.sip
package and do all the communication work and session tracking myself.The obvious benefit of the second option is that it allows me to take advantage of the full benefits of this package, but are there any downsides to it? Will it actually work? If not, what is the best alternative to avoid reimplementing most of the dialog
package?
Has anyone else done this who can share their experiences?
It's a wonderful repo, but I'm so sorry that I can't find license in your repo anywhere, can you add a license please?
Fuzzit was acquired by GitLab, so I think it's not an option anymore? Let's use good old gofuzz.
https://github.com/google/gofuzz
When the port of via is not specified, the byte array constructed by Append looks like this:
Via: SIP/2.0/UDP 183.15.178.142:0;rport=5060;branch=z9hG4bKr4HBegU1j4pBK;received=192.168.2.250
I don't want to add another sign :0 after the ip
In the Uri structure,When the port is 5060, can we omit the port?
The following message parsing failed: Error in SIP message at line 0 offset 0:
Thanks!
[REGISTER sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 172.16.1.36:5060;rport;branch=z9hG4bK1585760165
From: sip:[email protected]:5060;tag=1882859352
To: sip:[email protected]:5060
Call-ID: [email protected]
CSeq: 3 REGISTER
Contact: *
Authorization: Digest username="34020000001320000360", realm="3402000000", nonce="MTYwMzM2NDU0MA==", uri="sip:[email protected]:5060", response="39c7240195630f0b26124c00db7cfa5c", algorithm=MD5, cnonce="0a4f113b", qop=auth, nc=00000002
Max-Forwards: 70
User-Agent: VCP MWARE
Expires: 0
RegMode: DEVICE;Describe=IPC-S642-IR;Register;DevVer=CIPC-B2301.5.21.200528
ReplaceDescribe: IPC-S642-IR;ProductId=defaultProductId;RegionCode=NONE;Vendor=UNIVIEW;Resolve=HIC1080P;Ptzfg=1;;SnmpVer=v3;DescribeAssy=PAU-X5;ReplaceNameAssy=PAU-X5
Ability: UCSStore=0
Content-Length: 0
]
I have studied the fone example, and it seems very interesting, the control and safety we have with handling the audio.
But this is how a client generates a an invite to another agent.
I am wondering what approach should be taken to implement an agent waiting to receive calls, and handle the calls in the same way.
Can anyone point out how i could implement it?
Hi all,
Thank you for making this project. Wanted to check to see if you have any plans to support SIP over TLS?
Hello,
I'm getting the following compilation error while trying to use this package. From what I understand, this has something to do with assembly implementation of these func signatures.
Is there a flag I need to pass to make it work?
# github.com/jart/gosip/dsp
../dsp/dsp.go:22:6: missing function body
../dsp/dsp.go:28:6: missing function body
../dsp/dsp.go:31:6: missing function body
Is this repository still being maintained? @jart
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.