Translate Freeswitch config to Asterisk

I have this gateway config for freeswitch. I want to change this to Asterisk but I can’t find any gateway config documentation for Asterisk.

<include>
<gateway name="elisa51">
<param name="username" value="3726659651"/>
<param name="realm" value="gsmduo.com"/>
<param name="password" value="df"/>
<param name="register-proxy" value="195.222.16.36"/>
<param name="expire-seconds" value="60"/>
<param name="register" value="true"/>
<param name="codec-prefs" value="G722,G711"/>
<param name="liberal-dtmf" value="true"/>
<param name="rfc2833-pt" value="96"/>
-->
</gateway>
</include>

I tried to add an endpoint like this but it didn’t work.

[elisa1]
type=endpoint
transport=transport-udp
context=testing
disallow=all
allow=ulaw
direct_media=no
outbound_auth=elisa1_auth
aors=elisa1

[elisa1]
type=aor
max_contacts=1
;contact=sip:195.222.16.36

[elisa1_auth]
type=auth
auth_type=userpass
password=df
username=df
;realm=gsmduo.com


[elisa1]
type=identify
endpoint=elisa1
match=df@gsmduo.com

Please describe exactly how it didn’t work.

hi,
so after twitching, here is the config i’m using right now

[elisa1]
type=registration
transport=transport-udp
outbound_auth=elisa1_auth
outbound_proxy=sip:195.222.16.36
server_uri=sip:gsmduo.com
client_uri=sip:3726659651@gsmduo.com
;contact_user=1234567890
retry_interval=60
forbidden_retry_interval=600
expiration=3600
line=yes
endpoint=elisa1

[elisa1_auth]
type=auth
auth_type=userpass
password=df
username=3726659651
realm=gsmduo.com

[elisa1]
type=endpoint
transport=transport-udp
context=testing
disallow=all
allow=ulaw
direct_media=no
outbound_auth=elisa1_auth
force_rport=yes
direct_media=no
aors=elisa1

[elisa1]
type=aor
contact=sip:gsmduo.com

[elisa1]
type=identify
endpoint=elisa1
match=3726659651@gsmduo.com

This one gives me:

songmeo-dev*CLI> pjsip reload
Module 'res_pjsip.so' reloaded successfully.
Module 'res_pjsip_authenticator_digest.so' reloaded successfully.
Module 'res_pjsip_endpoint_identifier_ip.so' reloaded successfully.
Module 'res_pjsip_mwi.so' reloaded successfully.
Module 'res_pjsip_notify.so' reloaded successfully.
Module 'res_pjsip_outbound_publish.so' reloaded successfully.
Module 'res_pjsip_publish_asterisk.so' reloaded successfully.
Module 'res_pjsip_outbound_registration.so' reloaded successfully.
    -- Reloading module 'res_pjsip.so' (Basic SIP resource)
[Feb  5 10:35:46] ERROR[196]: netsock2.c:303 ast_sockaddr_resolve: getaddrinfo("3726659651@gsmduo.com", "(null)", ...): Name or service not known
[Feb  5 10:35:46] ERROR[196]: res_pjsip_endpoint_identifier_ip.c:550 ip_identify_apply: Identify 'elisa1' failed when adding resolution results of '3726659651@gsmduo.com'
[Feb  5 10:35:46] ERROR[196]: res_sorcery_config.c:418 sorcery_config_internal_load: Could not create an object of type 'identify' with id 'elisa1' from configuration file 'pjsip.conf'
    -- Reloading module 'res_pjsip_authenticator_digest.so' (PJSIP authentication resource)
    -- Reloading module 'res_pjsip_endpoint_identifier_ip.so' (PJSIP IP endpoint identifier)
[Feb  5 10:35:46] ERROR[577]: netsock2.c:303 ast_sockaddr_resolve: getaddrinfo("3726659651@gsmduo.com", "(null)", ...): Name or service not known
[Feb  5 10:35:46] ERROR[577]: res_pjsip_endpoint_identifier_ip.c:550 ip_identify_apply: Identify 'elisa1' failed when adding resolution results of '3726659651@gsmduo.com'
[Feb  5 10:35:46] ERROR[577]: res_sorcery_config.c:418 sorcery_config_internal_load: Could not create an object of type 'identify' with id 'elisa1' from configuration file 'pjsip.conf'
    -- Reloading module 'res_pjsip_mwi.so' (PJSIP MWI resource)
    -- Reloading module 'res_pjsip_notify.so' (CLI/AMI PJSIP NOTIFY Support)
    -- Reloading module 'res_pjsip_outbound_publish.so' (PJSIP Outbound Publish Support)
    -- Reloading module 'res_pjsip_publish_asterisk.so' (PJSIP Asterisk Event PUBLISH Support)
    -- Reloading module 'res_pjsip_outbound_registration.so' (PJSIP Outbound Registration Support)

As I understand it, to match on user name, the section name for the endpoint must be the user name, and to match on address, only the domain or IP address should be on the match line. There seem to be other options, but these are the two most commonly used.

I hope I don’t get you wrong… but I changed the username to be the same as the phone number like this:


[3726659651]
type=registration
transport=transport-udp
outbound_auth=elisa1_auth
outbound_proxy=sip:195.222.16.36
server_uri=sip:gsmduo.com
client_uri=sip:3726659651@gsmduo.com
;contact_user=1234567890
retry_interval=60
forbidden_retry_interval=600
expiration=3600
line=yes
endpoint=3726659651

[elisa1_auth]
type=auth
auth_type=userpass
password=df
username=3726659651
realm=gsmduo.com

[3726659651]
type=endpoint
transport=transport-udp
context=testing
disallow=all
allow=ulaw
direct_media=no
outbound_auth=elisa1_auth
force_rport=yes
aors=3726659651

[3726659651]
type=aor
contact=sip:gsmduo.com

[3726659651]
type=identify
endpoint=3726659651
match=3726659651@gsmduo.com

but i still have the same error:

songmeo-dev*CLI> pjsip reload
Module 'res_pjsip.so' reloaded successfully.
Module 'res_pjsip_authenticator_digest.so' reloaded successfully.
Module 'res_pjsip_endpoint_identifier_ip.so' reloaded successfully.
Module 'res_pjsip_mwi.so' reloaded successfully.
Module 'res_pjsip_notify.so' reloaded successfully.
Module 'res_pjsip_outbound_publish.so' reloaded successfully.
Module 'res_pjsip_publish_asterisk.so' reloaded successfully.
Module 'res_pjsip_outbound_registration.so' reloaded successfully.
    -- Reloading module 'res_pjsip.so' (Basic SIP resource)
[Feb  5 11:57:28] ERROR[391]: netsock2.c:303 ast_sockaddr_resolve: getaddrinfo("3726659651@gsmduo.com", "(null)", ...): Name or service not known
[Feb  5 11:57:28] ERROR[391]: res_pjsip_endpoint_identifier_ip.c:550 ip_identify_apply: Identify '3726659651' failed when adding resolution results of '3726659651@gsmduo.com'
[Feb  5 11:57:28] ERROR[391]: res_sorcery_config.c:418 sorcery_config_internal_load: Could not create an object of type 'identify' with id '3726659651' from configuration file 'pjsip.conf'
  == Endpoint elisa1 is now Unreachable
  == Contact elisa1/sip:gsmduo.com has been deleted
  == Endpoint 3726659651 is now Reachable
    -- Reloading module 'res_pjsip_authenticator_digest.so' (PJSIP authentication resource)
    -- Reloading module 'res_pjsip_endpoint_identifier_ip.so' (PJSIP IP endpoint identifier)
[Feb  5 11:57:29] ERROR[577]: netsock2.c:303 ast_sockaddr_resolve: getaddrinfo("3726659651@gsmduo.com", "(null)", ...): Name or service not known
[Feb  5 11:57:29] ERROR[577]: res_pjsip_endpoint_identifier_ip.c:550 ip_identify_apply: Identify '3726659651' failed when adding resolution results of '3726659651@gsmduo.com'
[Feb  5 11:57:29] ERROR[577]: res_sorcery_config.c:418 sorcery_config_internal_load: Could not create an object of type 'identify' with id '3726659651' from configuration file 'pjsip.conf'
    -- Reloading module 'res_pjsip_mwi.so' (PJSIP MWI resource)
    -- Reloading module 'res_pjsip_notify.so' (CLI/AMI PJSIP NOTIFY Support)
    -- Reloading module 'res_pjsip_outbound_publish.so' (PJSIP Outbound Publish Support)
    -- Reloading module 'res_pjsip_publish_asterisk.so' (PJSIP Asterisk Event PUBLISH Support)
    -- Reloading module 'res_pjsip_outbound_registration.so' (PJSIP Outbound Registration Support)

You’ve still got an IP address match with a malformed domain name. You normally wouldn’t want the identify section at all, if you are matching by user, and if not matching by user, you must match just the domain name. There appears to be a rarely used, match header option, for more general match restrictions.

so I deleted the identify section entirely and when i reload pjsip.conf it didn’t show any error. I want to use this phone number to reach other numbers in the testing context. But when I tried to dial the number, it said my dial number was not in use.

You’d need to provide the logs for the calls, including protocol logging

You need the logs from whatever reported the number not in use. It seems that request is not reaching an open SIP port on Asterisk, otherwise you should be able to obtain a log entry.

https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information

You shouldn’t be getting anything on the Skinny port number.

You should, at least, be getting an outbound register request logged. Note, if you are using an outbound proxy, it is the IP of that which you would need to use in any filter for the debugging.

Reachable means that OPTIONS requests are being answered. It doesn’t mean that you have successfully registered the contact address for the correct address of record.

As you are not receiving the INVITE for the call, you need to investigate this upstream of Asterisk.

No. Because I have no knowledge about the system with which you are registering.

You should, of course, check that the REGISTER request contains a useable contact address.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.