cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
25727
Views
15
Helpful
22
Replies

Modify SIP-Header P-Asserted-Identity

Michael Schmidt
Level 1
Level 1

Hi,

I just have a problem to modify the "P-Asserted-Identity" as the provider expect a special value.

The "normal" unmodified P-Asserted-Identity looks like this

P-Asserted-Identity: "username" <sip:XXXX77@x.x.x.x>

I want to change this P-Asserted-Identity to this one

P-Asserted-Identity: "username"<sip:YYYYYYYY77@y.y.y.y:5060>

X = internal DN
x = internal IP of CUCM
Y = external DN
y = external IP

I tried to do this with this config

voice class sip-profiles 1
request ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<sip:XXXX77@x.x.x.x>" "P-Asserted-Identity:\1<sip:YYYYYYYY77@y.y.y.y:5060>"

dial-peer voice 11 voip
 description SIP-Outgoing
 translation-profile incoming SipInbound
 translation-profile outgoing SipOutbound
 destination-pattern 0T
 modem passthrough nse codec g711alaw
 session protocol sipv2
 session target ipv4:y.y.y.y
 session transport udp
 voice-class sip early-offer forced
 voice-class sip profiles 1
 dtmf-relay sip-notify rtp-nte
 codec g711alaw
 fax-relay ecm disable
 fax-relay sg3-to-g3
 fax nsf 000000
 fax protocol t38 version 0 ls-redundancy 0 hs-redundancy 0 fallback pass-through g711alaw
 no vad
!


In the log I also see that dialpeer 11 should be used:


*Jun 16 15:16:31.242 MESZ: //-1/xxxxxxxxxxxx/DPM/MatchNextPeer:
   Result=Success(0); Outgoing Dial-peer=11 Is Matched

But the problem is that the P-Asserted-Identity is not modified and still the default value.

What did I wrong?

BR
Michael

22 Replies 22

you can try this to replace tel with sip, and you'd need to have previous command applied:

request ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<(tel):(.*)>" "P-Asserted-Identity:\1<sip:\3:5060>"

Leszek

Hi Leszek,

I added your rule.

Call is now going out with the still added command "voice-class sip asserted-id pai" although the P-Asserted-Identity is still not totally correct.

At the moment the sip-profile looks like this:

voice class sip-profiles 1
 request ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<sip:784577@10.40.40.41>" "P-Asserted-Identity:\1<sip:0305878477@10.21.147.154:5060>"
 response ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<sip:784577@10.40.40.41>" "P-Asserted-Identity:\1<sip:0305878477@10.21.147.154:5060>"
 request ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<(tel):(.*)>" "P-Asserted-Identity:\1<sip:\3>"

The receivced P-Asserted-Identy is:

P-Asserted-Identity: "username" <sip:784577@10.40.40.41>

The sent P-Asserted-Identy is:

P-Asserted-Identity: "username" <sip:0305878477@10.35.6.9>

The problem is that there is the wrong IP 10.35.6.9 (internal DMZ IP and not the external IP as written in the SIP-profile) 10.21.147.154.

Also the :5060 after the correct external IP is missing.

I just removed the sip-profile from the outgoing dial-peer and the P-Asserted-Identity is still the same for received and sent.

What can I do to change the P-Asserted-Identy to

<sip:0305878477@10.21.147.154:5060>

BR

Michael

Hi Michael,

This should do it:


request ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<(tel):(.*)@(.*)>" "P-Asserted-Identity:\1<sip:\3@10.21.147.154:5060>"

Leszek

Hi Leszek,

sorry but the P-Asserted-Identy still is wrong although I added your rule.

voice class sip-profiles 1
 request ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<(tel):(.*)@(.*)>" "P-Asserted-Identity:\1<sip:\3@10.21.147.154:5060>"
 response ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<(tel):(.*)@(.*)>" "P-Asserted-Identity:\1<sip:\3@10.21.147.154:5060>"
!

dial-peer voice 11 voip
 description SIP-Outgoing
 translation-profile incoming SipInbound
 translation-profile outgoing SipOutbound
 destination-pattern 0T
 modem passthrough nse codec g711alaw
 session protocol sipv2
 session target ipv4:10.15.165.102
 session transport udp
 voice-class sip asserted-id pai
 voice-class sip early-offer forced
 voice-class sip profiles 1
 dtmf-relay sip-notify rtp-nte
 codec g711alaw
 fax-relay ecm disable
 fax-relay sg3-to-g3
 fax nsf 000000
 fax protocol t38 version 0 ls-redundancy 0 hs-redundancy 0 fallback pass-through g711alaw
 no vad

Sent:

P-Asserted-Identity: "username" <sip:0305878477@10.35.6.9>

In the attachment please find the outgoing log file.

BR

Michael

because the debugs are not full, that's why it's a little tricky to troubleshoot the script

can you add this one line to script:

request ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<(sip):(.*)@(.*)>" "P-Asserted-Identity:\1<sip:\3@10.21.147.154:5060>"

This way it will match both tel and sip

Leszek

Hi Leszek,

great it`s working :-)

I added your rule. The sip profile looks now like that:

voice class sip-profiles 1
 request ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<(tel):(.*)@(.*)>" "P-Asserted-Identity:\1<sip:\3@10.21.147.154:5060>"
 response ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<(tel):(.*)@(.*)>" "P-Asserted-Identity:\1<sip:\3@10.21.147.154:5060>"
 request ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<(sip):(.*)@(.*)>" "P-Asserted-Identity:\1<sip:\3@10.21.147.154:5060>"
 response ANY sip-header P-Asserted-Identity modify "P-Asserted-Identity:(.*)<(sip):(.*)@(.*)>" "P-Asserted-Identity:\1<sip:\3@10.21.147.154:5060>"

Sent:

P-Asserted-Identity: "CANCOM" <sip:0207412577@10.21.147.154:5060>

BR

Michael

ok, great

If the answers were useful please mark them as correct so we can consider this subject closed.

Leszek

Dear Leszek,

how can i write sip profile for below details. 

DID Range 8914560050 to 8914560079

Intercom numbers 141 to 190 (Cisco IP Phones Model :7841)

SBC IP: 10.5.109.147
Domain ap.ims.airtel.in

Username +918914560050@ap.ims.airtel.in

 

At present i wrote profile for particular numbers. i.e

voice class sip-profiles 1
request INVITE sip-header P-Asserted-Identity modify "187@ap.ims.airtel.in" "+918914560050@ap.ims.airtel.in"
request INVITE sip-header From modify "187@ap.ims.airtel.in" "+918914560050@ap.ims.airtel.in"
request INVITE sip-header P-Asserted-Identity modify "190@ap.ims.airtel.in" "+918914560050@ap.ims.airtel.in"
request INVITE sip-header From modify "190@ap.ims.airtel.in" "+918914560050@ap.ims.airtel.in"
!

Now i can able to outgoing calls from those extension numbers only.