SIP register based on REGXML? How can i do that?

Status
Not open for further replies.

NoFate

Member
Sep 17, 2021
51
0
6
43
Hey,

i have an door intercom system, it contains a private SIP perotocol for the indoor station... on that specific indoor station we can also register extra indoor stations as extensions...
so what happens, if i press the doorbutton (intercom) , the first indoor station rings, and then also forwards the call to the other indoor stations

I did a wireshark trace, how this works, and seems the extensions that register on indoor station, are sending some extra XML header stuff...
I wanted to try this with a softphone, but it failed, with a 501 'not implemented' error, probably because i'm not sending the XML stuff....

I wanted to setup fusionpbx,to register a SIP trunk on it, so i can forward the calls, or maybe another approach ??

But how can i send extra XML ?

see below how the extension is beging registered on the indoor panel, you see some imortant xml stuff, also below is the 501 error when i do it from a softphone

thnx in advance

Code:
############ Indoor extension Protocol SIP/XML ######################################################################

10000000002@192.168.0.72:5060;line=39b237d1561ac46>
Authorization: Digest username="10000000002", realm="Hikvision", nonce="710ae2f3adf7446b6ea068ed6cede929", uri="sip:10000000002@192.168.0.71:5065", response="78e1b60cb438905bdaf010e680d06734", algorithm=MD5, opaque="9c77d2882f5d8f3fb72f307e3da4d76d"
Content-Type: text/xml
Max-Forwards: 70
User-Agent: eXosip/3.6.0
Expires: 900
Content-Length:   165

<regXML>
<version>V2.0.0</version>
<regDevName>Room 2</regDevName>
<regDevSerial>XXXXXX</regDevSerial>
<regDevMacAddr>xxxx</regDevMacAddr>
</regXML>
REGISTER sip:10000000002@192.168.0.71:5065 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.72:5060;rport;branch=z9hG4bK870856495
From: Room 2 <sip:10000000002@192.168.0.72>;tag=588337480
To: Room 2 <sip:10000000002@192.168.0.72>
Call-ID: 1549082696
CSeq: 2 REGISTER
Contact: <sip:10000000002@192.168.0.72:5060;line=39b237d1561ac46>
Authorization: Digest username="10000000002", realm="Hikvision", nonce="710ae2f3adf7446b6ea068ed6cede929", uri="sip:10000000002@192.168.0.71:5065", response="78e1b60cb438905bdaf010e680d06734", algorithm=MD5, opaque="9c77d2882f5d8f3fb72f307e3da4d76d"
Content-Type: text/xml
Max-Forwards: 70
User-Agent: eXosip/3.6.0
Expires: 900
Content-Length:   165

<regXML>
<version>V2.0.0</version>
<regDevName>Room 2</regDevName>
<regDevSerial>XXXXX</regDevSerial>
<regDevMacAddr>xxxx</regDevMacAddr>
</regXML>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.0.72:5060;rport=5060;branch=z9hG4bK870856495
From: Room 2 <sip:10000000002@192.168.0.72>;tag=588337480
To: Room 2 <sip:10000000002@192.168.0.72>;tag=111615696
Call-ID: 1549082696
CSeq: 2 REGISTER
Content-Type: text/xml
User-Agent: sipServer
Date: Thu, 16 Sep 2021 17:46:27 GMT
Content-Length:    70

<version>V2.0.0</version>
<random>r4yRs3RdrvLb3I7hUO+qDQ==</random>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.0.72:5060;rport=5060;branch=z9hG4bK870856495
From: Room 2 <sip:10000000002@192.168.0.72>;tag=588337480
To: Room 2 <sip:10000000002@192.168.0.72>;tag=111615696
Call-ID: 1549082696
CSeq: 2 REGISTER
Content-Type: text/xml
User-Agent: sipServer
Date: Thu, 16 Sep 2021 17:46:27 GMT
Content-Length:    70

<version>V2.0.0</version>
<random>r4yRs3RdrvLb3I7hUO+qDQ==</random>

############ Softphone Protocol SIP ######################################################################

REGISTER sip:192.168.0.71:5065 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.197:37969;branch=z9hG4bKSadsZg7XVO0mMlX2;rport
Contact: <sip:10000000002@192.168.0.197:37969;rinstance=8EBC221E>;expires=600;video
Max-Forwards: 70
From: <sip:10000000002@192.168.0.71:5065>;tag=A46D171175C26A4438D151F4BE0E4520
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: replaces, path
To: <sip:10000000002@192.168.0.71:5065>
Expires: 600
Call-ID: B72DE525A93DC0365BCC3981C749BC97848B17BC
CSeq: 1546 REGISTER
User-Agent: Softphone/5.4.9 (build 1648221; Android 11; arm64-v8a)
Content-Length: 0

REGISTER sip:192.168.0.71:5065 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.197:37969;branch=z9hG4bKSadsZg7XVO0mMlX2;rport=37969
From: <sip:10000000002@192.168.0.71:5065>;tag=A46D171175C26A4438D151F4BE0E4520
To: <sip:10000000002@192.168.0.71:5065>
Call-ID: B72DE525A93DC0365BCC3981C749BC97848B17BC
CSeq: 1546 REGISTER
Contact: <sip:10000000002@192.168.0.197:37969;rinstance=8EBC221E>;expires=600;video
Allow: ACK
Allow: BYE
Allow: CANCEL
Allow: INFO
Allow: INVITE
Allow: NOTIFY
Allow: OPTIONS
Allow: REFER
Max-forwards: 70
Supported: replaces
Supported: path
Expires: 600
User-agent: Softphone/5.4.9 (build 1648221; Android 11; arm64-v8a)
Content-Length: 0

SIP/2.0 501 Not Implemented
Via: SIP/2.0/UDP 192.168.0.197:37969;branch=z9hG4bKSadsZg7XVO0mMlX2;rport=5065;received=192.168.0.71
Contact: <sip:10000000002@192.168.0.197:37969>
From: <sip:10000000002@192.168.0.71:5065>;tag=A46D171175C26A4438D151F4BE0E4520
Call-ID: B72DE525A93DC0365BCC3981C749BC97848B17BC
CSeq: 1546 REGISTER
To: <sip:10000000002@192.168.0.71:5065>
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: replaces, path
User-Agent: Softphone/5.4.9 (build 1648221; Android 11; arm64-v8a)
Content-Length: 0

REGISTER sip:192.168.0.71:5065 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.197:37969;branch=z9hG4bKSadsZg7XVO0mMlX2;rport
Contact: <sip:10000000002@192.168.0.197:37969;rinstance=8EBC221E>;expires=600;video
Max-Forwards: 70
From: <sip:10000000002@192.168.0.71:5065>;tag=A46D171175C26A4438D151F4BE0E4520
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: replaces, path
To: <sip:10000000002@192.168.0.71:5065>
Expires: 600
Call-ID: B72DE525A93DC0365BCC3981C749BC97848B17BC
CSeq: 1546 REGISTER
User-Agent: Softphone/5.4.9 (build 1648221; Android 11; arm64-v8a)
Content-Length: 0
 
Last edited:

hfoster

Active Member
Jan 28, 2019
677
80
28
34
Wonder what the idea behind doing that is? I suspect the devices came from a system with some custom programming to strip the packets down into an XML and SIP component. You're probably best asking this directly on FreeSWITCH boards, maybe OpenSIPS or Kamailio as those suites are designed to mess with SIP messaging.
 

NoFate

Member
Sep 17, 2021
51
0
6
43
Hi @hfoster , correct, my intercom system runs some private SIP server, i want to register FusionPBX on it , so i can forward the calls
I only need to send indeed some extra XML stuff in the body, i dont mind if its hardcoded or not

i will have a look indeed at opensips or kamailo

But i was looking at fusion first, maybe i can add a custom parameter in the gateway options? or maybe i can change it directly in in the lua script , hardcoded... but i could not find the correct file that does the register?

can you give me a small hand maybe?
 

hfoster

Active Member
Jan 28, 2019
677
80
28
34
Ultimately, it will require whatever that parses SIP Messaging (in this case it's the Sofia SIP Stack in FreeSwitch) to be able to discard the XML messaging. I really don't think it will be possible without some modification to mod_sofia which is well beyond the scope of this forum.

For example, this is the source code that handles SIP registration in FreeSWITCH's mod_sofia.

As I said, it's probably better to directly ask the FreeSwitch, OpenSIPs, Kamailio projects as this is their wheelhouse. FusionPBX is a front end to FreeSwitch.

It might even be easier to see if the door phones can disable that XML stuff.

If you're really not that attached to these door phones, there are a lot of options out there that just talk normal SIP. A lot of our clients have picked Fanvils which seem to have no problems what-so-ever.
 
Status
Not open for further replies.