Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] services : sip: implementing sip protocol #406

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tobusucs
Copy link

No description provided.

@codecov-io
Copy link

codecov-io commented Jul 31, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@448bc32). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #406   +/-   ##
=========================================
  Coverage          ?   41.67%           
=========================================
  Files             ?       78           
  Lines             ?     8796           
  Branches          ?        0           
=========================================
  Hits              ?     3666           
  Misses            ?     4705           
  Partials          ?      425
Impacted Files Coverage Δ
server/honeytrap.go 3.15% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 448bc32...64b3fc7. Read the comment docs.


s.Method = args[0]
s.Uri = args[1]
s.SIPVersion = strings.TrimSpace(args[2])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add those values also in the event? eg sip.version, sip.method and sip.uri

return ErrBadMessage
}

fn := sipRequest[s.Method]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if !ok {
// not supported
return ErrBadMessage
}```


ch pushers.Channel

Method, Uri, SIPVersion, Username, Domain string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You cannot put values here, those are shared across all connections.

}

func (s *sipService) checkRequest(line string) bool {
ok := s.parseURI()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just use url.Parse here?


args := strings.Split(line, " ")
if len(args) != 3 {
return ErrBadMessage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should send a sip response back here.

import "fmt"

func (s *sipService) OptionMethod() string {
return fmt.Sprintf(`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it easier to return a http.Response? then you can also use resp.WriteTo(c)

@tobusucs tobusucs changed the title [WIP] sip : services : implementing sip protocol [WIP] services : sip: implementing sip protocol Aug 1, 2018
@nl5887
Copy link
Contributor

nl5887 commented Aug 1, 2018

take a look at this library, maybe useful: https://github.com/marv2097/siprocket or something comparable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants