Modify SIP headers for only one gateway

Hello everybody,

I have a couple of years using ASTPP but I’m not an expert on dialplan or custom configurations.

A carrier is asking to send the destination number in the INVITE with the route prefix but in the To header they need the destination number without the prefix, For example:

Prefix: 1234
Destination number (B-number): 44123456789
CID number (A-number): 34123456789
ASTPP IP: 1.2.3.4
Carrier IP: 6.7.8.9

The INVITE should be something like:
INVITE sip:123444123456789@6.7.8.9 SIP/2.0
Via: SIP/2.0/UDP 1.2.3.4;rport;branch=z9hG4bKt8Q94c1am7BaD
Max-Forwards: 69
From: “+34123456789” sip:+34123456789@1.2.3.4;tag=B9F81Bg43vtjr
To: sip:+44123456789@6.7.8.9
Call-ID: 5166ee9a-f798-123d-6f92-02da8e1f18c9
CSeq: 89175169 INVITE
Contact: sip:gw+MyCarrier-GW@1.2.3.4:5060;transport=udp;gw=MyCarrier-GW
User-Agent: ASTPP
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: path, replaces
Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
Privacy: none
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 246
P-Asserted-Identity: “34123456789” sip:34123456789@1.2.3.4
v=0
o=FreeSWITCH 1727446152 1727446153 IN IP4 1.2.3.4
s=FreeSWITCH
c=IN IP4 1.2.3.4
t=0 0
m=audio 11770 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20

I have highlighted the requisites:

  • A-number in From header on E.164 with + sign
  • A-number in P-Asserted-Identity on E.164
  • B-number in INVITE on E.164 with prefix no + sign
  • B-number must be in ‘To’ header NO prefix on E.164 with + sign

The quid here is to sent the prefix on the INVITE but not in the ‘To’ header, but, I don’t know how to remove the prefix from the ‘To’ header.

If anyone can shed light on how to do this customization I would really appreciate it.

Thanks, David

I think you need to customize the dialplan to achieve that. If you want ASTPP team to help then you can contact on contact@astppbiling.org.