[Home]

Summary:ASTERISK-12699: [patch] Allows Action: Register in Manager API to allow asterisk to register to a remote server
Reporter:roger leszczynski (synthetic)Labels:
Date Opened:2008-09-09 04:46:15Date Closed:2011-06-07 14:02:48
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/NewFeature
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 2009011400_bug13446.diff.txt
( 1) 2009011401_bug13446.diff.txt
( 2) chan_sip_register.patch
( 3) chan_sip_register[rev1].patch
( 4) chan_sip_register[rev2].patch
( 5) SIPregister.diff
Description:Allows you to register to remote SIP registrar. Gives userss with one single account on the system be able to call out or be contacted with the user's multiple user SIP accounts of other providers. Also great when using a SIP - JINGLE gateway.

Usage:

New registration to remote server nimbuzz.com:

Action: Register
Username: test
Secret: 1234
Authuser: test
Hostname: nimbuzz.com
Port: 5060
Cmd: ADD

User logs of, lets delete their registration:

Action: Register
Username: test
Secret: 1234
Authuser: test
Hostname: nimbuzz.com
Port: 5060
Cmd: DEL
Comments:By: Olle Johansson (oej) 2008-09-09 04:48:47

You need to separate hostname and domain. I would call hostname proxy and have a separate domain setting.

By: Olle Johansson (oej) 2008-09-09 04:49:53

As I can't see the patch yet, what do you do with the DEL command - send a de-registration to the server?

By: Olle Johansson (oej) 2008-09-09 04:50:46

And, to follow the existing convention, you need to have an extension and hopefully a context to return the calls coming back from the registered account.

By: roger leszczynski (synthetic) 2008-09-09 05:59:18

DEL command just deletes the sip registry object for now.  As for the context is is expected that it goes to you default context as there can be many different sip accounts for one user. It is upon your choice to run an AGI script there to determien the mapping or to forward to another sip/gateway.

By: Olle Johansson (oej) 2008-09-09 08:18:38

Well, for generic commands in ASterisk that are not specific to your application, we need a generic way to handle this. And we need all the options in the existing register= command - users expect that. Please look into this :-)

Cheers,
/O

By: roger leszczynski (synthetic) 2008-09-10 03:18:14

Added Exten Parameter to Manager AGI, makes sense to have in case we need to route the call differently for a user's account, which uses all parameters of register =>

Usage is similar:

Action: Register
Username: test
Secret: 1234
Authuser: test
Hostname: nimbuzz.com
Port: 5060
Exten: john-smiths-account
Cmd: ADD

Response: Success
Message: Authentication accepted

Action: Register
Username: test
Secret: 1234
Authuser: test
Hostname: nimbuzz.com
Port: 5060
Exten: john-smiths-account
Cmd: DEL

By: Olle Johansson (oej) 2008-09-10 03:37:43

Great, but if you have exten you will have to have context too. I haven't checked the headers you're using, but hoping they're the same headers as we use elsewhere.

Normally we don't have a Cmd: in manager, we have two different commands. This will have to be discussed. I have worked to minimize the amount of events this way, but not the commands. Maybe that should be discussed on the asterisk-dev mailing list.

By: Tilghman Lesher (tilghman) 2008-11-10 18:39:38.000-0600

You also need to distinguish this command as being SIP-specific, probably in the Action portion, since other channel drivers also can register.

By: roger leszczynski (synthetic) 2008-11-11 05:07:49.000-0600

Agreed... modified

New registration to remote server nimbuzz.com:

Action: SIPRegister
Username: test
Secret: 1234
Authuser: test
Hostname: nimbuzz.com
Port: 5060
Cmd: ADD

User logs of, lets delete their registration:

Action: SIPRegister
Username: test
Secret: 1234
Authuser: test
Hostname: nimbuzz.com
Port: 5060
Cmd: DEL

By: Olle Johansson (oej) 2008-11-11 05:20:18.000-0600

I would change "Hostname" to "Domain:". You do register with a domain, not a specific host. I still would like a review of the Cmd: syntax before we start using something like that. The way we have it today is "SipRegister" and "SipUnRegister" - two actions instead of one with subcommands.

I think it might be useful, but then we need to agree on a common standard for this new behaviour.

By: Leif Madsen (lmadsen) 2009-01-15 07:56:21.000-0600

Just pinging the reporter again to see if he can move this issue forward with the suggestions by oej? After having a discussion with him on IRC this morning, he feels it is a good patch, we just need to change the syntax a little bit, but other than that, it is ready to roll.

By: Michiel van Baak (mvanbaak) 2009-01-15 11:49:17.000-0600

New patch uploaded that splits this up in two manager actions

By: Olle Johansson (oej) 2009-01-15 12:06:40.000-0600

I just noticed that the unregister function doesn't actually transmit a REGISTER request to de-register with the server. We should really do that.

By: Michiel van Baak (mvanbaak) 2009-02-21 07:41:31.000-0600

oej: on IRC you stated that you would implement a function to do the unregister.
Is this still true ?

By: Leif Madsen (lmadsen) 2009-02-27 16:48:53.000-0600

You have a moment to answer mvanbaak's question? Thanks!

By: Olle Johansson (oej) 2009-02-28 02:19:50.000-0600

Already answered on IRC :-)

The answer is yes, soon.

By: Eliel Sardanons (eliel) 2009-05-20 11:45:16

New patch uploaded:

- We were calling sip_remote_register in the same way for adding and removing.
- Not all the parameters are required (only username and domain).
- Add a 'Transport' header that could be (tcp | tls | udp (default)).
- For some values we need to set defaults (transport, port number)
- Remove trailing white spaces.
- Fix a typo in documentation.
- Fix a typo when calling ast_manager_unregister.

By: Matthew Nicholson (mnicholson) 2009-10-13 12:32:15

I have several comments.  I will list them here, but please post this on reviewboard as soon as possible.

1. SIPRegister should accept an 'Expiry' parameter.
2. The remove_sip_register function should be broken into two functions.
3. What happens if I attempt to register to the same domain twice as the same user?  Will multiple entries be created in regl?
4. Assuming registering to the same domain as the same user multiple times is possible, what happens if I attempt to un-register this user multiple times?

By: Matthew Nicholson (mnicholson) 2009-10-13 12:34:21

Also, this patch needs to be updated to apply cleanly to trunk and use ast_manager_register_xml instead of ast_manager_register2.

By: Matthew Nicholson (mnicholson) 2009-10-21 09:28:49

Any updates on this?

By: Matthew Nicholson (mnicholson) 2009-10-30 13:39:08

Closing this because of lack of progress.  Reopen when the patch has been updated with the changes I requested.