星号修改头文件



我想替换星号的SPA2102。如何修改标题,如From, To和Contact?我需要替换标题,比如

From: "asterisk" <sip:XXXX174264@ip.ip.ip.6>;tag=as1ea48bca

到标头,如SPA2102。

我的SPA2102发送的是

"XXXX174264" <sip:XXXX174264@ip.ip.ip.6>

如何
#  tcpdump -nAieth0 port 5060 and net ip.ip.ip.0/24
10:47:55.801914 IP 10.37.93.21.5060 > ip.ip.ip.6.5060: SIP, length: 906
E....j..@...
%].............INVITE sip:474264@ip.ip.ip.6 SIP/2.0
Via: SIP/2.0/UDP 10.37.93.21:5060;branch=z9hG4bK20d7bc88
Max-Forwards: 70
From: "asterisk" <sip:XXXX174264@ip.ip.ip.6>;tag=as1ea48bca
To: <sip:474264@ip.ip.ip.6>
Contact: <sip:XXXX174264@10.37.93.21:5060>
Call-ID: 6b4c893e70628a626286cd0a748f93de@ip.ip.ip.6
CSeq: 102 INVITE
User-Agent: Linksys/SPA2102-5.2.5
Date: Wed, 16 Jan 2013 04:47:55 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 333
v=0
o=- 233070007 233070007 IN IP4 10.37.93.21
s=Asterisk PBX 11.2.0
c=IN IP4 10.37.93.21
t=0 0
m=audio 10004 RTP/AVP 0 8 3 111 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
10:47:55.822359 IP ip.ip.ip.6.5060 > 10.37.93.21.5060: SIP, length: 348
E..x..@.>.#.....
%]......d.CSIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.37.93.21:5060;branch=z9hG4bK20d7bc88
From: "asterisk" <sip:XXXX174264@ip.ip.ip.6>;tag=as1ea48bca
To: <sip:474264@ip.ip.ip.6>
Call-ID: 6b4c893e70628a626286cd0a748f93de@ip.ip.ip.6
CSeq: 102 INVITE
Contact: <sip:474264@ip.ip.ip.6:5060>
Server: MERA MVTS3G v.4.3.0-38t
Content-Length: 0

我试着用SPA和Asterisk打电话。两者都注册成功。但是Asterisk不能打电话。下面是来自SPA的tcpdump:

00:58:00.778565 IP 10.37.93.23.5060 > ip.ip.ip.6.5060: SIP, length: 892
Eh..........
%].............INVITE sip:474264@ip.ip.ip.6 SIP/2.0
Via: SIP/2.0/UDP 10.37.93.23:5060;branch=z9hG4bK-9b906813
From: XXXX174264 <sip:XXXX174264@ip.ip.ip.6>;tag=e9377d83dbc079fo0
To: <sip:474264@ip.ip.ip.6>
Remote-Party-ID: XXXX174264 <sip:XXXX174264@ip.ip.ip.6>;screen=yes;party=calling
Call-ID: 27e34e53-cdeded0f@10.37.93.23
CSeq: 101 INVITE
Max-Forwards: 70
Contact: XXXX174264 <sip:XXXX174264@10.37.93.23:5060>
Expires: 240
User-Agent: Linksys/SPA2102-5.2.5
Content-Length: 268
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: x-sipura, replaces
Content-Type: application/sdp
v=0
o=- 93383 93383 IN IP4 10.37.93.23
s=-
c=IN IP4 10.37.93.23
t=0 0
m=audio 16186 RTP/AVP 8 0 18 4 100
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729a/8000
a=rtpmap:4 G723/8000
a=rtpmap:100 NSE/8000
a=fmtp:100 192-193
a=ptime:20
a=sendrecv
00:58:00.782580 IP ip.ip.ip.6.5060 > 10.37.93.23.5060: SIP, length: 342
....E..r..@.>.#.....
%]......^..SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.37.93.23:5060;branch=z9hG4bK-9b906813
From: "XXXX174264" <sip:XXXX174264@ip.ip.ip.6>;tag=e9377d83dbc079fo0
To: <sip:474264@ip.ip.ip.6>
Call-ID: 27e34e53-cdeded0f@10.37.93.23
CSeq: 101 INVITE
Contact: <sip:474264@ip.ip.ip.6:5060>
Server: MERA MVTS3G v.4.3.0-38t
Content-Length: 0

00:58:02.479539 IP ip.ip.ip.6.5060 > 10.37.93.23.5060: SIP, length: 683
....E.....@.>."p....
%].......<.SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 10.37.93.23:5060;branch=z9hG4bK-9b906813
From: "XXXX174264" <sip:XXXX174264@ip.ip.ip.6>;tag=e9377d83dbc079fo0
To: <sip:474264@ip.ip.ip.6>;tag=109877804-3792792162-4082950052-3026001148
Call-ID: 27e34e53-cdeded0f@10.37.93.23
CSeq: 101 INVITE
Contact: <sip:474264@ip.ip.ip.6:5060>
Content-Type: application/sdp
Server: MERA MVTS3G v.4.3.0-38t
Content-Length:   258
v=0
o=- 1358621882 1358621882 IN IP4 ip.ip.ip.5
s=-
c=IN IP4 ip.ip.ip.5
t=0 0
m=audio 39878 RTP/AVP 8 0 18
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=ptime:20
a=sendrecv
a=silenceSupp:off - - - -
00:58:30.832778 IP 10.37.93.23.5060 > ip.ip.ip.6.5060: SIP, length: 339
Eh.o........
%]..........[O.CANCEL sip:474264@ip.ip.ip.6 SIP/2.0
Via: SIP/2.0/UDP 10.37.93.23:5060;branch=z9hG4bK-9b906813
From: XXXX174264 <sip:XXXX174264@ip.ip.ip.6>;tag=e9377d83dbc079fo0
To: <sip:474264@ip.ip.ip.6>
Call-ID: 27e34e53-cdeded0f@10.37.93.23
CSeq: 101 CANCEL
Max-Forwards: 70
User-Agent: Linksys/SPA2102-5.2.5
Content-Length: 0

00:58:30.836782 IP ip.ip.ip.6.5060 > 10.37.93.23.5060: SIP, length: 385
....E.....@.>.#.....
%].......7.SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.37.93.23:5060;branch=z9hG4bK-9b906813
From: "XXXX174264" <sip:XXXX174264@ip.ip.ip.6>;tag=e9377d83dbc079fo0
To: <sip:474264@ip.ip.ip.6>;tag=109877804-3792792162-4082950052-3026001148
Call-ID: 27e34e53-cdeded0f@10.37.93.23
CSeq: 101 CANCEL
Contact: <sip:474264@ip.ip.ip.6:5060>
Server: MERA MVTS3G v.4.3.0-38t
Content-Length: 0

00:58:30.838775 IP ip.ip.ip.6.5060 > 10.37.93.23.5060: SIP, length: 450
....E.....@.>.#Y....
%].........SIP/2.0 487 Request Terminated
Via: SIP/2.0/UDP 10.37.93.23:5060;branch=z9hG4bK-9b906813
From: "XXXX174264" <sip:XXXX174264@ip.ip.ip.6>;tag=e9377d83dbc079fo0
To: <sip:474264@ip.ip.ip.6>;tag=109877804-3792792162-4082950052-3026001148
Call-ID: 27e34e53-cdeded0f@10.37.93.23
CSeq: 101 INVITE
Contact: <sip:474264@ip.ip.ip.6:5060>
Server: MERA MVTS3G v.4.3.0-38t
Reason: SIP;cause=487;text="Request Terminated"
Content-Length: 0

00:58:30.845777 IP 10.37.93.23.5060 > ip.ip.ip.6.5060: SIP, length: 437
Eh.........&
%].............ACK sip:474264@ip.ip.ip.6 SIP/2.0
Via: SIP/2.0/UDP 10.37.93.23:5060;branch=z9hG4bK-9b906813
From: XXXX174264 <sip:XXXX174264@ip.ip.ip.6>;tag=e9377d83dbc079fo0
To: <sip:474264@ip.ip.ip.6>;tag=109877804-3792792162-4082950052-3026001148
Call-ID: 27e34e53-cdeded0f@10.37.93.23
CSeq: 101 ACK
Max-Forwards: 70
Contact: XXXX174264 <sip:XXXX174264@10.37.93.23:5060>
User-Agent: Linksys/SPA2102-5.2.5
Content-Length: 0

和tcpdump from Asterisk:

E...W,..@.      .
%].............INVITE sip:474264@ip.ip.ip.6 SIP/2.0
Via: SIP/2.0/UDP 10.37.93.21:5060;branch=z9hG4bK6422ee1e
Max-Forwards: 70
From: "asterisk" <sip:XXXX174264@ip.ip.ip.6>;tag=as43ada6c8
To: <sip:474264@ip.ip.ip.6>
Contact: <sip:XXXX174264@10.37.93.21:5060>
Call-ID: 6e8b22967d9c55ea349abb636c0e5263@ip.ip.ip.6
CSeq: 102 INVITE
User-Agent: Linksys/SPA2102-5.2.5
Date: Sat, 19 Jan 2013 18:49:27 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 333
v=0
o=- 413424664 413424664 IN IP4 10.37.93.21
s=Asterisk PBX 11.2.0
c=IN IP4 10.37.93.21
t=0 0
m=audio 10008 RTP/AVP 0 8 3 111 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
00:49:27.073977 IP ip.ip.ip.6.5060 > 10.37.93.21.5060: SIP, length: 348
E..x..@.>.#.....
%]......d..SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.37.93.21:5060;branch=z9hG4bK6422ee1e
From: "asterisk" <sip:XXXX174264@ip.ip.ip.6>;tag=as43ada6c8
To: <sip:474264@ip.ip.ip.6>
Call-ID: 6e8b22967d9c55ea349abb636c0e5263@ip.ip.ip.6
CSeq: 102 INVITE
Contact: <sip:474264@ip.ip.ip.6:5060>
Server: MERA MVTS3G v.4.3.0-38t
Content-Length: 0

00:49:27.100102 IP ip.ip.ip.6.5060 > 10.37.93.21.5060: SIP, length: 478
E.....@.>.#?....
%].........SIP/2.0 603 Subscriber account disabled
Via: SIP/2.0/UDP 10.37.93.21:5060;branch=z9hG4bK6422ee1e
From: "asterisk" <sip:XXXX174264@ip.ip.ip.6>;tag=as43ada6c8
To: <sip:474264@ip.ip.ip.6>;tag=179071226-3792791650-4082950052-3026001148
Call-ID: 6e8b22967d9c55ea349abb636c0e5263@ip.ip.ip.6
CSeq: 102 INVITE
Contact: <sip:474264@ip.ip.ip.6:5060>
Server: MERA MVTS3G v.4.3.0-38t
Reason: Centrex;cause=179;text="Subscriber account disabled"
Content-Length: 0

00:49:27.100295 IP 10.37.93.21.5060 > ip.ip.ip.6.5060: SIP, length: 433
E...W-..@.
.
%]...........#,ACK sip:474264@ip.ip.ip.6 SIP/2.0
Via: SIP/2.0/UDP 10.37.93.21:5060;branch=z9hG4bK6422ee1e
Max-Forwards: 70
From: "asterisk" <sip:XXXX174264@ip.ip.ip.6>;tag=as43ada6c8
To: <sip:474264@ip.ip.ip.6>;tag=179071226-3792791650-4082950052-3026001148
Contact: <sip:XXXX174264@10.37.93.21:5060>
Call-ID: 6e8b22967d9c55ea349abb636c0e5263@ip.ip.ip.6
CSeq: 102 ACK
User-Agent: Linksys/SPA2102-5.2.5
Content-Length: 0

尝试修改sip.conf:

[general]
realm=yourprovider-domain-here
useragent = Linksys/PAP2T-5.1.6(LS)
sdpsession= Linksys/PAP2T-5.1.6(LS)

您可以在dialplan中使用SipAddHeader,如

SipAddHeader(P-Preferred-Identity: <sip:XXXXXX@10.0.10.10>

有两个地方可以修改这些头信息。

在您的PBX中,对于PBX -> SPA意义上的呼叫,您应该这样修改您的sip.conf文件:

[general]
...
realm = my_realm.com ; This will substitute From: "asterisk"

在您的SPA2102中,对于SPA -> PBX意义下的呼叫,您必须进入SPA配置并更改用户信息。这是本指南的第5步:http://www.voipvoip.com/spa-2101/这里写着"显示名称"

相关内容

  • 没有找到相关文章

最新更新