I am stuck on a project and need help. I have setup a SIP trunk on Cisco 2900 router to another vendors call server which is based on asterisk(custom application). We have phones register with the 2900 and some with the asterisk server. DID numbers are mapped to extension numbers on the Cisco router but The vendor has requested that one of the DID number from the range should be configured as the destination pattern on the SIP trunk. I suggested translating the DID number to an extension which will be configured as destination pattern on the SIP trunk but I was told it won’t work as the application needs to see the DID number. Is this possible? How do I go about this?
I have a solution working with a Cisco 2800 acting as a Session Border Controller (CUBE) in front of an Asterisk box.
The inbound patterns and outbound patterns don't overlap (for me) so its a matter of getting the SIP service/SIP UA working and defining voice peers for each direction.
! ! Basic SIP service ! ! voice rtp send-recv ! voice service voip ip address trusted list ipv4 184.108.40.206 ipv4 220.127.116.11 ipv4 18.104.22.168 allow-connections sip to sip fax protocol t38 version 0 ls-redundancy 0 hs-redundancy 0 fallback pass-through g711alaw sip registrar server expires max 65535 min 3600 early-offer forced midcall-signaling passthru ! voice class codec 1 codec preference 1 g711alaw codec preference 2 g711ulaw codec preference 3 g729br8 ! ! ! sip-ua credentials username uuuuuuuuu password ppppppppppp realm sipconnect.hipcom.co.uk authentication username uuuuuuuuuu password 7 ppppppppppp no remote-party-id retry invite 3 retry bye 3 retry cancel 5 retry prack 6 retry register 3 timers options 1000 registrar dns:sipconnect.hipcom.co.uk expires 300 sip-server dns:sipconnect.hipcom.co.uk host-registrar !
Dial-peer for incoming calls
! ! incoming (trunk to asterisk) peers are in the form: ! dial-peer voice 1000 voip description *** Incoming for 01632001122 Trunk -> Asterisk *** destination-pattern 441632001122 session protocol sipv2 session target ipv4:22.214.171.124 // asterisk server session transport udp dtmf-relay rtp-nte codec transparent no vad !
You have as many of these as you need for DDI/DID and/or use pattern matching.
Dial-peers for outgoing calls
! dial-peer voice 2000 voip description *** Outgoing -> BT SIP trunk *** destination-pattern 0.T session protocol sipv2 session target sip-server session transport udp dtmf-relay rtp-nte codec transparent no vad !
above does the default pattern for anything with a leading zero.
Other patterns handle information numbers (operator, etc) and and a further pattern handles emergency numbers (999, 911, etc)
! dial-peer voice 2300 voip description *** Outgoing -> BT SIP Trunk: Information numbers *** destination-pattern 1.. session protocol sipv2 session target sip-server session transport udp dtmf-relay rtp-nte codec transparent no vad ! dial-peer voice 2400 voip description *** Outgoing -> BT SIP Trunk: Emergency numbers *** destination-pattern 9.. session protocol sipv2 session target sip-server session transport udp dtmf-relay rtp-nte codec transparent no vad !
You'll find more about using Cisco CUBE as an SBC in front of Asterisk on my blog article.
We where able to resolve the issue by manipulating the sip-header to show the external/PSTN number when request invite is sent to the asterisk server.
voice class sip-profiles 1 request INVITE sip-header From modify "<sip:(.*)@(.*)>" "<sip:real email@example.com>"
The sip profile was applied on the sip trunk to the asterisk server.