Asterisk re-writing domain

My current setup looks like this

Telco -> Asterisk -> Cisco Call Manager -> Phones
|
v
Phones

When someone calls me, the DID is received by asterisk and sent along to the call manager and then to my phone. What I’ve noticed is that the callerid is changed to show @asterisk.local. this isn’t a huge issue since i call out through asterisk aswell, however, it presents a significant issue with URI calling since i can’t simply call someone back. Any thoughts on where to check the issue?

If you are referring to the domain in the From header you can explicitly set it using the “fromdomain” option in chan_sip and “from_domain” option in chan_pjsip.

I need it to pass through the actual domain.

eg. i call from cisco spark to my phone.

driz@longoconsulting.us -> asterisk -> cisco call manager -> my phone

call works fine, however if i attempt to call the person back, the recent calls shows sparkuser@asterisk.local rather than sparkuser@ciscospark.com. changing or excluding my fromdomain in sip.conf results in sparkuser@

i’m going to setup a soft phone to register directly to asterisk and see if the issue occurs there too

Asterisk does not act as a proxy, it’s a back-to-back user agent so each side is independent. There may be a dial string you can use with chan_sip to do what you want but I do not know it off the top of my head.

calls directly into asterisk have the same result.

  == Using SIP VIDEO CoS mark 6
  == Using SIP RTP CoS mark 5
-- Executing [dznet-1@unauthenticated:1] Macro("SIP/pgw-v11g.phono.com-00000116", "oneline,SIP/dznet-1") in new stack
-- Executing [s@macro-oneline:1] Dial("SIP/pgw-v11g.phono.com-00000116", "SIP/dznet-1,20,tTkK") in new stack
  == Using SIP VIDEO CoS mark 6
  == Using SIP RTP CoS mark 5
-- Called SIP/dznet-1
-- SIP/dznet-1-00000117 is ringing
   > 0x7f1f80287f20 -- Probation passed - setting RTP source address to 192.168.128.3:4000
-- SIP/dznet-1-00000117 answered SIP/pgw-v11g.phono.com-00000116
-- Channel SIP/pgw-v11g.phono.com-00000116 joined 'simple_bridge' basic-bridge <8dbb814b-407c-494b-a4c1-f724fbe5d322>
-- Channel SIP/dznet-1-00000117 joined 'simple_bridge' basic-bridge <8dbb814b-407c-494b-a4c1-f724fbe5d322>
   > 0x7f1f8020a570 -- Probation passed - setting RTP source address to 192.168.128.3:4002
   > 0x7f1f80287f20 -- Probation passed - setting RTP source address to 192.168.128.3:4000
   > 0x7f1f7424b7d0 -- Probation passed - setting RTP source address to 54.208.174.25:22828
-- Channel SIP/dznet-1-00000117 left 'simple_bridge' basic-bridge <8dbb814b-407c-494b-a4c1-f724fbe5d322>
-- Channel SIP/pgw-v11g.phono.com-00000116 left 'simple_bridge' basic-bridge <8dbb814b-407c-494b-a4c1-f724fbe5d322>
  == Spawn extension (macro-oneline, s, 1) exited non-zero on 'SIP/pgw-v11g.phono.com-00000116' in macro 'oneline'
  == Spawn extension (unauthenticated, dznet-1, 1) exited non-zero on 'SIP/pgw-v11g.phono.com-00000116'

as you can see, the caller domain should be pgw-v11g.phono.com but it is rewritten as dznet.pwnz.org. The inbound call works fine, 2 way audio, h264 video, no problems, but calling back obviously doesnt work since the caller-id is modified.

Here is the extensions.conf

[unauthenticated]
exten => dznet-1,1,Macro(oneline,SIP/dznet-1)
[macro-oneline]
exten => s,1,Dial(${ARG1},20,tTkK)
 same => NoOp(${DIALSTATUS} // ${ARG2})
 same => n,GotoIf($["${DIALSTATUS}" = "BUSY"]?busy:unavail)
 same => n(unavail),VoiceMail(${ARG2}@default,u)
 same => n,Hangup()
 same => n(busy),VoiceMail(${ARG2}@default,b)
 same => n,Hangup()

This is not a bug. Asterisk was designed to handle things that only have a phone number, so it has to insert its own domain for those. The domain simply is not passed across the core of Asterisk.