callagent: Make it possible to run on a different port
This commit is contained in:
parent
11420c62b0
commit
115842f0e8
|
@ -67,6 +67,11 @@ Object subclass: SIPTransport [
|
|||
^ self subclassResponsibility
|
||||
]
|
||||
|
||||
port [
|
||||
<category: 'accessing'>
|
||||
^ self subclassResponsibility
|
||||
]
|
||||
|
||||
type [
|
||||
<category: 'accessing'>
|
||||
^ self class type
|
||||
|
@ -83,21 +88,30 @@ SIPTransport subclass: SIPUdpTransport [
|
|||
^ 'UDP'
|
||||
]
|
||||
|
||||
SIPUdpTransport class >> startOn: anAddress [
|
||||
SIPUdpTransport class >> startOn: anAddress port: aPort [
|
||||
<category: 'factory'>
|
||||
|
||||
^ (self new)
|
||||
initialize: anAddress;
|
||||
initialize: anAddress port: aPort;
|
||||
yourself
|
||||
]
|
||||
|
||||
SIPUdpTransport class >> startOn: anAddress [
|
||||
^ self startOn: anAddress port: 5060.
|
||||
]
|
||||
|
||||
address [
|
||||
<category: 'accessing'>
|
||||
^ socket address
|
||||
]
|
||||
|
||||
initialize: anAddress [
|
||||
socket := Sockets.DatagramSocket local: anAddress port: 5060.
|
||||
port [
|
||||
<category: 'accessing'>
|
||||
^ socket port
|
||||
]
|
||||
|
||||
initialize: anAddress port: aPort [
|
||||
socket := Sockets.DatagramSocket local: anAddress port: aPort.
|
||||
socket
|
||||
bufferSize: 2048;
|
||||
addToBeFinalized.
|
||||
|
@ -161,8 +175,8 @@ Object subclass: SIPUserAgentBase [
|
|||
generateVia: aBranch [
|
||||
<category: 'ids'>
|
||||
|
||||
^ 'SIP/2.0/%1 %2;branch=%3' %
|
||||
{transport type. transport address. aBranch}
|
||||
^ 'SIP/2.0/%1 %2:%3;branch=%4' %
|
||||
{transport type. transport address. transport port. aBranch}
|
||||
]
|
||||
|
||||
generateCSeq [
|
||||
|
|
Reference in New Issue