[solved]How to forward from a 'virtual' extension?

I arranged to receive calls via a SIP URI like “sip:30@MyDomain”; this functions. I try now to receive also calls via a SIP URI in the form of “sip:FirstName@MyDomain” on extension 30. In order to get this working a ‘virtual’ sip peer has been defined in

sip.conf[code][FirstName1]
type=peer
username=FirstName
fromuser=FirstName
nat=yes
insecure=very
canreinvite=no
disallow=all
allow=alaw
allow=ulaw
allow=ilbc

[FirstName1_in]
type=peer
username=FirstName
fromuser=FirstName
disallow=all
allow=ulaw
allow=alaw
allow=ilbc
context=incoming [/code]
and with the extension number being e.g. 30 in

extension.conf

[incoming] exten => FirstName1,1,macro,ruf|SIP|30 ....
Note: macro-ruf handles all incomming calls. This version however doesn’t work. The CLI set on verbosity=6 doesn’t show an incommin call and the X-Lite 3.0 which was used for testing indicates “Call failed: Not found”.

Any suggestions on how this transfer from peer FirstName to peer e.g. 30 can be realised?

Thanks for the help.

You need two entries in extensions.conf, but I cannot see why you would need extra entries in sip.conf.

Hi david55[quote=“david55”]You need two entries in extensions.conf, …[/quote] which ones? Corresponds one of them to the one which already has been added? If yes, which other one would be required?

30 and FirstName

Sorry, I can’t yet follow you.

[incomming] contains all the providers Asterisk is registered to; here I added also FirstName. Extension 30 is defined under

[Local] exten => _3X,1,NoCDR() exten => _3X,n,macro,ruf|SIP|${EXTEN}

Is that what you meant with the 2nd entry?

[incoming]
exten => FirstName,1,macro,ruf|SIP|30
exten => 30,1,macro,ruf|SIP|30

or

[incoming]
exten => FirstName,1,Goto(30,1)
exten => 30,1,macro,ruf|SIP|30

Tried both versions after having also removed the entry in sip.conf and I also didn’t forget to reload, but the results are the same:

No indication that the call arrived at the Asterisk (verbosity=6). X-Lite 3.0 indicates “Call failed: Not found”.

Doing the same test with sip:30@MyDomain causes no problem.

May be it helps to show the debug-output of two tests. The calls are made with X-Lite user is MET and domain is My.dyndns.org. In both cases X-Lite calls extension 30 on the Asterisk, first with sip:FirstName@MyDomain which doesn’t work and then with sip:30@MyDomain which does work. In both cases the actual SIP URI is sip:30@77.99.99.99

I tried to mark the relevant part in red or bolt, but this doesn’t work. Look what happens right after
"Looking for FirstName in default (domain MyDomain.com)“
or
"Looking for 30 in default (domain MyDomain.com)”

1 sip:FirstName@MyDomain (doesn’t work)

[code]<— SIP read from 85.107.191.187:11098 —>
INVITE sip:FirstName@MyDomain.com SIP/2.0
Via: SIP/2.0/UDP 192.168.1.32:5070;branch=z9hG4bK-d87543-3166210473655d4f-1–d87543-;rport
Max-Forwards: 70
Contact: sip:MET@192.168.1.32:5070
To: "sip:FirstName@MyDomain.com"sip:FirstName@MyDomain.com
From: "Direct SIP"sip:MET@My.dyndns.org;tag=c01a921d
Call-ID: ZWE4MWQ3NDM4YTgwM2FlNGIxZWRlNTIwOTc1MzdmZjg.
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
Content-Type: application/sdp
User-Agent: X-Lite release 1006e stamp 34025
Content-Length: 323

v=0
o=- 1 2 IN IP4 192.168.1.32
s=CounterPath X-Lite 3.0
c=IN IP4 192.168.1.32
t=0 0
m=audio 5076 RTP/AVP 107 119 0 98 8 3 101
a=alt:1 1 : 0BZgk+v6 4R+02ZVj 192.168.1.32 5076
a=fmtp:101 0-15
a=rtpmap:107 BV32/16000
a=rtpmap:119 BV32-FEC/16000
a=rtpmap:98 iLBC/8000
a=rtpmap:101 telephone-event/8000
a=sendrecv

<------------->
— (12 headers 13 lines) —
Sending to 85.107.191.187 : 11098 (NAT)
Using INVITE request as basis request - ZWE4MWQ3NDM4YTgwM2FlNGIxZWRlNTIwOTc1MzdmZjg.
Found no matching peer or user for '85.107.191.187:11098’
Found RTP audio format 107
Found RTP audio format 119
Found RTP audio format 0
Found RTP audio format 98
Found RTP audio format 8
Found RTP audio format 3
Found RTP audio format 101
Peer audio RTP is at port 192.168.1.32:5076
Found unknown media description format BV32 for ID 107
Found unknown media description format BV32-FEC for ID 119
Found audio description format iLBC for ID 98
Found audio description format telephone-event for ID 101
Capabilities: us - 0x40c (ulaw|alaw|ilbc), peer - audio=0x40e (gsm|ulaw|alaw|ilbc)/video=0x0 (nothing), combined - 0x40c (ulaw|alaw|ilbc)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 192.168.1.32:5076
Looking for FirstName in default (domain MyDomain.com)

<— Reliably Transmitting (NAT) to 85.107.191.187:11098 —>
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 192.168.1.32:5070;branch=z9hG4bK-d87543-3166210473655d4f-1–d87543-;received=85.107.191.187;rport=11098
From: "Direct SIP"sip:MET@My.dyndns.org;tag=c01a921d
To: "sip:FirstName@MyDomain.com"sip:FirstName@MyDomain.com;tag=as500790e7
Call-ID: ZWE4MWQ3NDM4YTgwM2FlNGIxZWRlNTIwOTc1MzdmZjg.
CSeq: 1 INVITE
User-Agent: MyDevice
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘ZWE4MWQ3NDM4YTgwM2FlNGIxZWRlNTIwOTc1MzdmZjg.’ in 32000 ms (Method: INVITE)
vsXXXX*CLI>
<— SIP read from 85.107.191.187:11098 —>
ACK sip:FirstName@MyDomain.com SIP/2.0
Via: SIP/2.0/UDP 192.168.1.32:5070;branch=z9hG4bK-d87543-3166210473655d4f-1–d87543-;rport
To: "sip:FirstName@MyDomain.com"sip:FirstName@MyDomain.com;tag=as500790e7
From: "Direct SIP"sip:MET@My.dyndns.org;tag=c01a921d
Call-ID: ZWE4MWQ3NDM4YTgwM2FlNGIxZWRlNTIwOTc1MzdmZjg.
CSeq: 1 ACK
Content-Length: 0[/code]

2 sip:30@MyDomain (works)

(The very first part is missing here, but it should be the same as above)

[code]— (12 headers 13 lines) —
Sending to 85.107.191.187 : 11124 (NAT)
Using INVITE request as basis request - YWIzYzc5ZGZhMTEwOTY0ZDg4MzE1MjliMzhhNDlmYzU.
Found no matching peer or user for '85.107.191.187:11124’
Found RTP audio format 107
Found RTP audio format 119
Found RTP audio format 0
Found RTP audio format 98
Found RTP audio format 8
Found RTP audio format 3
Found RTP audio format 101
Peer audio RTP is at port 192.168.1.32:5094
Found unknown media description format BV32 for ID 107
Found unknown media description format BV32-FEC for ID 119
Found audio description format iLBC for ID 98
Found audio description format telephone-event for ID 101
Capabilities: us - 0x40c (ulaw|alaw|ilbc), peer - audio=0x40e (gsm|ulaw|alaw|ilbc)/video=0x0 (nothing), combined
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telepho
Peer audio RTP is at port 192.168.1.32:5094
Looking for 30 in default (domain MyDomain.com)
list_route: hop: sip:MET@192.168.1.32:5070
vsXXXX*CLI>
<— Transmitting (NAT) to 85.107.191.187:11124 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.1.32:5070;branch=z9hG4bK-d87543-c5224d03a82e165b-1–d87543-;received=85.107.191.187;rpo
From: "Direct SIP"sip:MET@My.dyndns.org;tag=a1562453
To: "sip:30@MyDomain.com"sip:30@MyDomain.com
Call-ID: YWIzYzc5ZGZhMTEwOTY0ZDg4MzE1MjliMzhhNDlmYzU.
CSeq: 1 INVITE
User-Agent: MyDevice
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: sip:30@77.99.99.99
Content-Length: 0

<------------>
– Executing [30@default:1] NoCDR(“SIP/My.dyndns.org-f678b3e0”, “”) in new stack
– Executing [30@default:2] Macro(“SIP/My.dyndns.org-f678b3e0”, “ruf|SIP|30”) in new stack
– Executing [s@macro-ruf:1] NoOp(“SIP/My.dyndns.org-f678b3e0”, “Wir sind im Macro ruf gelandet”) in n
– Executing [s@macro-ruf:2] Dial(“SIP/My.dyndns.org-f678b3e0”, “SIP/30|28|r”) in new stack
Audio is at 77.99.99.99 port 11858
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x8 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 85.107.191.187:10024:
INVITE sip:30@192.168.1.30 SIP/2.0
Via: SIP/2.0/UDP 77.99.99.99:5060;branch=z9hG4bK4d95fefb;rport
From: “Direct SIP” sip:MET@77.99.99.99;tag=as4c1349dd
To: sip:30@192.168.1.30
Contact: sip:MET@77.99.99.99
Call-ID: 1d63dab20ebeaea80ccdbfe93ccf807c@77.99.99.99
CSeq: 102 INVITE
User-Agent: MyDevice
Max-Forwards: 70
Date: Mon, 26 Jan 2009 17:49:05 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Type: application/sdp
Content-Length: 262

v=0
o=root 20806 20806 IN IP4 77.99.99.99
s=session
c=IN IP4 77.99.99.99
t=0 0
m=audio 11858 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=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


-- Called 30

vsXXXX*CLI>
<— Transmitting (NAT) to 85.107.191.187:11124 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.1.32:5070;branch=z9hG4bK-d87543-c5224d03a82e165b-1–d87543-;received=85.107.191.187;rpo
From: "Direct SIP"sip:MET@My.dyndns.org;tag=a1562453
To: "sip:30@MyDomain.com"sip:30@MyDomain.com;tag=as502de8af
Call-ID: YWIzYzc5ZGZhMTEwOTY0ZDg4MzE1MjliMzhhNDlmYzU.
CSeq: 1 INVITE
User-Agent: MyDevice
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: sip:30@77.99.99.99
Content-Length: 0

<------------>
[/code]

Any idea on what goes wrong in the first case?

Problem solved. With the set-up of my extension.conf the command

exten => FirstName,1,macro,ruf|SIP|30

had to be placed in [Local] (instead of [incoming]). It only required this single command.