Need help for outgoing calls from Asterisk to IMS network

Hello!

First, sorry for my very bad English!!!

I’m a Professional Degree trainee in the field of VOIP Network and System Management into Alcatel-Lucent firm.
During my placement, I have to connect Asterisk (Installed on Ubuntu 9.10 OS) with an Alcatel-Lucent IMS platform.
The way to achieved this integration is the following:
I have 3 users A, B, C.
A and B are both IMS subscribers, and C is an Asterisk user (unknown for IMS network).
I’m using the subscriber B as a “gateway” between Asterisk user C and IMS subscriber A.
So, Asterisk performs a registration on subscriber B, exactly as it was a voip provider profile.
Then, calls from subscriber A to B are forwarded to Asterisk user C (Incoming calls), and calls from C to A are forwarded to subscriber B to reach A (Outgoing calls).

The problem:
Asterisk registration and incoming calls works fine, but on outgoing calls I always get the message from the p-cscf (proxy server of IMS network):
“407 Proxy Authentication required” (in wireshark);
“Fail to authenticate on invite” (in Asterisk CLI).

sip.conf

[general]
realm=ims.perros.bzh ;my domain name (ims.perros.bzh) for digest md5 authentication
defaultexpiry=3600
pedantic=yes ;if not present registration doesn't works
allow=ulaw
allow=alaw
allow=gsm
language=fr
deny=0.0.0.0/0.0.0.0
permit=192.168.135.7/255.255.255.255

register => 0296000001@ims.perros.bzh:0296000001:0296000001@192.168.135.7:5060/0296000001 ;registration of user B known of IMS network

[ims_in]
type=friend
context=appels_entrants
host=192.168.135.7

[ims_out]
type=peer
username=0296000001
fromuser=0296000001
secret=0296000001
fromdomain=192.168.135.7
insecure=very
host=192.168.135.7
qualify=yes
nat=no
allow=ulaw
allow=alaw
allow=gsm
outboundproxy=192.168.135.7

[0296000001] ;my asterisk user C which carry the same name as IMS subscriber B for transparency reasons between IMS and Asterisk worlds
type=friend  ;However if it has a different name the problem stays the same
username=0296000001
fromuser=0296000001
callerid="0296000001"
secret=0296000001
context=interne
host=dynamic

extensions.conf

[appels_entrants]
exten => 0296000001,1,Dial(SIP/${EXTEN})

[appels_sortants]
exten => _9.,1,Dial(SIP/${EXTEN:1}@ims_out)

[interne]
include => appels_sortants
exten => _1.,1,Dial(SIP/${EXTEN:1})

I searched during hours on the Internet and I tried a lot of things but nothing solved my problem.
I have noticed that IMS calls between IMS subscribers are based on domain name (invite user@domain,) whereas calls from Asterisk user to IMS subscriber are based on the P-CSCF IP address (invite user@192.168.135.7).
I tried to use SRV records in asterisk with bind9 to based calls on domain name but it doesn’t works.

How can I provide this authentication during outgoing calls?
If it’s not really an authentication problem what’s wrong between IMS network and Asterisk.

I also heard this “SIP signaling from IMS is a little bit different from the Asterisk SIP stack.”.
here: http://www.mail-archive.com/asterisk-dev@lists.digium.com/msg22020.html
What can you tell me about that?

Thank you in advance.

François Bourdoulous.

Hello,

Please post a SIP trace (sip set debug) of an outgoing call.

BR,
Ioan.

Hellow,

First, Thanks for your very fast reply, and sorry for the slowness of mine.

Many problems appeared on the IMS platform and finally we have entirely reinstalled it.
I think my problem is still the same but now I can not make outgoing and incoming calls due to “400 Bad Request”.
Something has changed in the new configuration, and i’m trying to solved it.

However, I post a SIP trace (sip set debug) of an outgoing call.

<--- SIP read from UDP:192.168.135.90:5061 --->
INVITE sip:9jerome@ims.perros.bzh;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.135.90:5061;branch=z9hG4bK-d8754z-0ee23e9b3b575f63-1---d8754z-;rport
Max-Forwards: 70
Contact: <sip:0296000001@192.168.135.90:5061;transport=UDP>
To: <sip:9jerome@ims.perros.bzh;transport=UDP>
From: "0296000001"<sip:0296000001@ims.perros.bzh;transport=UDP>;tag=4944de53
Call-ID: NmNiMDY0Mjc3ZTE1ZWNkMGQzMzhjMjUwOWY2YjdjOTU.
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Content-Type: application/sdp
User-Agent: Zoiper rev.5415
Content-Length: 308

v=0
o=Z 0 0 IN IP4 192.168.135.90
s=Z
c=IN IP4 192.168.135.90
t=0 0
m=audio 8000 RTP/AVP 3 110 98 8 0 101
a=rtpmap:3 GSM/8000
a=rtpmap:110 speex/8000
a=rtpmap:98 iLBC/8000
a=fmtp:98 mode=30
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
<------------->
--- (12 headers 15 lines) ---
  == Using SIP RTP CoS mark 5
Sending to 192.168.135.90 : 5061 (no NAT)
Using INVITE request as basis request - NmNiMDY0Mjc3ZTE1ZWNkMGQzMzhjMjUwOWY2YjdjOTU.
Found peer '0296000001' for '0296000001' from 192.168.135.90:5061

<--- Reliably Transmitting (no NAT) to 192.168.135.90:5061 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.135.90:5061;branch=z9hG4bK-d8754z-0ee23e9b3b575f63-1---d8754z-;received=192.168.135.90;rport=5061
From: "0296000001"<sip:0296000001@ims.perros.bzh;transport=UDP>;tag=4944de53
To: <sip:9jerome@ims.perros.bzh;transport=UDP>;tag=as4fb18ce4
Call-ID: NmNiMDY0Mjc3ZTE1ZWNkMGQzMzhjMjUwOWY2YjdjOTU.
CSeq: 1 INVITE
Server: Asterisk PBX 1.6.2.2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="ims.perros.bzh", nonce="426ca3e6"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog 'NmNiMDY0Mjc3ZTE1ZWNkMGQzMzhjMjUwOWY2YjdjOTU.' in 32000 ms (Method: INVITE)

<--- SIP read from UDP:192.168.135.90:5061 --->
ACK sip:9jerome@ims.perros.bzh;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.135.90:5061;branch=z9hG4bK-d8754z-0ee23e9b3b575f63-1---d8754z-;rport
Max-Forwards: 70
To: <sip:9jerome@ims.perros.bzh;transport=UDP>;tag=as4fb18ce4
From: "0296000001"<sip:0296000001@ims.perros.bzh;transport=UDP>;tag=4944de53
Call-ID: NmNiMDY0Mjc3ZTE1ZWNkMGQzMzhjMjUwOWY2YjdjOTU.
CSeq: 1 ACK
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---

<--- SIP read from UDP:192.168.135.90:5061 --->
INVITE sip:9jerome@ims.perros.bzh;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.135.90:5061;branch=z9hG4bK-d8754z-d23f12ffce37a7b1-1---d8754z-;rport
Max-Forwards: 70
Contact: <sip:0296000001@192.168.135.90:5061;transport=UDP>
To: <sip:9jerome@ims.perros.bzh;transport=UDP>
From: "0296000001"<sip:0296000001@ims.perros.bzh;transport=UDP>;tag=4944de53
Call-ID: NmNiMDY0Mjc3ZTE1ZWNkMGQzMzhjMjUwOWY2YjdjOTU.
CSeq: 2 INVITE
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE
Content-Type: application/sdp
User-Agent: Zoiper rev.5415
Authorization: Digest username="0296000001",realm="ims.perros.bzh",nonce="426ca3e6",uri="sip:9jerome@ims.perros.bzh;transport=UDP",response="5e80d932851125388d548cd696ed60db",algorithm=MD5
Content-Length: 308

v=0
o=Z 0 0 IN IP4 192.168.135.90
s=Z
c=IN IP4 192.168.135.90
t=0 0
m=audio 8000 RTP/AVP 3 110 98 8 0 101
a=rtpmap:3 GSM/8000
a=rtpmap:110 speex/8000
a=rtpmap:98 iLBC/8000
a=fmtp:98 mode=30
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
<------------->
--- (13 headers 15 lines) ---
Sending to 192.168.135.90 : 5061 (no NAT)
Using INVITE request as basis request - NmNiMDY0Mjc3ZTE1ZWNkMGQzMzhjMjUwOWY2YjdjOTU.
Found peer '0296000001' for '0296000001' from 192.168.135.90:5061
Found RTP audio format 3
Found RTP audio format 110
Found RTP audio format 98
Found RTP audio format 8
Found RTP audio format 0
Found RTP audio format 101
Found audio description format GSM for ID 3
Found audio description format speex for ID 110
Found audio description format iLBC for ID 98
Found audio description format PCMA for ID 8
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Capabilities: us - 0x8000e (gsm|ulaw|alaw|h263), peer - audio=0x60e (gsm|ulaw|alaw|speex|ilbc)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0xe (gsm|ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 192.168.135.90:8000
Looking for 9jerome in interne (domain ims.perros.bzh)
list_route: hop: <sip:0296000001@192.168.135.90:5061;transport=UDP>

<--- Transmitting (no NAT) to 192.168.135.90:5061 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.135.90:5061;branch=z9hG4bK-d8754z-d23f12ffce37a7b1-1---d8754z-;received=192.168.135.90;rport=5061
From: "0296000001"<sip:0296000001@ims.perros.bzh;transport=UDP>;tag=4944de53
To: <sip:9jerome@ims.perros.bzh;transport=UDP>
Call-ID: NmNiMDY0Mjc3ZTE1ZWNkMGQzMzhjMjUwOWY2YjdjOTU.
CSeq: 2 INVITE
Server: Asterisk PBX 1.6.2.2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: <sip:9jerome@192.168.135.90>
Content-Length: 0


<------------>
    -- Executing [9jerome@interne:1] Dial("SIP/0296000001-00000008", "SIP/jerome@ims_out") in new stack
  == Using SIP RTP CoS mark 5
Audio is at 192.168.135.90 port 17294
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x8 (alaw) to SDP
Adding codec 0x2 (gsm) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 192.168.135.7:5060:
INVITE sip:jerome@192.168.135.7 SIP/2.0
Via: SIP/2.0/UDP 192.168.135.90:5060;branch=z9hG4bK04890892;rport
Max-Forwards: 70
From: "0296000001" <sip:0296000001@192.168.135.7>;tag=as4569878d
To: <sip:jerome@192.168.135.7>
Contact: <sip:0296000001@192.168.135.90>
Call-ID: 08a8144d7ade734d0f4da36c4b385a20@192.168.135.7
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.6.2.2
Remote-Party-ID: "0296000001" <sip:0296000001@192.168.135.7>;privacy=off;screen=no
Date: Fri, 21 May 2010 09:38:29 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 310

v=0
o=root 93591572 93591572 IN IP4 192.168.135.90
s=Asterisk PBX 1.6.2.2
c=IN IP4 192.168.135.90
t=0 0
m=audio 17294 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

---
    -- Called jerome@ims_out

<--- SIP read from UDP:192.168.135.7:5060 --->
SIP/2.0 100 Trying
Call-ID: 08a8144d7ade734d0f4da36c4b385a20@192.168.135.7
Via: SIP/2.0/UDP 192.168.135.90:5060;received=192.168.135.90;branch=z9hG4bK04890892;rport=5060
To: <sip:jerome@192.168.135.7>
From: "0296000001" <sip:0296000001@192.168.135.7>;tag=as4569878d
CSeq: 102 INVITE
Date: Fri, 21 May 2010 09:38:53 GMT
Server: Alcatel-Lucent-HPSS/3.0.3
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---

<--- SIP read from UDP:192.168.135.7:5060 --->
SIP/2.0 400 Bad Request
Call-ID: 08a8144d7ade734d0f4da36c4b385a20@192.168.135.7
Via: SIP/2.0/UDP 192.168.135.90:5060;received=192.168.135.90;branch=z9hG4bK04890892;rport=5060
To: <sip:jerome@192.168.135.7>;tag=4be2b15f-1274434733758645
From: "0296000001" <sip:0296000001@192.168.135.7>;tag=as4569878d
CSeq: 102 INVITE
Contact: <sip:pcsf-stdn.imsgroup0-000.ics.ims.perros.bzh:5060>
Date: Fri, 21 May 2010 09:38:53 GMT
Server: Alcatel-Lucent-HPSS/3.0.3
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
    -- Got SIP response 400 "Bad Request" back from 192.168.135.7
Transmitting (no NAT) to 192.168.135.7:5060:
ACK sip:jerome@192.168.135.7 SIP/2.0
Via: SIP/2.0/UDP 192.168.135.90:5060;branch=z9hG4bK04890892;rport
Max-Forwards: 70
From: "0296000001" <sip:0296000001@192.168.135.7>;tag=as4569878d
To: <sip:jerome@192.168.135.7>;tag=4be2b15f-1274434733758645
Contact: <sip:0296000001@192.168.135.90>
Call-ID: 08a8144d7ade734d0f4da36c4b385a20@192.168.135.7
CSeq: 102 ACK
User-Agent: Asterisk PBX 1.6.2.2
Remote-Party-ID: "0296000001" <sip:0296000001@192.168.135.7>;privacy=off;screen=no
Content-Length: 0


---
    -- SIP/ims_out-00000009 is circuit-busy
  == Everyone is busy/congested at this time (1:0/1/0)
    -- Auto fallthrough, channel 'SIP/0296000001-00000008' status is 'CONGESTION'

<--- Reliably Transmitting (no NAT) to 192.168.135.90:5061 --->
SIP/2.0 503 Service Unavailable
Via: SIP/2.0/UDP 192.168.135.90:5061;branch=z9hG4bK-d8754z-d23f12ffce37a7b1-1---d8754z-;received=192.168.135.90;rport=5061
From: "0296000001"<sip:0296000001@ims.perros.bzh;transport=UDP>;tag=4944de53
To: <sip:9jerome@ims.perros.bzh;transport=UDP>;tag=as30947c31
Call-ID: NmNiMDY0Mjc3ZTE1ZWNkMGQzMzhjMjUwOWY2YjdjOTU.
CSeq: 2 INVITE
Server: Asterisk PBX 1.6.2.2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16


<------------>

<--- SIP read from UDP:192.168.135.90:5061 --->
ACK sip:9jerome@ims.perros.bzh;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.135.90:5061;branch=z9hG4bK-d8754z-d23f12ffce37a7b1-1---d8754z-;rport
Max-Forwards: 70
To: <sip:9jerome@ims.perros.bzh;transport=UDP>;tag=as30947c31
From: "0296000001"<sip:0296000001@ims.perros.bzh;transport=UDP>;tag=4944de53
Call-ID: NmNiMDY0Mjc3ZTE1ZWNkMGQzMzhjMjUwOWY2YjdjOTU.
CSeq: 2 ACK
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---
Really destroying SIP dialog '08a8144d7ade734d0f4da36c4b385a20@192.168.135.7' Method: INVITE
Really destroying SIP dialog 'NmNiMDY0Mjc3ZTE1ZWNkMGQzMzhjMjUwOWY2YjdjOTU.' Method: ACK
Reliably Transmitting (no NAT) to 192.168.135.7:5060:
OPTIONS sip:192.168.135.7 SIP/2.0
Via: SIP/2.0/UDP 192.168.135.90:5060;branch=z9hG4bK08a21976;rport
Max-Forwards: 70
From: "asterisk" <sip:asterisk@192.168.135.90>;tag=as01a0bd91
To: <sip:192.168.135.7>
Contact: <sip:asterisk@192.168.135.90>
Call-ID: 789e513760d5f343578d1fc53226bec8@192.168.135.90
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 1.6.2.2
Date: Fri, 21 May 2010 09:38:37 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0


---

<--- SIP read from UDP:192.168.135.7:5060 --->
SIP/2.0 200 OK
Call-ID: 789e513760d5f343578d1fc53226bec8@192.168.135.90
Via: SIP/2.0/UDP 192.168.135.90:5060;received=192.168.135.90;branch=z9hG4bK08a21976;rport=5060
To: <sip:192.168.135.7>;tag=4be2b15f-1274434741635899
From: "asterisk" <sip:asterisk@192.168.135.90>;tag=as01a0bd91
CSeq: 102 OPTIONS
Accept: application/sdp, application/xml, application/reginfo+xml, application/ISUP
Accept-Language: en
Date: Fri, 21 May 2010 09:39:01 GMT
Server: Alcatel-Lucent-HPSS/3.0.3
Supported: 100rel, precondition, timer, sec-agree
Content-Length: 0

<------------->
--- (12 headers 0 lines) ---
Really destroying SIP dialog '789e513760d5f343578d1fc53226bec8@192.168.135.90' Method: OPTIONS

<--- SIP read from UDP:192.168.135.90:5061 --->

Aserisk files are still the same as shown previously, so only the response from the P-CSCF is different for an other reason.

Thank you in advance.

François Bourdoulous.

Hi François,

Did u managed to succeed this issue? if yes i would be needing your help to achieve the same in my project.

Request you just send a hi to my mail id - santhoshc86@yahoo.co.in else please suggest in same thread.

Thanks in advance!!

Santhosh