{"action":"opened","issue":{"url":"https://api.github.com/repos/kirm/sip.js/issues/87","labels_url":"https://api.github.com/repos/kirm/sip.js/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/kirm/sip.js/issues/87/comments","events_url":"https://api.github.com/repos/kirm/sip.js/issues/87/events","html_url":"https://github.com/kirm/sip.js/issues/87","id":88817860,"number":87,"title":"Error when using the UDP protocol","user":{"login":"jsbeltz","id":12923460,"avatar_url":"https://avatars.githubusercontent.com/u/12923460?v=3","gravatar_id":"","url":"https://api.github.com/users/jsbeltz","html_url":"https://github.com/jsbeltz","followers_url":"https://api.github.com/users/jsbeltz/followers","following_url":"https://api.github.com/users/jsbeltz/following{/other_user}","gists_url":"https://api.github.com/users/jsbeltz/gists{/gist_id}","starred_url":"https://api.github.com/users/jsbeltz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsbeltz/subscriptions","organizations_url":"https://api.github.com/users/jsbeltz/orgs","repos_url":"https://api.github.com/users/jsbeltz/repos","events_url":"https://api.github.com/users/jsbeltz/events{/privacy}","received_events_url":"https://api.github.com/users/jsbeltz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-16T19:31:18Z","updated_at":"2015-06-16T19:31:18Z","closed_at":null,"body":"I get an error like:\r\n  TypeError: Cannot set property 'rport' of undefined\r\n      at Object.create.send.value [as send] (F:\\builds\\users_jeff.beltz_systest\\jscript\\node_modules\\sip\\sip.js:773:41)\r\n      at F:\\builds\\users_jeff.beltz_systest\\jscript\\node_modules\\sip\\sip.js:1354:18\r\n      at resolve (F:\\builds\\users_jeff.beltz_systest\\jscript\\node_modules\\sip\\sip.js:838:12)\r\n      at F:\\builds\\users_jeff.beltz_systest\\jscript\\node_modules\\sip\\sip.js:1344:13\r\n      at Object.send (F:\\builds\\users_jeff.beltz_systest\\jscript\\node_modules\\sip\\sip.js:1345:11)\r\n\r\nI have added code locally and this resolves the problem.\r\n\r\n```javascript\r\n function wrap(obj, target) {\r\n    return Object.create(obj, {send: {value: function(m) {\r\n      if(m.method) {\r\n        m.headers.via[0].host = options.publicAddress || options.address || options.hostname || os.hostname();\r\n        m.headers.via[0].port = options.port || defaultPort(this.protocol);\r\n        m.headers.via[0].protocol = this.protocol;\r\n\r\n        if(this.protocol === 'UDP' && (!options.hasOwnProperty('rport') || options.rport)) {\r\n          // addition\r\n          if(m.headers.via[0].params === undefined)\r\n              m.headers.via[0].params = {};\r\n          // end addition\r\n          m.headers.via[0].params.rport = null;\r\n        }\r\n      }\r\n      options.logger && options.logger.send && options.logger.send(m, target);\r\n      obj.send(m);\r\n    }}});\r\n  }\r\n```"}}